/* ============================================================
   无烟志 · 禁烟主题个人博客
   ============================================================ */
:root {
  --bg: #f5f7f6;
  --card: #ffffff;
  --ink: #1e2b26;
  --muted: #5f6f67;
  --line: #e3e9e6;
  --line-2: #cfe4d9;
  --green-950: #0b2e23;
  --green-900: #0f3d2e;
  --green-700: #14684b;
  --green-600: #178a63;
  --green-100: #e6f3ec;
  --green-50: #f0f8f3;
  --red: #cf4444;
  --red-100: #fdecec;
  --red-ink: #8f2f2f;
  --amber: #b45309;
  --amber-100: #fdf3e3;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 61, 46, .05), 0 8px 24px rgba(15, 61, 46, .07);
  --shadow-lift: 0 2px 4px rgba(15, 61, 46, .08), 0 14px 34px rgba(15, 61, 46, .12);
  --serif: "Georgia", "Times New Roman", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  /* 主题可覆盖的区域变量 */
  --header-bg: rgba(255, 255, 255, .92);
  --topbar-bg: #0b2e23;
  --footer-bg: #0b2e23;
  --hero-bg:
    radial-gradient(900px 420px at 85% -10%, rgba(23, 138, 99, .45), transparent 60%),
    radial-gradient(600px 380px at -10% 110%, rgba(20, 104, 75, .35), transparent 60%),
    linear-gradient(160deg, #0b2e23 0%, #10603f 68%, #178a63 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--green-600); }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 22px; }

/* ---------------- 页头 ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--green-900); }
.brand-mark { width: 30px; height: 30px; display: block; }
.brand-name { font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: 2px; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: 3px; margin-left: 2px; }
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav a {
  color: var(--muted); font-size: 14px; padding: 7px 13px; border-radius: 999px;
  transition: background .18s, color .18s;
}
.site-nav a:hover { background: var(--green-100); color: var(--green-900); }
.site-nav a.nav-admin { border: 1px solid var(--line); background: var(--card); }

/* ---------------- 首页 Hero ---------------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--hero-bg);
  color: #fff;
  padding: 78px 0 66px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25);
  color: #d7f2e5; font-size: 12.5px; letter-spacing: 2px;
  padding: 5px 14px; border-radius: 999px; margin-bottom: 22px;
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #7fe0b8; box-shadow: 0 0 8px #7fe0b8; }
.hero h1 {
  font-family: var(--serif); font-size: clamp(34px, 6vw, 54px);
  letter-spacing: 4px; line-height: 1.25; margin-bottom: 16px; font-weight: 700;
}
.hero p.hero-sub { color: rgba(255, 255, 255, .82); font-size: 17px; max-width: 560px; margin-bottom: 40px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.stat {
  border-left: 1px solid rgba(255, 255, 255, .22);
  padding-left: 18px;
}
.stat b { display: block; font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.2; }
.stat span { font-size: 12.5px; color: rgba(255, 255, 255, .72); letter-spacing: 1px; }

/* ---------------- 版块标题 ---------------- */
.section { padding: 58px 0 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 26px; }
.section-title {
  font-family: var(--serif); font-size: 27px; font-weight: 700; color: var(--green-950);
  display: flex; align-items: center; gap: 12px; letter-spacing: 1px;
}
.section-title::before {
  content: ""; width: 8px; height: 22px; border-radius: 3px;
  background: linear-gradient(180deg, var(--green-600), var(--green-900));
}
.section-note { font-size: 13px; color: var(--muted); }

/* ---------------- 文章卡片 ---------------- */
.article-list { display: flex; flex-direction: column; gap: 18px; }
.article-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 28px 22px; color: var(--ink);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.article-card::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--green-600), var(--green-900));
  opacity: 0; transition: opacity .2s;
}
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--line-2); }
.article-card:hover::after { opacity: 1; }
.article-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.article-meta .sep { color: var(--line-2); }
.article-card h2 { font-family: var(--serif); font-size: 22px; line-height: 1.4; margin-bottom: 8px; font-weight: 700; }
.article-card:hover h2 { color: var(--green-700); }
.article-card .summary { color: var(--muted); font-size: 15px; margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  font-size: 12px; color: var(--green-700); background: var(--green-50);
  border: 1px solid var(--green-100); padding: 2px 10px; border-radius: 999px;
}

/* ---------------- 关于 / 订阅戒烟卡片 ---------------- */
.about-card {
  margin-top: 40px; background: linear-gradient(150deg, var(--green-50), var(--green-100));
  border: 1px solid var(--green-100); border-radius: var(--radius);
  padding: 34px 34px 30px;
}
.about-card h3 { font-family: var(--serif); font-size: 21px; margin-bottom: 12px; color: var(--green-950); }
.about-card p { color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.warn-strip {
  margin-top: 20px; display: flex; gap: 12px; align-items: flex-start;
  background: var(--red-100); border: 1px solid var(--red-100); border-radius: 10px;
  padding: 14px 16px; font-size: 14px; color: var(--red-ink);
}
.warn-strip b { color: var(--red); }

/* ---------------- 页脚 ---------------- */
.site-footer { background: var(--footer-bg); color: rgba(255, 255, 255, .78); margin-top: 70px; padding: 42px 0 90px; }
.footer-inner { display: grid; grid-template-columns: 1fr auto auto; gap: 40px; align-items: start; }
.footer-brand { font-family: var(--serif); font-size: 20px; letter-spacing: 3px; color: #fff; margin-bottom: 8px; }
.footer-inner small { display: block; font-size: 12.5px; color: rgba(255, 255, 255, .5); margin-top: 6px; line-height: 1.9; }
.footer-hotline { font-size: 13.5px; line-height: 2; text-align: right; }
.footer-hotline b { font-family: var(--serif); font-size: 19px; color: #9fe3c6; letter-spacing: 1px; }

/* 首页页脚「支持我们」二维码 */
.footer-support { text-align: right; }
.support-title { font-size: 16px; font-weight: 600; color: #fff; margin-bottom: 10px; letter-spacing: 1px; }
.support-qr-box {
  display: inline-block;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  position: relative;
  max-width: 280px;                 /* 限制最大宽度，避免挤占左侧 */
}
.support-qr-box img { max-width: 100%; height: auto; display: block; }
.qr-placeholder-text {
  display: none; align-items: center; justify-content: center;
  width: 140px; height: 140px; background: rgba(255, 255, 255, .1); border-radius: 10px;
  padding: 8px; font-size: 12px; color: rgba(255, 255, 255, .7); text-align: center; line-height: 1.5;
}
.support-qr-box.qr-missing .qr-placeholder-text { display: flex; }
.support-qr-box.qr-missing img { display: none; }

/* ---------------- 文章详情页 ---------------- */
.article-page { padding: 50px 0 10px; }
.back-link { font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; margin-bottom: 26px; }
.back-link:hover { color: var(--green-700); }
.article-head h1 { font-family: var(--serif); font-size: clamp(26px, 4.5vw, 38px); line-height: 1.4; margin-bottom: 14px; font-weight: 700; }
.article-head .article-meta { margin-bottom: 6px; }
.draft-banner {
  display: inline-flex; gap: 8px; align-items: center; margin: 12px 0;
  background: var(--amber-100); color: var(--amber); border: 1px solid #f0dcb8;
  padding: 6px 14px; border-radius: 8px; font-size: 13px;
}
.article-body {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 42px 44px 38px; margin-top: 22px;
}
@media (max-width: 640px) { .article-body { padding: 28px 22px; } }

/* markdown 渲染样式 */
.md { font-size: 16.5px; color: var(--ink); }
.md > *:first-child { margin-top: 0; }
.md p { margin: 18px 0; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--serif); color: var(--green-950); line-height: 1.4; margin: 34px 0 14px; }
.md h1 { font-size: 26px; }
.md h2 { font-size: 22px; padding-left: 14px; border-left: 4px solid var(--green-600); }
.md h3 { font-size: 18.5px; }
.md h4 { font-size: 16.5px; }
.md strong { color: var(--green-900); }
.md em { color: inherit; }
.md code {
  font-family: Consolas, Menlo, monospace; font-size: .9em;
  background: var(--green-50); border: 1px solid var(--green-100); border-radius: 5px; padding: 1px 6px; color: var(--green-700);
}
.md blockquote {
  margin: 20px 0; padding: 14px 20px; background: var(--green-50);
  border-left: 4px solid var(--green-600); border-radius: 0 10px 10px 0;
  color: var(--muted); font-family: var(--serif);
}
.md ul, .md ol { margin: 18px 0; padding-left: 26px; }
.md li { margin: 7px 0; }
.md li::marker { color: var(--green-600); }
.md hr { border: none; border-top: 1px dashed var(--line-2); margin: 30px 0; }
.md a { border-bottom: 1px solid var(--green-100); }

/* ---------------- 评论区 ---------------- */
.comment-section { margin-top: 46px; }
.comment-count { font-size: 15px; color: var(--muted); }
.comment-form-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 28px;
}
.comment-form-card .replying-tip {
  display: none; align-items: center; gap: 8px; font-size: 13.5px; color: var(--green-700);
  background: var(--green-50); border: 1px dashed var(--green-100); border-radius: 8px;
  padding: 7px 12px; margin-bottom: 14px;
}
.comment-form-card.replaying .replying-tip { display: inline-flex; }
.comment-form-card .replying-tip button {
  border: none; background: none; color: var(--muted); cursor: pointer; font-size: 13px; text-decoration: underline;
}
.form-row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.comment-list { display: flex; flex-direction: column; gap: 14px; }
.comment-item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px 16px; box-shadow: var(--shadow);
}
.comment-item.is-hidden { opacity: .65; background: var(--bg); }
.comment-item.is-reply { margin-left: 46px; margin-top: 12px; border-left: 3px solid var(--line-2); }
.comment-top { display: flex; gap: 12px; }
.avatar {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 700; font-size: 16px; color: #fff;
  background: linear-gradient(150deg, var(--green-600), var(--green-900));
}
.comment-main { flex: 1; min-width: 0; }
.comment-name { font-weight: 600; font-size: 14.5px; }
.comment-time { font-size: 12.5px; color: var(--muted); margin-left: 10px; }
.comment-floor { font-size: 12px; color: var(--muted); margin-left: 10px; opacity: .7; }
.comment-content { font-size: 15px; color: var(--ink); margin-top: 6px; white-space: pre-wrap; word-break: break-word; }
.comment-actions { display: flex; gap: 14px; margin-top: 8px; }
.comment-actions button {
  border: none; background: none; cursor: pointer; font-size: 13px; color: var(--muted); padding: 0;
}
.comment-actions button:hover { color: var(--green-700); }
.comment-actions button.danger:hover { color: var(--red); }
.replies { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.badge {
  font-size: 11.5px; padding: 1px 8px; border-radius: 999px; margin-left: 8px; vertical-align: 1px;
  background: var(--amber-100); color: var(--amber); border: 1px solid #eedbba;
}

/* ---------------- 表单通用 ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--green-900); }
.field input, .field textarea, .field select {
  font-family: var(--sans); font-size: 15px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; padding: 10px 13px;
  background: var(--card); outline: none; transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.field textarea { resize: vertical; min-height: 96px; line-height: 1.7; }
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(23, 138, 99, .14);
}
.field .hint { font-size: 12.5px; color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; cursor: pointer; font-family: var(--sans); font-size: 14.5px; font-weight: 600;
  background: var(--green-700); color: #fff; border-radius: 9px; padding: 10px 22px;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--green-600); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: var(--card); color: var(--green-900); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--green-50); }
.btn-danger { background: var(--card); color: var(--red); border: 1px solid #eec9c9; }
.btn-danger:hover { background: var(--red-100); }
.btn-sm { padding: 6px 13px; font-size: 13px; border-radius: 7px; }
.btn-block { width: 100%; }
.inline-field { display: flex; gap: 10px; }
.inline-field input { flex: 1; }

/* ---------------- 状态 ---------------- */
.empty {
  text-align: center; color: var(--muted); padding: 54px 20px; font-size: 14.5px;
  background: var(--card); border: 1px dashed var(--line-2); border-radius: var(--radius);
}
.empty .big { font-size: 34px; display: block; margin-bottom: 10px; }
.loading { text-align: center; color: var(--muted); padding: 46px 0; font-size: 14px; letter-spacing: 1px; }
.loading::before {
  content: ""; display: block; width: 26px; height: 26px; margin: 0 auto 12px;
  border: 3px solid var(--green-100); border-top-color: var(--green-600); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status-chip {
  font-size: 12px; padding: 2px 10px; border-radius: 999px; font-weight: 500;
}
.status-published { background: var(--green-100); color: var(--green-700); }
.status-draft { background: #eef1f4; color: #64748b; }
.status-hidden { background: var(--amber-100); color: var(--amber); }

/* ---------------- Toast ---------------- */
.toast-host { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink); color: var(--bg); font-size: 14px;
  padding: 11px 20px; border-radius: 10px; box-shadow: var(--shadow-lift);
  animation: toast-in .25s ease; max-width: 86vw;
}
.toast-error { background: var(--red); color: #fff; }
.toast-out { opacity: 0; transition: opacity .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ============================================================
   管理后台
   ============================================================ */
.admin-body { background: var(--bg); }
.admin-top {
  background: var(--topbar-bg); color: #fff; padding: 0 26px;
  display: flex; align-items: center; justify-content: space-between; height: 60px;
  position: sticky; top: 0; z-index: 60;
}
.admin-top .brand-name { color: #fff; }
.admin-top .brand-sub { color: rgba(255, 255, 255, .55); }
.admin-user { display: flex; align-items: center; gap: 14px; font-size: 13.5px; color: rgba(255, 255, 255, .85); }
.admin-user button {
  border: 1px solid rgba(255, 255, 255, .3); background: transparent; color: #fff;
  border-radius: 999px; padding: 5px 14px; cursor: pointer; font-size: 13px;
}
.admin-user button:hover { background: rgba(255, 255, 255, .12); }

/* 登录卡片 */
.login-wrap { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.login-card {
  width: 100%; max-width: 430px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-lift); padding: 34px 34px 30px;
}
.login-card .login-title { font-family: var(--serif); font-size: 22px; color: var(--green-950); margin-bottom: 4px; }
.login-card .login-sub { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.auth-tabs { display: flex; gap: 4px; background: var(--green-50); border-radius: 10px; padding: 4px; margin-bottom: 22px; }
.auth-tabs button {
  flex: 1; border: none; background: transparent; cursor: pointer; font-size: 13.5px;
  padding: 8px 0; border-radius: 8px; color: var(--muted); font-family: var(--sans);
}
.auth-tabs button.active { background: var(--card); color: var(--green-900); font-weight: 600; box-shadow: 0 1px 3px rgba(15, 61, 46, .12); }
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.auth-switch a { cursor: pointer; text-decoration: underline; }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; }
.code-row .btn { white-space: nowrap; padding: 10px 16px; }

/* 管理台 */
.admin-main { max-width: 1020px; margin: 0 auto; padding: 34px 22px 80px; }
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; box-shadow: var(--shadow);
}
.stat-card b { font-family: var(--serif); font-size: 26px; color: var(--green-900); display: block; }
.stat-card span { font-size: 12.5px; color: var(--muted); letter-spacing: 1px; }
.stat-card.stat-link { cursor: pointer; transition: transform .15s, box-shadow .15s; }
.stat-card.stat-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }

/* 浏览量统计面板 */
.stats-controls {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.stats-controls input[type="date"] {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-family: var(--sans); font-size: 14px; color: var(--green-900); background: var(--card);
}
.stats-controls input[type="date"]:focus { outline: 2px solid var(--green-100); border-color: var(--green-600); }
.stats-sep { color: var(--muted); font-size: 13px; }
.stats-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 16px; }
.sum-item {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 20px; box-shadow: var(--shadow);
}
.sum-item b { font-family: var(--serif); font-size: 24px; color: var(--green-900); margin-right: 10px; }
.sum-item span { font-size: 13px; color: var(--muted); }
.stats-chart {
  display: flex; align-items: flex-end; gap: 6px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 18px 12px; margin-bottom: 20px;
  min-height: 180px; overflow-x: auto;
}
.bar-col { flex: 1; min-width: 30px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 150px; }
.bar-val { font-size: 11.5px; color: var(--green-700); margin-bottom: 4px; font-weight: 600; }
.bar {
  width: 100%; max-width: 40px; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--green-600), var(--green-700));
  transition: height .3s;
}
.bar-label { font-size: 11px; color: var(--muted); margin-top: 6px; white-space: nowrap; }
.stats-subtitle { font-family: var(--serif); font-size: 16px; color: var(--green-950); margin: 6px 0 12px; }
.rank-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 12px 16px; margin-bottom: 8px;
}
.rank-no {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--green-50); color: var(--green-700); font-size: 12.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.rank-title { flex: 1; font-size: 14px; color: var(--green-900); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-title:hover { text-decoration: underline; }
.rank-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
@media (max-width: 720px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .stats-summary { grid-template-columns: 1fr; }
}
.admin-tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.admin-tabs button {
  border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 14px;
  padding: 8px 20px; border-radius: 999px; color: var(--muted); font-family: var(--sans);
}
.admin-tabs button.active { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.panel-head h3 { font-family: var(--serif); font-size: 20px; color: var(--green-950); }

.admin-table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
  text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600;
  background: var(--green-50); padding: 11px 18px; border-bottom: 1px solid var(--line); letter-spacing: 1px;
}
.admin-table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .row-title { font-weight: 600; max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-table .row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.admin-table .row-actions .btn { padding: 5px 12px; font-size: 12.5px; border-radius: 7px; }

/* 编辑器 */
.editor-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 30px; }
.editor-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 6px; }
.field textarea.tall { min-height: 380px; font-family: Consolas, Menlo, "PingFang SC", monospace; font-size: 14px; line-height: 1.9; }
.radio-row { display: flex; gap: 22px; align-items: center; }
.radio-row label { display: flex; gap: 7px; align-items: center; font-size: 14px; font-weight: 400; color: var(--ink); cursor: pointer; }
.md-preview {
  background: var(--green-50); border: 1px solid var(--green-100); border-radius: 10px;
  padding: 14px 20px; font-size: 13px; color: var(--muted); margin-bottom: 14px;
}

/* 评论管理 */
.comment-admin-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; margin-bottom: 12px; }
.comment-admin-item .ca-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.comment-admin-item .ca-meta { font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.comment-admin-item .ca-content { font-size: 14.5px; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.comment-admin-item .ca-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 760px) {
  .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 22px 14px; }
  .admin-stats { grid-template-columns: 1fr; }
  .comment-item.is-reply { margin-left: 14px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-hotline { text-align: left; }
  .footer-support { text-align: left; }
  .brand-sub { display: none; }
  .admin-table .hide-sm { display: none; }
}

/* ---------------- 修改密码模态 ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(11, 46, 35, .45); backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.open { display: flex; }
.modal-card {
  width: 100%; max-width: 400px; background: var(--card);
  border-radius: 16px; box-shadow: var(--shadow-lift); padding: 26px 28px;
}
.modal-card h4 { font-family: var(--serif); font-size: 18px; color: var(--green-950); margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

/* ---------------- 编辑器图片工具栏与正文图片 ---------------- */
.editor-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.md img { max-width: 100%; display: block; margin: 12px 0; border-radius: 10px; border: 1px solid var(--line); }

/* ---------------- 分类导航与分类徽标 ---------------- */
.cat-nav { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.cat-nav button {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  font-family: var(--sans); font-size: 14px; padding: 7px 18px; border-radius: 999px; cursor: pointer;
  transition: all .18s;
}
.cat-nav button:hover { border-color: var(--green-600); color: var(--green-700); }
.cat-nav button.active { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.tag-cat { background: var(--green-700); color: #fff; border-color: var(--green-700); }

/* ---------------- 点赞按钮 ---------------- */
.like-bar {
  display: flex; justify-content: center;
  margin-top: 34px; padding-top: 24px; border-top: 1px dashed var(--line-2);
}
.like-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid #e5b8b8; background: var(--card); color: var(--red);
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  padding: 10px 28px; border-radius: 999px; cursor: pointer;
  transition: all .18s;
}
.like-btn .heart { font-size: 17px; }
.like-btn:hover { background: var(--red-100); transform: translateY(-1px); }
.like-btn.liked { background: var(--red); border-color: var(--red); color: #fff; }
.like-btn:disabled { opacity: .6; cursor: wait; }

/* ============================================================
   全站主题（html[data-theme] 覆盖 :root 变量，浅色为默认）
   ============================================================ */

/* ---------------- 深色 ---------------- */
html[data-theme="dark"] {
  --bg: #0f1513;
  --card: #18221e;
  --ink: #dfeae4;
  --muted: #8ba398;
  --line: #2a3831;
  --line-2: #36483f;
  --green-950: #e6f4ec;
  --green-900: #cde8da;
  --green-700: #3bbd87;
  --green-600: #55d39d;
  --green-100: #223329;
  --green-50: #1b2921;
  --red: #e06666;
  --red-100: #33201f;
  --red-ink: #f0b0b0;
  --amber: #e0a44f;
  --amber-100: #33281a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .4);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .45), 0 14px 34px rgba(0, 0, 0, .5);
  --header-bg: rgba(15, 21, 19, .9);
  --topbar-bg: #121b17;
  --footer-bg: #0c120f;
  --hero-bg:
    radial-gradient(900px 420px at 85% -10%, rgba(23, 138, 99, .35), transparent 60%),
    radial-gradient(600px 380px at -10% 110%, rgba(20, 104, 75, .28), transparent 60%),
    linear-gradient(160deg, #081a13 0%, #0d3524 68%, #125c3e 100%);
}
html[data-theme="dark"] .status-draft { background: #26313a; color: #8fa3b8; }

/* ---------------- 简约（黑白灰） ---------------- */
html[data-theme="minimal"] {
  --bg: #fafafa;
  --card: #ffffff;
  --ink: #1c1c1c;
  --muted: #6f6f6f;
  --line: #e4e4e4;
  --line-2: #d4d4d4;
  --green-950: #141414;
  --green-900: #1f1f1f;
  --green-700: #333333;
  --green-600: #4d4d4d;
  --green-100: #ececec;
  --green-50: #f4f4f4;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .05);
  --shadow-lift: 0 4px 16px rgba(0, 0, 0, .08);
  --serif: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --header-bg: rgba(250, 250, 250, .92);
  --topbar-bg: #161616;
  --footer-bg: #161616;
  --hero-bg: linear-gradient(160deg, #191919 0%, #2e2e2e 100%);
}
html[data-theme="minimal"] .hero-badge .dot { background: #cfcfcf; box-shadow: none; }
html[data-theme="minimal"] .hero-badge { color: #e0e0e0; }

/* ---------------- 科技感（深空蓝 + 霓虹青） ---------------- */
html[data-theme="tech"] {
  --bg: #080d1c;
  --card: #0f1830;
  --ink: #d9e9ff;
  --muted: #7e93bd;
  --line: #1e2c4e;
  --line-2: #28395f;
  --green-950: #e8f4ff;
  --green-900: #c4e3ff;
  --green-700: #22d3ee;
  --green-600: #67e8f9;
  --green-100: #14234a;
  --green-50: #0e1936;
  --red: #f87171;
  --red-100: #331f2e;
  --red-ink: #fda4af;
  --amber: #fbbf24;
  --amber-100: #2e2812;
  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 26px rgba(0, 0, 0, .5);
  --shadow-lift: 0 0 0 1px rgba(34, 211, 238, .25), 0 14px 34px rgba(0, 0, 0, .55);
  --serif: "Consolas", "Menlo", "Courier New", "PingFang SC", monospace;
  --header-bg: rgba(8, 13, 28, .88);
  --topbar-bg: #080d1c;
  --footer-bg: #060a16;
  --hero-bg:
    radial-gradient(900px 420px at 85% -10%, rgba(34, 211, 238, .28), transparent 60%),
    radial-gradient(600px 380px at -10% 110%, rgba(59, 130, 246, .25), transparent 60%),
    linear-gradient(160deg, #070c1a 0%, #0e1a3a 60%, #123a5c 100%);
}
html[data-theme="tech"] .admin-top { border-bottom: 1px solid rgba(34, 211, 238, .35); }
html[data-theme="tech"] .btn { box-shadow: 0 0 12px rgba(34, 211, 238, .3); }
html[data-theme="tech"] .status-draft { background: #1c2745; color: #8fa3c8; }
html[data-theme="tech"] .like-btn { background: var(--card); }
html[data-theme="tech"] .hero-badge .dot { background: #22d3ee; box-shadow: 0 0 8px #22d3ee; }

/* ---------------- 主题选择卡片（后台） ---------------- */
.theme-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 720px) { .theme-grid { grid-template-columns: 1fr; } }
.theme-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px; cursor: pointer; text-align: left;
  font-family: var(--sans); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.theme-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.theme-card.active { border-color: var(--green-600); }
.theme-card b { font-size: 16px; color: var(--green-950); font-family: var(--serif); }
.theme-card .theme-desc { font-size: 12.5px; color: var(--muted); }
.theme-preview { display: flex; gap: 6px; margin-bottom: 4px; }
.theme-preview i { width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(0, 0, 0, .08); }
.tp-light i:nth-child(1) { background: #f5f7f6; }
.tp-light i:nth-child(2) { background: #ffffff; }
.tp-light i:nth-child(3) { background: #14684b; }
.tp-dark i:nth-child(1) { background: #0f1513; }
.tp-dark i:nth-child(2) { background: #18221e; }
.tp-dark i:nth-child(3) { background: #3bbd87; }
.tp-minimal i:nth-child(1) { background: #fafafa; }
.tp-minimal i:nth-child(2) { background: #ffffff; }
.tp-minimal i:nth-child(3) { background: #333333; }
.tp-tech i:nth-child(1) { background: #080d1c; }
.tp-tech i:nth-child(2) { background: #0f1830; }
.tp-tech i:nth-child(3) { background: #22d3ee; }
