/* ============================================
   OriginAI Documentation — Warm Editorial
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=JetBrains+Mono:wght@400;500&family=Noto+Serif+SC:wght@400;500;600;700&display=swap');

/* ---------- tokens ---------- */
:root {
  --bg:          #FAF7F2;
  --bg-warm:     #F3EDE4;
  --bg-card:     #FFFFFF;
  --sidebar-bg:  #2A2520;
  --sidebar-fg:  #C8BFB4;
  --sidebar-active: #E8DDD0;
  --accent:      #B8956A;
  --accent-hover:#A07A52;
  --accent-light:#E8D8C4;
  --accent-glow: rgba(184,149,106,.12);
  --text:        #3D3530;
  --text-light:  #8A7E74;
  --text-muted:  #B5AAA0;
  --border:      #E8E0D6;
  --shadow-sm:   0 1px 3px rgba(42,37,32,.06);
  --shadow-md:   0 4px 16px rgba(42,37,32,.08);
  --shadow-lg:   0 8px 32px rgba(42,37,32,.12);
  --shadow-img:  0 8px 40px rgba(42,37,32,.15);
  --radius:      12px;
  --radius-lg:   20px;
  --sidebar-w:   280px;
  --header-h:    64px;

  --font-display: 'Cormorant Garamond', 'Noto Serif SC', 'Songti SC', Georgia, serif;
  --font-body:    'DM Sans', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-zh:      'Noto Serif SC', 'Songti SC', 'STSong', serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------- mobile header ---------- */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(250,247,242,.85);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  padding: 0 20px;
  align-items: center;
  justify-content: space-between;
}
.mobile-header .logo-area {
  display: flex; align-items: center; gap: 10px;
}
.mobile-header .logo-area img { width: 28px; height: 28px; }
.mobile-header .logo-area span {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 600; color: var(--text);
}
.hamburger {
  width: 36px; height: 36px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; cursor: pointer; border: none; background: none; padding: 4px;
}
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--text); border-radius: 1px;
  transition: .3s ease;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px,5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px,-5px); }

/* ---------- sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  z-index: 900;
  display: flex; flex-direction: column;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.sidebar-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-header .logo-row {
  display: flex; align-items: center; gap: 12px;
}
.sidebar-header img {
  width: 36px; height: 36px; border-radius: 8px;
}
.sidebar-header h1 {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 600;
  color: #F0EAE2; letter-spacing: -.01em;
}
.sidebar-header .subtitle {
  font-size: 12px; color: var(--text-muted);
  margin-top: 8px; letter-spacing: .04em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1; overflow-y: auto;
  padding: 16px 12px;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.nav-group { margin-bottom: 8px; }
.nav-group-title {
  font-size: 10px; font-weight: 600;
  color: rgba(200,191,180,.45);
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 8px 12px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--sidebar-fg);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 400;
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
}
.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: var(--sidebar-active);
}
.nav-item.active {
  background: rgba(184,149,106,.15);
  color: var(--accent-light);
  font-weight: 500;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-icon {
  width: 18px; height: 18px; flex-shrink: 0;
  opacity: .65;
}
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,.06);
  font-size: 11px; color: rgba(200,191,180,.3);
}

/* ---------- overlay ---------- */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(42,37,32,.5);
  z-index: 850;
  opacity: 0;
  transition: opacity .3s ease;
}
.sidebar-overlay.visible { opacity: 1; }

/* ---------- main ---------- */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}
.main-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 48px 48px 120px;
}

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding: 60px 0 48px;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: -48px; left: -48px; right: -48px;
  height: 360px;
  background: linear-gradient(170deg, #F0E8DC 0%, var(--bg) 70%);
  border-radius: 0 0 60px 60px;
  z-index: -1;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px;
  background: var(--accent-glow);
  border: 1px solid rgba(184,149,106,.2);
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  color: var(--accent);
  letter-spacing: .03em;
  margin-bottom: 20px;
}
.hero-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}
.hero h2 {
  font-family: var(--font-display);
  font-size: 42px; font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -.02em;
}
.hero p {
  font-size: 16px;
  color: var(--text-light);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.8;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin: 28px 0 20px;
}
.summary-card {
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(184,149,106,.18);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(6px);
}
.summary-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.summary-card strong {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.summary-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-light);
  line-height: 1.65;
}

/* ---------- section ---------- */
.doc-section {
  margin-top: 56px;
  animation: fadeUp .5s ease both;
}
.doc-section + .doc-section { margin-top: 64px; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.section-anchor {
  display: block;
  position: relative;
  top: calc(-1 * var(--header-h) - 32px);
  visibility: hidden;
}

.section-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.section-num {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  font-family: var(--font-display);
  font-size: 16px; font-weight: 700;
  border-radius: 10px;
  flex-shrink: 0;
}
.section-title {
  font-family: var(--font-zh);
  font-size: 26px; font-weight: 600;
  color: var(--text);
  letter-spacing: -.01em;
}
.section-title-en {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
  margin-left: 4px;
}

/* ---------- content typography ---------- */
.doc-content p {
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.8;
}
.doc-content h3 {
  font-family: var(--font-zh);
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  margin: 36px 0 14px;
}
.doc-content h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 24px 0 10px;
}
.doc-content ul, .doc-content ol {
  padding-left: 20px;
  margin-bottom: 16px;
}
.doc-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}
.doc-content strong {
  font-weight: 600;
  color: var(--text);
}
.doc-content code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--bg-warm);
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--accent-hover);
  border: 1px solid var(--border);
}
.doc-content pre {
  background: var(--sidebar-bg);
  color: #E0D8CE;
  padding: 20px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 16px 0 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
}
.doc-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}
.doc-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s;
}
.doc-content a:hover { color: var(--accent-hover); }

.checklist-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  margin: 22px 0 26px;
  box-shadow: var(--shadow-sm);
}
.checklist-card h3 {
  margin-top: 0;
}
.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}
.checklist li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 14px;
  color: var(--text-light);
}
.checklist li:last-child {
  margin-bottom: 0;
}
.checklist li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-glow);
  color: var(--accent-hover);
  border: 1px solid rgba(184,149,106,.2);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

/* ---------- step card ---------- */
.step-flow {
  display: flex; flex-direction: column;
  gap: 24px;
  margin: 20px 0 28px;
}
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  transition: box-shadow .3s ease, border-color .3s ease;
}
.step-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-light);
}
.step-card-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 16px;
}
.step-num {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-glow);
  border: 1.5px solid var(--accent-light);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 15px; font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}
.step-card-title {
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}
.step-card-body {
  color: var(--text-light);
  font-size: 14.5px;
  line-height: 1.75;
}
.step-card-body p { margin-bottom: 10px; }
.step-card-body p:last-child { margin-bottom: 0; }

.step-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg-warm);
  border-left: 3px solid var(--accent);
  font-size: 13.5px;
  color: var(--text);
}

/* connector line between steps */
.step-flow .step-card:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 40px;
  bottom: -24px;
  width: 2px;
  height: 24px;
  background: linear-gradient(to bottom, var(--accent-light), transparent);
}

/* ---------- screenshot ---------- */
.screenshot-wrap {
  margin: 20px 0 28px;
  position: relative;
}
.screenshot {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-img);
  cursor: zoom-in;
  transition: transform .4s cubic-bezier(.4,0,.2,1), box-shadow .4s ease;
  border: 1px solid rgba(0,0,0,.04);
}
.screenshot:hover {
  transform: scale(1.01);
  box-shadow: 0 12px 48px rgba(42,37,32,.18);
}
.screenshot-caption {
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 12px;
  font-style: italic;
}

/* ---------- callout / tip / warning ---------- */
.callout {
  padding: 18px 22px;
  border-radius: var(--radius);
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.7;
  display: flex;
  gap: 12px;
}
.callout-icon {
  flex-shrink: 0;
  width: 22px; height: 22px;
  margin-top: 1px;
}
.callout.tip {
  background: #F0F7ED;
  border: 1px solid #C8DFC0;
  color: #3D5A34;
}
.callout.warning {
  background: #FDF6EC;
  border: 1px solid #EEDCB8;
  color: #7A5C2E;
}
.callout.info {
  background: #EDF4FB;
  border: 1px solid #C4D8ED;
  color: #2E4A6A;
}

/* ---------- feature grid ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.feature-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: all .3s ease;
}
.feature-item:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.feature-item-icon {
  font-size: 24px;
  margin-bottom: 10px;
}
.feature-item h4 {
  font-size: 14.5px; font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}
.feature-item p {
  font-size: 13px;
  color: var(--text-light);
  margin: 0;
  line-height: 1.6;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 20px 0 26px;
}
.mode-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 22px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.mode-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.mode-card.recommended {
  border-color: rgba(184,149,106,.45);
  box-shadow: 0 0 0 1px rgba(184,149,106,.18), var(--shadow-md);
}
.mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--accent-hover);
  background: var(--accent-glow);
  margin-bottom: 14px;
}
.mode-card h4 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 10px;
}
.mode-card p {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
  margin: 0;
}

.faq-list {
  display: grid;
  gap: 16px;
  margin: 20px 0 24px;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.faq-item h4 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--text);
}
.faq-item p {
  margin: 0;
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.75;
}

/* ---------- pricing table ---------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 20px 0;
}
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  transition: all .3s ease;
}
.pricing-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}
.pricing-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.pricing-card .plan-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.pricing-card .plan-price {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.pricing-card .plan-period {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.pricing-card .plan-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.6;
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(20,18,16,.88);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 80px rgba(0,0,0,.4);
  transform: scale(.92);
  transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.lightbox.open img {
  transform: scale(1);
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: rgba(255,255,255,.1);
  color: #fff; font-size: 20px;
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s;
}
.lightbox-close:hover { background: rgba(255,255,255,.2); }

/* ---------- back-to-top ---------- */
.back-to-top {
  position: fixed;
  bottom: 32px; right: 32px;
  width: 44px; height: 44px;
  background: var(--accent);
  color: #fff;
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  transition: all .3s ease;
  z-index: 500;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

/* ---------- progress bar ---------- */
.progress-bar {
  position: fixed;
  top: 0; left: var(--sidebar-w); right: 0;
  height: 3px;
  z-index: 950;
  background: transparent;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #D4A96A);
  width: 0%;
  transition: width .1s linear;
  border-radius: 0 2px 2px 0;
}

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  :root { --sidebar-w: 260px; }
  .main-inner { padding: 32px 28px 100px; }
  .hero h2 { font-size: 32px; }
}

@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
  }
  .sidebar.open { transform: translateX(0); }
  .main {
    margin-left: 0;
    padding-top: var(--header-h);
  }
  .main-inner {
    padding: 24px 20px 100px;
  }
  .progress-bar { left: 0; top: var(--header-h); }
  .hero { padding: 32px 0 28px; }
  .hero::before { height: 280px; }
  .hero h2 { font-size: 28px; }
  .section-title { font-size: 22px; }
  .step-card { padding: 20px; }
  .checklist-card { padding: 22px 20px; }
  .feature-grid { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .pricing-grid { grid-template-columns: 1fr; }
}

/* ---------- print ---------- */
@media print {
  .sidebar, .mobile-header, .progress-bar, .back-to-top, .lightbox { display: none !important; }
  .main { margin-left: 0; }
  .screenshot { box-shadow: none; border: 1px solid #ddd; }
}
