:root {
  --bg: #f3ede4;
  --surface: #fffdf8;
  --surface-soft: #fbf6ee;
  --line: #ddcfbc;
  --line-strong: #c5b196;
  --text: #2f261b;
  --muted: #6f6553;
  --brand: #a54d2d;
  --brand-deep: #7c351d;
  --brand-soft: #f3d8c2;
  --ok-bg: #eef6ef;
  --warn-bg: #fff3eb;
  --info-bg: #f7f8ff;
  --shadow: 0 18px 38px rgba(77, 52, 24, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(165, 77, 45, 0.08), transparent 24rem),
    linear-gradient(180deg, #fbf6ee 0%, var(--bg) 52%, #efe5d8 100%);
  line-height: 1.72;
}

code,
pre {
  font-family: Consolas, "Courier New", monospace;
}

a {
  color: var(--brand-deep);
}

.site-shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  padding: 22px 18px 26px;
  border-right: 1px solid rgba(197, 177, 150, 0.7);
  background: rgba(255, 251, 245, 0.9);
  backdrop-filter: blur(8px);
}

.sidebar-brand {
  margin-bottom: 18px;
}

.sidebar-brand a {
  display: inline-block;
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
}

.sidebar-tree {
  display: grid;
  gap: 10px;
}

.sidebar-search-panel {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(221, 207, 188, 0.8);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow);
}

.sidebar-search-label {
  color: #8a5b3b;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.sidebar-search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(197, 177, 150, 0.9);
  border-radius: 12px;
  background: rgba(255, 250, 242, 0.96);
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.sidebar-search-input:focus {
  border-color: rgba(165, 77, 45, 0.8);
  box-shadow: 0 0 0 3px rgba(165, 77, 45, 0.12);
}

.sidebar-group {
  border: 1px solid rgba(221, 207, 188, 0.8);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  font-weight: 700;
}

.sidebar-group-title span {
  min-width: 0;
}

.sidebar-group-toggle {
  flex: 0 0 auto;
  min-width: 74px;
  padding: 6px 10px;
  border: 1px solid rgba(197, 177, 150, 0.9);
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.96);
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.sidebar-group-toggle:hover {
  background: var(--surface-soft);
}

.sidebar-links {
  display: grid;
  gap: 4px;
  padding: 0 10px 12px;
}

.sidebar-bucket {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(221, 207, 188, 0.7);
}

.sidebar-bucket:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.sidebar-bucket-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 6px;
  padding: 0 4px;
  color: #8a5b3b;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.sidebar-bucket-title span {
  min-width: 0;
}

.sidebar-bucket-toggle {
  min-width: 66px;
  padding: 5px 9px;
  font-size: 11px;
}

.sidebar-node {
  display: grid;
  gap: 6px;
}

.sidebar-node.is-hidden,
.sidebar-bucket.is-hidden,
.sidebar-group.is-hidden {
  display: none !important;
}

.sidebar-node-group {
  border-radius: 12px;
}

.sidebar-node-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-node-head .sidebar-link {
  flex: 1;
}

.sidebar-toggle {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(197, 177, 150, 0.85);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.95);
  color: var(--brand-deep);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.sidebar-toggle:hover {
  background: var(--surface-soft);
}

.sidebar-link {
  display: block;
  padding: 7px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
}

summary.sidebar-link {
  list-style: none;
}

.sidebar-link:hover {
  background: var(--surface-soft);
}

.sidebar-link.current {
  background: var(--brand);
  color: #fff;
}

.sidebar-sublinks {
  display: grid;
  gap: 4px;
  margin: -2px 0 4px 12px;
  padding-left: 10px;
  border-left: 2px solid rgba(197, 177, 150, 0.8);
}

.sidebar-node-group.is-collapsed > .sidebar-sublinks {
  display: none !important;
}

.sidebar-sublink {
  display: block;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
}

.sidebar-sublink:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.sidebar-sublink.current {
  background: rgba(165, 77, 45, 0.12);
  color: var(--brand-deep);
  font-weight: 700;
}

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

.page {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  background: linear-gradient(135deg, rgba(255, 248, 238, 0.98), rgba(255, 253, 247, 0.96));
  border: 1px solid rgba(198, 179, 154, 0.68);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 40px);
}

.hero-copy h1 {
  margin: 8px 0 12px;
  line-height: 1.2;
  font-size: clamp(30px, 5vw, 46px);
}

.hero-copy p {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 253, 248, 0.95);
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

.section-nav a {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.92);
  text-decoration: none;
}

.section {
  margin-top: 20px;
  background: rgba(255, 253, 248, 0.76);
  border: 1px solid rgba(221, 207, 188, 0.78);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.section h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.section-desc,
.muted,
.subhead,
.why-wrong,
.label {
  color: var(--muted);
}

.label {
  margin: 12px 0 6px;
  font-size: 14px;
  font-weight: 700;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.plain-list {
  margin: 0;
  padding-left: 22px;
}

.two-col,
.task-grid,
.example-grid,
.action-list {
  display: grid;
  gap: 16px;
}

.two-col {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.task-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.action-list {
  grid-template-columns: 1fr;
  gap: 24px;
}

.example-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 16px;
}

.info-card,
.task-card,
.error-card,
.action-card,
.note-box,
.tip-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.action-card {
  background: linear-gradient(180deg, #fffdfa 0%, #fff8f0 100%);
  border: 2px solid rgba(197, 177, 150, 0.92);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(77, 52, 24, 0.1);
  padding: 18px 20px;
}

.action-card:nth-child(even) {
  background: linear-gradient(180deg, #fffdf9 0%, #fff5eb 100%);
}

.action-details {
  margin-top: 14px;
  border: 1px solid rgba(181, 122, 86, 0.42);
  border-radius: 16px;
  background: rgba(255, 249, 242, 0.96);
  overflow: hidden;
}

.action-details summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 700;
  color: var(--brand-deep);
  background: linear-gradient(180deg, #fff4e8 0%, #ffefe0 100%);
  border-bottom: 1px solid rgba(181, 122, 86, 0.2);
  list-style: none;
}

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

.action-details-body {
  padding: 0 14px 14px;
}

.action-head {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(197, 177, 150, 0.72);
  margin-bottom: 8px;
}

.action-card h3 {
  font-size: 22px;
}

.subhead {
  color: #8c7258;
}

.example-stack {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(197, 177, 150, 0.72);
  background: rgba(255, 251, 245, 0.92);
}

.example-stack h4 {
  margin: 0 0 8px;
  font-size: 16px;
}

.example-stack + .example-stack {
  margin-top: 12px;
}

.example-stack:last-of-type {
  background: rgba(250, 244, 238, 0.78);
  border-color: rgba(197, 177, 150, 0.5);
  opacity: 0.9;
}

.example-stack:last-of-type h4,
.example-stack:last-of-type .why-wrong {
  color: #826a57;
}

.info-card h3,
.task-card h3,
.error-card h3,
.action-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.tips-inline {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--surface-soft);
  border: 1px solid rgba(198, 179, 154, 0.7);
}

.tips-inline p {
  margin: 6px 0;
}

.task-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

pre {
  margin: 8px 0 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: #241e17;
  color: #f6ecdc;
  overflow: auto;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

pre.code-block {
  position: relative;
  padding-top: 48px;
}

code {
  background: rgba(165, 77, 45, 0.09);
  border-radius: 6px;
  padding: 2px 6px;
}

pre code {
  background: transparent;
  padding: 0;
}

.code-copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff7ee;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.code-copy-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.search-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.search-bar input {
  flex: 1 1 320px;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 12px 16px;
  background: rgba(255, 253, 248, 0.95);
  font-size: 16px;
}

.table-wrap {
  overflow-x: auto;
}

.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.param-table th,
.param-table td {
  border-bottom: 1px solid rgba(221, 207, 188, 0.86);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.param-table th {
  background: rgba(243, 216, 194, 0.33);
  color: var(--muted);
  font-weight: 700;
}

.action-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.chip-control {
  background: #efe4d7;
  color: #6f4926;
}

.note-box {
  margin-top: 16px;
  background: #fff8ef;
}

.tip-box {
  margin-top: 16px;
  background: var(--info-bg);
}

.llm-tip {
  background: #f4f6ff;
}

.task-card ul,
.note-box ul,
.tip-box ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.is-hidden {
  display: none !important;
}

@media (max-width: 980px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(197, 177, 150, 0.7);
  }
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .section {
    padding: 18px 16px;
  }

  .section h2 {
    font-size: 24px;
  }

  .section-head,
  .action-head {
    flex-direction: column;
  }
}
