/* 视觉规范取自定稿设计稿 creation-system-v1.html（墨绿 + 系统字体 + 左 204px 导航） */
:root {
  --bg: #f3f2ee; --paper: #fbfbf9; --panel: #fff; --soft: #f5f6f4;
  --ink: #202623; --muted: #68716d; --faint: #959d99;
  --line: #e4e6e2; --line-strong: #d5d9d5;
  --accent: #315b4c; --accent-soft: #e9f0ec; --warning: #8a5a2b; --danger: #8b4138;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font: 13px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 2px solid #6d8e80; outline-offset: 2px; }
[v-cloak] { display: none; }

.shell { display: grid; grid-template-columns: 204px minmax(0, 1fr); min-height: 100vh; background: var(--paper); }
.sidebar { display: flex; flex-direction: column; padding: 20px 14px 16px; border-right: 1px solid var(--line); background: #f7f8f5; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 1px 6px 22px; }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; }
.brand b { display: block; font-size: 13px; font-weight: 500; }
.brand small { display: block; color: var(--faint); font-size: 11px; }
.new-btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 38px; margin-bottom: 18px; border: 1px solid var(--accent); border-radius: 7px; background: var(--accent); color: #fff; }
.nav { display: grid; gap: 2px; overflow-y: auto; }
.nav .grp { margin: 12px 10px 4px; color: var(--faint); font-size: 11px; }
.nav button { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; min-height: 36px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: #58625e; text-align: left; font-size: 12px; }
.nav button:hover { background: #eef1ee; }
.nav button.active { background: #e8eeea; color: #274438; }
.nav button b { color: var(--faint); font-size: 11px; font-weight: 400; }
.nav button.soon { color: var(--faint); }
.side-foot { margin-top: auto; padding: 13px 8px 0; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 9px; font-size: 11px; }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e3e7e3; }
.side-foot small { display: block; color: var(--faint); }
.side-foot a { color: var(--muted); cursor: pointer; }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding: 0 clamp(20px, 3vw, 34px); border-bottom: 1px solid var(--line); }
.crumb { color: var(--faint); font-size: 11px; }
.crumb b { color: var(--muted); font-weight: 400; }
.content { padding: 28px clamp(20px, 3vw, 34px) 60px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 24px; }
.page-head p { margin: 0 0 5px; color: var(--faint); font-size: 11px; }
.page-head h1 { margin: 0; font-size: 25px; font-weight: 500; letter-spacing: -.03em; }
.page-head span.sub { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 13px; border-radius: 7px; font-size: 12px; border: 1px solid var(--line-strong); background: var(--panel); white-space: nowrap; }
.btn:hover { background: var(--soft); }
.btn.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn.primary:hover { background: #284b3e; }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 28px; padding: 0 9px; font-size: 11px; }
.link { border: 0; background: none; color: var(--accent); padding: 0; font-size: 12px; }

.panel { border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.panel-pad { padding: 18px; }
.section-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 12px; }
.section-line h2 { margin: 0; font-size: 13px; font-weight: 500; }
.muted { color: var(--muted); } .faint { color: var(--faint); font-size: 11px; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { min-height: 30px; padding: 0 11px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; }
.tabs button.active { background: var(--accent-soft); color: #284438; }

.search { display: flex; align-items: center; gap: 8px; width: min(260px, 100%); min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.search input { border: 0; outline: 0; width: 100%; background: transparent; font-size: 12px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { text-align: left; font-weight: 400; color: var(--faint); font-size: 11px; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click:hover td { background: var(--soft); cursor: pointer; }

.status { display: inline-flex; padding: 2px 8px; border-radius: 10px; font-size: 11px; white-space: nowrap; background: #eef0ee; color: var(--muted); }
.status.ok { background: var(--accent-soft); color: var(--accent); }
.status.warn { background: #f3ede3; color: var(--warning); }
.status.bad { background: #f5e9e7; color: var(--danger); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; margin: 1px 3px 1px 0; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.chip.on { background: var(--accent-soft); border-color: #c9d9d0; color: var(--accent); }
button.chip { cursor: pointer; }

.field { display: grid; gap: 6px; }
.field > span { color: var(--muted); font-size: 11px; }
.field > span i { color: var(--danger); font-style: normal; }
.field input, .field textarea, .field select { width: 100%; min-height: 34px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font-size: 12px; }
.field textarea { min-height: 64px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .wide { grid-column: 1 / -1; }

.split { display: grid; grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 24px; align-items: start; }
.list-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 11px; align-items: center; width: 100%; min-height: 70px; padding: 8px 6px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
.list-row:hover { background: var(--soft); }
.list-row.active { background: linear-gradient(90deg, rgba(233, 240, 236, .9), transparent 80%); border-bottom-color: var(--accent); }
.list-row b { display: block; font-size: 12px; font-weight: 500; }
.list-row small { display: block; color: var(--faint); font-size: 11px; margin-top: 2px; }
.thumb { width: 52px; height: 52px; border-radius: 6px; background: #eceeea center/cover no-repeat; display: grid; place-items: center; color: var(--faint); font-size: 11px; }

.grid-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.img-card { position: relative; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; cursor: pointer; }
.img-card.sel { outline: 2px solid var(--accent); outline-offset: -1px; }
.img-card .ph { aspect-ratio: 1 / 1; background: #eef0ec center/contain no-repeat; }
.img-card .cap { padding: 6px 8px; font-size: 11px; color: var(--muted); }
.img-card .cap div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-card .tick { position: absolute; top: 6px; left: 6px; width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.9); display: grid; place-items: center; font-size: 12px; color: #fff; }
.img-card.sel .tick { background: var(--accent); border-color: var(--accent); }
.img-card .missing { position: absolute; inset: 0; background: rgba(139,65,56,.08); }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); font-size: 12px; }

.matrix { border-collapse: collapse; font-size: 12px; width: 100%; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line); padding: 7px 8px; text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix .grp td { background: var(--soft); color: var(--faint); font-size: 11px; text-align: left; }

.mode-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.mode-card { padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); text-align: left; }
.mode-card b { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.mode-card small { color: var(--faint); font-size: 11px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.metric { padding: 14px 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.metric b { display: block; font-size: 22px; font-weight: 500; }
.metric small { color: var(--faint); font-size: 11px; }

/* 全局状态：空 / 加载 / 失败 / 无权限 */
.state { padding: 46px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 9px; background: var(--panel); }
.state b { display: block; color: var(--ink); font-weight: 500; font-size: 14px; margin-bottom: 6px; }
.state.err { border-color: #e2c9c4; color: var(--danger); }

.modal-mask { position: fixed; inset: 0; background: rgba(32,38,35,.28); display: grid; place-items: center; z-index: 50; padding: 20px; }
.modal { width: min(640px, 100%); max-height: 88vh; overflow: auto; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 10px 34px rgba(29,35,32,.14); }
.modal header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal header h3 { margin: 0; font-size: 15px; font-weight: 500; }
.modal .body { padding: 18px 20px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.x { border: 0; background: none; font-size: 18px; color: var(--faint); }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 99; padding: 10px 14px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.toast.err { background: var(--danger); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.login { width: 340px; padding: 30px 28px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--paper); box-shadow: 0 10px 34px rgba(29,35,32,.07); }
.login h1 { margin: 14px 0 4px; font-size: 20px; font-weight: 500; }
.login .err { color: var(--danger); font-size: 12px; min-height: 18px; }

.pager { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 14px; font-size: 12px; color: var(--muted); }
code.path { font-size: 11px; background: var(--soft); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--muted); }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .mode-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .form-grid { grid-template-columns: 1fr; }
}
