:root {
  --bg: #f5f6f8; --card: #fff; --text: #1f2328; --muted: #6b7280; --border: #e5e7eb;
  --primary: #4f46e5; --primary-hover: #4338ca; --danger: #dc2626; --success: #16a34a; --warn: #d97706;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #111318; --card: #1b1e25; --text: #e6e8eb; --muted: #9aa1ac; --border: #2c313a;
          --primary: #818cf8; --primary-hover: #a5b4fc; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }

.topbar { background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.nav a { color: var(--text); }
main { padding: 20px 16px; }
.footer { color: var(--muted); font-size: 13px; padding: 24px 16px 40px; text-align: center; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; }
.narrow { max-width: 420px; margin: 40px auto; }
.empty { text-align: center; padding: 40px; color: var(--muted); }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
.side-col { position: sticky; top: 76px; }
.side-col h3 { margin: 0 0 8px; font-size: 16px; }
.hot-list { margin: 0; padding-left: 22px; }
.hot-list li { margin: 6px 0; font-size: 14px; }
.hot-list.plain { list-style: none; padding-left: 0; }
.hot-list a { color: var(--text); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; }
.tabs a { padding: 6px 14px; border-radius: 999px; color: var(--text); border: 1px solid var(--border); background: var(--card); }
.tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

input, select, textarea, button { font: inherit; color: var(--text); }
input, select, textarea { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; }
textarea { resize: vertical; width: 100%; }
button { cursor: pointer; background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 7px 14px; }
button:disabled { opacity: .6; cursor: not-allowed; }
.btn { display: inline-block; background: var(--primary); color: #fff !important; border: none; border-radius: 6px; padding: 8px 18px; text-decoration: none !important; }
.btn:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); }
button.link { background: none; border: none; padding: 0; color: var(--primary); }
button.link.danger { color: var(--danger); }
form.inline { display: inline; }

.news-item { display: flex; gap: 16px; }
.news-item .thumb { width: 160px; height: 100px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
@media (max-width: 600px) { .news-item .thumb { display: none; } }
.news-body { min-width: 0; }
.news-item h2 { font-size: 17px; margin: 0 0 6px; line-height: 1.45; }
.news-item h2 a { color: var(--text); }
.summary { margin: 0 0 8px; color: var(--muted); font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; }

.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: rgba(79, 70, 229, .1); color: var(--primary); }
.badge-pin { background: rgba(220, 38, 38, .12); color: var(--danger); margin-right: 4px; }
.status-published, .status-success { background: rgba(22, 163, 74, .12); color: var(--success); }
.status-draft, .status-running, .status-partial { background: rgba(217, 119, 6, .12); color: var(--warn); }
.status-failed { background: rgba(220, 38, 38, .12); color: var(--danger); }

.article h1 { font-size: 24px; line-height: 1.4; margin: 0 0 10px; }
.article .cover { max-width: 100%; border-radius: 8px; margin: 16px 0; }
.article .lead { margin: 16px 0; padding: 10px 16px; border-left: 4px solid var(--primary); background: rgba(79, 70, 229, .06); color: var(--muted); }
.article .content { font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }

.pager { display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 20px 0; }
.pager a, .pager span.current { padding: 4px 11px; border: 1px solid var(--border); border-radius: 6px; background: var(--card); }
.pager span.current { background: var(--primary); border-color: var(--primary); color: #fff; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.flash-success { background: rgba(22, 163, 74, .12); color: var(--success); }
.flash-error { background: rgba(220, 38, 38, .12); color: var(--danger); }

.form { display: flex; flex-direction: column; gap: 14px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.form label.check { flex-direction: row; align-items: center; gap: 8px; }
.form input:not([type=checkbox]), .form select { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }
.row { display: flex; gap: 10px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-between h2, .row-between h3 { margin: 8px 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { display: flex; flex-direction: column; margin: 0; }
.stat b { font-size: 26px; }
.stat span { color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.title-cell { min-width: 260px; }
.actions { white-space: nowrap; }
.actions > * { margin-right: 8px; }
.bulk-bar { display: flex; gap: 8px; margin-bottom: 10px; }
pre { white-space: pre-wrap; margin: 6px 0 0; font-size: 12px; }
