/* 0nz.de V1 — 浅色干净底，一个主色：墨蓝。全部本地，无外部字体/图片。 */
:root {
  --primary: #1e3a5f;        /* 墨蓝主色 */
  --primary-2: #2f6fb2;      /* 主色亮一级，用于链接与高亮 */
  --primary-soft: #e9eff6;   /* 主色浅底 */
  --bg: #f7f8fa;
  --surface: #ffffff;
  --ink: #1c2530;
  --muted: #5d6d7e;
  --line: #e3e8ef;
  --soft: #eef1f5;
  --danger: #b3563f;
  --ok: #3d7a4e;
  --warn: #a97b1f;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(28, 37, 48, .06), 0 4px 14px rgba(28, 37, 48, .05);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
[data-theme="dark"] {
  --primary: #8db4dd;
  --primary-2: #6ea3d4;
  --primary-soft: #1d2c40;
  --bg: #0e131a;
  --surface: #161e29;
  --ink: #e9eef4;
  --muted: #9aa9bb;
  --line: #263242;
  --soft: #1d2a3a;
  --danger: #d98a76;
  --ok: #6fb583;
  --warn: #d3a94f;
  --shadow: 0 1px 3px rgba(0, 0, 0, .35), 0 4px 14px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
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.6;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary-2); outline-offset: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { font-size: 22px; font-weight: 800; letter-spacing: .02em; color: var(--primary); }
.logo span { font-size: 15px; font-weight: 600; color: var(--muted); }
.logo:hover { text-decoration: none; }

.search-wrap { position: relative; flex: 1; max-width: 460px; margin-left: 8px; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
#search-input {
  width: 100%; height: 38px; padding: 0 52px 0 34px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-size: 14px; font-family: inherit;
}
#search-input:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-soft); }
.search-kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
  background: var(--soft); font-family: inherit;
}
.search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); max-height: 340px; overflow: auto; z-index: 50;
}
.search-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border: 0; background: none; text-align: left;
  color: var(--ink); font-size: 14px;
}
.search-item:hover, .search-item.active { background: var(--primary-soft); }
.search-item .type {
  flex: none; font-size: 11px; color: var(--primary);
  border: 1px solid var(--primary-2); border-radius: 4px; padding: 0 5px; line-height: 18px;
}
.search-item .sub { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.search-empty { padding: 14px; color: var(--muted); font-size: 14px; }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn-ghost {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; line-height: 1.4;
}
.btn-ghost:hover { border-color: var(--primary-2); color: var(--primary-2); }
.admin-link { text-decoration: none; }
.admin-link:hover { text-decoration: none; }

/* ---------- 入口开场 ---------- */
.intro {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .35s ease;
}
.intro-seen #intro, .intro.intro-leave { opacity: 0; pointer-events: none; }
.intro-seen #intro { display: none; }
.intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-inner { position: relative; z-index: 2; text-align: center; pointer-events: none; animation: intro-in .9s ease both; }
.intro-logo { font-size: 64px; font-weight: 800; letter-spacing: .02em; color: var(--primary); line-height: 1.1; }
.intro-logo span { font-size: 30px; font-weight: 600; color: var(--muted); }
.intro-tag { margin: 10px 0 0; color: var(--muted); font-size: 15px; letter-spacing: .08em; }
.intro-skip {
  position: absolute; right: 20px; bottom: 20px; z-index: 3;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 6px 16px; font-size: 13px;
}
@keyframes intro-in { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- 通用区块 ---------- */
.section { padding: 28px 0 8px; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--primary); }
.section-note { color: var(--muted); font-size: 13px; }
.head-actions { margin-left: auto; display: flex; gap: 8px; }
.section-foot { color: var(--muted); font-size: 13px; margin: 12px 0 0; }

/* ---------- 资讯 ---------- */
#news { position: relative; }
.news-groups h3 { margin: 18px 0 10px; font-size: 15px; color: var(--ink); }
.news-groups h3:first-child { margin-top: 0; }
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.news-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  visibility: hidden; opacity: 0; transform: translateY(8px);
  transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s;
}
.news-card.revealed { visibility: visible; opacity: 1; transform: none; transition: opacity .45s ease, transform .45s ease, visibility 0s; }
.news-card > a { display: block; padding: 14px 16px; color: var(--ink); height: 100%; }
.news-card > a:hover { text-decoration: none; }
.news-card h4 { margin: 0 0 6px; font-size: 15px; line-height: 1.5; font-weight: 650; }
.news-card .why { margin: 0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.news-card .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.news-card .meta .tag { background: var(--primary-soft); color: var(--primary); border-radius: 4px; padding: 0 6px; line-height: 19px; }
.news-card .meta .region-domestic { color: var(--danger); }
.news-card .meta .region-foreign { color: var(--primary-2); }

/* 仪式：微光扫过 + 蜘蛛画布 + 关键字飞片 */
.ritual-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: auto; cursor: pointer; }
#news .section-head { position: relative; z-index: 4; }
.ritual-shimmer {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden;
}
.ritual-shimmer::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 34%;
  background: linear-gradient(100deg, transparent, rgba(47, 111, 178, .14), transparent);
  animation: shimmer-sweep .8s ease-in-out infinite;
}
@keyframes shimmer-sweep { from { left: -34%; } to { left: 100%; } }
.kw-chip {
  position: absolute; z-index: 6; left: 0; top: 0;
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 600;
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(30, 58, 95, .35); pointer-events: none;
  will-change: transform;
}

/* ---------- 工具 ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.tool-card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: opacity .3s ease, filter .3s ease, transform .15s ease;
}
.tool-card:hover { transform: translateY(-2px); }
.tool-main { display: block; padding: 16px 14px 14px; color: var(--ink); }
.tool-main:hover { text-decoration: none; }
.tool-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; margin-bottom: 10px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 18px; font-weight: 700;
}
.tool-name { display: block; font-size: 15px; font-weight: 650; margin-bottom: 4px; }
.tool-desc { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.5; min-height: 37px; }
.tool-cat { display: inline-block; margin-top: 8px; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; line-height: 19px; }
.tool-card.pinned { border-color: var(--primary-2); }
.tool-card.pinned::after {
  content: "已钉住"; position: absolute; top: 8px; right: 8px;
  font-size: 11px; color: var(--primary); background: var(--primary-soft);
  border-radius: 4px; padding: 1px 6px;
}
.pin-btn {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s ease;
}
.tool-card:hover .pin-btn, .tool-card:focus-within .pin-btn, .pin-btn[aria-pressed="true"] { opacity: 1; }
.pin-btn[aria-pressed="true"] { color: var(--primary); border-color: var(--primary-2); background: var(--primary-soft); }
.pin-btn svg { width: 14px; height: 14px; }

/* ---------- AI 导航 ---------- */
.ai-group h3 { margin: 18px 0 10px; font-size: 15px; }
.ai-group h3:first-child { margin-top: 0; }
.ai-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ai-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .15s ease;
}
.ai-card:hover { text-decoration: none; transform: translateY(-2px); }
.ai-icon {
  flex: none; width: 38px; height: 38px; border-radius: 9px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
}
.ai-name { display: block; font-size: 15px; font-weight: 650; }
.ai-desc { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.ai-cat { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; line-height: 19px; }

/* ---------- 博客 ---------- */
.blog-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.blog-card h3 { margin: 0 0 6px; font-size: 19px; line-height: 1.5; }
.blog-date { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.blog-card p { margin: 0 0 12px; }
.blog-card p:last-child { margin-bottom: 0; }

/* ---------- 消失区 ---------- */
.gy-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.gy-chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 5px 14px; font-size: 13px;
}
.gy-chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.gy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.gy-card {
  position: relative; text-align: left; width: 100%;
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 16px 16px 40px; color: var(--ink);
  opacity: .75; filter: grayscale(.5);
  transition: opacity .15s ease, filter .15s ease, transform .15s ease;
}
.gy-card:hover { opacity: 1; filter: none; transform: translateY(-2px); border-style: solid; border-color: var(--primary-2); }
.gy-name { display: block; font-size: 15px; font-weight: 650; margin-bottom: 4px; }
.gy-reason { display: block; color: var(--muted); font-size: 13px; line-height: 1.55; }
.gy-removed { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.gy-tag {
  position: absolute; right: 10px; bottom: 10px;
  font-size: 11px; font-weight: 600; color: #fff; background: var(--muted);
  border-radius: 4px; padding: 2px 7px;
}
.gy-tag.t-未使用 { background: #7a8694; }
.gy-tag.t-已失效 { background: #a4442f; }
.gy-tag.t-被替代 { background: #2f6fb2; }
.gy-tag.t-已停更 { background: #6b5a8e; }
.gy-tag.t-热度降 { background: #a97b1f; }
.gy-empty { color: var(--muted); grid-column: 1 / -1; padding: 8px 0; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 36px; padding: 18px 0 28px; color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.footer-sep { margin: 0 6px; }
.link-btn { border: 0; background: none; color: var(--primary-2); font-size: 13px; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.health { display: inline-flex; align-items: center; gap: 6px; }
.health-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); display: inline-block; }
.health-dot.ok { background: var(--ok); }
.health-dot.bad { background: var(--danger); }

/* ---------- 更新日志弹窗 ---------- */
.changelog-dialog {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  padding: 0; width: min(560px, calc(100vw - 40px)); box-shadow: var(--shadow);
}
.changelog-dialog::backdrop { background: rgba(15, 20, 28, .45); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.dialog-head h3 { margin: 0; font-size: 17px; }
#changelog-list { padding: 12px 20px 20px; }
.changelog-item { border-top: 1px solid var(--line); padding: 12px 0; }
.changelog-item:first-child { border-top: 0; }
.changelog-item .c-date { color: var(--muted); font-size: 12px; }
.changelog-item .c-change { font-weight: 650; margin: 2px 0; }
.changelog-item .c-why { color: var(--muted); font-size: 13px; }

/* ---------- 提示条 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px);
  background: var(--primary); color: #fff; font-size: 14px;
  border-radius: 999px; padding: 9px 18px; z-index: 120;
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
  max-width: calc(100vw - 40px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.data-error { color: var(--danger); font-size: 14px; padding: 8px 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .ai-grid { grid-template-columns: repeat(2, 1fr); }
  .gy-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .news-grid, .tool-grid, .ai-grid, .gy-grid { grid-template-columns: 1fr; }
  .search-kbd { display: none; }
  .intro-logo { font-size: 48px; }
  .topbar-inner { gap: 10px; }
  #theme-toggle { padding: 6px 10px; }
}

/* ---------- 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .news-card { visibility: visible; opacity: 1; transform: none; }
}
