:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #14161c;
  --ink-soft: #454b57;
  --muted: #6b7280;
  --line: #e6e8ef;
  --line-strong: #d9dce6;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-dark: #4338ca;
  --brand-soft: #eef0ff;
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --warn: #b45309;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 14px 32px -20px rgba(16, 24, 40, 0.28);
  --shadow-lg: 0 2px 6px rgba(16, 24, 40, 0.05), 0 28px 60px -32px rgba(16, 24, 40, 0.35);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 12% -8%, rgba(99, 102, 241, 0.10), transparent 62%),
    radial-gradient(760px 460px at 88% -12%, rgba(59, 130, 246, 0.09), transparent 60%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(79, 70, 229, 0.18); }

a { color: var(--brand); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--brand-dark); }

h1, h2, h3 { line-height: 1.28; margin: 0 0 0.5em; letter-spacing: -0.018em; font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.2rem 0; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 布局 ---------- */
.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 22px; }
.container-narrow { max-width: 470px; }
.section { padding: 60px 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.hidden { display: none !important; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 22px;
}
.section-head h2 { margin: 0; }
.section-head p { margin: 0; }
@media (max-width: 620px) {
  .section-head { flex-direction: column; gap: 4px; }
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(230, 232, 239, 0.9);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
}
.site-header .container { display: flex; align-items: center; gap: 16px; height: 64px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.brand:hover { color: var(--ink); }
.brand-dot {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: linear-gradient(135deg, #6366f1, #7c3aed);
  box-shadow: 0 6px 14px -6px rgba(99, 102, 241, 0.8);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav a.navlink {
  color: var(--ink-soft);
  font-size: 0.93rem;
  padding: 7px 12px;
  border-radius: 9px;
  transition: background 0.15s, color 0.15s;
}
.nav a.navlink:hover { background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.18s, background 0.18s, border-color 0.18s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, #5b52ea, #4f46e5 55%, #6d3fe0);
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(79, 70, 229, 0.9);
}
.btn-primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 26px -10px rgba(79, 70, 229, 0.95);
}

.btn-ghost {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover {
  background: #fcfcff;
  border-color: #c8cbe0;
  color: var(--ink);
  transform: translateY(-1px);
}

.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #fbd5d5; }
.btn-danger:hover { background: #fee2e2; color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 0.845rem; border-radius: 9px; }
.btn-block { width: 100%; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.card-tight { padding: 20px 22px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
}
.input, .textarea, .select {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.input:hover, .textarea:hover { border-color: #c7cbdb; }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
  background: #fff;
}
.textarea {
  min-height: 280px;
  resize: vertical;
  line-height: 1.7;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.92rem;
}
.hint { font-size: 0.8rem; color: var(--muted); margin-top: 6px; }

/* ---------- 提示条 ---------- */
.alert {
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid transparent;
  margin-bottom: 16px;
}
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: #fbd5d5; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: #bbe7d6; }
.alert-info { background: var(--brand-soft); color: var(--brand-dark); border-color: #dcdcfb; }

/* ---------- 首页 Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 84px 0 66px; }
.hero-aurora {
  position: absolute;
  inset: -180px -12% auto -12%;
  height: 600px;
  pointer-events: none;
  background:
    radial-gradient(440px 280px at 16% 34%, rgba(99, 102, 241, 0.22), transparent 70%),
    radial-gradient(500px 320px at 58% 8%, rgba(59, 130, 246, 0.18), transparent 72%),
    radial-gradient(400px 260px at 88% 52%, rgba(168, 85, 247, 0.16), transparent 72%);
  filter: blur(8px);
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.hero-copy { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.15rem);
  letter-spacing: -0.035em;
  margin: 16px 0 18px;
}
.hero .lead { font-size: 1.06rem; color: var(--ink-soft); max-width: 34em; }
.hero-actions { margin-top: 28px; }
.hero-stats {
  display: flex;
  gap: 34px;
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.hero-stats .n { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; }
.hero-stats .l { font-size: 0.79rem; color: var(--muted); letter-spacing: 0.02em; }

.grad {
  background: linear-gradient(115deg, #4f46e5 10%, #7c3aed 55%, #2563eb 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 首页右侧的装饰卡片 */
.hero-art { position: relative; height: 330px; }
.ghost-card {
  position: absolute;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-lg);
}
.ghost-card.g1 {
  width: 216px; height: 148px; left: 12px; top: 52px;
  transform: rotate(-9deg);
  background: linear-gradient(135deg, #ffffff, #f4f5ff);
  opacity: 0.9;
}
.ghost-card.g2 {
  width: 216px; height: 148px; left: 104px; top: 22px;
  transform: rotate(6deg);
  opacity: 0.95;
}
.ghost-card.g3 {
  width: 250px; height: 178px; left: 46px; top: 108px;
  transform: rotate(-2deg);
  padding: 24px 24px 0;
}
.ghost-line {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e9ebf6, #f3f4fb);
  margin-bottom: 13px;
}
.ghost-line.w70 { width: 70%; }
.ghost-line.w90 { width: 90%; }
.ghost-line.w55 { width: 55%; }
.ghost-lock {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 15px;
}

/* ---------- 特性卡片 ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.16s, box-shadow 0.2s, border-color 0.2s;
}
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #dfe1f3; }
.feature .icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #eef0ff, #f6f4ff);
  box-shadow: inset 0 0 0 1px #e2e4fb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  margin-bottom: 14px;
}
.feature h3 { margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 0.91rem; }

/* ---------- 文章列表 ---------- */
.article-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }

.article-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  color: var(--ink);
  transition: transform 0.16s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
}
.article-card:hover {
  color: var(--ink);
  transform: translateY(-3px);
  border-color: #d5d7f4;
  box-shadow: var(--shadow-lg);
}
.article-card h3 { margin-bottom: 8px; font-size: 1.06rem; letter-spacing: -0.01em; }
.article-card p { color: var(--muted); font-size: 0.9rem; margin: 0 0 16px; }
.article-card .article-meta { margin-top: auto; }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.lock-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 12px;
}

.article-meta {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ---------- 文章正文排版 ---------- */
.prose { font-size: 1.05rem; line-height: 1.9; color: #23262d; }
.prose > * { max-width: 68ch; }
.prose h1, .prose h2, .prose h3 { margin-top: 1.9em; max-width: none; }
.prose h2 {
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--line);
  margin-top: 2.1em;
}
.prose h3 { font-size: 1.06rem; margin-top: 1.7em; }
.prose code {
  background: #f1f2f7;
  padding: 0.16em 0.42em;
  border-radius: 6px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.87em;
  border: 1px solid #e8e9f0;
}
.prose pre {
  background: #14161c;
  color: #e7e9f0;
  padding: 18px 20px;
  border-radius: 14px;
  overflow-x: auto;
  line-height: 1.6;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.prose pre code { background: none; padding: 0; color: inherit; border: 0; font-size: 0.86rem; }
.prose blockquote {
  margin: 1.4em 0;
  padding: 0.7em 1.1em;
  border-left: 3px solid var(--brand);
  background: linear-gradient(90deg, #f7f8ff, #fbfbff);
  color: var(--ink-soft);
  border-radius: 0 10px 10px 0;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.5em; }
.prose li { margin: 0.4em 0; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose img { border-radius: 14px; margin: 1.4em 0; box-shadow: var(--shadow); max-width: 100%; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th, table.data td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #fafbfe;
}
table.data tbody tr:hover { background: #fbfbfe; }
table.data tr:last-child td { border-bottom: 0; }

/* ---------- 标签 ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f1f2f6;
  color: var(--ink-soft);
  line-height: 1.5;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: #fff7ed; color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-brand {
  background: linear-gradient(135deg, #f0f1ff, #f6f2ff);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px #e0e2fb;
}

/* ---------- 统计卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.stat .n { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.02em; }
.stat .l { font-size: 0.79rem; color: var(--muted); }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  padding: 58px 24px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #fafbff);
}
.empty .big { font-size: 36px; margin-bottom: 10px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tab {
  padding: 11px 17px;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* ---------- Toast ---------- */
#toast-host {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  background: rgba(20, 22, 28, 0.95);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.18s ease-out;
}
.toast.err { background: #b91c1c; }
.toast.ok { background: #047857; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 80px;
  padding: 34px 0 44px;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.7));
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 8px; }
  .hero-art { display: none; }
}

@media (max-width: 760px) {
  .hero { padding: 52px 0 40px; }
  .hero h1 { margin-top: 12px; }
  .hero-stats { gap: 24px; margin-top: 28px; }
  .features, .article-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 22px; }
  .nav a.navlink { padding: 6px 8px; font-size: 0.87rem; }
  .section { padding: 40px 0; }
  .prose { font-size: 1rem; line-height: 1.85; }
}
