/* ===== CTD Guide — guide.css ===== */
:root {
  --ink: #0c1322;
  --navy: #1f3a5d;
  --ctd: #2bb6e8;
  --ctd-d: #1893c4;
  --muted: #6b7396;
  --line: rgba(12, 19, 34, 0.10);
  --paper: #ffffff;
  --bg: #f4f8fc;
  --radius: 14px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: Poppins, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--ink); background: var(--paper); }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
img { max-width: 100%; display: block; }

/* ===== HEADER ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav {
  max-width: 1280px; margin: 0 auto; height: 66px;
  display: flex; align-items: center; gap: 20px;
  padding: 0 32px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo { height: 27px; width: auto; display: block; }
.brand-divider { width: 1px; height: 20px; background: var(--line); }
.brand-guide { font-family: var(--font-head); font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.brand-guide:hover { color: var(--ink); }
.brand-link { display: flex; align-items: center; }
.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600;
  padding: 9px 18px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; white-space: nowrap; font-family: var(--font); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: #f4f7fb; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #1b2440; }

/* ===== SEARCH HERO (hub page) ===== */
.guide-hero {
  background: linear-gradient(160deg, #0c1322 0%, #1f3a5d 100%);
  padding: 72px 32px 80px;
  text-align: center;
  color: #fff;
}
.guide-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 10px;
}
.guide-hero p {
  font-size: 17px;
  color: rgba(255,255,255,.65);
  margin-bottom: 36px;
}
.search-wrap {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.search-wrap input {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  border: none;
  padding: 0 52px 0 20px;
  font-size: 16px;
  font-family: var(--font);
  color: var(--ink);
  outline: none;
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
}
.search-wrap input::placeholder { color: #9aa1b4; }
.search-wrap .search-icon {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  color: #9aa1b4; font-size: 20px; pointer-events: none;
}
#search-results-flyout {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: #fff; border-radius: 14px; border: 1px solid var(--line);
  box-shadow: 0 24px 50px -16px rgba(0,0,0,.22);
  overflow: hidden; display: none; text-align: left; z-index: 200;
  max-height: 420px; overflow-y: auto;
}
.sr-item { display: flex; flex-direction: column; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: #f4f8fc; }
.sr-item .sr-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ctd-d); margin-bottom: 3px; }
.sr-item .sr-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.sr-item .sr-desc { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.sr-none { padding: 18px; color: var(--muted); font-size: 15px; text-align: center; }

/* ===== HUB GRID ===== */
.hub-section { max-width: 1200px; margin: 0 auto; padding: 64px 32px; }
.hub-section h2 { font-family: var(--font-head); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 24px; }
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.cat-card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 24px; transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
  display: flex; flex-direction: column; gap: 10px;
}
.cat-card:hover { box-shadow: 0 16px 40px -16px rgba(12,19,34,.16); border-color: rgba(43,182,232,.3); transform: translateY(-2px); }
.cat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: #e7f6fd; color: var(--ctd-d);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.cat-card h3 { font-family: var(--font-head); font-size: 16px; font-weight: 700; color: var(--ink); }
.cat-card p { font-size: 13.5px; color: var(--muted); line-height: 1.5; flex: 1; }
.cat-count { font-size: 12.5px; font-weight: 600; color: var(--ctd-d); }

/* ===== CATEGORY PAGE ===== */
.cat-hero {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 52px 32px 44px;
}
.cat-hero-inner { max-width: 860px; margin: 0 auto; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--ctd-d); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { font-size: 12px; color: var(--line); }
.cat-icon-lg {
  width: 52px; height: 52px; border-radius: 14px;
  background: #e7f6fd; color: var(--ctd-d);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 18px;
}
.cat-hero h1 { font-family: var(--font-head); font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -.5px; margin-bottom: 10px; }
.cat-hero p { font-size: 16px; color: var(--muted); line-height: 1.6; }
.cat-body { max-width: 860px; margin: 0 auto; padding: 48px 32px 80px; }
.article-list { display: flex; flex-direction: column; gap: 2px; }
.art-row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: 12px;
  border: 1px solid transparent;
  transition: background .12s ease, border-color .12s ease;
}
.art-row:hover { background: var(--bg); border-color: var(--line); }
.art-row-icon { width: 34px; height: 34px; border-radius: 9px; background: #e7f6fd; color: var(--ctd-d);
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.art-row-body { flex: 1; min-width: 0; }
.art-row-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.art-row-desc { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-row-chev { font-size: 18px; color: #c2cad8; flex-shrink: 0; }
.section-divider { font-family: var(--font-head); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 28px 18px 10px; }

/* ===== ARTICLE PAGE ===== */
.article-layout { max-width: 1200px; margin: 0 auto; padding: 48px 32px 96px; display: grid; grid-template-columns: 1fr 280px; gap: 48px; align-items: start; }
.article-main {}
.article-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.article-breadcrumb a { color: var(--ctd-d); }
.article-breadcrumb a:hover { text-decoration: underline; }
.article-breadcrumb .sep { color: #c2cad8; }
.article-title { font-family: var(--font-head); font-size: clamp(22px, 3vw, 32px); font-weight: 800; letter-spacing: -.5px; line-height: 1.18; margin-bottom: 8px; }
.article-meta { font-size: 13px; color: var(--muted); margin-bottom: 36px; }
.article-body { font-size: 15.5px; line-height: 1.75; color: #3a4158; }
.article-body h2 { font-family: var(--font-head); font-size: 20px; font-weight: 700; color: var(--ink); margin: 36px 0 12px; }
.article-body h3 { font-family: var(--font-head); font-size: 16.5px; font-weight: 700; color: var(--ink); margin: 28px 0 8px; }
.article-body p { margin-bottom: 16px; }
.article-body ul, .article-body ol { padding-left: 22px; margin-bottom: 18px; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 7px; line-height: 1.65; }
.article-body a { color: var(--ctd-d); text-decoration: underline; }
.article-body a:hover { color: var(--ctd); }
.article-body strong { font-weight: 700; color: var(--ink); }
.article-body .callout {
  background: #e7f6fd; border-left: 3px solid var(--ctd); border-radius: 0 10px 10px 0;
  padding: 16px 20px; margin: 24px 0; font-size: 14.5px; color: #1e4a68;
}
.article-body .callout strong { color: var(--ctd-d); }
.article-body .tip {
  background: #edfaf0; border-left: 3px solid #22c55e; border-radius: 0 10px 10px 0;
  padding: 16px 20px; margin: 24px 0; font-size: 14.5px; color: #14532d;
}
.article-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14px; }
.article-body th { background: var(--bg); font-weight: 700; padding: 10px 14px; text-align: left; border-bottom: 2px solid var(--line); color: var(--ink); }
.article-body td { padding: 10px 14px; border-bottom: 1px solid var(--line); color: #3a4158; }
.article-body code { background: #f0f2f8; border-radius: 5px; padding: 2px 7px; font-size: .87em; font-family: "SFMono-Regular", Consolas, monospace; color: #c0392b; }
.article-body pre { background: #0c1322; border-radius: 12px; padding: 20px; overflow-x: auto; margin: 20px 0; }
.article-body pre code { background: none; color: #7fd5f3; font-size: 13.5px; padding: 0; }

/* sidebar */
.article-sidebar {}
.sidebar-card { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin-bottom: 18px; }
.sidebar-card h4 { font-family: var(--font-head); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.sidebar-links { display: flex; flex-direction: column; gap: 4px; }
.sidebar-links a { font-size: 13.5px; color: var(--ctd-d); padding: 6px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px; }
.sidebar-links a:last-child { border-bottom: none; }
.sidebar-links a:hover { color: var(--ctd); }
.sidebar-cta { background: linear-gradient(135deg, #0c1322 0%, #1f3a5d 100%); border-radius: 14px; padding: 24px; color: #fff; }
.sidebar-cta h4 { font-family: var(--font-head); font-size: 15px; font-weight: 700; margin-bottom: 8px; color: #fff; }
.sidebar-cta p { font-size: 13px; color: rgba(255,255,255,.65); margin-bottom: 18px; line-height: 1.5; }
.sidebar-cta .btn { width: 100%; justify-content: center; }
.btn-cta-book { background: var(--ctd); color: #fff; margin-bottom: 8px; border-color: var(--ctd); }
.btn-cta-book:hover { background: var(--ctd-d); border-color: var(--ctd-d); }
.btn-cta-signup { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }
.btn-cta-signup:hover { background: rgba(255,255,255,.2); }

/* next/prev nav */
.article-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.art-nav-btn { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; max-width: 280px; }
.art-nav-btn:hover { border-color: rgba(43,182,232,.3); background: #eaf6fc; }
.art-nav-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.art-nav-title { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.art-nav-btn.next { margin-left: auto; text-align: right; }

/* ===== SUPPORT FOOTER ===== */
.support-footer { margin-top: 48px; padding: 18px 22px; background: #fff; border: 1.5px solid var(--ctd); border-radius: 12px; font-size: 14px; color: var(--ink); display: flex; align-items: center; gap: 12px; }
.support-footer i { font-size: 22px; color: var(--ctd); flex-shrink: 0; }
.support-footer a { color: var(--ctd-d); font-weight: 600; }
.support-footer a:hover { text-decoration: underline; }

/* ===== FOOTER ===== */
.guide-footer { background: var(--bg); border-top: 1px solid var(--line); padding: 32px; text-align: center; }
.guide-footer p { font-size: 13px; color: var(--muted); }
.guide-footer a { color: var(--ctd-d); }
.guide-footer a:hover { text-decoration: underline; }

/* ===== TAGS ===== */
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.tag { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 20px;
  background: #e7f6fd; color: var(--ctd-d); font-size: 12px; font-weight: 600; cursor: pointer; }
.tag:hover { background: var(--ctd); color: #fff; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .nav { padding: 0 20px; }
}
@media (max-width: 600px) {
  .guide-hero { padding: 48px 20px 56px; }
  .hub-section { padding: 40px 20px; }
  .cat-body { padding: 32px 20px 60px; }
  .article-layout { padding: 32px 20px 60px; }
  .article-nav { flex-direction: column; }
  .art-nav-btn.next { margin-left: 0; text-align: left; }
}

/* ===== SEARCH PAGE ===== */
.search-page { max-width: 800px; margin: 0 auto; padding: 48px 32px 96px; }
.search-page h1 { font-family: var(--font-head); font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.search-page .search-desc { color: var(--muted); font-size: 15px; margin-bottom: 32px; }
.search-page-results { display: flex; flex-direction: column; gap: 2px; }
.search-result-item { padding: 18px; border-radius: 12px; border: 1px solid transparent; }
.search-result-item:hover { background: var(--bg); border-color: var(--line); }
.search-result-item .src-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ctd-d); margin-bottom: 4px; }
.search-result-item .src-title { font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.search-result-item .src-desc { font-size: 13.5px; color: var(--muted); line-height: 1.5; }

/* ===== API ENDPOINT BLOCKS ===== */
.endpoint-block { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 24px 0; }
.endpoint-header { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--bg); border-bottom: 1px solid var(--line); }
.endpoint-route { font-family: "SFMono-Regular", Consolas, monospace; font-size: 14px; color: var(--ink); background: none; padding: 0; }
.endpoint-desc { margin: 0; padding: 12px 18px 0; font-size: 14.5px; color: var(--muted); }
.endpoint-block pre { margin: 12px 18px 18px; border-radius: 8px; }
.method-get  { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 11.5px; font-weight: 700; font-family: "SFMono-Regular", Consolas, monospace; background: #d1fae5; color: #065f46; flex-shrink: 0; }
.method-post { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 11.5px; font-weight: 700; font-family: "SFMono-Regular", Consolas, monospace; background: #dbeafe; color: #1e40af; flex-shrink: 0; }
.method-patch { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 11.5px; font-weight: 700; font-family: "SFMono-Regular", Consolas, monospace; background: #fef3c7; color: #92400e; flex-shrink: 0; }
.method-delete { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 11.5px; font-weight: 700; font-family: "SFMono-Regular", Consolas, monospace; background: #fee2e2; color: #991b1b; flex-shrink: 0; }

/* ===== SECTIONED HUB ===== */
.hub-section { padding: 56px 40px 80px; max-width: 1200px; margin: 0 auto; }
.cat-section { margin-bottom: 52px; }
.cat-section:last-child { margin-bottom: 0; }
.cat-section-label { font-family: var(--font-head); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--ctd-d); margin: 0 0 20px; padding-bottom: 12px; border-bottom: 1.5px solid var(--line); }

/* ===== EMAIL TEMPLATE ===== */
.email-template { background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 28px 32px; margin: 24px 0; font-size: 14.5px; line-height: 1.7; color: var(--ink); }
.email-template-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 16px; }
.email-template p { margin: 0 0 14px; }
.email-template p:last-child { margin-bottom: 0; }
.email-template strong { font-weight: 600; }

.email-template { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 24px 0; font-size: 14.5px; line-height: 1.7; color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.email-template-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 16px; }
.email-headers { background: var(--bg); border-bottom: 1px solid var(--line); padding: 16px 24px; display: flex; flex-direction: column; gap: 6px; }
.email-header-row { display: flex; gap: 12px; font-size: 13.5px; }
.email-header-label { font-weight: 600; color: var(--muted); width: 52px; flex-shrink: 0; }
.email-header-value { color: var(--ink); }
.email-body { padding: 24px 24px 20px; }
.email-body p { margin: 0 0 14px; }
.email-body p:last-child { margin-bottom: 0; }
.email-body strong { font-weight: 600; }
