:root {
  --bg: #0c1412;
  --bg-elev: #121e1b;
  --panel: rgba(22, 35, 31, .78);
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .18);
  --text: #f3f0e6;
  --muted: rgba(243, 240, 230, .58);
  --accent: #ffe29a;
  --accent-dim: rgba(255, 226, 154, .14);
  --ok: #6ee7b7;
  --warn: #fbbf24;
  --danger: #fca5a5;
  --radius: 18px;
  --serif: "Noto Serif SC", "Songti SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", sans-serif;
  --display: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--sans); background: var(--bg); color: var(--text);
  min-height: 100vh; -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(900px 420px at 15% -10%, rgba(58, 123, 213, .16), transparent 65%),
    radial-gradient(800px 400px at 88% 0%, rgba(232, 111, 143, .13), transparent 60%);
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------------- 登录门禁 ---------------- */
.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden;
}
.login-card {
  width: 100%; max-width: 420px; border-radius: 24px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line-strong);
  backdrop-filter: blur(20px); box-shadow: 0 32px 80px rgba(0, 0, 0, .45);
}
.login-cover { height: 148px; position: relative; overflow: hidden; }
.login-cover .cover { width: 100%; height: 100%; display: block; }
.login-cover-title {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 20px 28px; background: linear-gradient(to top, rgba(12, 20, 18, .92), transparent 70%);
}
.login-cover-title span { font-family: var(--display); font-style: italic; color: var(--accent); font-size: 18px; }
.login-cover-title h1 { font-family: var(--serif); font-size: 24px; font-weight: 600; letter-spacing: .06em; }
.login-body { padding: 24px 28px 30px; }
.login-body p { font-size: 13.5px; color: var(--muted); line-height: 1.7; margin-bottom: 18px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; letter-spacing: .06em; }
.input, .select, .textarea {
  width: 100%; padding: 10px 14px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: rgba(0, 0, 0, .26);
  color: var(--text); font-size: 14px; outline: none; transition: border-color .25s, background .25s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); background: rgba(0, 0, 0, .38); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.75; }
.textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13.5px; min-height: 260px; }

.btn-pri, .btn-sec, .btn-danger {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 500; transition: transform .2s, opacity .2s, border-color .25s, background .25s;
  white-space: nowrap;
}
.btn-pri { background: var(--accent); color: #101a17; font-weight: 600; }
.btn-pri:hover { transform: translateY(-1px); opacity: .94; }
.btn-sec { background: rgba(255, 255, 255, .06); border-color: var(--line-strong); color: var(--text); }
.btn-sec:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .3); color: var(--danger); }
.btn-danger:hover { background: rgba(248, 113, 113, .2); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 999px; }

.login-hint {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; font-size: 12px; color: var(--muted);
}
.login-hint button { border: 0; background: none; color: var(--accent); text-decoration: underline; font-size: 12px; }
.err-msg { color: var(--danger); font-size: 13px; margin-bottom: 12px; min-height: 18px; }

/* ---------------- 工作台主框架 ---------------- */
.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 24px 16px;
  background: rgba(10, 17, 15, .85); border-right: 1px solid var(--line);
  backdrop-filter: blur(16px); display: flex; flex-direction: column; justify-content: space-between;
}
.brand { padding: 6px 12px 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.brand-logo { font-family: var(--display); font-style: italic; font-size: 28px; display: flex; align-items: baseline; gap: 8px; }
.brand-logo em { font-family: var(--serif); font-style: normal; font-size: 12px; color: var(--accent); letter-spacing: .16em; }
.engine-pill {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  padding: 3px 10px; border-radius: 999px; background: rgba(110, 231, 183, .1);
  border: 1px solid rgba(110, 231, 183, .28); color: var(--ok); font-size: 11.5px;
}
.engine-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid transparent;
  background: none; text-align: left; font-size: 14px; color: var(--muted);
  transition: background .25s, color .25s, border-color .25s;
}
.side-btn span { display: inline-flex; align-items: center; gap: 10px; }
.side-btn:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.side-btn.active { background: var(--accent-dim); border-color: rgba(255, 226, 154, .3); color: var(--accent); font-weight: 600; }
.badge-cnt {
  padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: rgba(251, 191, 36, .2); color: var(--warn); border: 1px solid rgba(251, 191, 36, .4);
}
.side-foot { padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }

/* ---------------- 主内容区 ---------------- */
.main { padding: 28px 36px 64px; max-width: 1260px; width: 100%; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.topbar h2 { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: .04em; }
.topbar p { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
  padding: 20px 22px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line);
  transition: border-color .3s, transform .3s;
}
.stat-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.stat-card.warn { border-color: rgba(251, 191, 36, .35); background: linear-gradient(145deg, rgba(251, 191, 36, .09), var(--panel)); }
.stat-card small { font-size: 12.5px; color: var(--muted); letter-spacing: .08em; }
.stat-card b { display: block; font-family: var(--display); font-size: 38px; font-weight: 600; margin: 6px 0 4px; color: var(--text); }
.stat-card.warn b { color: var(--warn); }
.stat-card span { font-size: 12px; color: var(--muted); }

.panel {
  border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line);
  padding: 22px 24px; margin-bottom: 22px;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.panel-head h3 { font-family: var(--serif); font-size: 18px; font-weight: 600; }

/* ---------------- 评论管理列表 ---------------- */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.pill-btn {
  height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .04); font-size: 13px; color: var(--muted);
}
.pill-btn.active { background: var(--accent); border-color: var(--accent); color: #101a17; font-weight: 600; }
.filter-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-group .input, .filter-group .select { width: auto; height: 34px; padding: 0 12px; font-size: 13px; }

.batch-bar {
  display: none; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; margin-bottom: 14px; border-radius: 12px;
  background: var(--accent-dim); border: 1px solid rgba(255, 226, 154, .32); font-size: 13px;
}
.batch-bar.on { display: flex; }

.cm-list { display: flex; flex-direction: column; gap: 12px; }
.cm-card {
  padding: 18px 20px; border-radius: 15px; background: rgba(0, 0, 0, .2);
  border: 1px solid var(--line); transition: border-color .25s;
}
.cm-card.pending { border-left: 3px solid var(--warn); }
.cm-card.hidden { opacity: .62; }
.cm-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cm-meta { display: inline-flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 13.5px; }
.cm-post-tag {
  font-size: 12px; padding: 2px 9px; border-radius: 6px;
  background: rgba(255, 255, 255, .06); color: var(--accent);
}
.st-badge { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; font-weight: 500; }
.st-approved { background: rgba(110, 231, 183, .14); color: var(--ok); }
.st-pending { background: rgba(251, 191, 36, .18); color: var(--warn); }
.st-hidden { background: rgba(255, 255, 255, .1); color: var(--muted); }
.cm-content { font-size: 14.5px; line-height: 1.75; margin: 8px 0 12px 26px; white-space: pre-wrap; }
.cm-reply-show {
  margin: 0 0 12px 26px; padding: 10px 14px; border-radius: 10px;
  background: var(--accent-dim); border-left: 2px solid var(--accent); font-size: 13.5px;
}
.cm-reply-box { display: none; gap: 8px; margin: 10px 0 4px 26px; }
.cm-reply-box.on { display: flex; }
.cm-actions { display: flex; gap: 8px; margin-left: 26px; flex-wrap: wrap; }

/* ---------------- 文章与作品编辑器 ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: rgba(255, 255, 255, .025); }
.mini-cover { width: 68px; height: 44px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line-strong); }
.mini-cover .cover { width: 100%; height: 100%; display: block; }

.editor-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) 340px; gap: 22px; align-items: start; }
.cover-studio { border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 10; border: 1px solid var(--line-strong); margin-bottom: 14px; }
.cover-studio .cover { width: 100%; height: 100%; display: block; }
.md-tools { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; align-items: center; }
.md-split { display: grid; grid-template-columns: 1fr; gap: 14px; }
.md-split.preview-on { grid-template-columns: 1fr 1fr; }
.md-preview {
  display: none; min-height: 260px; max-height: 440px; overflow-y: auto;
  padding: 16px 20px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, .28); font-family: var(--serif); font-size: 14.5px; line-height: 1.9;
}
.md-split.preview-on .md-preview { display: block; }
.md-preview h2 { font-size: 20px; margin: 1.2em 0 .4em; color: var(--text); }
.md-preview h3 { font-size: 16px; margin: 1em 0 .4em; color: var(--accent); }
.md-preview blockquote { border-left: 2px solid var(--accent); padding-left: 12px; margin: 1em 0; opacity: .9; }
.md-preview pre { background: rgba(0, 0, 0, .35); padding: 12px; border-radius: 8px; overflow: auto; font-size: 12.5px; }
.md-preview img { max-width: 100%; border-radius: 10px; }
.md-preview .md-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 10px 0; }
.md-preview .md-table th, .md-preview .md-table td { border: 1px solid var(--line); padding: 6px 10px; }
.vip-badge {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(255, 226, 154, .38);
}
.invite-banner {
  padding: 14px 18px; border-radius: 12px; margin-bottom: 16px;
  background: var(--accent-dim); border: 1px solid rgba(255, 226, 154, .4);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13.5px;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

.switch-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 16px; border-radius: 12px; background: rgba(0, 0, 0, .2); border: 1px solid var(--line);
}
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 999;
  padding: 12px 20px; border-radius: 999px; background: var(--accent); color: #101a17;
  font-weight: 600; font-size: 13.5px; box-shadow: 0 12px 32px rgba(0, 0, 0, .4);
  opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity .3s, transform .35s;
}
.toast.on { opacity: 1; transform: none; }

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .editor-grid { grid-template-columns: 1fr; }
}
