/* 交互思路随记 · 文章后台 —— 电脑优先，浅色，无外部依赖 */
:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --line: #e8edf4;
  --txt: #1f2937;
  --sub: #6b7280;
  --muted: #9ca3af;
  --brand: #2563eb;
  --brand-weak: #eff4ff;
  --danger: #e11d48;
  --ok: #059669;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--txt);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
form.inline { display: inline; margin: 0; }

/* 顶栏 */
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--txt);
}
.brand:hover { text-decoration: none; }
.brand em {
  font-style: normal;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  padding-left: 8px;
  border-left: 1px solid var(--line);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  display: inline-block;
}
.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  color: var(--sub);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.nav a:hover { background: #f3f6fb; text-decoration: none; }
.nav a.on { color: var(--brand); background: var(--brand-weak); font-weight: 600; }
.nav .link {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: 8px;
}
.nav .link:hover { background: #f3f6fb; color: var(--danger); }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 22px 24px 40px; flex: 1; }
.foot {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 16px;
  border-top: 1px solid var(--line);
}

/* 页头 */
.pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.pagehead h1 { font-size: 20px; margin: 0; }
.sub { color: var(--sub); font-size: 13px; margin: 4px 0 0; }

/* 按钮 */
.btn {
  display: inline-block;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--txt);
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: #cbd5e1; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.primary:hover { background: #1d4ed8; }
.btn.block { width: 100%; text-align: center; }

/* 提示条 */
.flash {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.7;
}
.flash.ok { background: #ecfdf5; color: var(--ok); border: 1px solid #d1fae5; }
.flash.err { background: #fef2f2; color: var(--danger); border: 1px solid #fee2e2; }
.flash .hint { color: #9f1239; opacity: 0.85; font-size: 12px; margin-top: 4px; }

/* 列表 */
.table {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.tr {
  display: grid;
  grid-template-columns: 1fr 120px 100px 70px 120px;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}
.tr:first-child { border-top: none; }
.tr.th {
  background: #fafcff;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 18px;
  letter-spacing: 0.3px;
}
.tr:hover:not(.th) { background: #fbfdff; }
.c-title a { font-size: 14px; font-weight: 600; color: var(--txt); }
.c-title a:hover { color: var(--brand); }
.sum {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 640px;
}
.tag {
  display: inline-block;
  font-size: 12px;
  color: var(--brand);
  background: var(--brand-weak);
  border-radius: 6px;
  padding: 2px 8px;
}
.c-date, .c-num { color: var(--sub); font-size: 13px; }
.c-act { display: flex; gap: 10px; justify-content: flex-end; }
.mini {
  border: none;
  background: none;
  color: var(--brand);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 0;
}
.mini.danger { color: var(--danger); }
.mini:hover { text-decoration: underline; }

/* 空态 */
.empty {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 56px 20px;
  text-align: center;
}
.empty-t { font-size: 16px; font-weight: 600; }
.empty-s { color: var(--sub); font-size: 13px; margin: 8px 0 18px; }

/* 编辑器 */
.editor .grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}
.main-col {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.field { display: block; margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field.tight { margin-bottom: 8px; }
.lbl {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
}
.lbl em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 8px; }
.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 12px;
  font: inherit;
  color: var(--txt);
  background: #fbfcfe;
  outline: none;
}
.input:focus { border-color: #a9c1f7; background: #fff; box-shadow: 0 0 0 3px #eff4ff; }
.input.lg { font-size: 16px; font-weight: 600; padding: 11px 12px; }
textarea.input { resize: vertical; line-height: 1.8; }
textarea.body { min-height: 460px; font-size: 14.5px; }

.side-col { display: flex; flex-direction: column; gap: 14px; }
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
}
.panel-t { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; }
.cat { position: relative; }
.cat input { position: absolute; opacity: 0; pointer-events: none; }
.cat span {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 16px;
  background: #f3f6fb;
  color: var(--sub);
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
}
.cat input:checked + span {
  background: var(--brand-weak);
  color: var(--brand);
  border-color: #c7d7fe;
  font-weight: 600;
}
.mini-tip { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 8px 0 0; }
.cover-preview {
  margin-top: 10px;
  height: 100px;
  border-radius: 10px;
  background: #f6f8fb;
  border: 1px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
}
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.panel.sticky { position: sticky; top: 74px; }

/* 登录 */
.login {
  max-width: 340px;
  margin: 12vh auto 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 26px;
  text-align: center;
}
.login h1 { font-size: 20px; margin: 0 0 4px; }
.login .sub { margin-bottom: 20px; }
.login input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  font: inherit;
  margin-bottom: 12px;
  background: #fbfcfe;
}
.login .tip { color: var(--muted); font-size: 12px; margin: 14px 0 0; line-height: 1.7; }

@media (max-width: 860px) {
  .editor .grid { grid-template-columns: 1fr; }
  .tr { grid-template-columns: 1fr 90px 90px; }
  .c-num, .tr.th .c-num { display: none; }
  .c-act { grid-column: 1 / -1; justify-content: flex-start; }
  .wrap { padding: 16px 14px 30px; }
}
