﻿:root {
  --bg: #f5f4ef;
  --paper: #fffaf0;
  --ink: #1f2a30;
  --muted: #5f6a6f;
  --brand: #0f766e;
  --brand-2: #d97706;
  --line: #d9d7cf;
  --ok: #166534;
  --warn: #b45309;
  --shadow: 0 12px 30px rgba(31, 42, 48, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: "Source Han Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: 1.6;
}

.bg-gradient {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(217, 119, 6, 0.18), transparent 35%),
    radial-gradient(circle at 90% 5%, rgba(15, 118, 110, 0.2), transparent 40%),
    linear-gradient(180deg, #f8f7f2 0%, #f1efe8 100%);
  z-index: -1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.9);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand h1 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: conic-gradient(var(--brand), var(--brand-2));
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-btn,
button,
input,
textarea {
  font: inherit;
}

.nav-btn,
.nav-link {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.nav-btn.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
}

.nav-link:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.main {
  width: min(1200px, 92vw);
  margin: 30px auto 40px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
  animation: rise 0.45s ease;
}

.hero-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
}

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

h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.2;
}

.hero-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

.docs-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 12px;
}

.docs-head h2 {
  margin: 4px 0 0;
}

.knowledge-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 12px;
}

.knowledge-head h2 {
  margin: 4px 0 0;
}

.knowledge-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.knowledge-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.knowledge-tools input {
  width: 260px;
}

.column-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.column-card {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.column-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}

.column-card-head h3 {
  margin: 0;
  font-size: 1rem;
}

.column-card-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.column-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.column-card.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
}

.column-card.active p,
.column-card.active .column-card-head span {
  color: rgba(255, 255, 255, 0.88);
}

.info-card,
.api-card,
.output-card,
.doc-sidebar,
.doc-viewer {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.info-card {
  padding: 18px;
}

.info-card h3 {
  margin: 0 0 6px;
}

.split {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 14px;
}

.doc-sidebar {
  padding: 14px;
  max-height: 72vh;
  overflow: auto;
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.side-head h3 {
  margin: 0;
}

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

.doc-item {
  display: grid;
  gap: 4px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
}

.doc-item strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.doc-item small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.doc-item.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
}

.doc-item.active small {
  color: rgba(255, 255, 255, 0.88);
}

.column-description {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.doc-viewer {
  padding: 22px;
  max-height: 72vh;
  overflow: auto;
}

.knowledge-layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 14px;
}

.knowledge-sidebar {
  border: 1px solid #c8d4ea;
  background: linear-gradient(180deg, #f9fbff 0%, #eff4fd 100%);
  border-radius: 10px;
  padding: 14px;
  max-height: 72vh;
  overflow: auto;
  box-shadow: 0 10px 24px rgba(27, 58, 98, 0.08);
}

.knowledge-sidebar h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  color: #17345d;
}

.knowledge-list {
  display: grid;
  gap: 8px;
}

.knowledge-group {
  border: 1px solid #c8d4ea;
  border-radius: 8px;
  background: #f6f9ff;
  overflow: hidden;
}

.knowledge-group-toggle {
  width: 100%;
  border: none;
  border-bottom: 1px solid #d5e0f3;
  border-radius: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #e9f0fb;
  color: #1f3f68;
  font-weight: 700;
  padding: 10px 12px;
}

.knowledge-group-items {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.knowledge-item {
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 1px solid #c8d4ea;
  background: #ffffff;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}

.knowledge-item strong {
  color: #17345d;
  font-size: 0.94rem;
}

.knowledge-item small {
  color: #526784;
  font-size: 0.82rem;
  line-height: 1.4;
}

.knowledge-tag {
  display: inline-flex;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #c8d4ea;
  color: #37557a;
  font-size: 0.74rem;
  background: #f4f8ff;
}

.knowledge-item.active {
  border-color: #17345d;
  background: #17345d;
}

.knowledge-item.active strong,
.knowledge-item.active small,
.knowledge-item.active .knowledge-tag {
  color: #e8f0ff;
  border-color: rgba(232, 240, 255, 0.45);
  background: rgba(232, 240, 255, 0.1);
}

.knowledge-viewer {
  border: 1px solid #c8d4ea;
  background: #fbfdff;
  border-radius: 10px;
  padding: 22px;
  max-height: 72vh;
  overflow: auto;
  box-shadow: 0 10px 24px rgba(27, 58, 98, 0.08);
}

.knowledge-viewer h1,
.knowledge-viewer h2,
.knowledge-viewer h3 {
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  color: #17345d;
}

.knowledge-viewer pre {
  background: #eef4ff;
  border-radius: 10px;
  padding: 14px;
  overflow: auto;
  border: 1px solid #c8d4ea;
}

.knowledge-viewer img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid #c8d4ea;
  margin: 8px 0;
}

.knowledge-viewer code {
  font-family: "JetBrains Mono", Consolas, monospace;
}

.knowledge-viewer blockquote {
  margin: 1em 0;
  border-left: 4px solid #365d93;
  padding: 2px 12px;
  color: #3b526e;
  background: #eef4ff;
}

.doc-viewer h1,
.doc-viewer h2,
.doc-viewer h3 {
  margin-top: 1.2em;
  margin-bottom: 0.5em;
}

.doc-viewer pre {
  background: #f3efe0;
  border-radius: 10px;
  padding: 14px;
  overflow: auto;
  border: 1px solid #ddd5bb;
}

.doc-viewer img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin: 8px 0;
}

.doc-viewer code {
  font-family: "JetBrains Mono", Consolas, monospace;
}

.doc-viewer blockquote {
  margin: 1em 0;
  border-left: 4px solid var(--brand);
  padding: 2px 12px;
  color: var(--muted);
  background: #f0f8f7;
}

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

.admin-grid {
  display: grid;
  gap: 14px;
}

.admin-card,
.output-card {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.admin-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.admin-doc-list {
  display: grid;
  gap: 8px;
}

.admin-doc-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.admin-doc-item strong {
  display: block;
  margin-bottom: 4px;
}

.admin-doc-item small {
  color: var(--muted);
  font-size: 0.82rem;
}

.api-card,
.output-card {
  padding: 16px;
}

.api-card h3,
.output-card h3 {
  margin-top: 0;
}

label {
  display: block;
  margin: 10px 0 6px;
  font-weight: 600;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
}

button.primary {
  color: #fff;
  border: none;
  background: linear-gradient(120deg, var(--brand), var(--brand-2));
}

button.ghost {
  background: #fff;
}

button.mini {
  padding: 6px 10px;
}

.output-card {
  margin-top: 14px;
}

#api-output {
  margin: 0;
  min-height: 120px;
  max-height: 380px;
  overflow: auto;
  background: #f3efe0;
  border: 1px solid #ddd5bb;
  border-radius: 10px;
  padding: 12px;
}

#admin-output {
  margin: 0;
  min-height: 120px;
  max-height: 420px;
  overflow: auto;
  background: #f3efe0;
  border: 1px solid #ddd5bb;
  border-radius: 10px;
  padding: 12px;
}

.media-filters {
  margin-top: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 220px) auto;
  gap: 8px;
}

.media-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.media-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}

.media-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.media-item-meta {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  word-break: break-all;
}

.media-preview {
  max-width: 220px;
  max-height: 120px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.media-pager {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer {
  width: min(1200px, 92vw);
  margin: 0 auto 24px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.placeholder {
  color: var(--muted);
}

.hidden {
  display: none;
}

.reveal {
  opacity: 0;
  transform: translateY(10px);
  animation: rise 0.5s ease forwards;
}

.delay-1 { animation-delay: 0.06s; }
.delay-2 { animation-delay: 0.12s; }
.delay-3 { animation-delay: 0.18s; }

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .docs-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .knowledge-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .knowledge-tools {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .knowledge-tools input {
    width: 100%;
  }

  .split {
    grid-template-columns: 1fr;
  }

  .knowledge-layout {
    grid-template-columns: 1fr;
  }

  .media-filters {
    grid-template-columns: 1fr;
  }

  .doc-sidebar,
  .doc-viewer,
  .knowledge-sidebar,
  .knowledge-viewer {
    max-height: none;
  }
}
