/* ============================================================
   Chrono Tide Documentation Station
   继承主站设计语言：深海色调 + 潮汐蓝
   双栏布局：左侧 240 侧边栏 + 右侧 760 内容
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink-900: #0a1628;
  --ink-800: #0f172b;
  --ink-700: #1e293b;
  --ink-600: #334155;
  --ink-500: #45556c;
  --ink-400: #62748e;
  --ink-300: #90a1b9;
  --ink-200: #b6c2d0;
  --ink-100: #e2e8f0;
  --ink-50:  #f1f5f9;
  --ink-25:  #f8fafc;

  --tide-700: #0070c7;
  --tide-600: #0084d1;
  --tide-500: #00a6f4;
  --tide-400: #38bdf8;
  --tide-300: #7dd3fc;
  --tide-200: #bae6fd;
  --tide-100: #e0f2fe;
  --tide-50:  #f0f9ff;

  --g-tide: linear-gradient(135deg, #00a6f4 0%, #00d4c5 100%);
  --g-tide-soft: linear-gradient(135deg, #38bdf8 0%, #14b8a6 100%);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-pill: 9999px;

  --sh-xs: 0 1px 2px rgba(10, 22, 40, 0.04);
  --sh-sm: 0 2px 4px rgba(10, 22, 40, 0.05), 0 1px 2px rgba(10, 22, 40, 0.04);
  --sh-md: 0 8px 24px rgba(10, 22, 40, 0.08);
  --sh-lg: 0 16px 40px rgba(10, 22, 40, 0.10);

  --f-display: 'Noto Serif SC', 'Inter', serif;
  --f-body: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'SimHei', sans-serif;
  --f-mono: 'JetBrains Mono', 'Menlo', 'Consolas', monospace;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--f-body);
  background: var(--ink-25);
  color: var(--ink-500);
  line-height: 1.65;
  overflow-x: hidden;
}

a { color: var(--tide-500); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--tide-600); }

code { font-family: var(--f-mono); font-size: 0.92em; }
pre code { font-size: 13px; }
p code, li code, td code {
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--ink-800);
}

::selection { background: var(--tide-500); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cad5e2; border-radius: var(--r-pill); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-300); }

/* ============================================================
   顶部文档头
   ============================================================ */
.doc-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 60px;
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}
.doc-header-inner {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.doc-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.doc-header-logo {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  box-shadow: 0 3px 8px rgba(0, 166, 244, 0.20);
}
.doc-header-title {
  font-family: var(--f-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-800);
  letter-spacing: 0.01em;
}
.doc-header-title span { color: var(--tide-500); }
.doc-header-divider {
  width: 1px;
  height: 18px;
  background: var(--ink-200);
  margin: 0 4px;
}
.doc-header-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-500);
  padding: 3px 10px;
  background: var(--tide-50);
  color: var(--tide-700);
  border-radius: var(--r-pill);
  letter-spacing: 0.04em;
}
.doc-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
}
.doc-header-link {
  color: var(--ink-500);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  transition: all 0.2s var(--ease);
}
.doc-header-link:hover {
  color: var(--tide-600);
  background: var(--tide-50);
}
.doc-header-link svg { width: 14px; height: 14px; }
.doc-header-github {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--ink-100);
  border-radius: var(--r-sm);
  color: var(--ink-700);
  font-weight: 500;
}
.doc-header-github:hover {
  color: var(--tide-600);
  border-color: var(--tide-500);
  background: #fff;
}
.doc-header-github svg { width: 14px; height: 14px; }

@media (max-width: 600px) {
  .doc-header-divider, .doc-header-tag { display: none; }
}

/* ============================================================
   双栏布局
   ============================================================ */
.doc-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  align-items: flex-start;
}

@media (max-width: 900px) {
  .doc-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 16px;
  }
}

/* ============================================================
   侧边栏
   ============================================================ */
.doc-sidebar {
  position: sticky;
  top: 80px;
  align-self: flex-start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 32px 0;
  border-right: 1px solid var(--ink-100);
  padding-right: 12px;
}

@media (max-width: 900px) {
  .doc-sidebar {
    position: relative;
    top: 0;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--ink-100);
    padding: 16px 0;
  }
}

.doc-sidebar-section {
  margin-bottom: 20px;
}
.doc-sidebar-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-400);
  padding: 0 12px;
  margin-bottom: 8px;
}
.doc-sidebar-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.doc-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-500);
  border-radius: var(--r-sm);
  transition: all 0.2s var(--ease);
  line-height: 1.4;
}
.doc-sidebar-link:hover {
  background: var(--tide-50);
  color: var(--tide-700);
}
.doc-sidebar-link.active {
  background: var(--tide-50);
  color: var(--tide-700);
  font-weight: 600;
}
.doc-sidebar-link.active::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--tide-500);
  border-radius: 2px;
  margin-left: -12px;
  margin-right: -3px;
}
.doc-sidebar-link-num {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--ink-300);
  font-weight: 600;
  flex-shrink: 0;
  width: 22px;
}
.doc-sidebar-link.active .doc-sidebar-link-num { color: var(--tide-500); }

/* ============================================================
   主内容区
   ============================================================ */
.doc-content {
  padding: 40px 0 80px;
  max-width: 760px;
  min-width: 0;
}

.doc-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--tide-600);
  background: var(--tide-50);
  padding: 5px 12px;
  border-radius: var(--r-pill);
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.doc-eyebrow::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--tide-500);
  border-radius: 50%;
}

h1.doc-title {
  font-family: var(--f-display);
  font-size: 38px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 12px;
}
@media (max-width: 600px) { h1.doc-title { font-size: 28px; } }

.doc-lead {
  font-size: 16px;
  color: var(--ink-500);
  line-height: 1.7;
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ink-100);
}

.doc-content h2 {
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin: 40px 0 14px;
  padding-top: 8px;
}
.doc-content h2::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--g-tide);
  border-radius: 2px;
  margin-right: 10px;
  vertical-align: -2px;
}

.doc-content h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-800);
  margin: 28px 0 10px;
  letter-spacing: -0.005em;
}

.doc-content p {
  font-size: 15px;
  color: var(--ink-600);
  line-height: 1.8;
  margin-bottom: 14px;
}

.doc-content ul, .doc-content ol {
  margin: 0 0 18px 0;
  padding-left: 24px;
  font-size: 15px;
  color: var(--ink-600);
  line-height: 1.8;
}
.doc-content ul li, .doc-content ol li { margin-bottom: 6px; }
.doc-content ul li::marker { color: var(--tide-500); }

.doc-content strong { color: var(--ink-900); font-weight: 600; }

/* 表格 */
.doc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0 28px;
  font-size: 14px;
  border: 1px solid var(--ink-100);
  border-radius: var(--r-md);
  overflow: hidden;
}
.doc-table th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-700);
  background: var(--ink-50);
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-100);
}
.doc-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-50);
  color: var(--ink-600);
  vertical-align: top;
}
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table tr:hover td { background: var(--tide-50); }

/* Callout 信息块 */
.callout {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  margin: 20px 0;
  border-radius: var(--r-md);
  border: 1px solid;
  font-size: 14px;
  line-height: 1.7;
}
.callout-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 13px;
  margin-top: 1px;
}
.callout-body { flex: 1; color: var(--ink-700); }
.callout-body strong { color: var(--ink-900); }
.callout-body p:last-child { margin-bottom: 0; }
.callout.info { background: var(--tide-50); border-color: var(--tide-200); }
.callout.info .callout-icon { background: var(--tide-500); color: #fff; }
.callout.success { background: #f0fdf4; border-color: #bbf7d0; }
.callout.success .callout-icon { background: #16a34a; color: #fff; }
.callout.warn { background: #fff7ed; border-color: #fed7aa; }
.callout.warn .callout-icon { background: #ea580c; color: #fff; }
.callout.tip { background: #faf5ff; border-color: #e9d5ff; }
.callout.tip .callout-icon { background: #9333ea; color: #fff; }

/* 代码块 */
pre {
  background: var(--ink-900);
  color: #cbd5e1;
  padding: 16px 20px;
  border-radius: var(--r-md);
  overflow-x: auto;
  margin: 16px 0 22px;
  font-size: 13px;
  line-height: 1.6;
  border: 1px solid var(--ink-800);
}
pre code { color: #cbd5e1; background: none; border: 0; padding: 0; }

/* 截图占位（实际使用时可替换为真实图片） */
.doc-shot {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
  border: 1px solid var(--ink-100);
  margin: 18px 0 8px;
  box-shadow: var(--sh-sm);
}
.doc-shot-caption {
  font-size: 12px;
  color: var(--ink-400);
  text-align: center;
  margin: 0 0 24px;
  font-style: italic;
}

/* 网格卡片 */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 18px 0 24px;
}
@media (max-width: 600px) { .doc-grid { grid-template-columns: 1fr; } }
.doc-card {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--ink-100);
  border-radius: var(--r-md);
  transition: all 0.2s var(--ease);
}
.doc-card:hover {
  border-color: var(--tide-200);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
}
.doc-card-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tide-50);
  color: var(--tide-600);
  border-radius: var(--r-sm);
  margin-bottom: 10px;
  font-size: 16px;
  font-weight: 700;
}
.doc-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 4px;
}
.doc-card-desc {
  font-size: 12.5px;
  color: var(--ink-400);
  line-height: 1.6;
}

/* 平台徽章 */
.platform-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-700);
  margin: 0 4px 6px 0;
}
.platform-badge .lang {
  font-size: 10px;
  color: var(--ink-300);
  padding: 1px 5px;
  background: #fff;
  border-radius: 4px;
}

/* 上下页导航 */
.doc-prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 60px;
  padding-top: 28px;
  border-top: 1px solid var(--ink-100);
}
.doc-pn-card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid var(--ink-100);
  border-radius: var(--r-md);
  transition: all 0.2s var(--ease);
  text-decoration: none;
  color: inherit;
}
.doc-pn-card.next { text-align: right; align-items: flex-end; }
.doc-pn-card:hover {
  border-color: var(--tide-200);
  box-shadow: var(--sh-sm);
  transform: translateY(-1px);
  color: inherit;
}
.doc-pn-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--tide-600);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.doc-pn-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-900);
}
.doc-pn-card.disabled {
  visibility: hidden;
}

/* 编辑此页 */
.doc-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  font-size: 13px;
  color: var(--ink-400);
}
.doc-edit:hover { color: var(--tide-600); }
.doc-edit svg { width: 14px; height: 14px; }
