/* AI图文灵感 · 内容后台 —— 延续 Editorial Gallery 品牌视觉 */
:root {
  --paper: #eae6dd;
  --surface: #fbfaf7;
  --ink: #1b1917;
  --ink-2: #2a2724;
  --ink-soft: #55504a;
  --muted: #8f877c;
  --rule: #dcd6c9;
  --rule-soft: #e8e3d8;
  --accent: #c8452b;
  --accent-soft: #f6e6e2;
  --gold: #a47b2e;
  --ok: #3f7a55;
  --ok-soft: #e4efe7;
  --warn: #b0741c;
  --radius: 4px;
  --shadow: 0 1px 2px rgba(27, 25, 23, .04), 0 12px 32px -18px rgba(27, 25, 23, .28);
  --serif: "Songti SC", "SimSun", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  background:
    radial-gradient(circle at 15% 15%, rgba(200, 69, 43, .06), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(164, 123, 46, .08), transparent 50%),
    var(--paper);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 48px 44px 40px;
  box-shadow: var(--shadow);
}
.login-mark { width: 76px; height: 76px; border-radius: 50%; display: block; margin: 0 auto 22px; }
.login-title {
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 4px;
  text-align: center;
  font-weight: 600;
}
.login-sub {
  text-align: center;
  font-size: 10px;
  letter-spacing: 4px;
  color: var(--muted);
  margin: 8px 0 34px;
  text-transform: uppercase;
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 7px;
  text-transform: uppercase;
}
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--rule);
  background: var(--surface);
  padding: 11px 13px;
  border-radius: var(--radius);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(27, 25, 23, .05);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
  letter-spacing: .5px;
  transition: all .18s;
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: #f7f4ee; }
.btn-primary:hover { background: var(--accent); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--rule); color: var(--ink-soft); background: transparent; }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-danger { border-color: #e2c4bd; color: var(--accent); background: transparent; }
.btn-danger:hover { background: var(--accent-soft); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.login-error {
  color: var(--accent);
  font-size: 12px;
  min-height: 18px;
  margin-top: 12px;
}

/* ---------- 框架 ---------- */
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }

.side {
  background: var(--ink);
  color: #cfc9bf;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 24px 22px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}
.brand img { width: 34px; height: 34px; border-radius: 50%; }
.brand-name { font-family: var(--serif); font-size: 16px; color: #f4f0e8; letter-spacing: 2px; line-height: 1.2; }
.brand-sub { font-size: 8px; letter-spacing: 2.4px; color: #8d867b; margin-top: 3px; }

.nav { padding: 18px 12px; flex: 1; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius);
  color: #b3aca1;
  font-size: 13px;
  letter-spacing: .6px;
  text-align: left;
  transition: all .16s;
  margin-bottom: 2px;
}
.nav-item:hover { color: #f4f0e8; background: rgba(255, 255, 255, .05); }
.nav-item.active { background: rgba(200, 69, 43, .16); color: #fff; }
.nav-item.active::before { content: ""; }
.nav-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .5; }
.nav-item.active .nav-dot { background: var(--accent); opacity: 1; box-shadow: 0 0 0 3px rgba(200, 69, 43, .2); }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 10px;
  letter-spacing: 0;
}
.side-foot {
  padding: 16px 22px 22px;
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #6d675e;
  border-top: 1px solid rgba(255, 255, 255, .07);
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  border-bottom: 1px solid var(--rule);
  background: rgba(251, 250, 247, .72);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.page-title { font-family: var(--serif); font-size: 20px; letter-spacing: 3px; }
.top-right { display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--muted); }
.who { letter-spacing: .5px; }
.who b { color: var(--ink); font-weight: 600; }

.stage { padding: 30px 34px 60px; max-width: 1320px; width: 100%; }

/* ---------- 工作台 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-bottom: 32px; }
.stat { background: var(--surface); padding: 22px 22px 20px; }
.stat-label { font-size: 10px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; }
.stat-value { font-family: var(--serif); font-size: 32px; line-height: 1.25; margin-top: 6px; }
.stat-value small { font-family: var(--sans); font-size: 12px; color: var(--muted); letter-spacing: 0; }
.stat.accent .stat-value { color: var(--accent); }

.panel { background: var(--surface); border: 1px solid var(--rule); margin-bottom: 24px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--rule-soft);
}
.panel-title { font-family: var(--serif); font-size: 15px; letter-spacing: 2px; }
.panel-body { padding: 20px 22px; }
.panel-body.flush { padding: 0; }

.two-col { display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 1080px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 1.6px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--rule-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f7f5f0; }
.table .num { font-variant-numeric: tabular-nums; }
.cell-title { font-weight: 600; font-size: 13.5px; }
.cell-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.thumb { width: 46px; height: 46px; object-fit: cover; border-radius: 3px; background: var(--rule-soft); display: block; }
.thumb-empty { width: 46px; height: 46px; border-radius: 3px; background: var(--rule-soft); display: grid; place-items: center; font-size: 9px; color: var(--muted); }

.badge { display: inline-block; font-size: 10.5px; letter-spacing: .8px; padding: 2px 9px; border-radius: 20px; border: 1px solid transparent; }
.badge-on { background: var(--ok-soft); color: var(--ok); }
.badge-off { background: #eeeae2; color: var(--muted); }
.badge-price { background: #f6efe0; color: var(--gold); font-variant-numeric: tabular-nums; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

.actions { display: flex; gap: 8px; justify-content: flex-end; }
.link-btn { font-size: 12px; color: var(--ink-soft); border-bottom: 1px solid transparent; padding: 0; }
.link-btn:hover { color: var(--ink); border-color: var(--ink); }
.link-btn.danger:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 工具条 ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; padding: 8px 12px; font-size: 13px; }
.toolbar .grow { flex: 1; }
.toolbar .search { min-width: 240px; }
.toolbar .spacer { flex: 1; }

/* ---------- 复选 / 开关 ---------- */
.check { width: 15px; height: 15px; accent-color: var(--ink); cursor: pointer; }
.sel-count { font-size: 12px; color: var(--muted); margin-right: 4px; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; gap: 12px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--rule-soft); font-size: 12px; color: var(--muted); }

/* ---------- 空态 / 加载 ---------- */
.empty { padding: 60px 20px; text-align: center; color: var(--muted); font-size: 13px; letter-spacing: 1px; }
.empty-mark { font-family: var(--serif); font-size: 34px; color: var(--rule); display: block; margin-bottom: 10px; }
.loading { padding: 50px; text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 2px; }

/* ---------- 反馈卡 ---------- */
.fb-item { padding: 18px 22px; border-bottom: 1px solid var(--rule-soft); display: flex; gap: 16px; }
.fb-item:last-child { border-bottom: none; }
.fb-main { flex: 1; min-width: 0; }
.fb-text { font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.fb-meta { font-size: 11px; color: var(--muted); margin-top: 9px; display: flex; gap: 12px; flex-wrap: wrap; }
.fb-imgs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.fb-imgs img { width: 66px; height: 66px; object-fit: cover; border-radius: 3px; border: 1px solid var(--rule); }

/* ---------- 标签页 ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin-bottom: 0; }
.tab {
  padding: 10px 18px;
  font-size: 12.5px;
  letter-spacing: 1px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------- 弹层 ---------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 16, .52);
  z-index: 60;
  display: flex;
  justify-content: flex-end;
}
.drawer {
  width: min(720px, 100%);
  background: var(--paper);
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: -24px 0 60px -20px rgba(0, 0, 0, .4);
  animation: slideIn .26s ease;
}
@keyframes slideIn { from { transform: translateX(24px); } to { transform: none; } }

/* 新建/编辑内容：居中弹窗（点击遮罩不关闭） */
.editor-mask { align-items: center; justify-content: center; padding: 24px; }
.editor-mask .drawer {
  width: min(760px, 100%);
  height: auto;
  max-height: calc(100vh - 48px);
  box-shadow: var(--shadow);
  animation: popIn .22s ease;
}
.editor-mask .drawer-body { max-height: calc(100vh - 220px); }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.drawer-head { padding: 22px 28px; border-bottom: 1px solid var(--rule); display: flex; align-items: center; justify-content: space-between; background: var(--surface); }
.drawer-title { font-family: var(--serif); font-size: 18px; letter-spacing: 2px; }
.drawer-body { padding: 26px 28px; overflow-y: auto; flex: 1; background: var(--paper); }
.drawer-foot { padding: 16px 28px; border-top: 1px solid var(--rule); display: flex; gap: 10px; justify-content: flex-end; background: var(--surface); }

.dialog { margin: auto; background: var(--surface); width: min(440px, 92vw); padding: 28px; border: 1px solid var(--rule); box-shadow: var(--shadow); }
.dialog-title { font-family: var(--serif); font-size: 17px; letter-spacing: 2px; margin-bottom: 6px; }
.dialog-desc { font-size: 12.5px; color: var(--muted); margin-bottom: 20px; line-height: 1.7; }
.dialog-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

.form-row { margin-bottom: 20px; }
.form-row > label { display: block; font-size: 10.5px; letter-spacing: 1.8px; color: var(--muted); text-transform: uppercase; margin-bottom: 7px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.textarea { min-height: 168px; resize: vertical; line-height: 1.75; font-size: 13px; }
.hint { font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.6; }

/* ---------- 图片编辑行 ---------- */
.img-list { display: flex; flex-direction: column; gap: 10px; }
.img-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.img-row img { width: 64px; height: 64px; object-fit: cover; border-radius: 3px; background: var(--rule-soft); }
.img-row .img-info { flex: 1; min-width: 0; }
.img-row .img-name { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 6px; }
.img-row .select { padding: 6px 10px; font-size: 12px; }
.img-remove { color: var(--muted); font-size: 18px; line-height: 1; padding: 4px 8px; }
.img-remove:hover { color: var(--accent); }
.add-img {
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  transition: all .16s;
  width: 100%;
}
.add-img:hover { border-color: var(--ink); color: var(--ink); background: rgba(27, 25, 23, .02); }
.uploading { font-size: 11px; color: var(--accent); letter-spacing: 1px; }

/* ---------- 提示 ---------- */
.toast-wrap { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink);
  color: #f7f4ee;
  padding: 10px 20px;
  border-radius: 3px;
  font-size: 13px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
  animation: toastIn .22s ease;
  max-width: 80vw;
}
.toast.err { background: var(--accent); }
.toast.ok { background: var(--ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.note {
  background: #f7f2e6;
  border: 1px solid #e6dcc4;
  border-left: 3px solid var(--gold);
  padding: 12px 16px;
  font-size: 12px;
  color: #6b5a3a;
  line-height: 1.7;
  margin-bottom: 20px;
}
.note b { color: #4a3d26; }

.kv { display: grid; grid-template-columns: 120px 1fr; gap: 10px 16px; font-size: 13px; }
.kv dt { color: var(--muted); font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; padding-top: 2px; }
.kv dd { word-break: break-all; }
