:root {
  --bg: #0b0f0c;
  --panel: #121a13;
  --panel2: #162019;
  --line: rgba(244, 243, 232, .12);
  --text: #f4f3e8;
  --muted: #9aa598;
  --accent: #d8ff3d;
  --danger: #ff6b6b;
  --ok: #59d98c;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1100px 520px at 50% -12%, #16210f 0%, var(--bg) 58%);
  color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--accent); text-decoration: none; }
button {
  font: inherit; cursor: pointer; border: 1px solid var(--line); color: var(--text);
  background: var(--panel2); border-radius: 10px; padding: 9px 16px; transition: .15s;
}
button:hover { border-color: rgba(216,255,61,.45); }
button.primary { background: var(--accent); color: #0b0f0c; border-color: var(--accent); font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: transparent; }
button.danger { color: var(--danger); }
button.small { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, textarea, select {
  font: inherit; color: var(--text); background: #0e150f; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%; outline: none;
}
input:focus, textarea:focus { border-color: rgba(216,255,61,.5); }
label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
label input, label textarea { margin-top: 6px; }

/* 登录 */
.login-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; background: rgba(18,26,19,.85); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px; backdrop-filter: blur(8px);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
}
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.brand.small { margin: 0 0 18px; gap: 10px; }
.logo {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent); color: #0b0f0c; font-weight: 800; font-size: 20px;
}
.brand.small .logo { width: 32px; height: 32px; font-size: 15px; border-radius: 9px; }
.brand h1 { margin: 0; font-size: 18px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.remember { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.remember input { width: auto; margin: 0; }
#login-btn { width: 100%; margin-top: 6px; }
.msg { color: var(--danger); font-size: 13px; min-height: 20px; margin: 10px 0 0; }

/* 布局 */
#app { display: flex; min-height: 100%; }
.sidebar {
  width: 210px; flex: 0 0 210px; border-right: 1px solid var(--line); padding: 22px 16px;
  display: flex; flex-direction: column; gap: 10px; background: rgba(10,14,10,.5);
  position: sticky; top: 0; height: 100vh;
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.sidebar nav a {
  color: var(--muted); padding: 9px 12px; border-radius: 10px; font-size: 14px; transition: .15s;
}
.sidebar nav a:hover { background: var(--panel2); color: var(--text); }
.sidebar nav a.active { background: rgba(216,255,61,.1); color: var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 20px; }
.page-head .sub { color: var(--muted); font-size: 13px; margin-top: 3px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.grid { display: grid; gap: 12px; }
.grid.cols2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.pill {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px;
  border: 1px solid var(--line); color: var(--muted);
}
.pill.ok { color: var(--ok); border-color: rgba(89,217,140,.35); }
.pill.bad { color: var(--danger); border-color: rgba(255,107,107,.35); }
.pill.auto { color: #ffc46b; border-color: rgba(255,196,107,.35); }

/* 列表 */
.post-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--panel); transition: .15s; cursor: pointer;
}
.post-row:hover { border-color: rgba(216,255,61,.35); background: var(--panel2); }
.post-row .t { font-weight: 600; }
.post-row .meta { color: var(--muted); font-size: 12.5px; }

/* 编辑器 */
.editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.editor textarea.body {
  min-height: 46vh; resize: vertical; font-family: var(--mono); font-size: 13.5px; line-height: 1.75;
}
.editor .split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .editor .split { grid-template-columns: 1fr; } }
.preview { border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #0e150f; overflow: auto; min-height: 46vh; }
.preview h1, .preview h2, .preview h3 { margin: 1em 0 .4em; }
.preview pre { background: #0a0f0b; padding: 12px; border-radius: 10px; overflow: auto; }
.preview code { font-family: var(--mono); font-size: 12.5px; }
.preview blockquote { border-left: 3px solid var(--line); margin: 0; padding-left: 12px; color: var(--muted); }
.preview img { max-width: 100%; border-radius: 10px; }

/* 资源 */
.assets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.asset { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--panel); }
.asset .thumb { height: 120px; display: grid; place-items: center; background: #0e150f; color: var(--muted); font-size: 12px; overflow: hidden; }
.asset .thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset .info { padding: 10px 12px; font-size: 12px; }
.asset .info .n { word-break: break-all; font-family: var(--mono); font-size: 11.5px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }

/* toast */
.toast {
  position: fixed; right: 20px; bottom: 20px; max-width: 420px; padding: 12px 16px;
  background: #1a2419; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.4); white-space: pre-wrap; z-index: 50;
}
.toast.err { border-color: rgba(255,107,107,.5); color: #ffb3b3; }
.toast.ok { border-color: rgba(89,217,140,.4); }
.publish-out { background: #0a0f0b; border-radius: 10px; padding: 12px; font-family: var(--mono); font-size: 12px; white-space: pre-wrap; max-height: 320px; overflow: auto; }
