/* 后台样式 —— 与前台同一套暖底+橄榄绿，但更工具化。响应式适配手机。 */
:root {
  --paper:#FAF9F5; --paper-2:#F2F1EA; --ink:#1A1A1A; --ink-2:#5B5A52;
  --muted:#8C8A7E; --olive:#6B7A4F; --olive-d:#54603C; --line:#E3E1D6;
  --danger:#b5483b;
  --sans:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
* { box-sizing: border-box; }
body { margin:0; background:var(--paper); color:var(--ink); font-family:var(--sans); font-size:15px; line-height:1.6; }
button { font-family:inherit; font-size:14px; cursor:pointer; border:1px solid var(--line);
  background:#fff; color:var(--ink); padding:8px 14px; border-radius:8px; }
button:hover { border-color:var(--olive); color:var(--olive); }
button.primary { background:var(--olive); border-color:var(--olive); color:#fff; }
button.primary:hover { background:var(--olive-d); color:#fff; }
button.danger { color:var(--danger); }
button.danger:hover { border-color:var(--danger); color:var(--danger); }
input, textarea, select { font-family:inherit; font-size:15px; width:100%;
  border:1px solid var(--line); border-radius:8px; padding:9px 11px; background:#fff; color:var(--ink); }
input:focus, textarea:focus, select:focus { outline:none; border-color:var(--olive); }
textarea { min-height:64px; resize:vertical; line-height:1.6; }
textarea.content-area { min-height:340px; font-size:15px; }

/* 登录 */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; }
.login-card { width:100%; max-width:360px; background:#fff; border:1px solid var(--line);
  border-radius:14px; padding:32px; }
.login-card h1 { font-size:20px; margin:0 0 6px; }
.login-card .hint { color:var(--muted); margin:0 0 20px; font-size:14px; }
.login-card input { margin-bottom:14px; }
.login-card button { width:100%; }
.msg { color:var(--danger); font-size:13px; min-height:18px; margin:10px 0 0; }

/* 顶栏 */
.admin-head { border-bottom:1px solid var(--line); background:#fff; }
.ah-inner { max-width:880px; margin:0 auto; padding:0 20px; height:60px;
  display:flex; align-items:center; justify-content:space-between; }
.ah-title { font-weight:600; }
.ah-right { display:flex; gap:14px; align-items:center; }
.ah-right a { color:var(--ink-2); text-decoration:none; font-size:14px; }
.ah-right a:hover { color:var(--olive); }

.admin-main { max-width:880px; margin:0 auto; padding:28px 20px 80px; }

/* tab */
.tabs { display:flex; gap:8px; margin-bottom:22px; }
.tab { background:transparent; border:1px solid var(--line); }
.tab.active { background:var(--ink); border-color:var(--ink); color:#fff; }
.tab.active:hover { color:#fff; }

.panel-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:14px; }
.panel-head h2 { font-size:18px; margin:0; }

/* 列表 */
.list-row { display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 0; border-top:1px solid var(--line); }
.list-row:last-child { border-bottom:1px solid var(--line); }
.lr-main { display:flex; align-items:baseline; gap:14px; min-width:0; }
.lr-date { font-family:var(--mono); font-size:13px; color:var(--muted); white-space:nowrap; }
.lr-label { overflow:hidden; text-overflow:ellipsis; }
.lr-actions { display:flex; gap:8px; flex-shrink:0; }
.muted { color:var(--muted); }

/* 编辑弹层 */
.editor-mask { position:fixed; inset:0; background:rgba(30,28,22,.45);
  display:flex; align-items:flex-start; justify-content:center; padding:32px 16px; overflow:auto; z-index:50; }
.editor-mask[hidden] { display:none; }  /* 确保 hidden 时真正隐藏（覆盖上面的 display:flex）*/
.editor-card { width:100%; max-width:640px; background:var(--paper); border-radius:14px;
  display:flex; flex-direction:column; max-height:90vh; }
.editor-head { display:flex; align-items:center; justify-content:space-between;
  padding:18px 22px; border-bottom:1px solid var(--line); }
.editor-head h2 { font-size:17px; margin:0; }
button.icon { border:0; background:transparent; font-size:24px; line-height:1; padding:0 6px; color:var(--muted); }
.editor-body { padding:20px 22px; overflow:auto; }
.editor-foot { display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 22px; border-top:1px solid var(--line); }
.editor-foot .msg { margin:0; }
.editor-foot > div { display:flex; gap:10px; }

/* 表单 */
.field { display:block; margin-bottom:16px; }
.field-label { display:block; font-size:13px; color:var(--ink-2); margin-bottom:6px; }
.field-hint { display:block; font-size:12px; color:var(--muted); margin-top:4px; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.sub-h { font-size:14px; color:var(--ink-2); margin:24px 0 12px; padding-top:8px; border-top:1px dashed var(--line); }

.items { display:flex; flex-direction:column; gap:14px; }
.item-row { background:var(--paper-2); border:1px solid var(--line); border-radius:10px;
  padding:12px; display:flex; flex-direction:column; gap:8px; }
.ir-line { display:flex; gap:8px; align-items:center; }
.ir-line select { width:auto; flex:1; }
button.mini { padding:6px 10px; font-size:13px; }
button.add { align-self:flex-start; margin-top:12px; border-style:dashed; color:var(--olive); }

/* 响应式 */
@media (max-width:600px) {
  .grid2 { grid-template-columns:1fr; }
  .list-row { flex-direction:column; align-items:flex-start; }
  .lr-actions { width:100%; }
  .lr-actions button { flex:1; }
  .editor-mask { padding:0; }
  .editor-card { max-width:100%; max-height:100vh; border-radius:0; min-height:100vh; }
}
