:root {
  --ink: #1c2430;
  --muted: #66707d;
  --line: #e2e6ec;
  --bg: #f6f7f9;
  --brand: #1f6f4a;
  --brand-soft: #e8f5ee;
  --warn: #b45309;
  --danger: #b91c1c;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------- 后台 ---------------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 0 28px; height: 60px;
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.topbar .brand { font-weight: 700; font-size: 16px; color: var(--ink); }
.topbar nav { display: flex; gap: 20px; font-size: 14px; }
.topbar nav a { color: var(--muted); }
.topbar nav a:hover { color: var(--brand); text-decoration: none; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 20px 64px; }

.msg {
  background: var(--brand-soft); border: 1px solid #bfe3cf; color: #14523a;
  padding: 11px 16px; border-radius: 10px; font-size: 14px; margin-bottom: 18px;
}

.cards {
  display: grid; grid-template-columns: repeat(4, minmax(0, 158px));
  gap: 12px; margin-bottom: 18px; justify-content: start;
}
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px;
}
.card .num { font-size: 24px; font-weight: 700; line-height: 1.2; }
.card .label { font-size: 13px; color: var(--muted); margin-top: 4px; }

.panel {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px;
}
.panel h2 { font-size: 16px; margin: 0 0 14px; }
.panel .hint { font-size: 13px; color: var(--muted); line-height: 1.7; }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a {
  padding: 7px 14px; border-radius: 999px; font-size: 14px;
  background: #fff; border: 1px solid var(--line); color: var(--muted);
}
.tabs a.on { background: var(--ink); border-color: var(--ink); color: #fff; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
td.title { font-weight: 600; }
td.meta { color: var(--muted); font-size: 13px; white-space: nowrap; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge.low { background: #e8f5ee; color: #1a6b45; }
.badge.medium { background: #fdf0e2; color: var(--warn); }
.badge.high { background: #fdeaea; color: var(--danger); }
.badge.pending { background: #eef2ff; color: #3b4bb5; }
.badge.published { background: #e8f5ee; color: #1a6b45; }
.badge.rejected { background: #f1f2f4; color: #6b7280; }
.badge.draft { background: #f1f2f4; color: #4a5462; }

.btn {
  display: inline-block; padding: 9px 18px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 14px; cursor: pointer; font-family: inherit;
  text-decoration: none;
}
.btn:hover { border-color: #c9d0d9; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #1a5c3d; }
.btn.danger { color: var(--danger); border-color: #f0c9c9; }
.btn.small { padding: 5px 12px; font-size: 13px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input[type=text], .field input[type=password], .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 15px; font-family: inherit; color: var(--ink); background: #fff;
}
.field textarea { line-height: 1.75; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid #bfe3cf; border-color: var(--brand);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* 审核编辑页：左边改、右边实时看 */
.editor-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px; align-items: start;
}


/* 顶部一条：合规体检 + 来源标识（压缩成单行，高度尽量小） */
.meta-row { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }
.meta-row .panel { padding: 10px 16px; margin-bottom: 14px; }
.meta-line {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted); line-height: 1.55;
  max-height: 54px; overflow-y: auto;
}
.meta-label { font-weight: 600; font-size: 14px; color: var(--ink); flex: none; }
.chip {
  background: #f1f2f4; border-radius: 6px; padding: 1px 8px;
  font-size: 12px; color: #4a5462; white-space: nowrap;
}
.chip.warn { background: #fdeaea; color: #a12d2d; }
.chip.mid { background: #fdf3e3; color: #8a5a12; }

/* 编辑区顶部的审核操作条 */
.action-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 14px; padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}
.preview-col { position: sticky; top: 76px; max-height: calc(100vh - 90px); overflow-y: auto; }
@media (max-width: 900px) {
  .editor-layout, .meta-row { grid-template-columns: 1fr; }
  .preview-col { position: static; max-height: none; overflow: visible; }
}

.issue { padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; line-height: 1.7; }
.issue:last-child { border-bottom: none; }
.issue b { font-weight: 700; }

.article-body { font-size: 17px; line-height: 1.95; }
.article-body h2 { font-size: 18px; margin: 22px 0 10px; }
.article-body p { margin: 0 0 14px; }
.article-body ul, .article-body ol { padding-left: 22px; margin: 0 0 16px; }
.article-body li { margin-bottom: 8px; }

.pager { display: flex; gap: 10px; justify-content: center; margin-top: 22px; font-size: 14px; }

.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.preview-note {
  font-size: 13px; color: var(--muted); background: #f2f3f5;
  border-radius: 8px; padding: 9px 12px; margin-bottom: 16px;
}
.preview-card { padding: 2px 0 6px; }
.preview-card h1 { font-size: 24px; line-height: 1.42; margin: 0 0 10px; }
.preview-card .article-meta { margin-bottom: 14px; }
.preview-card .article-cover { max-width: 320px; margin: 12px 0 6px; }
.preview-col .panel { margin-bottom: 0; }

.preview-bar {
  background: var(--ink); color: #fff; font-size: 14px;
  padding: 10px 20px; display: flex; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; position: sticky; top: 0; z-index: 30;
}
.preview-bar a { color: #9fd8bb; }

/* ---------------- 前台 ---------------- */
.site-header {
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 18px 20px;
}
.site-header .inner { max-width: 820px; margin: 0 auto; }
.site-header .name { font-size: 22px; font-weight: 800; color: var(--ink); }
.site-header .desc { font-size: 14px; color: var(--muted); margin-top: 4px; }

.site-main { max-width: 820px; margin: 0 auto; padding: 22px 18px 60px; }

.cat-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.cat-bar a {
  font-size: 16px; padding: 7px 16px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); color: var(--muted);
}
.cat-bar a.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.post-list { display: grid; gap: 16px; }
.post {
  display: grid; grid-template-columns: 200px 1fr; gap: 18px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; color: inherit;
}
.post:hover { border-color: #c9d0d9; text-decoration: none; }
/* 封面是小型胶囊图，按原始尺寸居中显示，不放大不裁切 */
.post img {
  width: auto; height: auto; max-width: 100%; max-height: 120px;
  justify-self: center; align-self: center;
  border-radius: 9px; display: block;
}
.post h3 { font-size: 21px; margin: 2px 0 8px; line-height: 1.45; color: var(--ink); }
.post p { font-size: 16px; color: var(--muted); margin: 0 0 10px; line-height: 1.7; }
.post .cat { font-size: 14px; color: var(--brand); }

.article-head { margin-bottom: 18px; }
.article-head h1 { font-size: 30px; line-height: 1.4; margin: 0 0 12px; }
.article-meta { font-size: 14px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
/* 封面按图片自身尺寸显示：生成的胶囊图很小，实拍图也不会被拉变形 */
.article-cover { width: auto; height: auto; max-width: 100%; border-radius: var(--radius); margin: 18px 0 8px; display: block; }

.article-content { font-size: 19px; line-height: 2; color: #222a35; }
.article-content h2 { font-size: 22px; margin: 30px 0 12px; padding-left: 12px; border-left: 5px solid var(--brand); }
.article-content p { margin: 0 0 18px; }
.article-content .lead {
  font-size: 19px; color: #3c4654; background: #f2f6f4;
  padding: 14px 16px; border-radius: 10px; margin: 0 0 22px;
}
.article-content ul, .article-content ol { padding-left: 26px; margin: 0 0 20px; }
.article-content li { margin-bottom: 10px; }
.article-content figure { margin: 26px 0; }
.article-content figure img {
  width: 100%; height: auto; display: block;
  border-radius: 12px; background: #f1f2f4;
}
.article-content figcaption {
  font-size: 15px; color: var(--muted); line-height: 1.75;
  margin-top: 10px; text-align: center;
}
.article-content .checklist {
  background: #fff; border: 2px dashed #bfe3cf; border-radius: 12px;
  padding: 6px 20px 14px; margin: 26px 0;
}
.article-content .checklist h2 { border-left: none; padding-left: 0; font-size: 20px; }
.article-content .disclaimer {
  background: #fdf7ec; border: 1px solid #f3e2c0; border-radius: 10px;
  padding: 14px 18px; margin: 28px 0 10px; font-size: 16px; line-height: 1.85; color: #6b5220;
}
.article-content .disclaimer p { margin: 6px 0 0; }

.ai-label {
  font-size: 14px; color: var(--muted); background: #f2f3f5;
  border-radius: 8px; padding: 10px 14px; margin-top: 26px; line-height: 1.7;
}

.related { margin-top: 34px; }
.related h2 { font-size: 18px; }
.related a { display: block; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 17px; }

.site-footer {
  text-align: center; font-size: 14px; color: var(--muted);
  padding: 26px 20px 40px; line-height: 1.9;
}

.empty { text-align: center; color: var(--muted); padding: 60px 0; font-size: 16px; }

@media (max-width: 720px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .row { grid-template-columns: 1fr; }
  .post { grid-template-columns: 1fr; }
  .post img { max-height: 120px; }
  .article-head h1 { font-size: 25px; }
  .article-content { font-size: 18px; }
  .topbar { padding: 0 16px; }
  .topbar nav { gap: 12px; font-size: 13px; }
}
