/* ============================================================
   style.css —— 玻璃拟态渐变 · 双主题
   ------------------------------------------------------------
   设计要点：
     · 背景是四团模糊光斑，所有面板是半透明玻璃 + backdrop-filter
     · 品牌渐变 --grad = accent → accent-2，强调色可在后台改
     · 明 / 暗两套变量，通过 html[data-theme] 或系统偏好切换
   ============================================================ */

:root {
  --bg:        #eef1f8;
  --bg-2:      #e8ecf6;
  --surface:   rgba(255, 255, 255, .72);
  --glass:     rgba(255, 255, 255, .58);
  --glass-2:   rgba(255, 255, 255, .42);
  --glass-3:   rgba(255, 255, 255, .78);

  --fg:        #1b1d2b;
  --fg-2:      #565b70;
  --muted:     #7a8095;

  /* 玻璃高光边 / 次级描边 / 正文分隔线 */
  --line:      rgba(255, 255, 255, .72);
  --line-2:    rgba(120, 125, 165, .24);
  --divider:   rgba(120, 125, 165, .15);

  --accent:    #7c5cff;
  --accent-2:  #ff6ec7;
  --cyan:      #38d6f5;
  --grad:      linear-gradient(100deg, var(--accent), var(--accent-2));

  --shadow:      0 18px 46px rgba(70, 70, 140, .13);
  --shadow-soft: 0 10px 30px rgba(60, 60, 120, .10);
  --shadow-lift: 0 22px 54px rgba(70, 70, 140, .18);

  --blob: .62;
  --blur-bg: 72px;

  --radius:    26px;
  --radius-sm: 16px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --shell:     1120px;
  --gutter:    26px;
  --head-h:    62px;
  --ease:      cubic-bezier(.22, .68, .24, 1);
}

html[data-theme="dark"] {
  --bg:      #0c0d18;
  --bg-2:    #111223;
  --surface: rgba(255, 255, 255, .07);
  --glass:   rgba(255, 255, 255, .085);
  --glass-2: rgba(255, 255, 255, .055);
  --glass-3: rgba(255, 255, 255, .13);

  --fg:      #eef0f8;
  --fg-2:    #a9aec6;
  --muted:   #7c8299;

  --line:    rgba(255, 255, 255, .15);
  --line-2:  rgba(255, 255, 255, .2);
  --divider: rgba(255, 255, 255, .11);

  --shadow:      0 18px 46px rgba(0, 0, 0, .5);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, .42);
  --shadow-lift: 0 24px 60px rgba(0, 0, 0, .58);

  --blob: .34;
  --blur-bg: 96px;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg:      #0c0d18;
    --bg-2:    #111223;
    --surface: rgba(255, 255, 255, .07);
    --glass:   rgba(255, 255, 255, .085);
    --glass-2: rgba(255, 255, 255, .055);
    --glass-3: rgba(255, 255, 255, .13);
    --fg:      #eef0f8;
    --fg-2:    #a9aec6;
    --muted:   #7c8299;
    --line:    rgba(255, 255, 255, .15);
    --line-2:  rgba(255, 255, 255, .2);
    --divider: rgba(255, 255, 255, .11);
    --shadow:      0 18px 46px rgba(0, 0, 0, .5);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, .42);
    --shadow-lift: 0 24px 60px rgba(0, 0, 0, .58);
    --blob: .34;
    --blur-bg: 96px;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.78;
  letter-spacing: .004em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
::selection { background: var(--accent); color: #fff; }

.shell { max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter); position: relative; z-index: 1; }
.main { padding-bottom: 110px; min-height: 60vh; }

/* ============================================================
   背景光斑（.grain 内放 4 个 <i>）
   ============================================================ */
.grain {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.grain i {
  position: absolute; display: block; border-radius: 50%;
  opacity: var(--blob); filter: blur(var(--blur-bg));
}
.grain i:nth-child(1) { width: 560px; height: 560px; background: var(--accent); top: -180px; left: -140px; }
.grain i:nth-child(2) { width: 480px; height: 480px; background: var(--accent-2); top: 60px; right: -160px; opacity: calc(var(--blob) * .8); }
.grain i:nth-child(3) { width: 620px; height: 620px; background: var(--cyan); bottom: -260px; left: 26%; opacity: calc(var(--blob) * .66); }
.grain i:nth-child(4) { width: 420px; height: 420px; background: #ffd166; bottom: -120px; right: -120px; opacity: calc(var(--blob) * .62); }

.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 60;
  background: var(--grad);
  transition: width .1s linear;
}

/* ============================================================
   顶栏 —— 悬浮玻璃胶囊
   ============================================================ */
.site-head {
  position: sticky; top: 0; z-index: 50;
  padding: 14px 0 0;
  transition: padding .35s var(--ease);
}
.site-head.is-stuck { padding-top: 8px; }

.head-inner {
  display: flex; align-items: center; gap: 22px;
  height: var(--head-h); padding: 0 10px 0 20px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  box-shadow: var(--shadow-soft);
  transition: box-shadow .35s var(--ease), background .35s var(--ease);
}
.site-head.is-stuck .head-inner { box-shadow: var(--shadow); }

.brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.brand-mark {
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; color: #fff;
  background: var(--grad);
  box-shadow: 0 5px 14px rgba(124, 92, 255, .4);
  transition: transform .55s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(120deg); }
.brand-name { font-size: 15px; font-weight: 650; letter-spacing: -.012em; }

.nav { display: flex; gap: 3px; margin-left: auto; }
.nav a {
  position: relative; font-size: 13.5px; color: var(--muted);
  padding: 8px 17px; border-radius: 999px;
  transition: color .22s, background .22s;
}
.nav a:hover { color: var(--fg); background: var(--glass-3); }
.nav a.on {
  color: #fff; font-weight: 600;
  background: var(--grad);
  box-shadow: 0 6px 18px rgba(124, 92, 255, .34);
}

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--glass-2); color: var(--fg-2);
  cursor: pointer;
  transition: color .25s, background .25s, transform .25s;
}
.icon-btn:hover { color: var(--fg); background: var(--glass-3); transform: rotate(18deg); }
.i-moon { display: none; }
html[data-theme="dark"] .i-sun { display: none; }
html[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .i-sun { display: none; }
  html:not([data-theme="light"]) .i-moon { display: block; }
}

/* ============================================================
   通用排版
   ============================================================ */
.kicker {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 16px; border-radius: 999px;
  font-size: 12.5px; letter-spacing: .02em; color: var(--fg-2);
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.kicker::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto;
  background: var(--grad);
}

/* ============================================================
   Hero
   ============================================================ */
.hero { padding: 78px 0 62px; border-bottom: 0; }
.hero h1 {
  margin: 24px 0 0;
  font-size: clamp(2.3rem, 7vw, 5.1rem);
  line-height: 1.05; letter-spacing: -.042em; font-weight: 750;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.hero h1 .thin {
  font-weight: 500;
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
}
.hero .lede {
  margin: 26px 0 0; max-width: 60ch;
  font-size: clamp(1rem, 1.6vw, 1.09rem);
  color: var(--fg-2); line-height: 1.85;
}
.hero-meta { display: flex; gap: 14px; margin-top: 42px; flex-wrap: wrap; }
.hero-meta div {
  display: flex; flex-direction: column; gap: 3px;
  min-width: 148px; padding: 18px 24px; border-radius: 20px;
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow-soft);
}
.hero-meta b {
  font-family: var(--font-mono); font-size: 27px; font-weight: 700; letter-spacing: -.03em;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.hero-meta span { font-size: 12px; color: var(--muted); letter-spacing: .04em; }

.scroll-hint {
  margin-top: 52px; display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--muted);
}
.scroll-hint i {
  display: block; width: 34px; height: 1px; background: var(--line-2);
  position: relative; overflow: hidden;
}
.scroll-hint i::after {
  content: ""; position: absolute; inset: 0; background: var(--accent);
  animation: slide 2.4s var(--ease) infinite;
}
@keyframes slide { 0% { transform: translateX(-100%); } 60%, 100% { transform: translateX(100%); } }

/* ============================================================
   文章列表
   ============================================================ */
.section-head {
  display: flex; align-items: center; gap: 16px;
  padding: 56px 0 18px;
}
.section-head h2 { margin: 0; font-size: 18.5px; font-weight: 680; letter-spacing: -.018em; white-space: nowrap; }
.section-head .rule {
  flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
}
.section-head .kicker { flex: 0 0 auto; padding: 5px 13px; font-size: 12px; }

.post-list {
  border-radius: var(--radius);
  background: var(--glass-2);
  border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.post-row {
  display: grid; grid-template-columns: 58px 1fr 30px;
  gap: 22px; align-items: start;
  padding: 28px 30px;
  border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease), padding-left .45s var(--ease);
}
.post-row:last-child { border-bottom: 0; }
.post-row:hover { background: var(--glass-3); padding-left: 38px; }

.post-row .idx {
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 14px;
  font-family: var(--font-mono); font-size: 13px; font-weight: 650; letter-spacing: .03em;
  color: var(--accent);
  background: var(--glass-3); border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(90, 90, 160, .1);
}
.post-row .body { min-width: 0; }
.post-row h3 {
  margin: 0; font-size: clamp(1.28rem, 2.7vw, 1.72rem);
  font-weight: 660; letter-spacing: -.024em; line-height: 1.32;
  transition: color .3s;
}
.post-row:hover h3 { color: var(--accent); }
.post-row .meta {
  display: flex; gap: 16px; flex-wrap: wrap; margin-top: 9px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--muted);
  letter-spacing: .05em;
}
.post-row .sum { margin: 11px 0 0; color: var(--fg-2); font-size: 14.5px; max-width: 68ch; }
.post-row .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.tag {
  font-size: 11.5px; padding: 4px 12px; border-radius: 999px;
  color: var(--fg-2); letter-spacing: .03em;
  background: var(--glass-3); border: 1px solid var(--line);
}
.post-row .arrow {
  color: var(--muted); padding-top: 14px;
  transition: transform .45s var(--ease), color .3s;
}
.post-row:hover .arrow { transform: translateX(7px); color: var(--accent); }

.post-row.has-cover { grid-template-columns: 58px 1fr 200px 30px; }
.post-row .cover {
  width: 200px; aspect-ratio: 16/10; object-fit: cover;
  border-radius: 16px; border: 1px solid var(--line); background: var(--glass-3);
}

.empty-note {
  padding: 80px 24px; text-align: center; color: var(--muted);
  border-radius: var(--radius);
  background: var(--glass-2); border: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-size: 15px;
}

/* ============================================================
   文章页
   ============================================================ */
.article-head { padding: 70px 0 36px; max-width: 860px; position: relative; z-index: 1; }
.article-head h1 {
  margin: 18px 0 0; font-size: clamp(1.95rem, 5.2vw, 3.3rem);
  line-height: 1.12; letter-spacing: -.032em; font-weight: 700;
}
.article-head .meta {
  display: flex; gap: 18px; flex-wrap: wrap; margin-top: 22px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); letter-spacing: .06em;
}
.article-head .lede { margin-top: 20px; color: var(--fg-2); font-size: 16.5px; }

.cover-wide {
  margin: 0 0 46px; border-radius: var(--radius);
  border: 1px solid var(--line); overflow: hidden; background: var(--glass-2);
  box-shadow: var(--shadow);
}
.cover-wide img { display: block; width: 100%; }

.article {
  max-width: 720px; font-size: 16.5px; line-height: 1.92; color: var(--fg);
  position: relative; z-index: 1;
}
.article > *:first-child { margin-top: 0; }
.article h2, .article h3, .article h4 {
  letter-spacing: -.024em; line-height: 1.28; margin: 2.2em 0 .6em; font-weight: 680;
}
.article h2 { font-size: 1.6rem; }
.article h3 { font-size: 1.27rem; }
.article h4 { font-size: 1.08rem; }
.article h1 { font-size: 1.88rem; margin: 2.2em 0 .6em; letter-spacing: -.024em; }
.article p { margin: 1.15em 0; }
.article a {
  color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  transition: background .25s, color .25s;
  padding-bottom: 1px;
}
.article a:hover { background: var(--accent); color: #fff; border-bottom-color: transparent; }
.article ul, .article ol { padding-left: 1.35em; margin: 1.15em 0; }
.article li { margin: .45em 0; }
.article blockquote {
  margin: 1.8em 0; padding: 16px 22px;
  border-left: 3px solid var(--accent); border-radius: 0 14px 14px 0;
  background: var(--glass-2);
  color: var(--fg-2); font-size: 1.02rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.article blockquote p { margin: .5em 0; }
.article hr { border: 0; border-top: 1px solid var(--divider); margin: 2.6em 0; }
.article img { border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 1.6em 0; }
.article code {
  font-family: var(--font-mono); font-size: .875em;
  background: var(--glass-3); border: 1px solid var(--line);
  padding: 2px 6px; border-radius: 7px;
}
.article pre {
  background: var(--glass-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 18px 20px; overflow-x: auto; margin: 1.7em 0; line-height: 1.7;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.article pre code { background: none; border: 0; padding: 0; font-size: 13.4px; }
.article table {
  width: 100%; border-collapse: collapse; margin: 1.7em 0; font-size: 14.5px;
}
.article th, .article td { padding: 10px 12px; border-bottom: 1px solid var(--divider); text-align: left; }
.article th {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
}
/* 首字下沉（默认关闭）
   中文排版下自动下沉容易把首行挤断，所以改成「按需开启」：
   只有后台勾选了「首字下沉」的文章（模板输出 .drop-cap 类）才生效。 */
.article.drop-cap > p:first-of-type::first-letter {
  font-size: 3em; line-height: .84; float: left;
  padding: 6px 12px 0 0; font-weight: 700; letter-spacing: -.04em;
  color: var(--accent);   /* 兜底色：不支持渐变文字时只是变成强调色，不会隐形 */
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .article.drop-cap > p:first-of-type::first-letter {
    background: var(--grad);
    -webkit-background-clip: text; background-clip: text;
    color: transparent; -webkit-text-fill-color: transparent;
  }
}

.article-foot {
  max-width: 720px; margin-top: 64px; padding-top: 26px;
  border-top: 1px solid var(--divider);
  display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap;
  position: relative; z-index: 1;
}

/* ============================================================
   下载区
   ============================================================ */
.dl-list {
  border-radius: var(--radius);
  background: var(--glass-2);
  border: 1px solid var(--line);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 36px;
}
.dl-row {
  display: grid; grid-template-columns: 52px 1fr auto;
  gap: 20px; align-items: center;
  padding: 22px 30px;
  border-bottom: 1px solid var(--line);
  transition: background .3s var(--ease), padding-left .45s var(--ease);
}
.dl-row:last-child { border-bottom: 0; }
.dl-row:hover { background: var(--glass-3); padding-left: 38px; }

.dl-ext {
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 650; letter-spacing: .04em;
  text-transform: uppercase; color: #fff;
  background: var(--grad);
  box-shadow: 0 6px 16px rgba(124, 92, 255, .3);
}
.dl-row:nth-child(3n+2) .dl-ext {
  background: linear-gradient(135deg, #38d6f5, #0aa3c2);
  box-shadow: 0 6px 16px rgba(56, 214, 245, .3);
}
.dl-row:nth-child(3n+3) .dl-ext {
  background: linear-gradient(135deg, #ff9f43, #e8761b);
  box-shadow: 0 6px 16px rgba(255, 159, 67, .3);
}

.dl-name { font-size: 16px; font-weight: 650; letter-spacing: -.014em; word-break: break-all; }
.dl-sub {
  display: flex; gap: 15px; flex-wrap: wrap; margin-top: 6px;
  font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); letter-spacing: .05em;
}
.dl-desc { margin-top: 8px; color: var(--fg-2); font-size: 14px; white-space: pre-wrap; }
.dl-lock {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: #d6317f; letter-spacing: .04em;
}
html[data-theme="dark"] .dl-lock { color: #ff8ec4; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px;
  border: 1px solid var(--line);
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  background: var(--glass-3); color: var(--fg-2); white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 6px 18px rgba(80, 80, 150, .1);
  transition: background .22s var(--ease), color .22s, border-color .22s,
              transform .22s var(--ease), box-shadow .22s;
}
.btn:hover { background: #fff; color: var(--fg); transform: translateY(-1px); box-shadow: var(--shadow-soft); }
html[data-theme="dark"] .btn:hover { background: var(--glass-3); }
html[data-theme="dark"] .btn { box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.btn:active { transform: translateY(1px); }

.btn-solid {
  background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: 0 10px 24px rgba(124, 92, 255, .34);
}
.btn-solid:hover { background: var(--grad); color: #fff; filter: brightness(1.06); }
html[data-theme="dark"] .btn-solid:hover { background: var(--grad); }

.btn-line { border-color: var(--line-2); background: var(--glass-2); color: var(--fg-2); }
.btn-danger { color: #d6317f; border-color: color-mix(in srgb, #d6317f 32%, transparent); background: var(--glass-2); }
.btn-danger:hover { background: #d6317f; border-color: #d6317f; color: #fff; }
.btn-sm { padding: 7px 15px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ============================================================
   表单
   ============================================================ */
label.field { display: block; margin-bottom: 20px; }
label.field > span {
  display: block; margin-bottom: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted);
}
input[type=text], input[type=password], input[type=search], textarea, select {
  width: 100%; padding: 12px 15px; font: inherit; font-size: 15px;
  color: var(--fg); background: var(--glass-3);
  border: 1px solid var(--line-2); border-radius: 14px;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: var(--glass-3);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
textarea { min-height: 110px; resize: vertical; line-height: 1.8; }
.hint { margin-top: 7px; font-size: 12.5px; color: var(--muted); }

/* ============================================================
   后台
   ============================================================ */
body.admin { background: var(--bg-2); }
.admin-main { padding-top: 30px; }

.panel {
  background: var(--glass); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(20px) saturate(165%);
  -webkit-backdrop-filter: blur(20px) saturate(165%);
  box-shadow: var(--shadow-soft);
  margin-bottom: 22px;
}
.panel-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 18px 24px; border-bottom: 1px solid var(--divider);
}
.panel-head h2 { margin: 0; font-size: 15.5px; font-weight: 680; letter-spacing: -.012em; }
.panel-head .spacer { flex: 1; }
.panel-body { padding: 24px; }
.panel-body > *:last-child { margin-bottom: 0; }
.panel-body .btn + .btn { margin-left: 8px; }

.page-title { margin: 4px 0 20px; }
.page-title h1 { margin: 0 0 6px; font-size: 27px; letter-spacing: -.03em; font-weight: 700; }
.page-title p { margin: 0; color: var(--muted); font-size: 14px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--glass); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px 20px;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow-soft);
}
.stat .n {
  font-family: var(--font-mono); font-size: 25px; font-weight: 700; letter-spacing: -.03em;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.stat .l { font-size: 12px; color: var(--muted); margin-top: 3px; letter-spacing: .06em; }

.table-scroll { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td { padding: 14px 12px; border-bottom: 1px solid var(--divider); text-align: left; vertical-align: top; }
table.grid th {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
}
table.grid tr:last-child td { border-bottom: 0; }
table.grid td.actions { white-space: nowrap; }
table.grid td.actions form { display: inline; }
table.grid td.actions .btn + .btn { margin-left: 6px; }
.cell-title { font-weight: 650; letter-spacing: -.01em; }
.cell-sub { color: var(--muted); font-size: 12.5px; margin-top: 4px; }

.alert {
  padding: 13px 17px; border-radius: 14px; font-size: 14px; margin-bottom: 18px; border: 1px solid;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.alert.ok  { background: rgba(26, 127, 90, .1); border-color: rgba(26, 127, 90, .3); color: #15714f; }
.alert.err { background: rgba(192, 57, 43, .1); border-color: rgba(192, 57, 43, .32); color: #b0301f; }
.alert.warn { background: rgba(184, 134, 11, .13); border-color: rgba(184, 134, 11, .34); color: #8a6408; }
html[data-theme="dark"] .alert.ok { color: #6fdcae; }
html[data-theme="dark"] .alert.err { color: #ff9a8a; }
html[data-theme="dark"] .alert.warn { color: #e8c36a; }

/* 登录页 */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; position: relative; z-index: 1; }
.auth-card { width: 100%; max-width: 410px; }
.auth-card .mark {
  width: 52px; height: 52px; border-radius: 18px; color: #fff;
  background: var(--grad);
  box-shadow: 0 10px 26px rgba(124, 92, 255, .38);
  display: grid; place-items: center; margin: 0 auto 18px;
}
.auth-card h1 { text-align: center; font-size: 22px; margin: 0 0 6px; letter-spacing: -.028em; font-weight: 700; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13.5px; margin: 0 0 26px; }

/* 上传拖拽区 */
.dropzone {
  border: 1px dashed var(--line-2); border-radius: var(--radius-sm); padding: 34px 20px;
  text-align: center; cursor: pointer; background: var(--glass-2);
  transition: border-color .25s, background .25s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--glass-3); }
.dropzone input[type=file] { display: none; }
.dz-title { font-weight: 650; font-size: 15px; }
.dz-sub { color: var(--muted); font-size: 13px; margin-top: 5px; }
.chips { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.chips li {
  display: flex; justify-content: space-between; gap: 14px;
  background: var(--glass-2); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 12px; font-size: 13px;
}
.chips .sz { color: var(--muted); font-family: var(--font-mono); font-size: 12px; flex: 0 0 auto; }

/* 编辑器 */
.tabs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--glass-2); padding: 3px; gap: 2px; }
.tabs button {
  border: 0; background: transparent; color: var(--muted);
  padding: 7px 16px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  border-radius: 999px;
  transition: background .2s, color .2s;
}
.tabs button.on { background: var(--grad); color: #fff; box-shadow: 0 5px 14px rgba(124, 92, 255, .3); }

.toolbar {
  display: flex; gap: 2px; flex-wrap: wrap; align-items: center;
  padding: 8px; border: 1px solid var(--line); border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--glass-2);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.toolbar button {
  min-width: 32px; height: 30px; padding: 0 9px;
  border: 0; background: transparent; color: var(--fg-2); border-radius: 8px;
  font: inherit; font-size: 13px; cursor: pointer; transition: background .2s, color .2s;
}
.toolbar button:hover { background: var(--glass-3); color: var(--accent); }
.toolbar .sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 6px; }
.editor {
  border: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--glass-3); min-height: 380px;
}
.editor .rt {
  min-height: 380px; padding: 20px 22px; outline: none;
  font-size: 15.5px; line-height: 1.85;
}
.editor .rt:empty::before { content: attr(data-ph); color: var(--muted); }
.editor .rt h2 { font-size: 1.45rem; margin: 1.4em 0 .5em; letter-spacing: -.02em; }
.editor .rt h3 { font-size: 1.18rem; margin: 1.3em 0 .5em; }
.editor .rt blockquote { margin: 1.2em 0; padding-left: 16px; border-left: 3px solid var(--accent); color: var(--fg-2); }
.editor .rt img { border: 1px solid var(--line); border-radius: 12px; }
.editor .rt pre { background: var(--glass-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; overflow-x: auto; }
.editor textarea {
  border: 0; border-radius: 0; min-height: 380px; font-family: var(--font-mono);
  font-size: 13.6px; line-height: 1.8; resize: vertical; background: transparent;
}
.editor textarea:focus { box-shadow: none; background: transparent; }

/* 内联展开面板 */
details.inline { display: inline-block; }
details.inline > summary { list-style: none; cursor: pointer; }
details.inline > summary::-webkit-details-marker { display: none; }
.inline-panel {
  margin-top: 10px; padding: 15px; min-width: 285px;
  background: var(--glass-3); border: 1px solid var(--line); border-radius: var(--radius-sm);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  text-align: left;
}
.inline-panel input, .inline-panel textarea { font-size: 13.5px; padding: 9px 12px; margin-bottom: 9px; }
.inline-panel textarea { min-height: 68px; }

/* ============================================================
   下载密码页
   ============================================================ */
.gate-shell { min-height: calc(100vh - var(--head-h)); display: grid; place-items: center; padding: 56px 20px; }
.gate {
  width: 100%; max-width: 460px; padding: 38px 34px 32px;
  border-radius: 28px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(170%);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  box-shadow: var(--shadow-lift);
}
.gate .file-badge {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}
.gate h1 { margin: 12px 0 8px; font-size: clamp(1.45rem, 4vw, 1.9rem); letter-spacing: -.028em; line-height: 1.24; word-break: break-all; font-weight: 700; }
.gate .info { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: .06em; display: flex; gap: 14px; flex-wrap: wrap; }
.gate form { margin-top: 26px; }
.gate .lock-icon {
  width: 58px; height: 58px; border-radius: 20px; color: #fff;
  background: var(--grad);
  box-shadow: 0 10px 24px rgba(124, 92, 255, .34);
  display: grid; place-items: center; margin-bottom: 22px;
}
.gate .lock-icon.is-locked {
  background: linear-gradient(135deg, #ff7a70, #d6317f);
  box-shadow: 0 10px 24px rgba(214, 49, 127, .34);
}
.gate input[type=password] { font-size: 16px; letter-spacing: .28em; text-align: center; }

/* ============================================================
   页脚
   ============================================================ */
.site-foot {
  padding: 34px 0 46px; margin-top: 60px;
  border-top: 1px solid var(--divider);
  position: relative; z-index: 1;
}
.foot-inner {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
}
.foot-links { display: flex; gap: 20px; }
.foot-links a:hover { color: var(--accent); }

/* ============================================================
   滚动揭示
   ============================================================ */
[data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
[data-reveal].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
  .scroll-hint i::after { animation: none; }
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 860px) {
  :root { --gutter: 18px; }
  .hero { padding: 56px 0 44px; }
  .head-inner { padding: 0 8px 0 16px; gap: 12px; }
  .nav { gap: 2px; }
  .nav a { padding: 8px 12px; font-size: 13px; }
  .post-row, .dl-row { padding: 22px 20px; }
  .post-row:hover, .dl-row:hover { padding-left: 26px; }
  .post-row { grid-template-columns: 44px 1fr 22px; gap: 14px; }
  .post-row .idx { width: 40px; height: 40px; border-radius: 12px; font-size: 12px; }
  .post-row.has-cover { grid-template-columns: 44px 1fr 22px; }
  .post-row .cover { display: none; }
  .dl-row { grid-template-columns: 46px 1fr; gap: 14px; }
  .dl-row .btn { grid-column: 1 / -1; justify-self: start; }
  .brand-name { max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .article.drop-cap > p:first-of-type::first-letter { font-size: 2.4em; }
  .gate { padding: 30px 24px 26px; border-radius: 24px; }
}

@media (max-width: 560px) {
  .nav a { padding: 7px 10px; font-size: 12.5px; }
  .panel-head, .panel-body { padding-left: 16px; padding-right: 16px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero-meta div { min-width: 0; flex: 1 1 40%; padding: 15px 18px; }
  .icon-btn { display: none; }
}
