/* ============================================================
   名字拼图 · 内部后台设计系统
   木作暖纸底 + 深林侧栏 + 玩具主色（绿）+ 蜡笔点缀色
   ============================================================ */

:root {
  /* 画布与表面（暖纸） */
  --paper:        #f4eee1;
  --paper-2:      #ece3d2;
  --surface:      #fffdf7;
  --surface-2:    #faf4e8;
  --surface-3:    #f3ebdb;
  --overlay:      rgba(255, 253, 247, .82);

  /* 文字（暖墨） */
  --ink:          #2c2418;
  --ink-2:        #5f5340;
  --ink-3:        #8d7f68;
  --line:         #e2d6bf;
  --line-2:       #d3c4a8;

  /* 侧栏（深林） */
  --side:         #1d2a23;
  --side-2:       #121d17;
  --side-ink:     #e9e3d3;
  --side-ink-2:   #a9b3a4;
  --side-line:    rgba(233, 227, 211, .12);
  --side-active:  rgba(63, 174, 122, .18);

  /* 主色（crafted 绿） */
  --primary:      #1f8a5f;
  --primary-600:  #177049;
  --primary-700:  #115738;
  --primary-soft: #e2f1e8;
  --primary-line: #bfe0cd;

  /* 蜡笔点缀（拼图块色） */
  --red:          #d9483b;
  --red-soft:     #fbe7e4;
  --amber:        #dd9a1f;
  --amber-soft:   #fbf0d8;
  --blue:         #2f6fed;
  --blue-soft:    #e5edfd;
  --violet:       #8257d6;
  --violet-soft:  #efe8fb;
  --pink:         #d6559b;
  --pink-soft:    #fbe6f1;
  --teal:         #199a8e;
  --teal-soft:    #def2f0;

  /* 语义 */
  --success:      #2f7b52;  --success-soft: #e3f1e8;
  --warning:      #b7791f;  --warning-soft: #fbf0d8;
  --danger:       #b3372b;  --danger-soft:  #fbe7e4;
  --info:         #2f6fed;  --info-soft:    #e5edfd;

  /* 形状与层次 */
  --r-xl: 22px; --r-lg: 16px; --r-md: 12px; --r-sm: 9px; --r-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(44, 36, 24, .06), 0 2px 8px rgba(44, 36, 24, .05);
  --shadow:    0 10px 30px rgba(44, 36, 24, .10);
  --shadow-lg: 0 24px 64px rgba(44, 36, 24, .18);
  --ring: 0 0 0 3px rgba(31, 138, 95, .22);

  --font-body: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --font-display: Georgia, "Noto Serif SC", "Songti SC", "Microsoft YaHei", serif;
  --font-mono: "Cascadia Code", Consolas, "Courier New", monospace;

  --side-w: 248px;
  --head-h: 76px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 620px at 88% -8%, rgba(31, 138, 95, .10), transparent 60%),
    radial-gradient(900px 560px at -6% 108%, rgba(221, 154, 31, .12), transparent 55%),
    radial-gradient(700px 480px at 50% 50%, rgba(217, 72, 59, .04), transparent 70%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* 细腻纸纹 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
}

a { color: var(--primary-600); text-decoration: none; }
a:hover { color: var(--primary-700); text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.25; }
h1 { font-size: 27px; margin: 0; font-weight: 700; letter-spacing: .2px; }
h2 { font-size: 19px; margin: 0 0 14px; font-weight: 700; }
h3 { font-size: 16px; margin: 0 0 10px; font-weight: 700; }

.mono { font-family: var(--font-mono); font-size: 12.5px; }
.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }

/* 滚动条（取自 palette） */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: var(--r-pill);
  border: 3px solid var(--paper);
}
*::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* ============================================================
   布局：侧栏 + 工作区
   ============================================================ */

.app-shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  width: var(--side-w);
  flex: 0 0 var(--side-w);
  background: linear-gradient(180deg, var(--side) 0%, var(--side-2) 100%);
  color: var(--side-ink);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid rgba(0, 0, 0, .2);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--side-line);
}
.brand-mark {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--teal) 100%);
  box-shadow: 0 6px 16px rgba(31, 138, 95, .4);
  color: #fff;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: #fff; }
.brand-sub { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--side-ink-2); }

.side-nav { flex: 1; overflow-y: auto; padding: 16px 14px; }
.side-section { margin-bottom: 20px; }
.side-label {
  font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--side-ink-2); padding: 0 12px; margin-bottom: 8px; font-weight: 600;
}
.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 3px;
  border-radius: var(--r-md);
  color: var(--side-ink);
  font-size: 14.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.side-link svg { width: 19px; height: 19px; flex: 0 0 19px; opacity: .85; }
.side-link:hover { background: rgba(233, 227, 211, .08); color: #fff; text-decoration: none; }
.side-link.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--primary); }
.side-link.active svg { opacity: 1; color: #6fd3a3; }
.side-link .side-cta {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--primary); color: #fff; padding: 1px 8px; border-radius: var(--r-pill);
}

.side-foot { border-top: 1px solid var(--side-line); padding: 14px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.side-avatar {
  width: 34px; height: 34px; border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--amber), var(--red));
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; flex: 0 0 34px;
}
.side-user-name { font-size: 13.5px; color: var(--side-ink); font-weight: 600; line-height: 1.2; }
.side-user-role { font-size: 11px; color: var(--side-ink-2); }
.side-logout {
  width: 100%; margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(233, 227, 211, .06); border: 1px solid var(--side-line);
  color: var(--side-ink-2); padding: 8px; border-radius: var(--r-md);
  cursor: pointer; font-size: 13px; font-family: inherit; transition: .15s;
}
.side-logout:hover { background: rgba(217, 72, 59, .18); color: #fff; border-color: rgba(217, 72, 59, .4); }
.side-logout svg { width: 16px; height: 16px; }

.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 20px;
  padding: 30px 40px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 253, 247, .7), rgba(255, 253, 247, 0));
}
.page-head-text { min-width: 0; }
.eyebrow {
  font-size: 11.5px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--primary-600); font-weight: 700; margin-bottom: 6px;
}
.page-desc { color: var(--ink-2); font-size: 14px; margin-top: 7px; max-width: 640px; }
.page-actions { display: flex; gap: 10px; flex-shrink: 0; align-items: center; }

.page-body { padding: 28px 40px 64px; width: 100%; max-width: 1240px; }

/* 面包屑 */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-3); margin-bottom: 18px; flex-wrap: wrap; }
.crumbs a { color: var(--ink-2); }
.crumbs .sep { opacity: .5; }

/* ============================================================
   面板与卡片
   ============================================================ */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: 22px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-head h2 { margin: 0; }
.panel-head .panel-tools { display: flex; gap: 8px; align-items: center; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-head { padding: 18px 22px; margin: 0; border-bottom: 1px solid var(--line); }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* 主内容 + 侧栏（详情/手动生产），窄屏自动堆叠 */
.split-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.split-side { position: sticky; top: 24px; }
@media (max-width: 960px) {
  .split-layout { grid-template-columns: 1fr; }
  .split-side { position: static; }
}

/* 统计卡 */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  display: block;
  color: inherit;
}
.stat-card::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent, var(--primary));
}
.stat-card:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); transition: .15s; }
.stat-num { font-family: var(--font-display); font-size: 32px; font-weight: 700; line-height: 1.1; color: var(--ink); }
.stat-label { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; display: flex; align-items: center; gap: 7px; }
.stat-dot { width: 9px; height: 9px; border-radius: var(--r-pill); background: var(--accent, var(--primary)); flex: 0 0 9px; }

/* 入口卡（配置首页） */
.nav-card {
  display: flex; gap: 15px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm);
  color: inherit; transition: .15s; position: relative;
}
.nav-card:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--line-2); }
.nav-card-icon {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px;
  display: grid; place-items: center; color: #fff;
  background: var(--accent, var(--primary));
  box-shadow: 0 6px 14px rgba(44, 36, 24, .16);
}
.nav-card-icon svg { width: 24px; height: 24px; }
.nav-card-title { font-weight: 700; font-size: 16px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.nav-card-count { font-size: 12px; font-weight: 700; color: var(--ink-3); background: var(--surface-3); padding: 1px 9px; border-radius: var(--r-pill); }
.nav-card-desc { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

/* ============================================================
   按钮
   ============================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 9px 18px; min-height: 40px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { text-decoration: none; border-color: var(--ink-3); background: var(--surface-2); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 16px rgba(31, 138, 95, .28); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #9c2f24; border-color: #9c2f24; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); border-color: transparent; }
.btn-sm { padding: 5px 13px; min-height: 32px; font-size: 13px; }
.btn-lg { padding: 13px 28px; min-height: 50px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* 行内文字按钮 */
.linkbtn {
  background: none; border: none; padding: 2px 4px; cursor: pointer;
  color: var(--primary-600); font-size: 13.5px; font-family: inherit; font-weight: 600;
  border-radius: var(--r-sm);
}
.linkbtn:hover { text-decoration: underline; color: var(--primary-700); }
.linkbtn.danger { color: var(--danger); }
.linkbtn.danger:hover { color: #9c2f24; }
form.inline { display: inline; margin: 0; }

/* ============================================================
   表单
   ============================================================ */

.field { margin-bottom: 18px; }
.field > label, .field-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field-label .req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; font-family: inherit; font-size: 14.5px; color: var(--ink);
  padding: 10px 13px; border: 1px solid var(--line-2); border-radius: var(--r-md);
  background: var(--surface); transition: .15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.input[readonly] { background: var(--surface-3); color: var(--ink-2); }
.textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%235f5340' stroke-width='2'%3E%3Cpath d='M3 5l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 36px; }
.help { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.help.warn { color: var(--warning); }

.check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; cursor: pointer; }

.field-row { display: flex; gap: 16px; }
.field-row > .field { flex: 1; }

/* 卡片单选（产品/字体/尺寸） */
.choice-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  border: 2px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); padding: 12px; cursor: pointer; transition: .15s; text-align: center;
}
.choice:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--ring); }
.choice-thumb {
  width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r-sm);
  background: var(--surface-2); display: grid; place-items: center; overflow: hidden;
  border: 1px solid var(--line);
}
.choice-thumb img { width: 100%; height: 100%; object-fit: contain; }
.choice-thumb .ph { color: var(--ink-3); font-size: 26px; }
.choice-name { font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.choice-meta { font-size: 11.5px; color: var(--ink-3); }
.choice-check {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px;
  border-radius: var(--r-pill); background: var(--primary); color: #fff;
  display: none; place-items: center;
}
.choice:has(input:checked) .choice-check { display: grid; }
.choice-check svg { width: 14px; height: 14px; }

/* 色块 chip / 配色选择 */
.swatch-row { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  position: relative; display: flex; align-items: center; gap: 9px;
  border: 2px solid var(--line); border-radius: var(--r-pill);
  padding: 6px 14px 6px 8px; cursor: pointer; background: var(--surface); transition: .15s;
}
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch:hover { border-color: var(--line-2); }
.swatch:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--ring); }
.swatch-dot { width: 22px; height: 22px; border-radius: var(--r-pill); border: 1px solid rgba(0, 0, 0, .12); flex: 0 0 22px; }
.swatch-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }

/* 配色色值：列表预览 + 弹层编辑 */
.color-dots { display: inline-flex; gap: 4px; align-items: center; vertical-align: middle; }
.color-dots .dot { width: 16px; height: 16px; border-radius: 5px; border: 1px solid rgba(0, 0, 0, .12); }
.color-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.color-list:empty { display: none; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type="color"] {
  width: 46px; height: 38px; padding: 2px; flex: 0 0 46px;
  border: 1px solid var(--line-2); border-radius: var(--r-md); background: var(--surface); cursor: pointer;
}
.color-row .color-hex { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); }
.color-empty { font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }

/* 元素 chip 多选 */
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  border: 1.5px solid var(--line-2); border-radius: var(--r-pill);
  padding: 6px 13px; cursor: pointer; background: var(--surface); font-size: 13px; font-weight: 600; color: var(--ink-2); transition: .12s;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:hover { border-color: var(--ink-3); }
.chip:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-700); }
.chip .chip-code { font-size: 11px; color: var(--ink-3); font-weight: 500; }

/* ============================================================
   表格
   ============================================================ */

.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-table th { background: var(--surface-2); color: var(--ink-2); font-weight: 700; font-size: 12.5px; letter-spacing: .3px; white-space: nowrap; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.cell-main { font-weight: 600; color: var(--ink); }
.cell-sub { font-size: 12px; color: var(--ink-3); }
.cell-clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table td.actions { white-space: nowrap; text-align: right; }
.data-table .title-cell { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 订单表：列宽由 <colgroup> 显式定义，长标题只做省略号，不再把「时间 / 交付」挤成竖排。
   窄屏交给 .table-scroll 横向滚动，不压缩列宽。其余 data-table 保持原有自适应布局。 */
.table-scroll { overflow-x: auto; }
.data-table.task-table { table-layout: fixed; min-width: 980px; }
.data-table.task-table th, .data-table.task-table td { padding: 10px 14px; line-height: 1.45; }
.data-table.task-table td > div + div { margin-top: 3px; }
.data-table.task-table .time-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table.task-table .time-label { display: inline-block; min-width: 2.8em; color: var(--ink-3); }
.data-table.task-table .delivery-cell { white-space: nowrap; }

/* 状态 pill */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 700; white-space: nowrap;
  background: var(--surface-3); color: var(--ink-2);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: var(--r-pill); background: currentColor; }
.pill.green, .pill.state-done, .pill.state-uploaded { background: var(--success-soft); color: var(--success); }
.pill.blue, .pill.state-generated, .pill.state-locked, .pill.state-parsed, .pill.state-discovered { background: var(--info-soft); color: var(--info); }
.pill.amber, .pill.state-running, .pill.state-failed { background: var(--warning-soft); color: var(--warning); }
.pill.red, .pill.state-manual { background: var(--danger-soft); color: var(--danger); }
.pill.gray, .pill.state-skipped, .pill.state-queued { background: var(--surface-3); color: var(--ink-3); }
.pill.violet { background: var(--violet-soft); color: var(--violet); }

/* 家族标签 */
.family-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.family-dot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; }

/* 概览：状态分布 chip 行 */
.state-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.state-chips a.pill { text-decoration: none; transition: .12s; }
.state-chips a.pill:hover { text-decoration: none; filter: brightness(.96); transform: translateY(-1px); }
.state-chips a.pill strong { font-weight: 800; margin-left: 2px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 26px 0 14px; }
.section-head h2 { margin: 0; }
.section-head .section-link { font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.section-head .section-link svg { width: 15px; height: 15px; }

/* ============================================================
   工具条 / 筛选 / 搜索 / 分页
   ============================================================ */

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.toolbar .spacer { flex: 1; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 380px; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-3); }
.search-box .input { padding-left: 38px; border-radius: var(--r-pill); }
.filter-select { width: auto; min-width: 130px; border-radius: var(--r-pill); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--r-pill); padding: 3px; gap: 2px; }
.seg button, .seg a {
  border: none; background: none; font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-2); padding: 6px 14px; border-radius: var(--r-pill); cursor: pointer; text-decoration: none;
}
.seg button.active, .seg a.active { background: var(--surface); color: var(--primary-700); box-shadow: var(--shadow-sm); }

.result-count { font-size: 13px; color: var(--ink-3); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 20px; font-size: 14px; }
.pager .pager-info { color: var(--ink-2); }

/* 空态 */
.empty-state { text-align: center; padding: 48px 24px; color: var(--ink-3); }
.empty-state .empty-icon {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: var(--r-lg);
  background: var(--surface-3); display: grid; place-items: center; color: var(--ink-3);
  border: 1px dashed var(--line-2);
}
.empty-state .empty-icon svg { width: 30px; height: 30px; }
.empty-state .empty-title { font-size: 16px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.empty-state .empty-desc { font-size: 13.5px; max-width: 380px; margin: 0 auto 16px; }

/* ============================================================
   提示 / flash
   ============================================================ */

.notice {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 16px; border-radius: var(--r-md); margin-bottom: 18px;
  font-size: 14px; border: 1px solid; line-height: 1.5;
}
.notice svg { width: 19px; height: 19px; flex: 0 0 19px; margin-top: 1px; }
.notice.info { background: var(--info-soft); border-color: #c7d8fb; color: #1e4fc0; }
.notice.success { background: var(--success-soft); border-color: var(--primary-line); color: var(--success); }
.notice.warning { background: var(--warning-soft); border-color: #ecd9a8; color: var(--warning); }
.notice.danger { background: var(--danger-soft); border-color: #f0c4be; color: var(--danger); }

/* ============================================================
   详情：键值 / 技术信息折叠
   ============================================================ */

.kv { display: grid; grid-template-columns: 130px 1fr; gap: 11px 18px; font-size: 14px; }
.kv dt { color: var(--ink-3); font-weight: 600; }
.kv dd { margin: 0; color: var(--ink); word-break: break-word; }
.kv dd.big { font-family: var(--font-display); font-size: 22px; font-weight: 700; }

.tech-details { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.tech-details summary {
  cursor: pointer; padding: 11px 16px; font-size: 13px; font-weight: 600; color: var(--ink-3);
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.tech-details summary::-webkit-details-marker { display: none; }
.tech-details summary::before { content: "▸"; transition: transform .15s; }
.tech-details[open] summary::before { transform: rotate(90deg); }
.tech-details .tech-body { padding: 4px 16px 16px; }

/* 预览图 */
.preview-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.preview-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; box-shadow: var(--shadow-sm); }
.preview-card .preview-img { width: 100%; border-radius: var(--r-sm); background: #fff; border: 1px solid var(--line); display: block; cursor: zoom-in; }
.preview-card figcaption { font-size: 12.5px; color: var(--ink-2); margin-top: 9px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.preview-card .preview-role { font-size: 11px; font-weight: 700; color: var(--primary-600); background: var(--primary-soft); padding: 1px 8px; border-radius: var(--r-pill); }

/* 结果页下载大按钮 */
.download-hero {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--primary-soft), var(--surface));
  border: 1px solid var(--primary-line); border-radius: var(--r-lg); padding: 22px;
}
.download-hero .dl-icon { width: 52px; height: 52px; flex: 0 0 52px; border-radius: 14px; background: var(--primary); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px rgba(31, 138, 95, .3); }
.download-hero .dl-icon svg { width: 26px; height: 26px; }
.download-hero .dl-text { flex: 1; min-width: 200px; }
.download-hero .dl-title { font-weight: 700; font-size: 16px; color: var(--ink); }
.download-hero .dl-desc { font-size: 13px; color: var(--ink-2); margin-top: 2px; }

/* ============================================================
   弹层
   ============================================================ */

dialog.modal {
  border: none; border-radius: var(--r-xl); padding: 0;
  width: 500px; max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-lg); background: var(--surface);
}
dialog.modal::backdrop { background: rgba(28, 22, 12, .5); backdrop-filter: blur(3px); }
.modal-head { padding: 22px 24px 0; }
.modal-head h2 { margin: 0; font-size: 19px; }
.modal-head .modal-sub { font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.modal-body { padding: 20px 24px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 24px 22px; }

/* 图片查看器 */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(20, 16, 8, .88); display: none; place-items: center; padding: 40px; }
.lightbox.open { display: grid; }
.lightbox img { max-width: 92vw; max-height: 86vh; border-radius: var(--r-md); box-shadow: var(--shadow-lg); background: #fff; }
.lightbox-close { position: absolute; top: 22px; right: 26px; width: 44px; height: 44px; border-radius: var(--r-pill); border: none; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; font-size: 22px; }
.lightbox-close:hover { background: rgba(255, 255, 255, .26); }

/* ============================================================
   登录
   ============================================================ */

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; z-index: 1; }
.login-card {
  width: 400px; max-width: 100%; background: var(--overlay); backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-lg);
  padding: 40px 36px; text-align: center;
}
.login-brand { width: 60px; height: 60px; margin: 0 auto 18px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--teal)); color: #fff; box-shadow: 0 12px 28px rgba(31, 138, 95, .35); }
.login-brand svg { width: 34px; height: 34px; }
.login-card h1 { font-size: 23px; margin-bottom: 4px; }
.login-card .login-sub { color: var(--ink-3); font-size: 13px; margin-bottom: 26px; letter-spacing: 1px; }
.login-card .field { text-align: left; }
.login-card .btn { margin-top: 8px; }

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 960px) {
  :root { --side-w: 210px; }
  .page-head { padding: 24px 24px 18px; }
  .page-body { padding: 22px 24px 56px; }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .brand { border-bottom: none; padding: 14px 18px; }
  .side-nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px; overflow: visible; }
  .side-section { margin: 0; display: flex; gap: 4px; }
  .side-label { display: none; }
  .side-link { padding: 8px 12px; margin: 0; }
  .side-link span.nav-text { display: none; }
  .side-foot { border-top: none; margin-left: auto; padding: 8px 12px; }
  .side-user { display: none; }
  .side-logout { width: auto; margin: 0; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px 18px 16px; }
  .page-body { padding: 18px 16px 48px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; gap: 0; }
  .kv { grid-template-columns: 1fr; gap: 4px; }
  .kv dt { margin-top: 8px; }
  .data-table { font-size: 12.5px; }
  .data-table th, .data-table td { padding: 9px 10px; }
  .data-table.task-table th, .data-table.task-table td { padding: 9px 12px; }
  .btn { width: 100%; }
  .page-actions { width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; }
}