:root {
  --bg: #faf5ed;
  --surface: #fffdf9;
  --panel: #f2e9dc;
  --text: #2a211b;
  --text-body: #463a31;
  --text-muted: #78695c;
  --border: #e4d8c8;
  --primary: #c05621;
  --primary-hover: #9c4215;
  --primary-soft: rgba(192, 86, 33, 0.1);
  --sage: #4a7856;
  --sage-soft: rgba(74, 120, 86, 0.12);
  --shadow: 0 6px 24px rgba(68, 44, 24, 0.06);
  --radius: 18px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1512;
    --surface: #251e19;
    --panel: #2f2620;
    --text: #f7efe6;
    --text-body: #e5d9cc;
    --text-muted: #b0a090;
    --border: rgba(247, 239, 230, 0.12);
    --primary: #e88b58;
    --primary-hover: #f3a276;
    --primary-soft: rgba(232, 139, 88, 0.15);
    --sage: #7bb38a;
    --sage-soft: rgba(123, 179, 138, 0.14);
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  gap: 2px;
}

.lang-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-btn:hover {
  color: var(--text);
  text-decoration: none;
}

.lang-btn.is-active {
  background: var(--primary);
  color: #ffffff;
}

.lang-btn.is-active:hover {
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .lang-btn.is-active,
  .lang-btn.is-active:hover {
    color: #1a1512;
  }
}

.lang-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.75;
  font-size: 16px;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  max-width: 940px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.93rem;
  font-weight: 600;
}

.nav-links a {
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 10px;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: var(--primary-soft);
  text-decoration: none;
}

.container {
  max-width: 940px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 30px;
  margin-bottom: 24px;
}

.eyebrow {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 12px;
  color: var(--text);
  font-family: Georgia, "Noto Serif TC", "Songti TC", serif;
  font-size: 2.05rem;
  line-height: 1.28;
  letter-spacing: -0.01em;
}

.hero .lead {
  margin: 0 0 12px;
  font-size: 1.07rem;
  color: var(--text-body);
}

.hero .lead-zh {
  margin: 0 0 22px;
  font-size: 1.02rem;
  color: var(--text-muted);
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.94rem;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .btn.primary {
    color: #1a1512;
  }
}

.btn:hover {
  text-decoration: none;
  opacity: 0.92;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 22px;
}

.split-grid .card {
  margin-bottom: 0;
}

.card h2 {
  margin-top: 0;
  margin-bottom: 10px;
  color: var(--text);
  font-family: Georgia, "Noto Serif TC", "Songti TC", serif;
  font-size: 1.32rem;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 1.1rem;
}

.pill-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 10px;
}

.pill-tag.free {
  background: var(--sage-soft);
  color: var(--sage);
}

.clean-list {
  margin: 10px 0 0;
  padding-left: 1.25rem;
}

.clean-list li {
  margin-bottom: 7px;
}

.doc-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.doc-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.doc-item-title strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
}

.doc-item-title span {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.doc-item-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.note-box {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--panel);
  border-left: 4px solid var(--primary);
  font-size: 0.93rem;
}

.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px;
}

.doc-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.93rem;
  font-weight: 600;
}

.doc-content h1 {
  color: var(--text);
  font-family: Georgia, "Noto Serif TC", "Songti TC", serif;
  font-size: 1.75rem;
  line-height: 1.3;
  margin-top: 0;
}

.doc-content h2 {
  color: var(--text);
  font-family: Georgia, "Noto Serif TC", "Songti TC", serif;
  font-size: 1.3rem;
  margin-top: 2rem;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.doc-content h3 {
  color: var(--text);
  font-size: 1.08rem;
  margin-top: 1.4rem;
}

.doc-content h4 {
  color: var(--text);
  font-size: 1rem;
  margin-top: 1.1rem;
}

.doc-content ul, .doc-content ol {
  padding-left: 1.4rem;
}

.doc-content li {
  margin-bottom: 6px;
}

.doc-content blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--primary);
  background: var(--panel);
  border-radius: 0 10px 10px 0;
}

.doc-content code {
  background: var(--panel);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
}

.doc-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.doc-content th, .doc-content td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.doc-content th {
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
}

.doc-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.site-footer {
  max-width: 940px;
  margin: 0 auto;
  padding: 22px 20px 36px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.section-intro {
  margin: 0 0 14px;
  color: var(--text-muted);
  font-size: 0.96rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.feature-card h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text);
}

.feature-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.55;
}

.feature-badge {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}

.feature-badge.sage {
  background: var(--sage-soft);
  color: var(--sage);
}

.screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.screenshot-card {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.screenshot-frame {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow);
}

.screenshot-frame img {
  width: 100%;
  height: auto;
  display: block;
}

.screenshot-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.screenshot-card figcaption strong {
  font-size: 0.94rem;
  color: var(--text);
  line-height: 1.35;
}

.screenshot-card figcaption span {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Guide subtree layout & components */
.container--wide {
  max-width: 1120px;
}

.guide-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.guide-sidebar {
  position: sticky;
  top: 82px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.guide-tree summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.96rem;
  color: var(--text);
  list-style: none;
}

.guide-tree summary::-webkit-details-marker {
  display: none;
}

.guide-tree summary::after {
  content: "+";
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.guide-tree[open] summary::after {
  content: "−";
}

.guide-nav-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.guide-nav-link {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--text-body);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  min-height: 40px;
}

.guide-nav-link:hover {
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
}

.guide-nav-link.is-active {
  background: var(--primary-soft);
  color: var(--primary);
}

.guide-nav-num {
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  min-width: 22px;
  padding-top: 2px;
}

.guide-nav-link.is-active .guide-nav-num {
  color: var(--primary);
}

.guide-main {
  min-width: 0;
}

.guide-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.guide-section {
  scroll-margin-top: 88px;
  margin-top: 28px;
  padding-top: 6px;
}

.guide-section:first-of-type {
  margin-top: 18px;
}

.step-list {
  list-style: none;
  padding: 0;
  margin: 14px 0 18px;
  display: grid;
  gap: 12px;
}

.step-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

@media (prefers-color-scheme: dark) {
  .step-num {
    color: #1a1512;
  }
}

.step-body strong {
  color: var(--text);
}

.step-body p {
  margin: 4px 0 0;
}

.ui-chip {
  display: inline-block;
  max-width: 100%;
  padding: 1px 8px;
  border-radius: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 0.88em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.guide-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  align-items: start;
  margin-top: 12px;
}

.guide-figure {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  max-width: 290px;
}

.guide-figure img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
  border: 1px solid var(--border);
}

.guide-figure figcaption {
  margin-top: 8px;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.callout {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  font-size: 0.94rem;
}

.callout--tip {
  background: var(--sage-soft);
  border-left-color: var(--sage);
}

.callout--warn {
  background: var(--primary-soft);
  border-left-color: var(--primary);
}

.callout strong {
  color: var(--text);
}

.guide-pager {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.guide-pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  min-height: 60px;
}

.guide-pager-link:hover {
  border-color: var(--primary);
  text-decoration: none;
}

.guide-pager-link--next {
  text-align: right;
}

.guide-pager-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.guide-pager-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--primary);
}

.faq-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.faq-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.faq-item summary {
  min-height: 52px;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-body {
  padding: 0 16px 16px;
  color: var(--text-body);
}

.faq-body p:first-child {
  margin-top: 0;
}

.feature-card-link {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.86rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 859px) {
  .guide-shell {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .guide-sidebar {
    position: static;
  }
}

@media (max-width: 759px) {
  .guide-split {
    grid-template-columns: 1fr;
  }

  .guide-figure {
    margin: 6px auto 0;
  }

  .doc-card {
    padding: 20px;
  }
}
