:root {
  --sidebar-w: 280px;
  --bg: #f6f8fc;
  --sidebar: #0f172a;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #1e293b;
  --accent: #3b82f6;
  --accent-soft: #dbeafe;
  --text: #1e293b;
  --muted: #64748b;
  --card: #ffffff;
  --border: #e2e8f0;
  --code-bg: #f1f5f9;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.brand {
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.02em;
}

.brand-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
}

.brand-tagline {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #cbd5e1;
  font-weight: 500;
}

.brand-keywords {
  margin: 0.3rem 0 0;
  font-size: 0.72rem;
  color: #64748b;
}

.nav-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0.5rem 1rem;
}

.nav-group-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.75rem 0.75rem 0.35rem;
}

.nav-link {
  display: block;
  padding: 0.55rem 0.85rem;
  margin: 2px 0;
  border-radius: 8px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
}

.nav-link.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.nav-link.json-file {
  font-size: 0.82rem;
  opacity: 0.9;
}

.sidebar-contact-wrap {
  padding: 0.65rem 0.85rem 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-contact-card {
  padding: 0.75rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.sidebar-contact-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.sidebar-contact-avatar {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #f8fafc;
  background: #475569;
}

.sidebar-contact-header-text {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}

.sidebar-contact-eyebrow {
  font-size: 0.68rem;
  color: #94a3b8;
}

.sidebar-contact-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #f1f5f9;
}

/* 固定小图标，避免 SVG 被全局样式撑大 */
.sidebar-contact-icon {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  min-width: 26px;
  min-height: 26px;
  max-width: 26px;
  max-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  overflow: hidden;
  line-height: 0;
}

.sidebar-contact-icon svg {
  display: block;
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  flex: none;
}

.sidebar-contact-icon--phone {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-contact-icon--wechat {
  color: #86efac;
  background: rgba(34, 197, 94, 0.15);
}

/* 电话：浅底深字，不用蓝色 */
.sidebar-contact-action {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.55rem;
  margin-bottom: 0.4rem;
  border-radius: 8px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(203, 213, 225, 0.25);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sidebar-contact-action:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(226, 232, 240, 0.4);
}

.sidebar-contact-action-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sidebar-contact-action-label {
  font-size: 0.65rem;
  color: #94a3b8;
}

.sidebar-contact-action-value {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.sidebar-contact-wechat {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-contact-wechat-text {
  font-size: 0.72rem;
  color: #bbf7d0;
}

.sidebar-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
}

.sidebar-footer a {
  color: #93c5fd;
  text-decoration: none;
}

.sidebar-footer a:hover { text-decoration: underline; }

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.topbar-actions a {
  margin-left: 0.75rem;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.content-wrap {
  flex: 1;
  padding: 1.5rem 2rem 3rem;
  max-width: 920px;
}

.doc-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 2rem 2.25rem;
  min-height: 320px;
}

.doc-loading {
  color: var(--muted);
  text-align: center;
  padding: 3rem;
}

.site-disclaimer {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--muted);
}

.site-disclaimer-title {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #475569;
}

.site-disclaimer-body p {
  margin: 0 0 0.65rem;
}

.site-disclaimer-body p:last-child {
  margin-bottom: 0;
}

.site-disclaimer-body code {
  font-size: 0.78rem;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.site-disclaimer-accept {
  margin: 0.85rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
  font-size: 0.78rem;
  color: #64748b;
}

.markdown-body {
  line-height: 1.75;
  font-size: 0.95rem;
}

.markdown-body h1 {
  font-size: 1.75rem;
  border-bottom: 2px solid var(--accent-soft);
  padding-bottom: 0.4rem;
  margin-top: 0;
}

.markdown-body h2 {
  font-size: 1.3rem;
  margin-top: 2rem;
  color: #0f172a;
}

.markdown-body h3 {
  font-size: 1.05rem;
  margin-top: 1.5rem;
}

.markdown-body a { color: var(--accent); }

.markdown-body code {
  background: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
}

.markdown-body pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1rem 1.1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

.markdown-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.75rem;
  text-align: left;
}

.markdown-body th {
  background: var(--accent-soft);
  font-weight: 600;
}

.markdown-body blockquote {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 4px solid var(--accent);
  background: #f8fafc;
  color: var(--muted);
}

.json-view {
  background: #0f172a;
  color: #a5f3fc;
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: Consolas, "Cascadia Code", monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  white-space: pre;
}

.menu-toggle {
  display: none;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: fixed;
    left: -100%;
    z-index: 100;
    transition: left 0.25s;
    width: min(85vw, var(--sidebar-w));
  }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-block; }
  .content-wrap { padding: 1rem; }
  .doc-card { padding: 1.25rem; }
}
