/* ============================================================
 * 基础层：设计变量、重置、排版、站点头部
 * ============================================================ */
:root {
  --bg: #f6f7fb;
  --bg-soft: #eef1f7;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e6e9f0;
  --line-2: #dde2ec;

  --brand: #4f46e5;
  --brand-2: #0891b2;
  --brand-soft: rgba(79, 70, 229, .08);
  --brand-soft-2: rgba(8, 145, 178, .09);
  --warn: #e11d48;
  --ok: #16a34a;
  --amber: #d97706;

  --grad: linear-gradient(120deg, #4f46e5 0%, #0891b2 100%);
  --grad-soft: linear-gradient(120deg, rgba(79, 70, 229, .10), rgba(8, 145, 178, .10));

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;

  --sh-1: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .05);
  --sh-2: 0 4px 14px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --sh-3: 0 18px 40px -18px rgba(15, 23, 42, .22), 0 2px 8px rgba(15, 23, 42, .05);

  --font: "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans SC",
    "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --serif: Georgia, "Songti SC", "Source Han Serif SC", "Noto Serif SC", serif;

  --header-h: 60px;
  --maxw: 1400px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--brand);
  text-decoration: none;
}

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

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.3;
  font-weight: 650;
  letter-spacing: -.01em;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

button,
input,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

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

/* ---------------- 站点头部 ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--maxw);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.brand-mark {
  display: flex;
  box-shadow: 0 3px 10px rgba(79, 70, 229, .28);
  border-radius: 9px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 15.5px;
  letter-spacing: .04em;
  font-weight: 700;
}

.brand-text em {
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
}

.site-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.site-nav a {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--ink-2);
  font-weight: 500;
  transition: background .15s, color .15s;
}

.site-nav a:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 650;
}

#view {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* ---------------- 页脚 ---------------- */
.site-footer {
  margin-top: 56px;
  padding: 28px 0 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.foot-note {
  max-width: 620px;
  text-align: right;
  color: var(--muted-2);
}

/* ---------------- 通用元件 ---------------- */
.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .02em;
}

.btn {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .16s ease;
}

.btn:hover {
  border-color: #c7cede;
  background: var(--surface-2);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(79, 70, 229, .5);
}

.btn-primary:hover {
  color: #fff;
  filter: brightness(1.06);
}

.btn-primary.is-paused {
  background: linear-gradient(120deg, #16a34a, #0891b2);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #cfd6e4;
  border-radius: 10px;
  border: 3px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: #b6c0d3;
}

::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 720px) {
  #view {
    padding: 0 16px 48px;
  }

  .header-inner {
    padding: 0 16px;
    gap: 14px;
  }

  .site-nav a:nth-child(n+3) {
    display: none;
  }

  .foot-note {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
