/* ==========================================================================
   weiyu wiki · 设计系统
   视觉语言参考 apple.com：大字号紧排标题、大量留白、
   通栏分节（黑 / 白 / 浅灰交替）、无边框卡片、胶囊按钮、极细分割线。

   色彩说明：主色沿用位育校徽的青蓝色系（取样自官网页首标识），
   交互色为 Apple 蓝（#0071e3 / 深色模式 #2997ff）。
   ========================================================================== */

:root {
  /* 位育识别色（取样近似值）：校徽与官网标识的青蓝 */
  --brand-900: #08283a;
  --brand-800: #0d3d55;
  --brand-700: #135d7d;
  --brand-600: #1a789e;
  --brand-500: #2f9cc3;
  --brand-300: #9ad3e8;
  --brand-100: #e0f1f9;
  --brand-50:  #f0f9fc;

  /* 中性色（Apple 取值） */
  --bg:        #ffffff;
  --bg-alt:    #f5f5f7;
  --bg-dark:   #000000;
  --surface:   #ffffff;
  --text:      #1d1d1f;
  --text-2:    #6e6e73;
  --text-3:    #86868b;
  --border:    #d2d2d7;
  --hairline:  rgba(0, 0, 0, .08);

  /* 交互色 */
  --blue:      #0071e3;
  --blue-hover:#0077ed;
  --link:      #0066cc;
  --gold:      #b0801c;
  --gold-bg:   #fdf6e3;
  --teal:      #0f766e;
  --teal-bg:   #e6f6f3;
  --rose:      #c0392b;
  --rose-bg:   #fdeceb;

  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --pill: 980px;

  --shadow-card: 0 4px 20px rgba(0, 0, 0, .06);
  --shadow-hover: 0 14px 40px rgba(0, 0, 0, .13);
  --shadow-float: 0 20px 60px rgba(0, 0, 0, .28);

  /* 控件底色：深色模式只改变量。用 html[data-theme=dark] .btn 这种覆盖写法会压过
     .btn-primary 之类的变体（优先级更高），主按钮会变成灰的——所以这里用变量。 */
  --btn-bg: #e8e8ed;
  --btn-bg-hover: #dcdce1;
  --btn-fg: var(--text);
  --chip-bg: #f0f0f2;
  --chip-bg-soft: rgba(0, 0, 0, .05);

  --maxw: 1024px;
  --nav-h: 48px;

  --font: "SF Pro Text", "SF Pro SC", -apple-system, BlinkMacSystemFont, "PingFang SC",
          "Helvetica Neue", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-serif: "New York", Georgia, "Songti SC", "Noto Serif CJK SC", serif;
}

html[data-theme="dark"] {
  --bg:        #000000;
  --bg-alt:    #1d1d1f;
  --surface:   #1d1d1f;
  --text:      #f5f5f7;
  --text-2:    #a1a1a6;
  --text-3:    #86868b;
  --border:    #38383a;
  --hairline:  rgba(255, 255, 255, .14);
  --blue:      #0071e3;
  --blue-hover:#0077ed;
  --link:      #2997ff;
  --gold:      #e3b341;
  --gold-bg:   #2b2413;
  --teal:      #4fd1c5;
  --teal-bg:   #122b28;
  --rose:      #ff6b60;
  --rose-bg:   #33191b;
  --brand-700: #2f9cc3;
  --brand-500: #4fb3d6;
  --brand-100: #12303f;
  --brand-50:  #101f28;
  --shadow-card: 0 4px 20px rgba(0, 0, 0, .5);
  --shadow-hover: 0 14px 40px rgba(0, 0, 0, .6);
  --btn-bg: #2c2c2e;
  --btn-bg-hover: #3a3a3c;
  --btn-fg: #f5f5f7;
  --chip-bg: #2c2c2e;
  --chip-bg-soft: rgba(255, 255, 255, .1);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 页面内容不足一屏时，页脚贴在视口底部，避免页脚下面露出一条纯背景色 */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
.site-footer { flex: none; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .35em; font-weight: 600; line-height: 1.1; letter-spacing: -.022em; }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.19rem; letter-spacing: -.017em; }
p { margin: 0 0 1em; }
img { max-width: 100%; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
code { background: var(--bg-alt); padding: 2px 6px; border-radius: 6px; }

::selection { background: var(--brand-300); color: #08283a; }

/* ---------- 布局 ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

main { padding: 0 0 80px; }
main > .stack > *:first-child, main > .card:first-child { margin-top: 32px; }

/* 通栏分节：内容仍与 .container 对齐，背景铺满视口 */
.band {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding-left: calc(50vw - 50%);
  padding-right: calc(50vw - 50%);
  padding-top: 72px;
  padding-bottom: 72px;
}
.band-alt { background: var(--bg-alt); }
.band-dark { background: var(--bg-dark); color: #f5f5f7; }
.band-dark h1, .band-dark h2, .band-dark h3 { color: #f5f5f7; }
.band-tight { padding-top: 44px; padding-bottom: 44px; }
.bands > * + * { margin-top: 0; }
.bands > .band:first-child { margin-top: 0; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
html[data-theme="dark"] .site-header { background: rgba(0, 0, 0, .72); }
.site-header .container { display: flex; align-items: center; gap: 10px; height: var(--nav-h); max-width: 1120px; }

.brand { display: flex; align-items: center; gap: 8px; color: var(--text); flex: none; }
.brand:hover { text-decoration: none; }
/* 官方校徽（由 tools/ai2svg.py 从 .ai 转出的矢量文件） */
.brand-mark { width: 32px; height: 32px; flex: none; display: grid; place-items: center; }
.brand-mark img { width: 100%; height: 100%; display: block; }
.brand-mark.lg { width: 104px; height: 104px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -.02em; }
.brand-sub { display: none; }

.nav { display: flex; gap: 2px; margin: 0 auto; }
.nav a {
  padding: 6px 11px; border-radius: var(--pill); color: var(--text-2);
  font-size: 12.5px; font-weight: 400; white-space: nowrap; transition: color .2s ease;
}
.nav a:hover { color: var(--text); background: none; text-decoration: none; }
.nav a.active { color: var(--text); font-weight: 600; }

.nav-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.icon-btn {
  border: 0; background: transparent; color: var(--text-2);
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 15px;
  display: grid; place-items: center; flex: none; transition: background .2s ease, color .2s ease;
}
.icon-btn:hover { background: var(--bg-alt); color: var(--text); }
.nav-toggle { display: none; }

/* ---------- 页脚 ---------- */
.site-footer {
  background: var(--bg-alt); color: var(--text-3);
  font-size: 12px; line-height: 1.6; padding: 28px 0 40px;
  border-top: 1px solid var(--hairline);
}
.site-footer .container { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--text); }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--bg-alt); border: 0; border-radius: var(--r-lg);
  padding: 24px; box-shadow: none;
}
.band-alt .card { background: var(--surface); box-shadow: var(--shadow-card); }
.card + .card { margin-top: 14px; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px; border-radius: var(--pill); border: 0;
  background: var(--btn-bg); color: var(--btn-fg);
  font: inherit; font-size: 15px; font-weight: 400; letter-spacing: -.01em;
  cursor: pointer; transition: background .2s ease, transform .1s ease, opacity .2s ease;
}
.btn:hover { background: var(--btn-bg-hover); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary, html[data-theme="dark"] .btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover, html[data-theme="dark"] .btn-primary:hover { background: var(--blue-hover); }
.btn-ghost, html[data-theme="dark"] .btn-ghost { background: transparent; color: var(--link); padding-left: 8px; padding-right: 8px; }
.btn-ghost:hover, html[data-theme="dark"] .btn-ghost:hover { background: transparent; text-decoration: underline; }
.btn-danger, html[data-theme="dark"] .btn-danger { background: var(--rose-bg); color: var(--rose); }
.btn-danger:hover, html[data-theme="dark"] .btn-danger:hover { background: var(--rose); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13.5px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.input, .textarea, .select {
  width: 100%; padding: 12px 16px; font: inherit; font-size: 16px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-md); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0, 113, 227, .18);
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.field { margin-bottom: 16px; }
.hint { font-size: 13px; color: var(--text-3); margin-top: 6px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 11px; border-radius: var(--pill); background: var(--chip-bg);
  color: var(--text-2); font-size: 12px; font-weight: 400; border: 0; line-height: 1.5;
}
.band-alt .chip, .tile .chip, .quick-link .chip, .composer .chip, .card .chip { background: var(--chip-bg-soft); }
.chip-gold, .card .chip-gold, .band-alt .chip-gold, .tile .chip-gold { background: var(--gold-bg); color: var(--gold); }
.chip-teal, .card .chip-teal, .band-alt .chip-teal, .tile .chip-teal { background: var(--teal-bg); color: var(--teal); }
.chip-rose, .card .chip-rose, .band-alt .chip-rose, .tile .chip-rose { background: var(--rose-bg); color: var(--rose); }
.chip-plain, .card .chip-plain, .band-alt .chip-plain, .tile .chip-plain { background: transparent; color: var(--text-3); padding-left: 0; padding-right: 0; }
/* 灰底卡片里的 chip 需要区分度；白卡（.band-alt/.tile）里保持浅灰 */

button.chip { cursor: pointer; transition: background .2s ease, color .2s ease; }
button.chip:hover { background: var(--btn-bg-hover); }
button.chip.chip-plain:hover { background: transparent; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }

.section-head {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  margin: 0 0 26px; padding: 0; border: 0;
}
.section-head h2 { margin: 0; }
.section-head .lead { color: var(--text-2); font-size: 15px; }
.section-head .spacer { margin-left: auto; }
.band .section-head { margin-top: 0; }

.muted { color: var(--text-2); }
.small { font-size: 14.5px; }
.tiny  { font-size: 12.5px; }
.center { text-align: center; }
.stack > * + * { margin-top: 18px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.divider { height: 1px; background: var(--hairline); margin: 22px 0; border: 0; }

.empty {
  padding: 52px 24px; text-align: center; color: var(--text-2);
  border: 0; border-radius: var(--r-lg); background: rgba(0, 0, 0, .03);
}
html[data-theme="dark"] .empty { background: rgba(255, 255, 255, .05); }
.empty .big { font-size: 2rem; display: block; margin-bottom: 10px; }

.alert {
  padding: 16px 20px; border-radius: var(--r-md); font-size: 14.5px;
  background: var(--bg-alt); color: var(--text-2); border: 0; line-height: 1.6;
}
.band-alt .alert, .card .alert { background: var(--chip-bg-soft); }

.alert-info, .card .alert-info, .band-alt .alert-info { background: var(--brand-50); color: var(--brand-800); }
html[data-theme="dark"] .alert-info { color: var(--brand-300); }
.alert-warn, .card .alert-warn, .band-alt .alert-warn { background: var(--gold-bg); color: var(--gold); }
.alert-error, .card .alert-error, .band-alt .alert-error { background: var(--rose-bg); color: var(--rose); }
.alert-ok, .card .alert-ok, .band-alt .alert-ok { background: var(--teal-bg); color: var(--teal); }
.alert a { color: inherit; text-decoration: underline; }

/* ---------- 首页 Hero（通栏深色） ---------- */
.hero {
  background: var(--bg-dark); color: #f5f5f7;
  text-align: center; padding-top: 76px; padding-bottom: 76px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto -20%; height: 130%;
  background:
    radial-gradient(60% 60% at 50% 0%, rgba(47, 156, 195, .30), transparent 70%),
    radial-gradient(40% 50% at 82% 20%, rgba(201, 162, 39, .14), transparent 70%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow { font-size: 15px; color: #a1a1a6; margin-bottom: 14px; }
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  letter-spacing: -.032em; font-weight: 600; margin: 0 0 14px; color: #f5f5f7;
}
.hero .tagline {
  font-size: clamp(1.05rem, 2.1vw, 1.4rem); color: #a1a1a6;
  max-width: 34em; margin: 0 auto 6px; line-height: 1.4; letter-spacing: -.01em;
}
.hero .hero-meta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 4px; }
.hero .hero-meta .chip { background: rgba(255, 255, 255, .12); color: #f5f5f7; }

.search-bar {
  display: flex; gap: 8px; align-items: center;
  max-width: 620px; margin: 30px auto 0;
  background: #fff; border-radius: var(--pill); padding: 6px 6px 6px 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .38);
}
.search-bar input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: #1d1d1f;
  font: inherit; font-size: 17px; padding: 11px 0; outline: none;
}
.search-bar input::placeholder { color: #86868b; }
.search-bar .btn { flex: none; }

.hero-links { display: flex; gap: 28px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.hero-links a { font-size: 17px; color: #2997ff; }
.hero-links a:hover { text-decoration: underline; }

.hero-foot { margin-top: 26px; font-size: 14px; color: #86868b; line-height: 1.9; }
.hero-foot .motto { font-family: var(--font-serif); color: #d2d2d7; }

/* ---------- 大数字统计 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 26px; }
.stat {
  background: transparent; border: 0; border-radius: 0; padding: 0;
  box-shadow: none; text-align: center; color: var(--text);
}
a.stat:hover { text-decoration: none; }
a.stat:hover .n { color: var(--blue); }
.stat .n {
  font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 600; letter-spacing: -.03em;
  line-height: 1.05; color: var(--brand-700); transition: color .2s ease;
}
html[data-theme="dark"] .stat .n { color: var(--brand-500); }
.stat .k { font-size: 13px; color: var(--text-2); margin-top: 6px; }

/* ---------- 卡片式入口（白卡 + 悬停上浮） ---------- */
.quick-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 18px; }
.quick-link {
  display: block; background: var(--surface); border-radius: var(--r-lg);
  padding: 26px 24px; color: var(--text); box-shadow: var(--shadow-card);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), box-shadow .3s ease;
}
.quick-link:hover { text-decoration: none; transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.quick-link .ico { font-size: 1.9rem; line-height: 1; }
.quick-link .t { font-weight: 600; font-size: 1.06rem; margin: 14px 0 6px; letter-spacing: -.017em; }
.quick-link .d { font-size: 14px; color: var(--text-2); line-height: 1.5; }

.tile {
  background: var(--surface); border: 0; border-radius: var(--r-lg);
  overflow: hidden; box-shadow: var(--shadow-card); display: flex; flex-direction: column;
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), box-shadow .3s ease;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.tile-cover {
  height: 96px; display: grid; place-items: center; font-size: 2.2rem;
  background: linear-gradient(180deg, var(--bg-alt) 0%, rgba(0, 0, 0, .03) 100%); border: 0;
}
.tile-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.tile-title { font-weight: 600; font-size: 1.06rem; margin: 0; letter-spacing: -.017em; }
.tile-desc { font-size: 14px; color: var(--text-2); margin: 0; flex: 1; line-height: 1.5; }
.tile-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.tile-foot .btn { margin-left: auto; }
.clickable { cursor: pointer; }

.person-card { flex-direction: row; align-items: center; gap: 14px; padding: 16px 20px; }
.avatar {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-weight: 600; color: #fff; font-size: 15px;
  letter-spacing: -.02em; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
  background: #8a94a6;   /* 真实底色由 JS 按昵称哈希赋值 */
  overflow: hidden;
}
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }
.avatar.lg { width: 84px; height: 84px; font-size: 26px; }
.avatar.w3 { font-size: 14px; }
.avatar.lg.w3 { font-size: 21px; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; margin: 0; padding-left: 30px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px;
  background: var(--hairline);
}
.tl-item { position: relative; padding: 0 0 34px 6px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -29px; top: 8px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border);
}
.band-alt .tl-item::before { background: var(--surface); }
.tl-item.milestone::before { border-color: var(--brand-600); background: var(--brand-600); }
.tl-year { font-weight: 600; color: var(--brand-700); font-size: 1.06rem; letter-spacing: -.017em; }
html[data-theme="dark"] .tl-year { color: var(--brand-500); }
.tl-title { font-weight: 600; margin: 4px 0 6px; font-size: 1.02rem; }
.tl-body { color: var(--text-2); font-size: 15px; }

/* ---------- 留言与编辑器 ---------- */
.composer { background: var(--bg-alt); border-radius: var(--r-lg); padding: 24px; }
.composer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.composer .input, .composer .textarea { background: var(--surface); }

.post { display: flex; gap: 14px; padding: 22px 0; border-bottom: 1px solid var(--hairline); }
.post:last-child { border-bottom: 0; }
.post-main { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-author { font-weight: 600; font-size: 15px; }
.post-body { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; font-size: 15.5px; }
.post-imgs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.post-imgs img {
  width: 128px; height: 128px; object-fit: cover; border-radius: var(--r-md);
  border: 0; cursor: zoom-in; background: var(--bg-alt);
}
.post-actions { display: flex; gap: 16px; margin-top: 10px; font-size: 12.5px; color: var(--text-3); }
.post-actions button {
  background: none; border: 0; color: var(--text-3); cursor: pointer; font: inherit; font-size: 12.5px; padding: 0;
}
.post-actions button:hover { color: var(--link); text-decoration: underline; }
.post.pending {
  background: var(--gold-bg); border-radius: var(--r-md); padding: 18px; border: 0; margin: 14px 0;
}

/* ---------- 图库 ---------- */
.gallery { columns: 4 190px; column-gap: 18px; }
.gallery figure {
  margin: 0 0 18px; break-inside: avoid; border-radius: var(--r-md); overflow: hidden;
  border: 0; background: var(--surface); box-shadow: var(--shadow-card);
}
.gallery img { display: block; width: 100%; cursor: zoom-in; }
.gallery figcaption { padding: 12px 15px; font-size: 12.5px; color: var(--text-2); }

.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(0, 0, 0, .94);
  display: grid; place-items: center; padding: 32px; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: var(--r-md); box-shadow: var(--shadow-float); }
.lightbox .lb-cap { color: #a1a1a6; margin-top: 16px; font-size: 14px; text-align: center; }

/* ---------- 文章列表：Apple Newsroom 风格（小图 + 分类 + 粗标题 + 日期 + 细线） ---------- */
.news-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  column-gap: 56px; row-gap: 0;
}
.news-item {
  display: flex; gap: 24px; align-items: flex-start;
  padding: 28px 0; border-top: 1px solid var(--hairline);
  color: var(--text); text-decoration: none;
}
.news-item:nth-child(1), .news-item:nth-child(2) { border-top: 0; padding-top: 8px; }
.news-item:hover { text-decoration: none; }
.news-item:hover .news-title { text-decoration: underline; text-underline-offset: 3px; }
.news-thumb {
  width: 128px; height: 128px; flex: none; border-radius: var(--r-md);
  object-fit: cover; background: var(--bg-alt);
  display: grid; place-items: center; font-size: 12px; color: var(--text-3);
  text-align: center; padding: 8px; box-sizing: border-box; line-height: 1.4;
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}
.news-item:hover .news-thumb { transform: scale(1.03); }
.news-body { flex: 1; min-width: 0; }
.news-kicker { font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.news-title {
  margin: 0 0 10px; font-size: 1.32rem; font-weight: 600; letter-spacing: -.021em;
  line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-date { font-size: 14px; color: var(--text-2); }

@media (max-width: 900px) {
  .news-grid { grid-template-columns: 1fr; }
  .news-item:nth-child(2) { border-top: 1px solid var(--hairline); padding-top: 28px; }
  .news-thumb { width: 104px; height: 104px; }
  .news-title { font-size: 1.18rem; }
}

/* 旧的卡片式文章条目（首页仍可能用到） */
.article-item { display: flex; gap: 20px; padding: 20px 22px; }
.article-item .thumb {
  width: 132px; height: 92px; flex: none; border-radius: var(--r-md); object-fit: cover;
  background: var(--bg-alt); display: grid; place-items: center; font-size: 2rem; border: 0;
}
.article-body {
  font-size: 1.12rem; line-height: 1.8; color: var(--text);
  max-width: 42em; margin: 0 auto; letter-spacing: -.008em;
}
.article-body h2 { margin: 2em 0 .6em; font-size: 1.6rem; letter-spacing: -.022em; padding: 0; border: 0; }
.article-body h3 { margin-top: 1.5em; }
.article-body img { border-radius: var(--r-md); margin: 1.4em auto; display: block; box-shadow: var(--shadow-card); }
.article-body blockquote {
  margin: 1.6em 0; padding: 20px 24px; border-left: 3px solid var(--brand-500);
  background: var(--bg-alt); border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--text-2);
}
.article-body p { margin: 0 0 1.2em; }
.article-body section[data-section] { margin: 0; padding: 0; }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body li { margin-bottom: .5em; }

.reading-meta { display: flex; gap: 18px; flex-wrap: wrap; color: var(--text-2); font-size: 14px; }
.prose-note {
  background: var(--bg-alt); border: 0; border-left: 3px solid var(--brand-500);
  border-radius: 0 var(--r-md) var(--r-md) 0; padding: 16px 20px; font-size: 14.5px; color: var(--text-2);
}
.band-alt .prose-note { background: rgba(0, 0, 0, .045); }
html[data-theme="dark"] .band-alt .prose-note { background: rgba(255, 255, 255, .07); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); background: var(--bg-alt); }
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th, table.data td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--hairline); vertical-align: top; }
table.data th { font-weight: 600; color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }

/* ---------- 分段控件（Apple segmented control） ---------- */
.tabs {
  display: inline-flex; gap: 2px; padding: 2px; margin: 0 0 26px;
  background: var(--bg-alt); border-radius: 10px; border: 0; flex-wrap: wrap;
}
.tabs button {
  border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 400;
  color: var(--text); padding: 7px 16px; border-radius: 8px; cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease;
}
.tabs button:hover { background: rgba(0, 0, 0, .04); }
.tabs button.active { background: var(--surface); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
html[data-theme="dark"] .tabs button.active { background: #48484a; }
.tabs .count { font-size: 11px; color: var(--text-2); margin-left: 6px; }

/* ---------- 加载 / 提示 / 弹层 ---------- */
.spinner {
  width: 16px; height: 16px; border-radius: 50%; display: inline-block;
  border: 2px solid var(--border); border-top-color: var(--text-2);
  animation: spin .7s linear infinite; vertical-align: -3px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast-wrap {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 300;
  display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none;
}
.toast {
  background: rgba(29, 29, 31, .92); color: #f5f5f7; padding: 12px 22px; border-radius: var(--pill);
  font-size: 14.5px; box-shadow: var(--shadow-float); backdrop-filter: blur(20px); animation: rise .25s ease;
}
html[data-theme="dark"] .toast { background: rgba(245, 245, 247, .94); color: #1d1d1f; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

.skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 25%, var(--surface) 37%, var(--bg-alt) 63%);
  background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: var(--r-sm);
}
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.modal-back {
  position: fixed; inset: 0; z-index: 150; background: rgba(0, 0, 0, .5);
  display: grid; place-items: center; padding: 24px; backdrop-filter: blur(6px);
}
.modal {
  background: var(--surface); border-radius: var(--r-lg); max-width: 720px; width: 100%;
  max-height: 86vh; overflow: auto; padding: 32px; box-shadow: var(--shadow-float); border: 0;
}
.modal-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 18px; }
.modal-head h2 { margin: 0; flex: 1; font-size: 1.5rem; }

.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); display: inline-block; }


/* ---------- 管理后台：紧凑版式 ---------- */
.admin-head { text-align: center; padding: 4px 0 2px; }
.admin-head h1 { margin: 0; font-size: clamp(1.85rem, 4vw, 2.45rem); letter-spacing: -.022em; }
.admin-tabs {
  display: flex; gap: 4px; padding: 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; overflow-x: auto;
}
.admin-tabs button {
  border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--text-2);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; white-space: nowrap;
}
.admin-tabs button:hover { background: var(--bg-alt); }
.admin-tabs button.active { background: var(--bg-alt); color: var(--text); font-weight: 600; }
html[data-theme="dark"] .admin-tabs button.active { background: #48484a; }
.admin-sec { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 14px; }
.admin-sec h3 { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: -.01em; }
.admin-sec-meta { color: var(--text-3); font-size: 13px; }
.admin-sec-right { margin-left: auto; color: var(--text-3); font-size: 13px; }
.admin-view > * + * { margin-top: 18px; }   /* 标签栏 / 统计卡 / 分区之间要留白 */
.admin-view .card { padding: 18px 20px; }
.admin-view .admin-sec + * { margin-top: 0; }
.admin-view .empty { padding: 26px 20px; }
.admin-view .empty .big { font-size: 1.5rem; margin-bottom: 6px; }

/* ---------- 管理后台：总览卡片 / 图片墙 ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; margin-bottom: 4px;
}
@media (max-width: 1080px) { .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg, 16px);
  padding: 18px 20px; transition: border-color .18s ease, transform .18s ease;
}
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { border-color: var(--link); transform: translateY(-1px); }
.stat-value { font-size: 2rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.stat-label { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; margin-bottom: 16px; }
@media (max-width: 760px) {
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .stat-value { font-size: 1.6rem; }
}

/* ---------- 列表页页头：标题居中、无副标题、留白舒服 ---------- */
.page-head { text-align: center; }
.page-head h1 { margin: 0; font-size: clamp(2rem, 4.6vw, 2.75rem); letter-spacing: -.022em; }
.page-head .search-field { margin-top: 26px; text-align: left; }
.page-head .row { justify-content: center; }
.page-head .chips { justify-content: center; margin-top: 16px; }
.page-head .chips + .chips { margin-top: 10px; }
.page-head .alert { text-align: left; margin-top: 22px; }
.page-head .field, .page-head .label, .page-head .select, .page-head .textarea, .page-head .input { text-align: left; }
.page-head .hint-row { margin-top: 14px; }

/* ---------- 大号搜索框（Apple Support 风格） ---------- */
.search-field {
  display: flex; align-items: center; gap: 12px;
  height: 56px; padding: 0 20px; box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; transition: border-color .18s ease, box-shadow .18s ease;
}
.search-field:hover { border-color: var(--border-strong); }
.search-field:focus-within { border-color: var(--link); box-shadow: 0 0 0 3.5px rgba(0, 113, 227, .16); }
.search-field .search-icon { flex: none; color: var(--text-3); }
.search-input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font: inherit; font-size: 17px; color: var(--text); padding: 0;
}
.search-input::placeholder { color: var(--text-3); }
.search-input::-webkit-search-cancel-button { display: none; }
@media (max-width: 760px) {
  .search-field { height: 50px; padding: 0 16px; border-radius: 11px; }
  .search-input { font-size: 16px; }
}

/* ---------- 表情选择 ---------- */
.emoji-wrap { position: relative; display: inline-block; }
.emoji-panel {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px;
  background: var(--surface); border-radius: var(--r-md); padding: 8px;
  box-shadow: var(--shadow-hover); border: 1px solid var(--border); width: 288px;
}
.emoji-item {
  border: 0; background: transparent; font-size: 19px; line-height: 1; cursor: pointer;
  padding: 4px; border-radius: 6px;
}
.emoji-item:hover { background: var(--bg-alt); }

/* ---------- 留言的回复 ---------- */
.post-actions .reply-toggle { background: none; border: 0; color: var(--text-3); cursor: pointer; font: inherit; font-size: 12.5px; padding: 0; }
.post-actions .reply-toggle:hover { color: var(--link); text-decoration: underline; }
.replies { margin-top: 12px; padding-left: 14px; border-left: 2px solid var(--hairline); display: flex; flex-direction: column; gap: 12px; }
.replies:empty { display: none; }
.reply { display: flex; gap: 10px; }
.reply .avatar { width: 30px; height: 30px; font-size: 12px; }
.reply-body { flex: 1; min-width: 0; }
.reply-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.reply-head strong { font-weight: 600; }
.reply-text { font-size: 14.5px; white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.reply-form { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.reply-form .input { flex: 1; min-width: 0; padding: 8px 12px; font-size: 14px; }

/* ---------- 人物卡：统一两行、单行省略，避免参差 ---------- */
.person-card { min-height: 86px; }
.person-card .pc-body { flex: 1; min-width: 0; }
.person-card .pc-name { display: flex; align-items: center; gap: 8px; }
.person-card .pc-name strong {
  font-weight: 600; font-size: 1.02rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.person-card .pc-sub {
  font-size: 12.5px; color: var(--text-2); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.person-card .pc-arrow { color: var(--text-3); flex: none; }

/* ---------- 同学账号 ---------- */
#authBtn { flex: none; font-weight: 500; }
/* 登录后导航上只显示一个圆形头像 */
#authBtn.signed-in {
  background: transparent; padding: 3px; border-radius: 50%;
  width: 36px; height: 36px; display: grid; place-items: center;
}
#authBtn.signed-in:hover { background: var(--bg-alt); }
#authBtn.signed-in .avatar { width: 30px; height: 30px; font-size: 13px; }
.auth-tabs {
  display: inline-flex; gap: 2px; padding: 2px; background: var(--bg-alt);
  border-radius: 10px; margin-bottom: 18px;
}
.auth-tabs .tabs-btn {
  border: 0; background: transparent; font: inherit; font-size: 14px; color: var(--text);
  padding: 7px 20px; border-radius: 8px; cursor: pointer;
}
.auth-tabs .tabs-btn.active { background: var(--surface); font-weight: 600; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
html[data-theme="dark"] .auth-tabs .tabs-btn.active { background: #48484a; }
@media (max-width: 760px) {
  #authBtn { padding: 5px 12px; font-size: 13px; }
  #authBtn.signed-in { padding: 2px; }
  #authBtn.signed-in .avatar { width: 28px; height: 28px; }
}

/* ---------- 就地编辑 ---------- */
.editable { position: relative; border-radius: 6px; }
body.editing .editable {
  cursor: text; outline: 1.5px dashed rgba(0, 113, 227, .5); outline-offset: 3px;
  background: rgba(0, 113, 227, .05); transition: background .15s ease, outline-color .15s ease;
}
body.editing .editable:hover { background: rgba(0, 113, 227, .1); outline-color: var(--blue); }
body.editing .editable::after {
  content: "✏️"; position: absolute; top: -13px; right: -13px; font-size: 10px; line-height: 1;
  background: var(--blue); color: #fff; border-radius: 50%; padding: 4px;
  opacity: 0; transition: opacity .15s ease; pointer-events: none;
}
body.editing .editable:hover::after { opacity: 1; }

.inline-editor {
  background: var(--surface); border-radius: var(--r-md); padding: 16px 18px; margin: 12px 0;
  box-shadow: 0 0 0 2px var(--blue), var(--shadow-hover);
}
.inline-editor .input, .inline-editor .textarea { font-size: 15px; }

.edit-bar {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 120;
  display: flex; align-items: center; gap: 16px; max-width: calc(100vw - 32px);
  background: rgba(29, 29, 31, .94); color: #f5f5f7; padding: 10px 12px 10px 22px;
  border-radius: var(--pill); box-shadow: var(--shadow-float); font-size: 14.5px;
  backdrop-filter: blur(20px);
}
.edit-bar .btn { background: rgba(255, 255, 255, .18); color: #fff; flex: none; }
.edit-bar .btn:hover { background: rgba(255, 255, 255, .3); }
html[data-theme="dark"] .edit-bar { background: rgba(245, 245, 247, .95); color: #1d1d1f; }
html[data-theme="dark"] .edit-bar .btn { background: rgba(0, 0, 0, .1); color: #1d1d1f; }
html[data-theme="dark"] .edit-bar .btn:hover { background: rgba(0, 0, 0, .18); }

.icon-btn.active { background: var(--blue); color: #fff; }
.icon-btn.active:hover { background: var(--blue-hover); color: #fff; }

.chip-new, .card .chip-new, .band-alt .chip-new { background: var(--blue); color: #fff; }

@media (max-width: 760px) {
  .edit-bar { font-size: 13px; padding: 10px 12px 10px 16px; gap: 10px; }
  body.editing .editable { outline-offset: 2px; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
  .gallery { columns: 3 150px; }
}
@media (max-width: 900px) {
  .composer-grid { grid-template-columns: 1fr; }
  body { font-size: 16px; }
}
@media (max-width: 760px) {
  .band { padding-top: 52px; padding-bottom: 52px; }
  .hero { padding-top: 60px; padding-bottom: 60px; }
  /* 手机端：入口卡片两列、只留图标与标题（对齐 Apple 移动端栅格） */
  .quick-links { grid-template-columns: 1fr 1fr; gap: 12px; }
  .quick-link { padding: 18px 16px; }
  .quick-link .ico { font-size: 1.5rem; }
  .quick-link .t { font-size: .98rem; margin: 10px 0 0; }
  .quick-link .d { display: none; }
  .article-item .thumb { height: 124px; }
  .search-bar { padding-left: 18px; }
  .search-bar input { font-size: 16px; }
  .nav-toggle { display: grid; }
  .nav {
    position: absolute; top: var(--nav-h); left: 0; right: 0; margin: 0;
    flex-direction: column; gap: 0; padding: 10px 22px 18px;
    background: rgba(255, 255, 255, .96); backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--hairline); display: none;
  }
  html[data-theme="dark"] .nav { background: rgba(0, 0, 0, .94); }
  .nav.open { display: flex; }
  .nav a { padding: 13px 0; font-size: 15px; border-bottom: 1px solid var(--hairline); border-radius: 0; }
  .nav a:last-child { border-bottom: 0; }
  .nav-actions { margin-left: auto; }
  .gallery { columns: 2 130px; column-gap: 12px; }
  .gallery figure { margin-bottom: 12px; }
  .article-item { flex-direction: column; }
  .article-item .thumb { width: 100%; height: 150px; }
  .hero h1 { letter-spacing: -.026em; }
  .modal { padding: 24px; }
  .section-head { margin-bottom: 20px; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; text-align: center; }
}

@media print {
  .site-header, .site-footer, .composer, .post-actions, .btn, .tabs { display: none !important; }
  .article-body { max-width: none; font-size: 12pt; }
  .band { width: auto; margin: 0; padding: 0; }
  body { background: #fff; color: #000; }
}

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