/* =========================================================
   站点样式 · 零依赖
   想改配色，改下面的 :root 变量就够了
   ========================================================= */

:root {
  --bg: #fbfbfd;
  --bg-soft: #f3f4f7;
  --card: #ffffff;
  --ink: #14161b;
  --ink-soft: #5a606c;
  --ink-faint: #8b919c;
  --line: #e5e7ec;
  --accent: #2f6fed;
  --accent-ink: #1f52c4;
  --accent-soft: #eef3ff;
  --ok: #12805c;
  --warn: #b4451f;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 20, 28, .04), 0 8px 24px -12px rgba(16, 20, 28, .12);
  --max: 980px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
          "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
}

html[data-theme="dark"] {
  --bg: #0d1016;
  --bg-soft: #12161d;
  --card: #141922;
  --ink: #e8eaf0;
  --ink-soft: #a2a9b6;
  --ink-faint: #767e8c;
  --line: #232a36;
  --accent: #6f9bff;
  --accent-ink: #9dbaff;
  --accent-soft: #16203a;
  --ok: #4fd1a5;
  --warn: #ff9873;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .6);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.68;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.015em; margin: 0; }

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

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

/* ---------- 顶部导航 ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(20px, calc((100vw - var(--max)) / 2));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  letter-spacing: -.01em;
}

.brand-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.nav-links {
  display: flex;
  gap: 4px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.nav-links a {
  padding: 6px 11px;
  border-radius: 8px;
  transition: background .16s ease, color .16s ease;
}
.nav-links a:hover { background: var(--bg-soft); color: var(--ink); }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, transform .16s ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-faint); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* ---------- 布局 ---------- */

main > section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 首屏 ---------- */

.hero { padding-top: clamp(56px, 9vw, 104px); padding-bottom: clamp(40px, 6vw, 64px); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 5px 12px 5px 10px;
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.pulse {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .5);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, .45); }
  70%  { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hero h1 {
  font-size: clamp(32px, 6vw, 54px);
  font-weight: 700;
  letter-spacing: -.03em;
  margin-bottom: 18px;
}

.grad {
  background: linear-gradient(100deg, var(--accent), #14b8a6 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 46ch;
  margin: 0 0 30px;
  font-size: clamp(16px, 2.1vw, 18px);
  color: var(--ink-soft);
}
.lede strong { color: var(--ink); font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 44px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font: inherit;
  font-size: 15px;
  font-weight: 550;
  border-radius: 11px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .14s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover { background: var(--accent-ink); }
html[data-theme="dark"] .btn-primary { color: #0b1017; font-weight: 650; }

.btn-ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink-faint); }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.facts li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 18px;
  background: var(--card);
}
.facts span { font-size: 12.5px; color: var(--ink-faint); }
.facts strong { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }

/* ---------- 通用区块 ---------- */

.section { padding-block: clamp(44px, 7vw, 76px); border-top: 1px solid var(--line); }

.section-head { margin-bottom: 28px; }
.section-head h2 {
  font-size: clamp(21px, 3vw, 26px);
  font-weight: 680;
  margin-bottom: 6px;
}
.section-head p { margin: 0; color: var(--ink-soft); font-size: 15px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.about-grid h3 { font-size: 15.5px; font-weight: 640; margin-bottom: 8px; }
.about-grid p { margin: 0; color: var(--ink-soft); font-size: 14.8px; }

.inline-link {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.inline-link:hover { border-bottom-color: var(--accent); }

/* ---------- 工具栏 ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 260px;
  padding: 9px 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search svg {
  flex: none;
  width: 17px; height: 17px;
  fill: none; stroke: var(--ink-faint);
  stroke-width: 1.8; stroke-linecap: round;
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}
.search input::placeholder { color: var(--ink-faint); }
.search input:focus { outline: none; }

.tags { display: flex; flex-wrap: wrap; gap: 7px; }

.tag-btn {
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
}
.tag-btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.tag-btn[aria-pressed="true"] {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  font-weight: 550;
}

/* ---------- 工具卡片 ---------- */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.tool {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.tool:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.tool-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tool h3 { font-size: 15.5px; font-weight: 620; }
.tool p { margin: 0; font-size: 14.2px; color: var(--ink-soft); }

.tool-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12.5px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.tool-meta .dot::before { content: "·"; margin-right: 10px; }

.tool-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 4px; }

.tool-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  padding: 2px 8px;
  font-size: 11.5px;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border-radius: 999px;
}

.dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: 9px;
  white-space: nowrap;
  transition: background .16s ease, border-color .16s ease;
}
.dl:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.dl svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.empty { margin: 22px 0 0; color: var(--ink-faint); font-size: 14.5px; }

/* hidden 属性要盖过 .tool 的 display:flex */
.tool[hidden] { display: none; }

/* 页脚的开发者入口：低调一点 */
.dev-entry { opacity: .55; }
.dev-entry:hover { opacity: 1; }

.hint {
  margin: 26px 0 0;
  font-size: 13px;
  color: var(--ink-faint);
}
.hint code, .fineprint code {
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--bg-soft);
  border-radius: 5px;
}

/* ---------- 表单 ---------- */

.form { display: grid; gap: 16px; max-width: 640px; }

.field { display: grid; gap: 6px; }
.field label { font-size: 13.5px; font-weight: 550; color: var(--ink-soft); }
.field .opt { font-weight: 400; color: var(--ink-faint); }

.field input, .field textarea {
  width: 100%;
  padding: 10px 13px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.field textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--warn); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.form-status { margin: 0; font-size: 14px; color: var(--ink-soft); }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--warn); }

.fineprint { margin: 0; font-size: 12.5px; color: var(--ink-faint); }

/* ---------- 留言板 ---------- */

.counter {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--ink-faint);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.counter.over { color: #d93a3a; font-weight: 600; }

.msg-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 40px 0 16px;
}
.msg-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 640;
  letter-spacing: -.01em;
}
.msg-refresh {
  padding: 6px 14px;
  font-size: 13px;
}

.msg-list { display: grid; gap: 10px; }

.msg-item {
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.msg-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.msg-name {
  font-size: 13.5px;
  font-weight: 620;
  color: var(--accent-ink);
}
.msg-time {
  font-size: 12px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.msg-text {
  margin: 0;
  font-size: 14.8px;
  line-height: 1.65;
  color: var(--ink);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.msg-empty {
  margin: 0;
  padding: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--ink-faint);
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}

/* ---------- 页脚 ---------- */

.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 30px 24px 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: baseline;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--ink-faint);
}
.footer p { margin: 0; }
.footer a { transition: color .15s ease; }
.footer a:hover { color: var(--ink); }
.footer-links { display: flex; gap: 10px; }

/* 备案号启用后单独占一行 */
.icp { flex-basis: 100%; font-size: 12.5px; }

/* ---------- 响应式 ---------- */

@media (max-width: 620px) {
  .nav-links { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .hero { padding-top: 44px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts li:last-child { grid-column: span 2; }
}

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

@media print {
  .nav, .theme-toggle, .form, .hero-actions, .toolbar { display: none !important; }
  body { background: #fff; }
}
