/* site/theme/assets/style.css
 *
 * 手写，无框架、无外部字体。理由：
 *   1. 外链 CSS/字体 = 第三方请求 = 用户 IP 泄露给第三方 + CSP 必须放宽；
 *   2. 个人站样式量级只有几百行，框架的复杂度反而是负担。
 * 这份文件是"防护"环节的一部分：CSP 里 style-src 'self' 能这么写，就是因为它不引外链。
 *
 * 设计取向：构成主义（Constructivism）＋ 极简（Minimalism）。
 *   · 底色是"偏蓝的绿"——深底 #06282c、亮底 #e6efee，强调色是更亮的蓝绿 #2ec4b6；
 *   · 构成主义靠几何体说话：方块、圆、斜线、编号、粗描边，不靠插画；
 *   · 极简靠克制：统一节奏、少动效、只在关键处给一点暖色对比（构造主义的"那一点红"）。
 * 不引图标库、不动效库：图标用字符或 SVG，动效只留 hover 并对 prefers-reduced-motion 退让。
 */

/* ── 设计令牌 ───────────────────────────────────────────────────────────── */
:root {
  /* 默认走深色（与 themeColor 一致）。浅色由 [data-theme="light"] 或系统偏好覆盖。 */
  --bg: #06282c;
  --bg-soft: #0a3036;
  --bg-card: #0b343a;
  --bg-raised: #0e3d44;
  --border: #14454d;
  --border-soft: #103a41;
  --fg: #e6efee;
  --fg-muted: #9fb8b6;
  --fg-dim: #6f8a88;
  --accent: #2ec4b6;          /* 偏蓝的绿 */
  --accent-strong: #1f9e93;
  --accent-soft: rgba(46, 196, 182, 0.12);
  --contrast: #e8654a;        /* 构造主义的"那一点红"，极克制 */
  --contrast-soft: rgba(232, 101, 74, 0.14);
  --focus: #5fe0d2;

  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1080px;
  --gap: clamp(1rem, 2.4vw, 1.75rem);

  --font-sans: system-ui, -apple-system, "Segoe UI", "Noto Sans SC", "PingFang SC",
    "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 18px 40px -22px rgba(0, 0, 0, 0.7);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] {
  --bg: #e6efee;
  --bg-soft: #dce9e7;
  --bg-card: #ffffff;
  --bg-raised: #f2f8f7;
  --border: #c2d6d3;
  --border-soft: #d3e2df;
  --fg: #06282c;
  --fg-muted: #3f5b58;
  --fg-dim: #6b8481;
  --accent: #13857a;
  --accent-strong: #0f6b62;
  --accent-soft: rgba(19, 133, 122, 0.1);
  --contrast: #d2502f;
  --contrast-soft: rgba(210, 80, 47, 0.12);
  --focus: #13857a;
  --shadow: 0 1px 2px rgba(6, 40, 44, 0.06), 0 18px 38px -22px rgba(6, 40, 44, 0.28);
  --shadow-sm: 0 1px 2px rgba(6, 40, 44, 0.06);
}

/* 没手动选过主题时，跟随系统偏好 */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #e6efee;
    --bg-soft: #dce9e7;
    --bg-card: #ffffff;
    --bg-raised: #f2f8f7;
    --border: #c2d6d3;
    --border-soft: #d3e2df;
    --fg: #06282c;
    --fg-muted: #3f5b58;
    --fg-dim: #6b8481;
    --accent: #13857a;
    --accent-strong: #0f6b62;
    --accent-soft: rgba(19, 133, 122, 0.1);
    --contrast: #d2502f;
    --contrast-soft: rgba(210, 80, 47, 0.12);
    --focus: #13857a;
    --shadow: 0 1px 2px rgba(6, 40, 44, 0.06), 0 18px 38px -22px rgba(6, 40, 44, 0.28);
    --shadow-sm: 0 1px 2px rgba(6, 40, 44, 0.06);
  }
}

/* ── 基础 ───────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.003em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2rem);
}

main.wrap {
  flex: 1 0 auto;
  padding-block: clamp(1.5rem, 5vw, 3.5rem);
}

h1,
h2,
h3,
h4 {
  line-height: 1.22;
  margin: 0 0 0.6em;
  font-weight: 680;
  letter-spacing: -0.022em;
}

/* 构成主义的小标记：每个 h2 前面挂一个方块 */
.section > h2::before,
.strip-head h2::before,
.prose h2::before {
  content: "";
  display: inline-block;
  width: 0.62em;
  height: 0.62em;
  margin-right: 0.55rem;
  background: var(--accent);
  transform: translateY(0.04em);
  border-radius: 2px;
}

h1 {
  font-size: clamp(2.1rem, 5.4vw, 3.1rem);
}
h2 {
  font-size: clamp(1.3rem, 2.8vw, 1.7rem);
}
h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 1.1em;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

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

img {
  max-width: 100%;
  height: auto;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  padding: 0.14em 0.4em;
  border-radius: 5px;
}

pre {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  overflow-x: auto;
  line-height: 1.55;
  margin: 0 0 1.2em;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.85em;
}

hr {
  border: 0;
  border-top: 1px solid var(--border-soft);
  margin: 2.4rem 0;
}

blockquote {
  margin: 0 0 1.2em;
  padding: 0.2em 0 0.2em 1.1rem;
  border-left: 3px solid var(--accent);
  color: var(--fg-muted);
}

blockquote p:last-child {
  margin-bottom: 0;
}

.muted {
  color: var(--fg-muted);
}

.meta {
  color: var(--fg-dim);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 10;
}

.skip-link:focus {
  left: 0;
}

/* ── 页头 ───────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--gap);
  min-height: 66px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.04rem;
  color: var(--fg);
  letter-spacing: -0.015em;
}

.brand:hover {
  color: var(--fg);
  text-decoration: none;
}

/* 标记做成"同心方块 + 圆"——构成主义的眼睛，而不是普通圆点 */
.brand-mark {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 4px var(--border);
  flex: none;
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--gap);
}

.nav-menu {
  display: flex;
  gap: 1.5rem;
}

.nav-menu a {
  color: var(--fg-muted);
  font-size: 0.94rem;
  padding-block: 0.35rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-menu a:hover {
  color: var(--fg);
  text-decoration: none;
  border-bottom-color: var(--border);
}

.nav-menu a.is-active {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

.lang-switch {
  font-size: 0.82rem;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.26rem 0.72rem;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.lang-switch:hover {
  color: var(--fg);
  border-color: var(--accent);
  text-decoration: none;
}

/* 主题切换 + 命令面板：两个克制的方块按钮 */
.header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 34px;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tool-btn:hover {
  color: var(--fg);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* 图标用字符画，避免引图标库 */
.tool-btn .ic {
  font-size: 1.02rem;
  line-height: 1;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 34px;
  padding: 0 9px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--fg-muted);
  border-radius: 2px;
}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }
  .nav-menu {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    gap: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0.4rem clamp(1.15rem, 4vw, 2rem) 0.8rem;
    box-shadow: var(--shadow);
  }
  .nav-menu.is-open {
    display: flex;
  }
  .nav-menu a {
    padding-block: 0.62rem;
    border-bottom: 1px solid var(--border-soft);
  }
  .nav-menu a:last-child {
    border-bottom: 0;
  }
}

/* ── 公告条 ─────────────────────────────────────────────────────────────── */
.noticebar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: clamp(1.5rem, 4vw, 2.2rem);
  padding: 0.7rem 0.9rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}

.noticebar[hidden] {
  display: none;
}

.noticebar-tag {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.noticebar-text {
  flex: 1;
}

.noticebar-text strong {
  color: var(--fg);
}

.noticebar-close {
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  color: var(--fg-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.noticebar-close:hover {
  color: var(--fg);
  border-color: var(--accent);
}

/* ── 首页 hero ──────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding-block: clamp(1.8rem, 5vw, 3.6rem) clamp(1.8rem, 5vw, 3.2rem);
  border-bottom: 1px solid var(--border-soft);
  overflow: hidden;
}

/* 构成主义构图：方块 + 圆 + 斜线，纯 CSS，无图片请求 */
.hero-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-deco span {
  position: absolute;
  display: block;
}

.hero-deco .d-square {
  top: 12%;
  right: 6%;
  width: 84px;
  height: 84px;
  border: 2px solid var(--accent);
  opacity: 0.5;
  transform: rotate(12deg);
}

.hero-deco .d-circle {
  top: 54%;
  right: 16%;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--accent-soft);
}

.hero-deco .d-bar {
  top: 8%;
  right: 26%;
  width: 2px;
  height: 200px;
  background: var(--contrast);
  opacity: 0.7;
  transform: rotate(18deg);
}

.hero-deco .d-dot {
  bottom: 14%;
  right: 8%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--contrast);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero .kicker {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 640;
  color: var(--accent);
  margin-bottom: 0.85rem;
}

.hero h1 {
  margin-bottom: 0.45em;
}

.lead {
  font-size: clamp(1.02rem, 2.1vw, 1.16rem);
  color: var(--fg-muted);
  max-width: 58ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.7rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.58rem 1.2rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.94rem;
  font-weight: 580;
  border: 1px solid transparent;
  transition: background 0.15s ease, transform 0.12s ease, border-color 0.15s ease;
}

.button:hover {
  background: var(--accent-strong);
  color: #fff;
  text-decoration: none;
}

.button:active {
  transform: translateY(1px);
}

.button.ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

.button.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── 区块 ───────────────────────────────────────────────────────────────── */
.section {
  padding-block: clamp(1.8rem, 4.5vw, 3rem);
  border-bottom: 1px solid var(--border-soft);
}

.section:last-child {
  border-bottom: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 265px), 1fr));
  gap: var(--gap);
  margin-top: 1.4rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow: var(--shadow);
}

.card h3 {
  margin-bottom: 0.45rem;
}

.card p {
  color: var(--fg-muted);
  font-size: 0.94rem;
  margin-bottom: 0.9rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  list-style: none;
  padding: 0;
  margin: 0 0 0.85rem;
}

.tags li {
  font-size: 0.74rem;
  color: var(--fg-muted);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.58rem;
}

.card-link {
  font-size: 0.9rem;
  font-weight: 580;
}

/* ── 抽屉柜 ─────────────────────────────────────────────────────────────── */
/* 一个格子 = 一个栏目。柜格默认给你看"这里有什么"，而不是信息流的"最新"。 */
.cabinet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--gap);
  margin-top: 1.4rem;
}

.drawer {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 1rem;
  padding: 1.15rem 1.2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  color: var(--fg);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.drawer:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  border-left-color: var(--contrast);
  text-decoration: none;
  box-shadow: var(--shadow);
}

.drawer-no {
  flex: none;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.drawer-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.drawer-title {
  font-weight: 640;
  font-size: 1.12rem;
}

.drawer-desc {
  color: var(--fg-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* 抽屉把手：一个圆 + 一条凹槽，hover 时往里"推"一点 */
.drawer-pull {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.drawer:hover .drawer-pull {
  background: var(--contrast);
  border-color: var(--contrast);
}

/* ── 首页下部 strips ────────────────────────────────────────────────────── */
.strips {
  display: grid;
  gap: 0;
}

.strip {
  padding-block: clamp(1.4rem, 3.5vw, 2.2rem);
  border-bottom: 1px solid var(--border-soft);
}

.strip:last-child {
  border-bottom: 0;
}

.strip-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.strip-head h2 {
  margin: 0;
}

.strip-list {
  display: grid;
  gap: 0.1rem;
}

.strip-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.2rem;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--border-soft);
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  transition: padding-left 0.15s ease, color 0.15s ease;
}

.strip-row:last-child {
  border-bottom: 0;
}

a.strip-row {
  text-decoration: none;
}

.strip-row:hover {
  padding-left: 0.6rem;
  color: var(--accent);
}

.strip-date {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-dim);
  font-variant-numeric: tabular-nums;
}

.strip-title {
  font-size: 0.98rem;
}

.random-note {
  margin: 0;
  padding: 1rem 1.2rem;
  background: var(--bg-soft);
  border-left: 3px solid var(--contrast);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ── 视频网格 ───────────────────────────────────────────────────────────── */
/* 卡片不加载 B 站缩略图（那会把访客 IP 交给第三方、还要放宽 CSP 的 img-src），
   改用编号色块——既符合构成主义，也让首屏零外链请求。点开才内嵌播放器。 */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--gap);
  margin-top: 1.4rem;
}

.vcard {
  display: flex;
  align-items: stretch;
  gap: 0;
  text-align: left;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  overflow: hidden;
  cursor: pointer;
  font: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.vcard:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.vcard-face {
  flex: none;
  width: 76px;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  position: relative;
}

.vcard-face::after {
  content: "▶";
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 0.7rem;
  opacity: 0.85;
}

.vcard-no {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 700;
}

.vcard-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.85rem 1rem;
  min-width: 0;
}

.vcard-title {
  font-weight: 640;
  font-size: 1.02rem;
}

.vcard-desc {
  color: var(--fg-muted);
  font-size: 0.86rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vcard-meta {
  color: var(--fg-dim);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.vcard-body .tags {
  margin: 0.1rem 0 0;
}

/* ── 文字碎片 ───────────────────────────────────────────────────────────── */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1.2rem 0 0.4rem;
}

.filter-chip {
  font: inherit;
  font-size: 0.82rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: none;
  color: var(--fg-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.filter-chip:hover {
  color: var(--fg);
  border-color: var(--accent);
}

.filter-chip.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.notes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: var(--gap);
  margin-top: 1.4rem;
}

.note {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  transition: border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.note:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  transform: translateY(-2px);
}

.note.is-hidden {
  display: none;
}

.note-text {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  line-height: 1.65;
}

.note .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}

.tag {
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.tag::before {
  content: "#";
  opacity: 0.7;
}

/* ── 公告时间线 ─────────────────────────────────────────────────────────── */
.timeline {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  border-left: 2px solid var(--border);
}

.tl-item {
  position: relative;
  padding: 0 0 1.6rem 1.6rem;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 0.35rem;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--accent);
  border: 2px solid var(--bg);
}

.tl-item.is-alert::before {
  background: var(--contrast);
}

.tl-item.is-update::before {
  background: var(--accent);
}

.tl-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--fg-dim);
  margin-bottom: 0.3rem;
  font-variant-numeric: tabular-nums;
}

.tl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1.1rem;
}

.tl-card h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.tl-card p {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.92rem;
}

.tl-item.is-alert .tl-card {
  border-left: 3px solid var(--contrast);
}

/* ── 文章列表 ───────────────────────────────────────────────────────────── */
.posts {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.4rem;
}

.post-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.35rem;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.post-item:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
}

.post-item h2 {
  font-size: 1.16rem;
  margin-bottom: 0.3rem;
}

.post-item h2 a {
  color: var(--fg);
}

.post-item h2 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-item p:last-of-type {
  color: var(--fg-muted);
  font-size: 0.94rem;
  margin-bottom: 0.75rem;
}

/* ── 检索 ───────────────────────────────────────────────────────────────── */
.searchbox {
  margin: 1.4rem 0 1.6rem;
}

.searchbox input {
  width: 100%;
  font: inherit;
  font-size: 1.05rem;
  padding: 0.9rem 1.1rem;
  color: var(--fg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.searchbox input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-results {
  display: grid;
  gap: 0.7rem;
}

.search-result {
  display: block;
  padding: 0.95rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.search-result:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.search-result .sr-kind {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.search-result .sr-title {
  display: block;
  font-weight: 620;
  font-size: 1.05rem;
  margin: 0.2rem 0 0.25rem;
}

.search-result .sr-snippet {
  color: var(--fg-muted);
  font-size: 0.88rem;
  margin: 0;
}

.search-empty {
  color: var(--fg-muted);
  padding: 1rem 0;
}

/* ── 命令面板 + 视频弹窗（共享一套遮罩） ────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(2rem, 12vh, 8rem) 1rem 1rem;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(3px);
}

.overlay[hidden] {
  display: none;
}

.overlay:focus-within {
  outline: none;
}

/* 命令面板 */
.palette-box {
  width: 100%;
  max-width: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.palette-input {
  width: 100%;
  font: inherit;
  font-size: 1.02rem;
  padding: 0.95rem 1.1rem;
  color: var(--fg);
  background: var(--bg-soft);
  border: 0;
  border-bottom: 1px solid var(--border);
}

.palette-input:focus {
  outline: none;
}

.palette-list {
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  max-height: 56vh;
  overflow-y: auto;
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.7rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
}

.palette-item .pi-kind {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
  min-width: 4.4rem;
}

.palette-item .pi-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette-item.is-active,
.palette-item:hover {
  background: var(--accent-soft);
}

.palette-item.is-active .pi-kind,
.palette-item:hover .pi-kind {
  color: var(--accent);
}

.palette-empty {
  padding: 0.8rem 0.9rem;
  color: var(--fg-muted);
  font-size: 0.9rem;
}

/* 视频弹窗 */
.modal-box {
  width: 100%;
  max-width: 880px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-bar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  flex: 1;
  min-width: 0;
  font-weight: 620;
  font-size: 0.98rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-bar a {
  font-size: 0.86rem;
  white-space: nowrap;
}

.modal-close {
  flex: none;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: none;
  color: var(--fg-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--fg);
  border-color: var(--accent);
}

.modal-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.modal-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── 正文排版 ───────────────────────────────────────────────────────────── */
.prose {
  max-width: 70ch;
}

.prose h2 {
  margin-top: 2.3rem;
  padding-top: 0.3rem;
}

.prose h3 {
  margin-top: 1.7rem;
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
  margin: 0 0 1.2em;
}

.prose li {
  margin-bottom: 0.38em;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.4em;
}

.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 0.52rem 0.78rem;
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--bg-soft);
  font-weight: 620;
}

/* ── 404 ────────────────────────────────────────────────────────────────── */
.notfound {
  text-align: center;
  padding-block: clamp(3rem, 12vw, 7rem);
  border-bottom: 0;
}

.notfound h1 {
  font-size: clamp(4rem, 16vw, 8rem);
  color: var(--accent);
  margin-bottom: 0.1em;
  line-height: 1;
}

.notfound .lead {
  margin-inline: auto;
}

/* ── 页脚 ───────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-soft);
  padding-block: 1.5rem;
  font-size: 0.86rem;
  color: var(--fg-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.footer-inner p {
  margin: 0;
}

.social {
  display: flex;
  gap: 1.1rem;
}

.social a {
  color: var(--fg-muted);
}

.social a:hover {
  color: var(--accent);
}

/* ── 打印 ───────────────────────────────────────────────────────────────── */
@media print {
  .site-header,
  .site-footer,
  .actions,
  .nav-toggle,
  .header-tools,
  .noticebar,
  .overlay {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
}
