:root {
  color-scheme: light;
  --text: #18181b;
  --muted: #71717a;
  --muted-2: #52525b;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --accent: #18181b;
  --accent-soft: #f4f4f5;
  --radius: 4px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border-strong);
}

a:hover {
  text-decoration-color: var(--text);
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(20px, 5vw, 56px);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius);
  background: var(--text);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.top-nav a {
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.top-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ---------- 文章容器 ---------- */
.main {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 80px) clamp(20px, 5vw, 32px) 96px;
}

.kicker {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.main h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 32px);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.main .subtitle {
  margin: 12px 0 0;
  color: var(--muted-2);
  font-size: 16px;
  max-width: 60ch;
}

.meta {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 正文 ---------- */
.body {
  margin-top: 40px;
}

.body h2 {
  margin: 40px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.body h2:first-child {
  margin-top: 0;
}

.body h3 {
  margin: 24px 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.body p {
  margin: 0 0 14px;
  color: var(--text);
  max-width: 68ch;
}

.body ul,
.body ol {
  margin: 8px 0 16px;
  padding-left: 1.2rem;
}

.body li {
  margin: 6px 0;
  color: var(--text);
}

.body li::marker {
  color: var(--muted);
}

.body strong {
  font-weight: 600;
  color: var(--text);
}

.lead {
  font-size: 16px;
  color: var(--text);
}

code {
  padding: 0.08em 0.38em;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", "JetBrains Mono", Consolas, monospace;
  font-size: 0.86em;
}

/* ---------- 对照表 ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 12px 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  font-size: 13px;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}

th {
  background: var(--surface-2);
  color: var(--muted-2);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

td:first-child {
  color: var(--muted-2);
  width: 38%;
}

td:last-child {
  color: var(--text);
}

/* ---------- 技术栈标签 ---------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 4px;
}

.tag {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.6;
}

/* ---------- 职责/成果卡片 ---------- */
.role-list,
.result-list {
  list-style: none;
  margin: 12px 0 20px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.role-list li,
.result-list li {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.role-list li:last-child,
.result-list li:last-child {
  border-bottom: 0;
}

.result-list li {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.result-num {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- 边界提示框 ---------- */
.callout {
  margin: 12px 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--text);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-2);
  color: var(--muted-2);
  font-size: 14px;
}

.callout ul {
  margin: 6px 0 0;
}

/* ---------- 落地方案编号 ---------- */
.body ol.steps li {
  padding-left: 4px;
}

/* ---------- 回到顶部 ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--surface-2);
}

/* ---------- 索引页 ---------- */
.index-main {
  max-width: 680px;
  margin: 0 auto;
  padding: clamp(56px, 10vw, 96px) clamp(20px, 5vw, 32px);
}

.index-main h1 {
  margin: 0;
  font-size: clamp(24px, 3.5vw, 30px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.index-main .subtitle {
  margin: 12px 0 0;
  color: var(--muted-2);
  font-size: 15px;
  max-width: 52ch;
}

.index-cards {
  margin-top: 40px;
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.index-card {
  display: block;
  padding: 22px 20px;
  background: var(--surface);
  text-decoration: none;
  transition: background 120ms ease;
}

.index-card:hover {
  background: var(--surface-2);
}

.index-card .card-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.index-card .card-title {
  margin: 6px 0 4px;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.index-card .card-desc {
  margin: 0;
  color: var(--muted-2);
  font-size: 13px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  td:first-child {
    width: auto;
  }
}

@media print {
  .site-header,
  .back-to-top {
    display: none;
  }

  .main {
    max-width: none;
    padding: 0;
  }

  a {
    text-decoration: none;
  }
}
