/* Nodexel 内容后台样式。与主站同一套配色，但完全独立于 styles.css。 */
:root {
  --accent: #39c98d;
  --accent-strong: #21aa72;
  --ink-950: #06100e;
  --ink-900: #091612;
  --ink-800: #11231e;
  --paper: #f5f7f2;
  --paper-cool: #eef2ed;
  --surface: #ffffff;
  --text: #13211d;
  --text-soft: #56645f;
  --line: rgba(18, 34, 29, .14);
  --danger: #d8452f;
  --warning: #b5771a;
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font-family: var(--font); font-size: 14px; line-height: 1.6;
}
a { color: var(--accent-strong); }
code { padding: 1px 5px; border-radius: 4px; background: var(--paper-cool); font-size: .92em; }

/* ---- 顶栏 ---- */
.topbar {
  display: flex; align-items: center; gap: 28px;
  padding: 0 24px; height: 56px;
  background: var(--ink-950); color: #fff;
}
.brand { display: flex; align-items: baseline; gap: 8px; color: #fff; font-weight: 700;
  letter-spacing: .04em; text-decoration: none; }
.brand span { color: var(--accent); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.topnav { display: flex; gap: 4px; margin-right: auto; }
.topnav a { padding: 6px 14px; border-radius: 99px; color: rgba(255,255,255,.72);
  text-decoration: none; transition: background .2s, color .2s; }
.topnav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.topnav a.active { color: #06231a; background: var(--accent); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-right .ext { color: rgba(255,255,255,.6); font-size: 13px; text-decoration: none; }
.topbar-right .ext:hover { color: var(--accent); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 26px 24px 64px; }

/* ---- 通用块 ---- */
.page-head { display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.42rem; }
.page-head .count { margin-left: 6px; color: var(--text-soft); font-size: 1rem; font-weight: 400; }
.page-actions { display: flex; align-items: center; gap: 10px; }
.page-actions form { margin: 0; }
.saved-tip { color: var(--accent-strong); font-size: 13px; }

/* 保存后的下一步引导：状态改了不等于上线，还要点发布 */
.notice { display: flex; align-items: center; justify-content: space-between;
  gap: 18px; margin-bottom: 18px; padding: 14px 18px; border-radius: var(--radius);
  font-size: 13px; line-height: 1.7; }
.notice form { margin: 0; flex-shrink: 0; }
.notice-next { border: 1px solid rgba(33,170,114,.3); background: rgba(57,201,141,.09); }
.notice-pending { border: 1px solid rgba(181,119,26,.35); background: rgba(181,119,26,.1); }
.pending-list { margin: 6px 0; padding-left: 18px; }
.pending-list li { margin-bottom: 2px; }

.panel { margin-bottom: 18px; padding: 20px 22px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); }
.panel h2 { margin: 0 0 14px; font-size: .95rem; }
.panel h2:not(:first-child) { margin-top: 22px; }
.muted { color: var(--text-soft); font-size: 13px; }
.hint { display: block; margin-top: 6px; color: var(--text-soft); font-size: 12px; }

/* ---- 按钮 ---- */
.btn { display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 18px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--paper-cool); color: var(--text); font-family: inherit; font-size: 14px;
  text-decoration: none; cursor: pointer; transition: filter .2s, background .2s; }
.btn:hover { filter: brightness(.96); }
.btn-primary { background: var(--accent-strong); color: #fff; }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---- 统计 ---- */
.stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); }
.stat b { display: block; font-size: 1.7rem; line-height: 1.2; }
.stat span { color: var(--text-soft); font-size: 12px; }
.stat-warn b { color: var(--warning); }

/* ---- 徽标 / 提示条 ---- */
.badge { display: inline-block; margin: 0 0 10px; padding: 5px 12px; border-radius: 99px;
  font-size: 13px; }
.badge-ok { background: rgba(57,201,141,.14); color: var(--accent-strong); }
.badge-fail { background: rgba(216,69,47,.12); color: var(--danger); }
.badge-warn { background: rgba(181,119,26,.13); color: var(--warning); }
.banner { margin: 0 0 18px; padding: 14px 18px; border-radius: var(--radius); font-size: 14px; }
.banner-ok { background: rgba(57,201,141,.14); color: #15694a; }
.banner-fail { background: rgba(216,69,47,.1); color: #96301f; }

.issue-list { margin: 0; padding-left: 18px; }
.issue-list li { margin-bottom: 8px; }
.issue-list small { color: var(--text-soft); }
.issue-warn li b { color: var(--warning); }
.plain-list { margin: 0; padding-left: 18px; color: var(--text-soft); }
.plain-list li { margin-bottom: 6px; }
.file-list { margin: 0 0 8px; padding: 0; list-style: none; font-family: ui-monospace, monospace;
  font-size: 13px; }
.file-list li { padding: 3px 0; }
.f-write::before { content: "+ "; color: var(--accent-strong); }
.f-remove::before { content: "− "; color: var(--danger); }
.f-draft::before { content: "· "; color: var(--text-soft); }

/* ---- 表格 ---- */
.table { width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: var(--paper-cool); color: var(--text-soft); font-size: 12px;
  font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.row-title { display: block; color: var(--text); font-weight: 600; text-decoration: none; }
.row-title:hover { color: var(--accent-strong); }
.slug { color: var(--text-soft); font-family: ui-monospace, monospace; font-size: 12px; }
.col-date, .col-status, .col-tag { width: 120px; }
.col-op { width: 130px; }
.col-op a { margin-right: 10px; font-size: 13px; }
.chip { padding: 2px 9px; border: 1px solid var(--line); border-radius: 99px;
  color: var(--text-soft); font-size: 12px; }
.pill { padding: 3px 11px; border-radius: 99px; font-size: 12px; }
.pill-ok { background: rgba(57,201,141,.16); color: var(--accent-strong); }
.pill-draft { background: var(--paper-cool); color: var(--text-soft); }

/* ---- 表单 ---- */
.field-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 16px; }
.field-grid label { display: flex; flex-direction: column; gap: 5px;
  color: var(--text-soft); font-size: 12px; }
.field-grid .f-wide { grid-column: 1 / -1; }
input[type=text], input[type=date], input[type=number], input[type=password],
select, textarea {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-family: inherit; font-size: 14px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(57,201,141,.15);
}
input[readonly] { background: var(--paper-cool); color: var(--text-soft); }
textarea { resize: vertical; line-height: 1.7; }
.counter { align-self: flex-start; padding: 2px 8px; border-radius: 99px;
  background: var(--paper-cool); font-size: 11px; }
.counter.ok { background: rgba(57,201,141,.16); color: var(--accent-strong); }
.counter.over { background: rgba(216,69,47,.14); color: var(--danger); font-weight: 600; }
.counter.under { background: rgba(181,119,26,.14); color: var(--warning); }

/* ---- 配图选择 ---- */
.thumb-picker { display: grid; grid-template-columns: 1fr 1fr 300px; gap: 16px; align-items: start; }
.thumb-picker label { display: flex; flex-direction: column; gap: 5px;
  color: var(--text-soft); font-size: 12px; }
.thumb-preview { border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--ink-900); aspect-ratio: 256 / 152; }
.thumb-preview-case { aspect-ratio: 300 / 160; }
.thumb-item { width: 100%; height: 100%; }
.thumb-preview svg { display: block; width: 100%; height: 100%; }

/* ---- 编辑器 ---- */
.panel-editor { padding-bottom: 16px; }
.editor-head { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; }
.editor-head h2 { margin: 0; }
.mode-switch { display: flex; gap: 2px; padding: 3px; border-radius: 99px;
  background: var(--paper-cool); }
.mode-btn { padding: 5px 14px; border: 0; border-radius: 99px; background: transparent;
  color: var(--text-soft); font-family: inherit; font-size: 12px; cursor: pointer; }
.mode-btn.is-active { background: var(--surface); color: var(--text); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.editor-split { display: grid; gap: 14px; min-height: 460px; }
.editor-split[data-mode="split"] { grid-template-columns: 1fr 1fr; }
.editor-split[data-mode="edit"] { grid-template-columns: 1fr; }
.editor-split[data-mode="edit"] .preview-pane { display: none; }
.editor-split[data-mode="preview"] { grid-template-columns: 1fr; }
.editor-split[data-mode="preview"] .editor-pane { display: none; }
.editor-pane textarea { width: 100%; height: 100%; min-height: 460px; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 13px;
  line-height: 1.8; }
.preview-pane { position: relative; overflow: auto; max-height: 620px; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.preview-status { position: sticky; top: 0; float: right; padding: 2px 9px;
  border-radius: 99px; background: var(--paper-cool); color: var(--text-soft); font-size: 11px; }
.preview-error { color: var(--danger); }

/* 预览区排版，尽量贴近站点文章正文观感 */
.preview-pane .article-body h2 { margin: 22px 0 10px; font-size: 1.1rem; }
.preview-pane .article-body h3 { margin: 18px 0 8px; font-size: .98rem; }
.preview-pane .article-body p { margin: 0 0 14px; color: #3d4a45; line-height: 1.85; }
.preview-pane .article-body ul, .preview-pane .article-body ol { margin: 0 0 16px;
  padding-left: 20px; color: #3d4a45; line-height: 1.85; }
.preview-pane .article-body li { margin-bottom: 6px; }
.preview-pane .article-body li::marker { color: var(--accent-strong); }
.preview-pane .article-body blockquote { margin: 18px 0; padding: 12px 16px;
  border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0;
  background: rgba(57,201,141,.07); }
.preview-pane .article-body .article-lead { color: var(--text); font-weight: 500; }
.preview-pane .article-body .figure-note { color: var(--text-soft); font-size: 12px;
  text-align: center; }

/* ---- 登录页 ---- */
.login-body { display: flex; align-items: center; justify-content: center;
  min-height: 100vh; background: var(--ink-950); }
.login-card { width: 340px; padding: 34px 30px 28px; border-radius: 16px;
  background: var(--surface); box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.login-brand { margin: 0 0 4px; color: var(--accent-strong); font-size: 12px;
  font-weight: 700; letter-spacing: .16em; }
.login-card h1 { margin: 0 0 22px; font-size: 1.24rem; }
.login-card label { display: block; margin-bottom: 6px; color: var(--text-soft); font-size: 12px; }
.login-card input { width: 100%; margin-bottom: 16px; }
.login-error { margin: 0 0 14px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: rgba(216,69,47,.1); color: var(--danger); font-size: 13px; }
.login-note { margin: 14px 0 0; color: var(--text-soft); font-size: 11px; text-align: center; }

@media (max-width: 980px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .thumb-picker { grid-template-columns: 1fr; }
  .editor-split[data-mode="split"] { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .field-grid { grid-template-columns: 1fr; }
  .topnav { gap: 0; }
  .topbar { gap: 14px; padding: 0 14px; }
}
