/* ===== 阿朱秘书站 /assets/site.css ===== */
:root {
  --color-bg: #F5F3EE;
  --color-bg-teal: #003540;
  --color-bg-warm: #E8E4D9;
  --color-card-yellow: #FFD166;
  --color-card-coral: #FF6B5E;
  --color-card-mint: #2EC4B6;
  --color-card-blue: #3A86FF;
  --color-accent-red: #E63946;
  --color-accent-purple: #8338EC;
  --color-status-new: #00C853;
  --color-status-update: #FF5722;
  --color-status-done: #2196F3;
  --color-text: #1A1A1A;
  --color-text-aux: #5A5A5A;
  --color-border: #2B2B2B;
  --color-white: #FFFFFF;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: "Roboto Mono", "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  --container-w: 1280px;
  --container-pad: 24px;
  --border-w: 3px;
  --shadow-soft: 4px 4px 0 rgba(43, 43, 43, 0.12);
  --shadow-hard: 7px 7px 0 rgba(43, 43, 43, 0.18);
  --header-h: 74px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, nav, section { display: block; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; font-size: inherit; cursor: pointer; background: none; border: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
table { border-collapse: collapse; width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; margin-bottom: 0.5em; }
p { margin-bottom: 1em; }
[hidden] { display: none !important; }

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

/* ===== Skip Link ===== */
.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 9999;
  background: var(--color-accent-red);
  color: var(--color-white);
  font-weight: 700;
  padding: 10px 18px;
  border: 3px solid var(--color-border);
  box-shadow: 4px 4px 0 var(--color-border);
  transform: translateY(-200%);
  transition: transform 0.2s;
}
.skip-link:focus { transform: translateY(0); }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-bg-teal);
  color: var(--color-white);
  border-bottom: 4px solid var(--color-border);
}
.header-accent { display: flex; height: 4px; }
.header-accent span { flex: 1; }
.accent-new { background: var(--color-status-new); }
.accent-update { background: var(--color-status-update); }
.accent-done { background: var(--color-status-done); }
.accent-tag { background: var(--color-accent-purple); }

.header-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 var(--container-pad);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.header-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-link { display: flex; align-items: center; gap: 10px; color: var(--color-white); font-weight: 800; font-size: 22px; letter-spacing: 0.02em; }
.brand-mark {
  width: 14px; height: 14px;
  background: var(--color-card-yellow);
  transform: rotate(45deg);
  box-shadow: 4px 4px 0 var(--color-accent-red);
  flex-shrink: 0;
  display: inline-block;
}
.brand-name { line-height: 1.2; white-space: nowrap; }
.brand-version {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  background: var(--color-accent-purple); color: var(--color-white);
  padding: 3px 7px; border: 2px solid var(--color-border);
  transform: rotate(-3deg); line-height: 1.2; white-space: nowrap;
}
.brand-zone {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  color: var(--color-card-mint); border: 2px solid var(--color-card-mint);
  padding: 2px 7px; line-height: 1.2; white-space: nowrap;
}

.site-nav { flex: 1; display: flex; justify-content: flex-end; }
.nav-list { display: flex; align-items: center; gap: 2px; }
.nav-list a {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--color-white);
  font-size: 15px; font-weight: 600;
  padding: 10px 12px;
  transition: background 0.2s, color 0.2s;
}
.nav-list a[data-index]::before {
  content: attr(data-index);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  color: var(--color-card-mint);
  transition: color 0.2s;
}
.nav-list a:hover { background: var(--color-card-mint); color: var(--color-text); }
.nav-list a:hover::before { color: var(--color-accent-red); }
.nav-list a[aria-current="page"] {
  background: var(--color-card-yellow);
  color: var(--color-text);
  box-shadow: 3px 3px 0 var(--color-border);
}
.nav-list a[aria-current="page"]::before { color: var(--color-accent-red); }

.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.search-toggle {
  width: 42px; height: 42px;
  border: 3px solid var(--color-white);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--color-white);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.search-toggle:hover { background: var(--color-card-coral); color: var(--color-text); transform: rotate(8deg); }
.search-toggle[aria-expanded="true"] { background: var(--color-card-yellow); color: var(--color-text); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 3px solid var(--color-white);
  border-radius: 4px;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
}
.nav-toggle-bar { display: block; width: 20px; height: 3px; background: var(--color-white); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ===== Search Panel ===== */
.search-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  display: none;
  background: var(--color-bg-warm);
  border-top: 3px solid var(--color-border);
  border-bottom: 4px solid var(--color-border);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.2);
}
.search-panel[data-open] { display: block; }
.search-box {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 14px var(--container-pad);
  display: flex; align-items: center; gap: 12px;
}
.search-box-icon { color: var(--color-text-aux); flex-shrink: 0; }
.search-input {
  flex: 1;
  background: transparent;
  border: none;
  border-bottom: 3px solid var(--color-border);
  padding: 8px 4px;
  font-size: 16px;
  color: var(--color-text);
  outline: none;
}
.search-input::placeholder { color: var(--color-text-aux); font-family: var(--font-mono); font-size: 13px; }
.search-close {
  font-size: 18px; font-weight: 700;
  padding: 6px 12px;
  border: 3px solid var(--color-border);
  background: var(--color-card-coral);
  color: var(--color-text);
  box-shadow: 3px 3px 0 var(--color-border);
  line-height: 1;
}

/* ===== Mobile Nav ===== */
@media (max-width: 1024px) {
  .site-nav {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--color-bg-teal);
    border-bottom: 4px solid var(--color-border);
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .site-nav[data-open] { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; padding: 10px var(--container-pad) 20px; gap: 0; }
  .nav-list a {
    display: flex; padding: 14px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 16px;
  }
  .nav-list a[data-index]::before { min-width: 28px; }
  .nav-list a:hover { background: rgba(255, 255, 255, 0.08); color: var(--color-card-mint); }
  .nav-list a[aria-current="page"] { background: var(--color-card-yellow); color: var(--color-text); box-shadow: none; }
  .nav-toggle { display: inline-flex; }
}

/* ===== Footer ===== */
.site-footer {
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    var(--color-bg-teal);
  background-size: 24px 24px;
  color: var(--color-white);
  border-top: 4px solid var(--color-border);
  margin-top: 60px;
}
.footer-accent { display: flex; height: 4px; }
.footer-accent span { flex: 1; }
.footer-accent span:nth-child(1) { background: var(--color-card-yellow); }
.footer-accent span:nth-child(2) { background: var(--color-card-coral); }
.footer-accent span:nth-child(3) { background: var(--color-card-mint); }
.footer-accent span:nth-child(4) { background: var(--color-card-blue); }

.footer-inner { max-width: var(--container-w); margin: 0 auto; padding: 48px var(--container-pad) 20px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.4fr 1fr; gap: 40px; }
.footer-col-brand .brand-mark { background: var(--color-card-yellow); box-shadow: 4px 4px 0 var(--color-accent-red); }
.footer-brand-link { display: inline-flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; color: var(--color-white); margin-bottom: 14px; }
.footer-brand-name { line-height: 1.2; }
.footer-tagline { font-size: 14px; color: rgba(255, 255, 255, 0.75); margin-bottom: 14px; max-width: 28ch; }
.footer-icp { font-family: var(--font-mono); font-size: 12px; color: var(--color-card-mint); }

.footer-title {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--color-card-mint);
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  padding-bottom: 8px; margin-bottom: 16px;
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 14px; color: rgba(255, 255, 255, 0.9); transition: color 0.2s, padding-left 0.2s; }
.footer-links a:hover { color: var(--color-card-yellow); padding-left: 6px; }
.footer-links-contact li { font-size: 14px; color: rgba(255, 255, 255, 0.9); line-height: 1.5; }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-top: 40px; padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--font-mono); font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}
.footer-mode { color: var(--color-card-coral); font-weight: 700; letter-spacing: 0.18em; }

/* ===== Back to Top ===== */
.back-top {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 900;
  width: 48px; height: 48px;
  background: var(--color-card-yellow);
  color: var(--color-text);
  font-size: 22px; font-weight: 900;
  border: 3px solid var(--color-border);
  box-shadow: 4px 4px 0 var(--color-border);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
}
.back-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { background: var(--color-card-coral); }

/* ===== Layout & Sections ===== */
.page-container { max-width: var(--container-w); margin: 0 auto; padding: 0 var(--container-pad); }
.site-main { min-height: 60vh; }
.section { padding: 60px 0; }
.section-teal { background: var(--color-bg-teal); color: var(--color-white); }
.section-warm { background: var(--color-bg-warm); }
.section-plain { background: var(--color-bg); }

/* ===== Typography ===== */
.page-title {
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 900; line-height: 1.1; letter-spacing: -0.01em;
  text-transform: uppercase; margin-bottom: 12px;
}
.page-lead { font-size: 16px; color: var(--color-text-aux); max-width: 62ch; line-height: 1.7; }
.section-title { font-size: 32px; font-weight: 800; line-height: 1.2; margin-bottom: 8px; }
.section-kicker {
  font-family: var(--font-mono); font-size: 13px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--color-accent-purple); font-weight: 700;
  margin-bottom: 8px;
}
.section-teal .section-kicker { color: var(--color-card-mint); }
.section-teal .section-title { color: var(--color-white); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  font-size: 15px; font-weight: 700;
  border: 3px solid var(--color-border);
  background: var(--color-card-yellow);
  color: var(--color-text);
  box-shadow: 4px 4px 0 var(--color-border);
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--color-border); }
.btn-coral { background: var(--color-card-coral); }
.btn-mint { background: var(--color-card-mint); }
.btn-blue { background: var(--color-card-blue); color: var(--color-text); }
.btn-purple { background: var(--color-accent-purple); color: var(--color-white); }
.btn-ghost { background: transparent; box-shadow: none; border: 3px solid currentColor; }

/* ===== Breadcrumbs ===== */
.breadcrumbs {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-family: var(--font-mono); font-size: 13px;
  padding: 20px 0; font-weight: 500;
}
.breadcrumbs a { color: var(--color-accent-purple); border-bottom: 1px dashed transparent; transition: border-color 0.2s; }
.breadcrumbs a:hover { border-bottom-color: var(--color-accent-purple); }
.breadcrumbs a::after { content: '/'; color: var(--color-text-aux); margin-left: 8px; }
.breadcrumbs .is-current { color: var(--color-text-aux); }

/* ===== Card Grid ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; }
.card {
  border: 3px solid var(--color-border);
  background: var(--color-bg);
  box-shadow: var(--shadow-soft);
  padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-hard); }
.card-yellow { background: var(--color-card-yellow); color: var(--color-text); }
.card-coral { background: var(--color-card-coral); color: var(--color-text); }
.card-mint { background: var(--color-card-mint); color: var(--color-text); }
.card-blue { background: var(--color-card-blue); color: var(--color-text); }

/* ===== Tile Matrix ===== */
.tile-matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.tile {
  position: relative;
  border: 3px solid var(--color-border);
  padding: 20px 16px;
  box-shadow: 4px 4px 0 var(--color-border);
  display: flex; flex-direction: column; gap: 8px;
  min-height: 118px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.tile:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--color-border); }
.tile-yellow { background: var(--color-card-yellow); color: var(--color-text); }
.tile-coral { background: var(--color-card-coral); color: var(--color-text); }
.tile-mint { background: var(--color-card-mint); color: var(--color-text); }
.tile-blue { background: var(--color-card-blue); color: var(--color-text); }
.tile-purple { background: var(--color-accent-purple); color: var(--color-white); }

/* ===== Entry List ===== */
.entry-list { display: flex; flex-direction: column; border-top: 3px solid var(--color-border); }
.entry-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 16px;
  padding: 14px 8px;
  border-bottom: 2px solid var(--color-border);
  background: var(--color-bg);
  transition: background 0.15s, padding-left 0.15s;
}
.entry-row:hover { background: var(--color-bg-warm); padding-left: 14px; }

/* ===== Tags ===== */
.tag-group { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-label {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  padding: 6px 12px;
  border: 2px solid var(--color-border);
  background: var(--color-bg);
  transition: transform 0.15s, background 0.2s, color 0.2s;
}
.tag-label:hover { transform: rotate(-2deg) translateY(-2px); background: var(--color-accent-purple); color: var(--color-white); }
.tag-yellow { background: var(--color-card-yellow); color: var(--color-text); }
.tag-coral { background: var(--color-card-coral); color: var(--color-text); }
.tag-mint { background: var(--color-card-mint); color: var(--color-text); }
.tag-blue { background: var(--color-card-blue); color: var(--color-text); }
.tag-hot { background: var(--color-accent-red); color: var(--color-white); }

/* ===== Status Badges ===== */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  padding: 4px 10px;
  border: 2px solid var(--color-border);
  line-height: 1.3; white-space: nowrap;
}
.status-badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.status-badge.is-new { background: var(--color-status-new); color: var(--color-text); }
.status-badge.is-update { background: var(--color-status-update); color: var(--color-text); }
.status-badge.is-done { background: var(--color-status-done); color: var(--color-text); }
.status-badge.is-purple { background: var(--color-accent-purple); color: var(--color-white); }

/* ===== Index Numbers & Metric Bars ===== */
.index-number { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--color-accent-purple); display: inline-block; }
.metric-bar { height: 12px; background: var(--color-bg-warm); border: 2px solid var(--color-border); overflow: hidden; }
.metric-bar-fill { height: 100%; background: var(--color-card-blue); display: block; width: 50%; }
.metric-bar-fill.is-coral { background: var(--color-card-coral); }
.metric-bar-fill.is-mint { background: var(--color-card-mint); }
.metric-bar-fill.is-yellow { background: var(--color-card-yellow); }
.metric-bar-fill.is-purple { background: var(--color-accent-purple); }

/* ===== Index Bar ===== */
.index-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.index-key {
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  padding: 6px 10px; min-width: 38px; text-align: center;
  border: 2px solid var(--color-border);
  background: var(--color-card-blue);
  color: var(--color-text);
  transition: transform 0.15s, background 0.2s;
}
.index-key:hover { transform: scale(1.12); background: var(--color-accent-red); color: var(--color-white); }
.index-key.is-current { background: var(--color-card-yellow); color: var(--color-text); box-shadow: 3px 3px 0 var(--color-border); }

/* ===== Horizon Scroll ===== */
.horizon-scroll {
  display: flex; gap: 18px;
  overflow-x: auto;
  padding: 4px 4px 16px;
  scroll-snap-type: x mandatory;
  scrollbar-color: var(--color-accent-purple) var(--color-bg-warm);
}
.horizon-scroll > * { flex: 0 0 270px; scroll-snap-align: start; }

/* ===== Compare Table ===== */
.compare-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--color-bg); }
.compare-table th, .compare-table td { border: 2px solid var(--color-border); padding: 12px 14px; text-align: left; vertical-align: top; }
.compare-table thead th {
  background: var(--color-bg-teal); color: var(--color-white);
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
}
.compare-table tbody tr:nth-child(even) { background: var(--color-bg-warm); }
.compare-table tbody tr:hover { background: var(--color-card-yellow); }

/* ===== Tabs ===== */
.tab-list { display: flex; flex-wrap: wrap; gap: 8px; border-bottom: 3px solid var(--color-border); margin-bottom: 20px; }
.tab-btn {
  font-family: var(--font-mono); font-size: 14px; font-weight: 700;
  padding: 10px 18px;
  border: 3px solid var(--color-border);
  border-bottom: none;
  background: var(--color-bg-warm);
  margin-bottom: -3px;
  color: var(--color-text);
  transition: background 0.2s;
}
.tab-btn:hover { background: var(--color-bg); }
.tab-btn[data-active] { background: var(--color-card-yellow); box-shadow: 3px 3px 0 var(--color-border); position: relative; top: -3px; }

/* ===== Image Frames ===== */
.img-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 3px solid var(--color-border);
  background:
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(0, 0, 0, 0.08) 10px 12px),
    var(--color-card-mint);
  box-shadow: var(--shadow-soft);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.img-frame::after {
  content: 'FIG';
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  background: var(--color-border); color: var(--color-white);
  padding: 4px 10px;
  position: absolute; top: 10px; right: 10px;
}
.img-frame-square { aspect-ratio: 1; }
.img-frame-wide { aspect-ratio: 16 / 9; }

/* ===== Helpers ===== */
.mono-label { font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent-purple); }
.note { font-size: 13px; color: var(--color-text-aux); font-family: var(--font-mono); }

/* ===== Responsive ===== */
@media (max-width: 1024px) and (min-width: 769px) {
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 24px; }
}

@media (max-width: 768px) {
  :root { --container-pad: 16px; --header-h: 64px; }
  .section { padding: 40px 0; }
  .card-grid { grid-template-columns: 1fr; }
  .tile-matrix { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .back-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}

@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
  .brand-zone { display: none; }
  .brand-version { display: none; }
  .brand-link { font-size: 20px; }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
