/* SHUIMBA Studio —— 布局仿 NewArc（浅灰底 + 白色圆角卡片 + 左工具右记录），品牌色沿用 SHUIMBA 橙 */
:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --ink: #1d1b18;
  --ink-2: #4f4a43;
  --muted: #8a8378;
  --line: #e7e3dc;
  --line-2: #efece6;
  --accent: #e0651c;
  --accent-ink: #b34d10;
  --accent-soft: #fbeadf;
  --ok: #3d7a52;
  --ok-soft: #e4efe5;
  --danger: #b3382c;
  --danger-soft: #f8e3df;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(29, 27, 24, .05), 0 1px 1px rgba(29, 27, 24, .03);
  --shadow-lg: 0 12px 40px rgba(29, 27, 24, .16);
  --sans: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  --display: "Didot", "Bodoni 72", "Bodoni MT", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1 { font-size: 26px; margin: 0; font-weight: 700; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
[hidden] { display: none !important; }

/* ---------- 品牌 ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mark { display: block; flex: none; height: 30px; width: auto; color: var(--ink); overflow: visible; }
.lockup { display: inline-flex; flex-direction: column; line-height: 1; }
.word { font-family: var(--display); font-size: 16px; letter-spacing: .3em; margin-right: -.3em; }
.word em { font-style: normal; color: var(--accent); }
.tagline { margin-top: 7px; font-family: var(--display); font-size: 10px; letter-spacing: .42em; color: var(--muted); }
.brand-name { font-size: 13px; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); }
.brand-lg .mark { height: 48px; }
.brand-lg .word { font-size: 22px; }

/* ---------- 基础控件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--ink-2); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn-danger { color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; color: var(--ink-2); font: inherit; cursor: pointer; text-decoration: none; }
.btn-link:hover { color: var(--accent-ink); }
.btn-link.rated { color: var(--ok); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  border: 1px solid transparent; border-radius: var(--radius-sm); background: none; color: var(--ink-2);
  font-size: 15px; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); }
.icon-btn.active, .icon-btn.on { background: var(--accent-soft); color: var(--accent-ink); }
.input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; resize: vertical;
}
.input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.input-num { width: 110px; display: inline-block; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 13px; }
.stack { display: grid; gap: 14px; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form .input { width: auto; flex: 1 1 200px; }
.notice { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); margin: 12px 0; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.bad { background: var(--danger-soft); color: var(--danger); }
.badge { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--surface-2); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.code { font-family: Consolas, monospace; letter-spacing: .08em; }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
}
.credits { font-size: 13px; font-weight: 600; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; }

/* ---------- 登录 ---------- */
.page-center { display: grid; place-items: center; min-height: 100%; padding: 24px 16px; }
.login-card {
  width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 32px; box-shadow: var(--shadow); display: grid; gap: 14px;
}
.login-card h1 { font-size: 22px; margin-top: 8px; }

/* ---------- 首页 ---------- */
.home-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1120px; margin: 16px auto 0; padding: 12px 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.home-user { display: flex; align-items: center; gap: 12px; }
.home-user form { margin: 0; }
.home-main { max-width: 1120px; margin: 0 auto; padding: 28px 20px 60px; }
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.home-head .inline-form { flex: 0 1 460px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.project-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: visible; box-shadow: var(--shadow); }
.project-card .cover { display: block; aspect-ratio: 4 / 3; background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
.project-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; }
.project-meta { padding: 12px 14px; display: grid; gap: 2px; }
.project-name { font-weight: 600; text-decoration: none; }
.menu { position: absolute; top: 8px; right: 8px; }
.menu summary, .project-switch summary, .send summary { list-style: none; cursor: pointer; }
.menu summary::-webkit-details-marker, .project-switch summary::-webkit-details-marker, .send summary::-webkit-details-marker { display: none; }
.menu summary { width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .92); border: 1px solid var(--line); }
.menu-pop {
  position: absolute; z-index: 30; min-width: 200px; margin-top: 6px; padding: 8px; display: grid; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.menu .menu-pop { right: 0; }
.menu-item { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-radius: 6px; background: none; font: inherit; cursor: pointer; text-decoration: none; color: var(--ink); }
.menu-item:hover, .menu-item.active { background: var(--surface-2); }
.menu-item.active { font-weight: 600; }
.footnote { margin-top: 24px; }

/* ---------- 工作台 ---------- */
.page-ws { overflow: hidden; }
.ws { display: grid; grid-template-columns: 360px 1fr; gap: 12px; height: 100vh; padding: 12px; }
.ws-left { display: grid; grid-template-rows: auto 1fr auto; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ws-project { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); position: relative; }
.project-switch summary { font-weight: 600; padding: 4px 8px; border-radius: 6px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-switch summary:hover { background: var(--surface-2); }
.caret { color: var(--muted); font-size: 11px; }
.project-switch .menu-pop { left: 40px; max-height: 60vh; overflow: auto; }
.menu-new { margin: 4px 0 0; border-top: 1px solid var(--line-2); padding-top: 8px; }
.ws-tools { display: grid; grid-template-columns: 72px 1fr; min-height: 0; }
.rail { display: flex; flex-direction: column; gap: 4px; padding: 10px 6px; border-right: 1px solid var(--line-2); overflow-y: auto; }
.rail-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border: 0; border-radius: 10px;
  background: none; color: var(--ink-2); font: inherit; font-size: 11px; line-height: 1.25; cursor: pointer; text-align: center;
}
.rail-btn:hover { background: var(--surface-2); color: var(--ink); }
.rail-btn.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.rail-all { background: var(--ink); color: #fff; margin-bottom: 6px; }
.rail-all:hover { background: var(--ink-2); color: #fff; }
.rail-icon svg { width: 22px; height: 22px; display: block; }
.panel { overflow-y: auto; padding: 16px 16px 24px; }
.panel-head { display: flex; align-items: center; gap: 8px; }
.panel-head h2 { margin: 0; }
.panel-icon svg { width: 20px; height: 20px; display: block; color: var(--ink-2); }
.panel-desc { margin: 4px 0 6px; }
.field-block { margin-top: 16px; }
.field-label { font-weight: 600; font-size: 13px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.opt { font-weight: 400; font-size: 11px; color: var(--muted); padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; }
.hint { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.panel-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line-2); }
.panel-foot .btn { min-width: 120px; }
.cost { font-weight: 400; opacity: .85; font-size: 12px; }

.slot { position: relative; border: 1.5px dashed var(--line); border-radius: 10px; background: var(--surface-2); min-height: 120px; display: grid; place-items: center; overflow: hidden; }
.slot.drag { border-color: var(--accent); background: var(--accent-soft); }
.slot.filled { border-style: solid; background: #fff; }
.slot img { max-width: 100%; max-height: 200px; display: block; object-fit: contain; }
.slot-empty { width: 100%; min-height: 120px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; display: grid; place-items: center; align-content: center; gap: 4px; }
.slot-plus { font-size: 24px; line-height: 1; color: var(--ink-2); }
.slot-x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 11px; }
.slot-change { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); padding: 2px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; font-size: 12px; cursor: pointer; }
.slot-row { display: flex; gap: 8px; flex-wrap: wrap; }
.slot-sm { width: 92px; min-height: 92px; }
.slot-sm .slot-empty { min-height: 92px; }
.slot-sm img { max-height: 92px; }
.slot-sm .slot-change { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font: inherit; font-size: 12px; cursor: pointer; color: var(--ink-2);
}
.chip:hover { border-color: var(--ink-2); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.sw { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .15); display: inline-block; }
.order { min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; display: inline-grid; place-items: center; }
.segmented, .count { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.segmented button, .count button { border: 0; background: none; padding: 5px 14px; border-radius: 7px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.segmented button.on, .count button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.count button { min-width: 40px; }

.ws-right { display: grid; grid-template-rows: auto 1fr; gap: 12px; min-height: 0; min-width: 0; }
.ws-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.ws-top-right { display: flex; align-items: center; gap: 12px; }
.ws-top-right form { margin: 0; }
.badge-mock { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: #fff4d6; color: #8a6200; }
.feed-card { display: grid; grid-template-rows: auto 1fr; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.feed-tabs { display: flex; align-items: center; justify-content: space-between; padding: 0 14px; border-bottom: 1px solid var(--line-2); }
.tabs { display: flex; gap: 4px; }
.tab { border: 0; background: none; padding: 12px 8px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--accent-ink); border-bottom-color: var(--accent); }
.feed-actions { display: flex; align-items: center; gap: 10px; }
.view-toggle { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.feed { overflow-y: auto; padding: 16px; }
.empty { text-align: center; padding: 60px 20px; }
.gen { padding: 4px 0 20px; border-bottom: 1px solid var(--line-2); margin-bottom: 18px; }
.gen:last-child { border-bottom: 0; }
.gen-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.gen-title { font-weight: 600; color: var(--ink); }
.gen-tools { display: flex; align-items: center; gap: 4px; flex: none; }
.gen-inputs { display: flex; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.gen-inputs figure { margin: 0; text-align: center; }
.gen-inputs img { width: 64px; height: 64px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; cursor: zoom-in; display: block; }
.gen-inputs figcaption { font-size: 11px; color: var(--muted); }
.gen-error { margin: 8px 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 13px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 10px; border-radius: 999px; }
.status.running { background: var(--accent-soft); color: var(--accent-ink); }
.status.bad { background: var(--danger-soft); color: var(--danger); }
.out-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.view-grid .out-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.out { position: relative; margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: visible; background: #fff; }
.out-img { display: block; aspect-ratio: 1; background: var(--surface-2); border-radius: 10px 10px 0 0; overflow: hidden; cursor: zoom-in; }
.out-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.out-label { position: absolute; top: 8px; left: 8px; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); font-size: 12px; }
.out-actions { display: flex; align-items: center; gap: 10px; padding: 4px 8px; border-top: 1px solid var(--line-2); white-space: nowrap; font-size: 12px; }
.out-actions .icon-btn { width: 26px; height: 26px; }
.out-actions a:last-child { margin-left: auto; }
.out.placeholder { aspect-ratio: 1; display: grid; place-items: center; background: var(--surface-2); border-style: dashed; }
.send { position: relative; }
.send .menu-pop { bottom: 100%; left: 0; margin-bottom: 6px; }
.review { padding: 10px; border-top: 1px solid var(--line-2); display: grid; gap: 6px; background: var(--surface-2); border-radius: 0 0 10px 10px; }
.review .field-label { margin: 4px 0 0; font-size: 12px; }
.review .input { font-size: 13px; }
.review .btn { justify-self: start; margin-top: 4px; }

.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; color: var(--accent); }
.out.placeholder .spinner { width: 24px; height: 24px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 弹层 ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; }
.overlay-inner { max-width: 1120px; margin: 0 auto; padding: 28px 20px; }
.overlay-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.overlay-head h2 { margin: 0; font-size: 20px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tool-card { position: relative; display: grid; gap: 6px; align-content: start; text-align: left; padding: 18px; min-height: 140px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font: inherit; cursor: pointer; box-shadow: var(--shadow); }
.tool-card:hover { border-color: var(--accent); }
.tool-card-icon svg { width: 28px; height: 28px; color: var(--accent-ink); }
.tool-card.coming { cursor: default; opacity: .6; }
.tool-card.coming:hover { border-color: var(--line); }
.soon { position: absolute; top: 14px; right: 14px; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(29, 27, 24, .4); display: grid; place-items: center; padding: 16px; }
.modal-box { width: min(480px, 100%); max-height: 90vh; overflow: auto; background: var(--surface); border-radius: 16px; padding: 20px; box-shadow: var(--shadow-lg); }
.modal-wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.modal-head h2 { margin: 0; }
.scope { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; }
.dropzone { display: block; padding: 18px; border: 1.5px dashed var(--line); border-radius: 10px; background: var(--surface-2); text-align: center; cursor: pointer; margin-bottom: 14px; font-size: 13px; color: var(--ink-2); }
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.pick { aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); cursor: pointer; overflow: hidden; }
.pick:hover { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.pick img { width: 100%; height: 100%; object-fit: contain; display: block; }
.switch-row { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 12px 0; }
.share-link { display: flex; gap: 8px; }
/* 大图查看：左边图（整张放进窗口）+ 底部浮动操作条，右边信息栏 */
.viewer { position: fixed; inset: 0; z-index: 70; background: var(--surface); display: flex; }
.viewer[hidden] { display: none; }
.vw-stage { position: relative; flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 56px 72px 84px; background: var(--surface); }
.viewer.bare .vw-stage { padding-bottom: 40px; }
.vw-stage img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.vw-btn { border: 0; background: transparent; color: var(--ink-2); cursor: pointer; font: inherit; border-radius: 8px; }
.vw-btn:hover { background: var(--surface-2); }
.vw-close { position: absolute; top: 14px; left: 16px; width: 36px; height: 36px; font-size: 18px; }
.vw-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; font-size: 34px; line-height: 1; color: var(--muted); }
.vw-prev { left: 12px; } .vw-next { right: 12px; }
.vw-nav[hidden] { display: none; }
.vw-bar { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px;
  padding: 5px 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, .12); white-space: nowrap; font-size: 13px; }
.vw-bar[hidden] { display: none; }
.vw-act, .vw-bar .send summary { padding: 5px 10px; border-radius: 6px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
.vw-act:hover, .vw-bar .send summary:hover { background: var(--surface-2); }
.vw-act.on { color: var(--accent-ink); }
.vw-act.rated { color: var(--ok); }
.vw-count { padding: 0 6px 0 10px; border-left: 1px solid var(--line-2); margin-left: 4px; }
.vw-side { position: relative; width: 340px; flex: none; border-left: 1px solid var(--line); overflow-y: auto; background: var(--surface); }
.viewer.no-side .vw-side { width: 52px; }
.viewer.bare .vw-side { display: none; }
.vw-fold { position: absolute; top: 14px; left: 8px; width: 34px; height: 34px; font-size: 20px; }
.vw-info { padding: 18px 22px 28px 56px; }
.vw-title { font-weight: 600; font-size: 15px; }
.vw-k { margin-top: 18px; color: var(--muted); font-size: 12px; }
.vw-v { margin-top: 4px; line-height: 1.6; word-break: break-word; }
.vw-thumbs { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.vw-thumbs img { width: 76px; height: 76px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); cursor: zoom-in; }
.vw-copyable { position: relative; padding-right: 26px; }
.vw-copy { position: absolute; top: 0; right: 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; }
.vw-call summary { list-style: none; cursor: pointer; }
.vw-call summary::-webkit-details-marker { display: none; }
.vw-info .review { margin-top: 8px; border-radius: 8px; }
.vw-reuse { margin-top: 22px; }
@media (max-width: 760px) {
  .viewer { flex-direction: column; }
  .vw-stage { padding: 52px 8px 76px; }
  .vw-side, .viewer.no-side .vw-side { width: auto; max-height: 40vh; border-left: 0; border-top: 1px solid var(--line); }
  .viewer.no-side .vw-side { max-height: 52px; }
}
.toast { position: fixed; z-index: 80; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 13px; box-shadow: var(--shadow-lg); transition: opacity .4s; }
.toast.bad { background: var(--danger); }
.toast.out { opacity: 0; }

/* ---------- 管理 ---------- */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ---------- 手机 ---------- */
@media (max-width: 860px) {
  .page-ws { overflow: auto; }
  .ws { grid-template-columns: 1fr; height: auto; padding: 8px; }
  .ws-left { grid-template-rows: auto auto auto; }
  .ws-tools { grid-template-columns: 1fr; }
  .rail { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line-2); }
  .rail-btn { min-width: 64px; }
  .panel { overflow: visible; }
  .panel-foot { position: sticky; bottom: 0; background: var(--surface); border-radius: 0 0 var(--radius) var(--radius); }
  .feed { overflow: visible; }
  .out-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .admin-grid { grid-template-columns: 1fr; }
  .home-bar { margin: 8px; }
  .home-main { padding: 20px 16px 40px; }
}
.out-model { padding: 3px 8px 0; font-size: 11px; color: var(--muted, #888); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.center, th.center { text-align: center; }
.model-list { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 2px 0; }
.model-opt { display: inline-flex; align-items: center; gap: 7px; padding: 4px 2px; border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 14px; color: var(--ink-2); }
.model-opt .check { width: 12px; height: 12px; border: 1.5px solid var(--muted); border-radius: 50%; flex: none; font-size: 0; box-sizing: border-box; transition: all .12s; }
.model-opt:hover .check { border-color: var(--accent); }
.model-opt.on { color: var(--ink); font-weight: 600; }
.model-opt.on .check { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 2px #fff; }
.chips-sm { margin-top: 8px; } .chips-sm .chip { padding: 2px 10px; font-size: 12px; }
.vw-share { margin-top: 26px; padding-top: 6px; border-top: 1px solid var(--line-2); }
.vw-share .btn { margin-top: 8px; }
.vw-qr { display: block; width: 168px; height: 168px; margin: 10px 0 6px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 6px; }
.image-share { max-width: 900px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.image-share img { max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: 8px; background: var(--surface-2); }
#cost-hint.bad { color: #b3261e; }
.input-code { width: 72px; }
.nowrap { white-space: nowrap; }
form.inline { display: inline; }
.usage-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 10px 0; }
.usage-stats > div { display: flex; flex-direction: column; gap: 2px; }
.usage-gen { padding: 14px 0; border-top: 1px solid var(--line-2); }
.usage-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.usage-inputs { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0; color: var(--ink-2); }
.usage-imgs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.usage-img { display: flex; flex-direction: column; width: 132px; font-size: 11px; color: var(--ink-2); text-decoration: none; gap: 2px; }
.usage-img img { width: 132px; height: 132px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; }
.usage-img.input img { opacity: .85; border-style: dashed; }
.usage-img .ok { color: var(--ok); }
.model-opt.off { color: var(--muted); opacity: .45; cursor: not-allowed; }
.model-opt.off .check { border-style: dashed; }
.model-opt.off:hover .check { border-color: var(--muted); }
.test-bar { display: flex; gap: 16px; align-items: flex-start; padding: 12px; margin: 8px 0 14px; background: var(--surface-2); border-radius: 10px; }
.test-bar .input { margin-top: 8px; max-width: 360px; }
.test-sketch { width: 96px; height: 96px; flex: none; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: 8px; background: #fff; text-align: center; }
.test-sketch img { max-width: 94px; max-height: 94px; object-fit: contain; }
.models-table td { vertical-align: top; }
.input-sort { width: 64px; }
.input-name { min-width: 150px; }
.input-note { min-width: 200px; resize: vertical; font-size: 12px; }
.test-cell { min-width: 120px; }
.test-result { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.test-result img { width: 96px; height: 96px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; }
.ok-text { color: var(--ok); }
.bad-text { color: #b3261e; word-break: break-word; max-width: 220px; }
.btn-link.danger { color: #b3261e; }
.add-model { margin-top: 16px; }
.add-model > summary { list-style: none; display: inline-block; cursor: pointer; }
.add-model > summary::-webkit-details-marker { display: none; }
.add-model-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; align-items: end; margin-top: 12px; }
.add-model-form .muted { grid-column: 1 / -1; }
.deleted-models { margin-top: 14px; }
.test-sketch { cursor: pointer; }
.test-sketch:hover { border-color: var(--accent); }
/* 工艺单 */
.tp { margin-top: 12px; display: grid; gap: 16px; }
.tp-wait { display: flex; align-items: center; gap: 8px; padding: 18px 4px; }
.tp-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tp-cat { font-weight: 700; font-size: 16px; }
.tp-sum { color: var(--ink-2); flex: 1; min-width: 200px; }
.tp-title { font-weight: 600; margin-bottom: 6px; padding-left: 8px; border-left: 3px solid var(--accent); }
.tp-table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
.tp-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.tp-table td { padding: 0; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.tp-cell { padding: 6px; min-height: 20px; line-height: 1.5; outline: none; border-radius: 4px; word-break: break-word; }
.tp-cell:hover { background: var(--surface-2); }
.tp-cell:focus { background: #fff; box-shadow: inset 0 0 0 1.5px var(--accent); }
.tp-confirm { color: var(--accent-ink); }
.tp-x { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 15px; padding: 6px 4px; opacity: .5; }
.tp-x:hover { opacity: 1; color: #b3261e; }
.tp-list { margin: 0; padding-left: 18px; font-size: 13px; }
.tp-list li { display: flex; align-items: flex-start; }
.tp-list li .tp-cell { flex: 1; }
.tp-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tp-spacer { flex: 1; }
.tp-note { margin: 0; }
