:root {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --ink: #16201e;
  --muted: #5b6b67;
  --line: #e6ece9;
  --brand: #0e7c66;
  --brand-2: #15a383;
  --brand-ink: #063a31;
  --gold: #b8893a;
  --shadow: 0 10px 30px rgba(14, 124, 102, .08);
  --shadow-sm: 0 4px 14px rgba(14, 124, 102, .06);
  --radius: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.86); backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .bar { display: flex; align-items: center; gap: 18px; height: 64px; }
.logo { font-weight: 800; font-size: 20px; color: var(--brand-ink); display: flex; align-items: center; gap: 10px; letter-spacing: .5px; }
.logo .dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), #9be3cf); box-shadow: 0 0 0 4px rgba(14,124,102,.12); }
.nav { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.nav a { color: var(--muted); font-weight: 600; font-size: 15px; }
.nav a.active, .nav a:hover { color: var(--brand); text-decoration: none; }
.nav-toggle { display: none; margin-left: auto; border: none; background: transparent; font-size: 22px; cursor: pointer; color: var(--brand-ink); }
.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border: none;
  background: var(--brand); color: #fff; padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: 14px;
}
.btn:hover { background: var(--brand-2); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn.small { padding: 6px 12px; font-size: 13px; }

/* Hero */
.hero { padding: 52px 0 30px; text-align: center; }
.hero-badge {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 1px; color: var(--brand);
  background: linear-gradient(135deg, rgba(14,124,102,.12), rgba(21,163,131,.08));
  border: 1px solid rgba(14,124,102,.2); padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 {
  font-size: 40px; margin: 0 0 12px; color: var(--brand-ink); letter-spacing: 1px;
  background: linear-gradient(120deg, #063a31 0%, #0e7c66 60%, #15a383 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { color: var(--muted); font-size: 17px; max-width: 760px; margin: 0 auto; }
.hero-desc { color: var(--muted); font-size: 14px; max-width: 640px; margin: 8px auto 0; }

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 22px auto 6px; max-width: 640px; }
.search { flex: 1; min-width: 220px; position: relative; }
.search input {
  width: 100%; padding: 13px 14px 13px 42px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 15px; background: var(--surface); box-shadow: var(--shadow-sm);
}
.search::before { content: "🔍"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); opacity: .5; }

/* 栏目区块 */
.sec {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 22px; overflow: hidden;
}
.sec-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); border-left: 5px solid var(--accent); }
.sec-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); flex: none; }
.sec-name { font-size: 19px; font-weight: 800; color: var(--brand-ink); margin: 0; }
.sec-desc { color: var(--muted); font-size: 13px; }
.sec-more { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--brand); white-space: nowrap; }
.sec-more:hover { text-decoration: none; opacity: .8; }

/* 单行标题列表 */
.line-list { list-style: none; margin: 0; padding: 6px 22px 14px; }
.line-list li { border-bottom: 1px dashed var(--line); }
.line-list li:last-child { border-bottom: none; }
.line-list a { display: flex; align-items: center; gap: 14px; padding: 14px 4px; color: var(--ink); }
.line-list a:hover { text-decoration: none; }
.line-list a:hover .t { color: var(--brand); }
.line-list .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15.5px; font-weight: 600; }
.line-list .date { color: var(--muted); font-size: 12px; flex: none; font-variant-numeric: tabular-nums; }
.line-list .empty { padding: 16px 4px; color: var(--muted); font-size: 14px; }

/* 视频号二维码 */
.video-qr {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px;
  background: linear-gradient(135deg, #063a31, #0e7c66);
  border-radius: var(--radius); padding: 30px; color: #eafff7; box-shadow: var(--shadow); margin-bottom: 24px;
}
.qr-box { width: 176px; height: 176px; flex: none; border-radius: 12px; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.qr-box img { width: 100%; height: 100%; object-fit: cover; }
.qr-ph { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--brand); font-size: 12px; }
.qr-ph-icon { width: 40px; height: 40px; border-radius: 10px; background: rgba(14,124,102,.1); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.qr-text h3 { margin: 0; color: #fff; font-size: 19px; }

/* Article detail */
.article-wrap { max-width: 820px; margin: 28px auto 60px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.article-banner { padding: 22px 28px; color: #fff; }
.article-banner h1 { margin: 0; font-size: 27px; line-height: 1.35; }
.article-body { padding: 24px 32px 36px; }
.article-meta { color: var(--muted); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.article-content h1, .article-content h2, .article-content h3 { color: var(--brand-ink); margin-top: 1.4em; }
.article-content img { max-width: 100%; border-radius: 8px; }
.article-content pre { background: #0f1b18; color: #d7f5ea; padding: 14px; border-radius: 10px; overflow: auto; }
.article-content code { background: #eef4f2; padding: 2px 6px; border-radius: 5px; font-size: 90%; }
.article-content pre code { background: transparent; padding: 0; }
.article-content blockquote { border-left: 4px solid var(--brand); margin: 1em 0; padding: 6px 16px; background: #f0f7f4; color: var(--muted); border-radius: 0 8px 8px 0; }
.article-content table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 14px; }
.article-content th, .article-content td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.article-content th { background: #f0f7f4; }
.attachments { margin-top: 24px; padding-top: 16px; border-top: 1px dashed var(--line); }
.attachments a { display: inline-flex; align-items: center; gap: 6px; margin: 4px 8px 4px 0; }

/* About */
.about { max-width: 820px; margin: 30px auto 60px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; }
.about h2 { color: var(--brand-ink); margin-top: 1.2em; }
.about ul { padding-left: 20px; }

/* 渲染后的 Markdown 容器 */
.about-md h1 { font-size: 26px; color: var(--brand-ink); margin: 0 0 .4em; }
.about-md h2 { color: var(--brand-ink); margin-top: 1.2em; font-size: 20px; }
.about-md h3 { color: var(--brand-ink); margin-top: 1em; }
.about-md p { line-height: 1.8; margin: .6em 0; color: var(--ink); }
.about-md ul, .about-md ol { padding-left: 22px; line-height: 1.9; }
.about-md li { margin: .25em 0; }
.about-md strong { color: var(--brand-ink); }
.about-md a { color: var(--brand); text-decoration: underline; }
.about-md blockquote { border-left: 4px solid var(--brand); margin: 1em 0; padding: 6px 16px; background: #f0f7f4; color: var(--muted); border-radius: 0 8px 8px 0; }
.about-md table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 14px; }
.about-md th, .about-md td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.about-md th { background: #f0f7f4; }
.about-md pre { background: #0f1b18; color: #d7f5ea; padding: 14px; border-radius: 10px; overflow: auto; }
.about-md code { background: #eef4f2; padding: 2px 6px; border-radius: 5px; font-size: 90%; }
.about-md pre code { background: transparent; padding: 0; }
.about-md hr { border: none; border-top: 1px solid var(--line); margin: 1.4em 0; }
.about-md img { max-width: 100%; border-radius: 8px; }

/* 后台标签页 */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 9px; padding: 8px 16px; cursor: pointer; font-weight: 600; font-size: 14px; }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 统计模块 */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat-num { font-size: 26px; font-weight: 800; color: var(--brand-ink); }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat-table { width: 100%; border-collapse: collapse; margin-bottom: 22px; }
.stat-table th, .stat-table td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; font-size: 14px; }
.stat-table th { color: var(--muted); font-weight: 600; }
.stat-right { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--brand-ink); }
.stat-bar { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
.recent-list { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.recent-item { display: flex; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; align-items: baseline; }
.recent-item .r-path { font-weight: 700; color: var(--brand-ink); font-family: ui-monospace, Menlo, Consolas, monospace; }
.recent-item .r-meta { color: var(--muted); }

/* Pagination */
.pager { display: flex; justify-content: center; gap: 10px; margin: 30px 0; }
.pager button { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 8px 14px; cursor: pointer; font-weight: 600; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* 扫码访问二维码 */
.site-qr { display: flex; justify-content: center; margin: 6px 0 26px; }
.qr-card { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 22px; box-shadow: var(--shadow); }
.qr-card img { width: 150px; height: 150px; border-radius: 10px; display: block; }
.qr-tip { display: flex; flex-direction: column; gap: 6px; }
.qr-tip strong { color: var(--brand-ink); font-size: 15px; }
.qr-tip span { color: var(--muted); font-size: 12.5px; max-width: 180px; line-height: 1.55; }
@media (max-width: 760px) { .qr-card { flex-direction: column; text-align: center; } .qr-tip span { max-width: 220px; } }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 28px 0; color: var(--muted); font-size: 13px; text-align: center; }

/* Admin */
.admin-wrap { max-width: 1000px; margin: 30px auto 60px; }
.login-box { max-width: 380px; margin: 80px auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px; }
.login-box h2 { margin-top: 0; color: var(--brand-ink); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-family: inherit;
}
.field textarea { min-height: 200px; resize: vertical; }
.admin-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px; }
@media (max-width: 880px) { .admin-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.panel h3 { margin-top: 0; color: var(--brand-ink); }
.row-list { max-height: 420px; overflow: auto; }
.row-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.row-item .t { flex: 1; font-weight: 600; font-size: 14px; }
.row-item .t small { display: block; color: var(--muted); font-weight: 400; }
.cat-row { display: grid; grid-template-columns: 160px 1fr; gap: 10px; align-items: center; margin-bottom: 10px; }
.cat-row .cn { font-weight: 700; color: var(--brand-ink); }
.msg { padding: 10px 14px; border-radius: 9px; margin: 12px 0; font-size: 14px; }
.msg.ok { background: #eaf6f1; color: var(--brand-ink); }
.msg.err { background: #fdeaea; color: #a3262b; }
.hidden { display: none !important; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--brand-ink); color: #fff; padding: 12px 20px; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 200; }
.toast.show { opacity: 1; }

/* 响应式 */
@media (max-width: 760px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; background: #fff; border-bottom: 1px solid var(--line); padding: 8px 20px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: block; }
  .hero { padding: 36px 0 22px; }
  .hero h1 { font-size: 30px; }
  .hero-sub { font-size: 15px; }
  .sec-head { flex-wrap: wrap; }
  .sec-desc { flex-basis: 100%; order: 3; }
  .sec-more { order: 2; }
  .video-qr { flex-direction: column; text-align: center; }
  .qr-box { margin: 0 auto; }
  .line-list a { padding: 13px 2px; }
  .line-list .date { display: none; }
}
