/* =========================================================
   衣线 · Atelier Link
   Editorial fashion-studio interface
   ========================================================= */

:root {
  --paper: #f6f1e8;
  --paper-2: #efe7da;
  --paper-3: #e8ddcc;
  --card: #fffdf8;
  --ink: #211e1a;
  --ink-2: #453f36;
  --ink-3: #6b6356;
  --muted: #6f665a;
  --line: #e0d4c2;
  --line-strong: #cdbda6;
  --clay: #b4552d;
  --clay-deep: #8f3f1f;
  --clay-soft: #eed3c3;
  --olive: #6b7159;
  --gold: #a8894f;
  --danger: #a33b2e;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --shadow-sm: 0 1px 2px rgba(46, 38, 27, .05), 0 8px 24px -18px rgba(46, 38, 27, .4);
  --shadow-md: 0 24px 60px -36px rgba(40, 32, 22, .55);
  --shadow-lg: 0 40px 90px -40px rgba(35, 28, 19, .6);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

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

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
::selection { background: var(--clay); color: #fff; }

.hidden { display: none !important; }

.eyebrow {
  margin: 0;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 20px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

/* =========================================================
   Buttons & fields
   ========================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, transform .15s, box-shadow .2s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.sheet-actions .btn:disabled,
.modal-actions .btn:disabled { opacity: 1; background: var(--paper-2); border-color: var(--line); color: var(--muted); box-shadow: none; }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover:not(:disabled) { background: var(--clay); border-color: var(--clay); }

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border-color: var(--line-strong);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); background: var(--card); }

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: rgba(163, 59, 46, .3);
}
.btn-danger-ghost:hover { background: rgba(163, 59, 46, .07); border-color: var(--danger); }

.btn-block { width: 100%; height: 46px; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--ink-3);
}
.field-label em { font-style: normal; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.field input, .field select, .field textarea {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  font-size: 14px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(33, 30, 26, .06);
}
.field input::placeholder, .field textarea::placeholder { color: #b3a795; }
.field input:disabled, .field select:disabled { background: var(--paper-2); color: var(--muted); cursor: not-allowed; }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  transition: all .18s;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* =========================================================
   Login
   ========================================================= */

.login {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  height: 100dvh;
  background: var(--paper);
}

.login-art {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 44px 54px 36px;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  isolation: isolate;
}
.login-art::before {
  content: "";
  position: absolute;
  width: 620px;
  height: 620px;
  right: -230px;
  top: -190px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(180, 85, 45, .38), rgba(180, 85, 45, 0) 66%);
  z-index: -1;
}
.login-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(246, 241, 232, .035) 0 1px, transparent 1px 118px),
    radial-gradient(120% 90% at 0% 100%, rgba(0, 0, 0, .45), transparent 60%);
  z-index: -1;
  pointer-events: none;
}

.login-brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(246, 241, 232, .4);
  border-radius: 7px;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1;
  color: var(--paper);
}
.brand-word {
  display: flex;
  flex-direction: column;
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: .16em;
  line-height: 1.1;
}
.brand-word small {
  font-family: var(--sans);
  font-size: 7.5px;
  letter-spacing: .34em;
  color: rgba(246, 241, 232, .45);
  margin-top: 4px;
}

.art-copy { margin-top: auto; position: relative; z-index: 2; }
.art-copy .eyebrow { color: rgba(246, 241, 232, .45); margin-bottom: 22px; }
.art-copy h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(42px, 4.4vw, 68px);
  line-height: 1.14;
  letter-spacing: .01em;
  color: #f7f1e6;
}
.art-lede {
  margin: 28px 0 0;
  font-size: 14px;
  line-height: 1.9;
  color: rgba(246, 241, 232, .62);
  letter-spacing: .04em;
}

.dressform {
  position: absolute;
  right: 7%;
  top: 12%;
  width: min(40%, 360px);
  color: #f6f1e8;
  opacity: .9;
  z-index: 1;
  animation: breathe 9s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: translateY(0); opacity: .82; }
  50% { transform: translateY(-8px); opacity: .95; }
}

.art-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(246, 241, 232, .14);
  font-size: 9px;
  letter-spacing: .2em;
  color: rgba(246, 241, 232, .4);
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 40px;
  background:
    radial-gradient(90% 70% at 100% 0%, rgba(180, 85, 45, .07), transparent 55%),
    var(--paper);
}
.login-form { width: min(400px, 100%); animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.login-form .eyebrow { color: var(--clay); }
.login-form h2 {
  margin: 12px 0 10px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 40px;
  letter-spacing: .03em;
}
.login-form .hint { margin: 0 0 30px; color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.login-form .btn-block { margin-top: 8px; }
.fineprint { margin: 18px 0 0; text-align: center; font-size: 10.5px; color: var(--muted); letter-spacing: .03em; }
.site-legal { margin: 10px 0 0; text-align: center; font-size: 10.5px; line-height: 1.6; color: var(--muted); letter-spacing: .02em; }
.site-legal a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(33, 30, 26, .28); }
.site-legal a:hover { color: var(--ink-3); }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   Shell / Rail
   ========================================================= */

.shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  height: 100dvh;
  background: var(--paper);
}

.rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 26px 16px 16px;
  background: var(--ink);
  color: var(--paper);
  position: relative;
  z-index: 3;
}
.rail::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: rgba(246, 241, 232, .06);
}
.rail .brand { padding: 0 8px 26px; }
.rail .brand-mark { border-color: rgba(246, 241, 232, .28); width: 34px; height: 34px; font-size: 18px; }
.rail .brand-word { font-size: 17px; }
.rail .brand-word small { font-size: 7px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(246, 241, 232, .56);
  font-size: 13px;
  text-align: left;
  transition: color .2s, background .2s;
}
.nav-item:hover { color: var(--paper); background: rgba(246, 241, 232, .055); }
.nav-item.is-active { color: var(--paper); background: rgba(246, 241, 232, .09); }
.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 12px;
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--clay);
}
.nav-icon { display: grid; place-items: center; width: 18px; height: 18px; opacity: .9; }
.nav-icon svg { width: 17px; height: 17px; }
.nav-badge {
  margin-left: auto;
  min-width: 19px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--clay);
  color: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.rail-series {
  margin-top: auto;
  padding: 20px 10px 18px;
  border-top: 1px solid rgba(246, 241, 232, .12);
}
.rail-series .eyebrow { color: rgba(246, 241, 232, .34); font-size: 8px; margin-bottom: 8px; }
.rail-series strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: .04em;
  line-height: 1.4;
  color: #f1e9db;
}
.rail-series span { display: block; margin-top: 7px; font-size: 8px; letter-spacing: .2em; color: var(--clay-soft); opacity: .65; }

.rail-foot { border-top: 1px solid rgba(246, 241, 232, .12); padding-top: 12px; }
.me-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  transition: background .2s;
}
.me-card:hover { background: rgba(246, 241, 232, .06); }
.me-card .avatar { width: 32px; height: 32px; font-size: 13px; }
.me-copy { min-width: 0; display: flex; flex-direction: column; }
.me-copy strong { font-size: 12.5px; font-weight: 500; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-copy span { font-size: 10px; color: rgba(246, 241, 232, .42); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-card .admin-dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: none; }

/* Avatars */
.avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--c, var(--clay));
  color: #fff8ef;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  user-select: none;
}
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.lg { width: 52px; height: 52px; font-size: 20px; }
.avatar.ai {
  background: var(--ink);
  color: var(--clay-soft);
  box-shadow: inset 0 0 0 1px rgba(246, 241, 232, .22);
}
.avatar.ai svg { width: 19px; height: 19px; }
.avatar .presence {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #7f9a6b;
  border: 2px solid var(--paper);
}
.avatar.on-dark .presence { border-color: var(--ink); }

/* =========================================================
   Topbar
   ========================================================= */

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 22px;
  height: 78px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 241, 232, .82);
  backdrop-filter: blur(14px);
  position: relative;
  z-index: 2;
}
.topbar-title { display: flex; flex-direction: column; gap: 2px; min-width: 130px; }
.topbar-title .eyebrow { color: var(--clay); font-size: 8.5px; }
.topbar-title h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 23px;
  letter-spacing: .03em;
  line-height: 1.25;
}
.topbar-sub { margin: 0; color: var(--muted); font-size: 11.5px; letter-spacing: .02em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }

.online-stack { display: flex; align-items: center; }
.online-stack .avatar { margin-left: -8px; border: 2px solid var(--paper); width: 28px; height: 28px; font-size: 10px; }
.online-stack .avatar:first-child { margin-left: 0; }
.online-stack .more { font-size: 10px; color: var(--muted); margin-left: 8px; letter-spacing: .04em; }

.ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-3);
  font-size: 10.5px;
  letter-spacing: .04em;
  transition: all .2s;
}
.ai-pill:hover { border-color: var(--ink); color: var(--ink); }
.ai-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #7f9a6b; }
.ai-pill.is-demo .dot { background: var(--clay); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  transition: all .2s;
}
.icon-btn:hover { border-color: var(--ink); color: var(--ink); }
.icon-btn svg { width: 16px; height: 16px; }
.notif-btn { position: relative; flex: none; }
.notif-group { margin-top: 12px; }
.notif-group h4 { margin: 0 0 6px; font-family: var(--sans); font-size: 10px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.notif-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); text-align: left; color: var(--ink); font-family: var(--sans); cursor: pointer; }
.notif-item + .notif-item { margin-top: 5px; }
.notif-item strong { display: block; font-size: 11px; font-weight: 500; }
.notif-item small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.notif-item-dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--clay); }
.notif-item-dot.is-late { background: var(--danger, #a44936); }
.notif-empty { padding: 18px 4px; color: var(--muted); font-size: 11px; text-align: center; }
.notif-badge { position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: var(--clay); color: #fff; font-size: 8px; font-style: normal; line-height: 15px; text-align: center; }
.topbar-me { display: none; padding: 0; border: 0; }
.topbar-me .avatar { width: 32px; height: 32px; }

/* =========================================================
   Views
   ========================================================= */

.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.view.hidden { display: none !important; }

/* =========================================================
   Chat
   ========================================================= */

.chat-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px 360px;
}
body.ai-direct-open { overflow: hidden; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-layout, .chat-main, .timeline, .msg, .msg-body, .ai-card { min-width: 0; max-width: 100%; }
.timeline { overflow-x: hidden; }
.channel-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 10px 18px 8px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.channel-current {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  height: 32px;
  padding: 0 8px 0 2px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
}
.channel-current:hover { background: var(--paper-2); }
.channel-hash { color: var(--clay); font-family: var(--serif); font-size: 18px; line-height: 1; }
#channel-current-name { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.channel-current-meta { color: var(--muted); font-size: 9px; }
.channel-chevron { color: var(--muted); font-size: 13px; }
.channel-action {
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 9px;
  white-space: nowrap;
  cursor: pointer;
}
.channel-action:hover { border-color: var(--clay); color: var(--clay); }
.channel-new { margin-left: auto; }
.channel-action.hidden { display: none; }
.channel-picker { display: flex; flex-direction: column; gap: 4px; }
.channel-picker-row { display: flex; align-items: center; gap: 8px; padding: 9px 8px; border: 1px solid transparent; border-radius: 7px; }
.channel-picker-row:hover { background: var(--paper-2); }
.channel-picker-row.is-active { border-color: var(--line-strong); background: var(--paper-2); }
.channel-picker-main { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; color: var(--ink); font-family: var(--sans); cursor: pointer; }
.channel-picker-main strong { display: block; font-size: 12px; font-weight: 500; }
.channel-picker-main small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.channel-picker-badge { font-size: 8px; color: var(--muted); }
.channel-create-form .channel-member-list { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin: 6px 0 12px; }
.channel-member-option { display: flex; align-items: center; gap: 6px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; font-size: 10px; }
.channel-member-option input { accent-color: var(--clay); }
.channel-member-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 30px 40px 10px;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.date-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 860px;
  margin: 4px auto 24px;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.date-divider::before, .date-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.date-divider:first-child { margin-top: 0; }

.msg {
  position: relative;
  display: flex;
  gap: 13px;
  max-width: 860px;
  margin: 0 auto 24px;
  animation: msg-in .4s cubic-bezier(.2, .75, .2, 1) both;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg.is-pending { opacity: .62; }
.msg-body { flex: 1; min-width: 0; }
.msg-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 20px;
  font-size: 10.5px;
  color: var(--muted);
}
.msg-head .name { font-size: 12.5px; font-weight: 600; color: var(--ink); letter-spacing: .01em; }
.msg-head .role { font-size: 10px; color: var(--muted); }
.msg-head time { margin-left: 2px; font-size: 10px; color: #a99d8c; letter-spacing: .02em; }
.msg-head .badge {
  height: 18px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: .08em;
  border: 1px solid var(--line);
  color: var(--ink-3);
  background: var(--paper-2);
}
.msg-head .badge.demo { border-color: rgba(180, 85, 45, .3); color: var(--clay-deep); background: rgba(180, 85, 45, .07); }
.msg-head .badge.pending { border-color: transparent; color: var(--muted); background: transparent; }

.msg-text { margin-top: 5px; font-size: 14.5px; line-height: 1.8; color: var(--ink-2); word-break: break-word; }
.msg-text p { margin: 0 0 10px; }
.msg-text p:last-child { margin-bottom: 0; }

.msg.is-own .msg-text { color: var(--ink); }

.msg-actions {
  display: flex;
  gap: 4px;
  margin-top: 7px;
  opacity: 0;
  transition: opacity .2s;
}
.msg:hover .msg-actions, .msg:focus-within .msg-actions { opacity: 1; }
.msg-action {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
  gap: 5px;
  height: 25px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .02em;
  transition: all .15s;
}
.msg-action:hover { border-color: var(--line); background: var(--card); color: var(--ink); }
.msg-action svg { width: 13px; height: 13px; }

/* AI message */
.msg.is-ai .msg-body { max-width: 100%; }
.msg.is-ai .msg-head .name { color: var(--clay-deep); }
.ai-card {
  margin-top: 7px;
  padding: 22px 24px 12px;
  border-radius: 3px 18px 18px 18px;
  background: var(--ink);
  color: #efe7d9;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.ai-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  width: 2px;
  height: 34px;
  background: var(--clay);
}
.ai-card .prose { font-size: 13.8px; line-height: 1.85; color: #e8dfd0; }
.ai-card .prose h3, .ai-card .prose h4 { color: #faf5ea; }
.ai-card .prose strong { color: #fffaf0; }
.ai-card .prose blockquote { border-left-color: var(--clay); color: rgba(246, 241, 232, .6); background: rgba(246, 241, 232, .04); }
.ai-card .prose code { background: rgba(246, 241, 232, .1); color: #f0d3b8; }
.ai-card .prose table th { background: rgba(246, 241, 232, .08); color: #faf5ea; border-color: rgba(246, 241, 232, .16); }
.ai-card .prose table td { border-color: rgba(246, 241, 232, .12); }
.ai-card .table-wrap { width: 100%; max-width: 100%; overflow-x: hidden; }
.ai-card .table-wrap table { width: 100%; min-width: 0; table-layout: fixed; }
.ai-card .prose th, .ai-card .prose td { overflow-wrap: anywhere; word-break: break-word; }
.ai-card .prose table { font-size: 12px; }
.ai-card .prose th, .ai-card .prose td { padding: 6px 7px; }
.ai-card .prose hr { border-color: rgba(246, 241, 232, .14); }

.ai-card-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 9px;
  border-top: 1px solid rgba(246, 241, 232, .1);
  opacity: .92;
  transition: opacity .2s;
}
.ai-card:hover .ai-card-foot { opacity: 1; }
.ai-card-foot .msg-action { color: rgba(246, 241, 232, .7); }
.ai-card-foot .msg-action:hover { color: #faf5ea; border-color: rgba(246, 241, 232, .2); background: rgba(246, 241, 232, .06); }
.ai-card-foot .spacer { flex: 1; }
.ai-card-foot .model-tag { font-size: 9px; letter-spacing: .1em; color: rgba(246, 241, 232, .34); text-transform: uppercase; }

.typing { display: inline-flex; gap: 4px; align-items: center; height: 16px; }
.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--clay-soft);
  animation: typing 1.1s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%, 70%, 100% { transform: translateY(0); opacity: .35; } 35% { transform: translateY(-4px); opacity: 1; } }

.cursor-blink::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--clay-soft);
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Markdown prose */
.prose { color: var(--ink-2); font-size: 14px; line-height: 1.8; }
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose h2, .prose h3, .prose h4 {
  margin: 20px 0 8px;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: .02em;
  color: var(--ink);
}
.prose h2 { font-size: 19px; }
.prose h3 { font-size: 16.5px; }
.prose h4 { font-size: 14.5px; }
.prose p { margin: 0 0 10px; }
.prose ul, .prose ol { margin: 6px 0 12px; padding-left: 20px; }
.prose li { margin-bottom: 5px; }
.prose li::marker { color: var(--clay); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }
.prose code {
  font-family: var(--mono);
  font-size: .88em;
  background: var(--paper-2);
  padding: 2px 5px;
  border-radius: 4px;
}
.prose pre {
  background: #2b2721;
  color: #efe6d7;
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 12px 0;
}
.prose pre code { background: none; padding: 0; color: inherit; }
.prose blockquote {
  margin: 12px 0;
  padding: 9px 14px;
  border-left: 2px solid var(--clay);
  background: rgba(180, 85, 45, .05);
  color: var(--ink-3);
  font-size: .94em;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.prose a { color: var(--clay-deep); text-decoration: underline; text-underline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; margin: 0; font-size: 12.5px; }
.prose th, .prose td { padding: 7px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--paper-2); font-weight: 600; color: var(--ink); }
.table-wrap { margin: 12px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 520px; }

/* Composer */
.composer-wrap { flex: none; padding: 6px 40px 14px; }
.composer {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  box-shadow: 0 12px 34px -26px rgba(40, 32, 22, .55);
  transition: border-color .2s, box-shadow .2s;
}
.composer:focus-within {
  border-color: #b3a18a;
  box-shadow: 0 16px 38px -26px rgba(40, 32, 22, .6), 0 0 0 3px rgba(180, 85, 45, .05);
}
.composer.is-listening { border-color: var(--clay); }

.composer-modes {
  display: flex;
  gap: 4px;
  padding: 9px 10px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.composer-modes::-webkit-scrollbar { display: none; }
.mode-chip {
  height: 27px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  flex: none;
  transition: all .16s;
}
.mode-chip:hover { color: var(--ink); background: var(--paper-2); }
.mode-chip.is-active { color: var(--paper); background: var(--ink); border-color: var(--ink); }

.composer textarea {
  display: block;
  width: 100%;
  max-height: 170px;
  min-height: 44px;
  padding: 10px 16px 4px;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink);
}
.composer textarea::placeholder { color: #ac9f8d; }

.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 9px 9px 11px; }
.composer-attachment {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 2px 11px 4px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  font-size: 9.5px;
  color: var(--muted);
}
.composer-attachment img { width: 42px; height: 42px; object-fit: cover; border-radius: 5px; flex: none; }
.composer-attachment span { flex: 1; min-width: 0; }
.composer-attachment button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--paper-2); color: var(--ink-3); font-size: 16px; line-height: 1; cursor: pointer; }
.image-menu {
  position: absolute;
  left: 44px;
  bottom: 48px;
  z-index: 8;
  min-width: 132px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}
.image-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}
.image-menu button:hover { background: var(--paper-2); }
.msg-image-wrap { margin: 5px 0 8px; max-width: min(320px, 100%); }
.msg-image-wrap img { display: block; width: 100%; max-height: 280px; object-fit: cover; border-radius: 7px; cursor: zoom-in; border: 1px solid rgba(33, 30, 26, .08); }
.composer-tools { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tool-btn {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink-3);
  transition: all .2s;
}
.tool-btn:hover { border-color: var(--clay); color: var(--clay); background: rgba(180, 85, 45, .06); }
.tool-btn svg { width: 16px; height: 16px; }
.tool-btn.is-active { border-color: var(--clay); color: var(--clay); background: rgba(180, 85, 45, .08); }
.tool-btn.is-recording { background: var(--clay); border-color: var(--clay); color: #fff; animation: rec 1.4s infinite; }
@keyframes rec {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180, 85, 45, .3); }
  50% { box-shadow: 0 0 0 7px rgba(180, 85, 45, 0); }
}

.ai-switch { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-3); cursor: pointer; user-select: none; white-space: nowrap; }
.ai-switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  position: relative;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background .2s;
  flex: none;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}
.ai-switch input:checked + .switch-track { background: var(--clay); }
.ai-switch input:checked + .switch-track::after { transform: translateX(12px); }
.ai-switch input:focus-visible + .switch-track { outline: 2px solid var(--ink); outline-offset: 2px; }

.mode-hint {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .02em;
}

.composer-send { display: flex; align-items: center; gap: 12px; flex: none; }
.kbd-hint { font-size: 9.5px; color: #ad9f8c; letter-spacing: .02em; }
.send-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  transition: background .2s, transform .15s;
}
.send-btn:hover:not(:disabled) { background: var(--clay); }
.send-btn:active:not(:disabled) { transform: scale(.95); }
.send-btn:disabled { opacity: .35; cursor: not-allowed; }
.send-btn svg { width: 17px; height: 17px; }
.send-btn.is-stop { background: var(--clay); }

.composer-foot {
  max-width: 860px;
  margin: 8px auto 0;
  text-align: center;
  font-size: 9.5px;
  letter-spacing: .04em;
  color: #ab9e8b;
}

/* Voice overlay */
.voice-overlay {
  position: absolute;
  inset: auto 0 calc(100% + 6px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 12px;
  pointer-events: none;
  border-radius: 15px;
  background: var(--ink);
  color: var(--paper);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity .2s, visibility .2s, transform .2s;
}
.composer.is-listening .voice-overlay { opacity: 1; visibility: visible; transform: none; }
.voice-bars { display: flex; align-items: center; gap: 3px; height: 26px; }
.voice-bars i {
  width: 3px;
  height: 6px;
  background: var(--clay-soft);
  border-radius: 3px;
  animation: bars .9s ease-in-out infinite;
}
.voice-bars i:nth-child(2) { animation-delay: .1s; }
.voice-bars i:nth-child(3) { animation-delay: .2s; }
.voice-bars i:nth-child(4) { animation-delay: .3s; }
.voice-bars i:nth-child(5) { animation-delay: .4s; }
.voice-bars i:nth-child(6) { animation-delay: .5s; }
.voice-bars i:nth-child(7) { animation-delay: .6s; }
@keyframes bars { 0%, 100% { height: 6px; opacity: .5; } 50% { height: 24px; opacity: 1; } }
.voice-copy { display: flex; flex-direction: column; min-width: 0; }
.voice-copy strong { font-family: var(--serif); font-size: 15px; font-weight: 400; letter-spacing: .04em; }
.voice-copy span { font-size: 12px; color: rgba(246, 241, 232, .8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-tools .tool-btn.voice-btn {
  display: inline-flex;
  flex: none;
  gap: 6px;
  width: auto;
  height: 44px;
  padding: 0 9px;
  border-radius: 10px;
  font-size: 12px;
  white-space: nowrap;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* =========================================================
   Context rail
   ========================================================= */

.context-rail {
  min-height: 0;
  overflow-y: auto;
  padding: 22px 16px 30px;
  background: #f1eade;
  border-left: 1px solid var(--line);
}
.ctx-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.ctx-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.ctx-head h4 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .09em; color: var(--ink-3); }
.mini-link { border: 0; background: none; color: var(--muted); font-size: 10px; padding: 0; }
.mini-link:hover { color: var(--clay); }
.live-dot { font-size: 8px; letter-spacing: .18em; color: var(--olive); }

.series-card { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.series-card .eyebrow { color: rgba(246, 241, 232, .36); font-size: 8px; }
.series-card h3 {
  margin: 8px 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  line-height: 1.35;
  color: #f7f0e3;
  letter-spacing: .02em;
}
.series-card > p:not(.eyebrow) { margin: 0 0 16px; font-size: 11px; line-height: 1.7; color: rgba(246, 241, 232, .48); }
.series-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 12px 0; border-top: 1px solid rgba(246, 241, 232, .12); border-bottom: 1px solid rgba(246, 241, 232, .12); }
.series-stats div { display: flex; flex-direction: column; gap: 2px; }
.series-stats strong { font-family: var(--serif); font-size: 20px; font-weight: 400; color: #f5eddf; line-height: 1; }
.series-stats span { font-size: 9px; color: rgba(246, 241, 232, .4); letter-spacing: .05em; }
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 13px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--clay-soft);
  font-size: 10px;
  letter-spacing: .04em;
}
.text-link:hover { color: #fff; }
.text-link span { transition: transform .2s; }
.text-link:hover span { transform: translateX(3px); }

.mini-tasks { display: flex; flex-direction: column; gap: 2px; }
.mini-task {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 4px;
  border-radius: 6px;
  text-align: left;
  border: 0;
  background: transparent;
  width: 100%;
  transition: background .15s;
}
.mini-task:hover { background: var(--paper); }
.mini-check {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  color: transparent;
}
.mini-check:hover { border-color: var(--olive); background: rgba(107, 113, 89, .1); }
.mini-check svg { width: 9px; height: 9px; }
.mini-task-copy { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mini-task-copy strong { font-size: 11.5px; font-weight: 500; color: var(--ink-2); line-height: 1.45; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mini-task-copy span { font-size: 9px; color: var(--muted); }
.mini-empty { padding: 8px 4px; font-size: 11px; color: var(--muted); line-height: 1.7; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  text-align: left;
  transition: all .18s;
}
.quick-btn:hover { border-color: var(--clay); background: rgba(180, 85, 45, .05); }
.quick-btn strong { font-size: 11px; font-weight: 500; color: var(--ink-2); }
.quick-btn span { font-size: 8.5px; color: var(--muted); letter-spacing: .02em; }

.online-list { display: flex; flex-direction: column; gap: 7px; }
.online-person { display: flex; align-items: center; gap: 8px; }
.online-person .avatar { width: 26px; height: 26px; font-size: 10px; }
.online-person .name { font-size: 11.5px; color: var(--ink-2); }
.online-person .role { margin-left: auto; font-size: 9px; color: var(--muted); }

/* Empty timeline */
.chat-empty { max-width: 640px; margin: 8vh auto 0; text-align: center; padding: 0 20px; }
.chat-empty .mark {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 24px;
  color: var(--clay);
}
.chat-empty h3 { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 26px; }
.chat-empty p { margin: 0 auto 18px; max-width: 420px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.starter-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.starter {
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-3);
  font-size: 11px;
  transition: all .18s;
}
.starter:hover { border-color: var(--ink); color: var(--ink); }

/* =========================================================
   Page / Tasks
   ========================================================= */

.page { flex: 1; min-height: 0; overflow-y: auto; padding: 28px 34px 48px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  height: 31px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-3);
  font-size: 11px;
  transition: all .18s;
}
.filter-chip:hover { border-color: var(--ink-3); }
.filter-chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.page-actions { display: flex; gap: 8px; }

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
  align-items: stretch;
}

/* 任务页 · 新版列表 */
.tasks-page-v2 { padding-top: 18px; padding-bottom: 104px; }
.task-quick-filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.task-quick-filters .filter-chip { height: 40px; padding: 0 14px; font-size: 12px; }
.task-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.task-actions .btn { height: 44px; justify-content: center; font-size: 12px; }
.task-focus-card {
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--paper);
}
.task-focus-card.is-actionable { cursor: pointer; }
.task-focus-card .eyebrow { margin: 0 0 8px; color: var(--clay-soft); font-size: 9px; }
.task-focus-card h3 { margin: 0 0 5px; color: var(--paper); font-family: var(--serif); font-size: 19px; font-weight: 400; line-height: 1.4; }
.task-focus-meta { margin: 0; color: rgba(246, 241, 232, .62); font-size: 10px; }
.task-focus-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(246, 241, 232, .16); }
.task-focus-stats div { display: flex; flex-direction: column; gap: 3px; }
.task-focus-stats strong { color: var(--paper); font-family: var(--serif); font-size: 24px; font-weight: 400; line-height: 1; }
.task-focus-stats span { color: rgba(246, 241, 232, .55); font-size: 9px; }
.task-status-filters { display: flex; align-items: center; justify-content: space-between; gap: 2px; margin: 2px 0 12px; overflow: hidden; }
.task-status-chip {
  min-width: 0;
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 38px;
  padding: 0 3px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.task-status-chip span { color: inherit; font-size: 8px; opacity: .7; }
.task-status-chip.is-active { background: var(--ink); color: var(--paper); }
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-list-card.task-card { display: block; padding: 13px 14px 11px; border-radius: 10px; cursor: pointer; }
.tasks-page-v2 .task-card::before { display: none; }
.task-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.task-priority { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border-radius: 4px; background: var(--paper-2); color: var(--ink-3); font-size: 9px; }
.task-priority.p-high { background: var(--clay-soft); color: var(--clay-deep); }
.task-priority.p-urgent { background: var(--clay); color: #fff; }
.task-stage-tag { display: inline-flex; align-items: center; min-height: 20px; padding: 0 7px; border-radius: 4px; background: var(--paper-2); color: var(--clay-deep); font-size: 9px; }
.task-done-tag { color: var(--muted); font-size: 9px; }
.task-list-empty { padding: 40px 16px; border: 1px dashed var(--line-strong); border-radius: 10px; text-align: center; color: var(--muted); }
.task-list-empty strong { display: block; margin-bottom: 5px; color: var(--ink); font-family: var(--serif); font-size: 19px; font-weight: 400; }
.task-list-empty p { margin: 0; font-size: 11px; }
.board-col {
  background: #efe7da;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 10px;
  min-height: calc(100dvh - 275px);
  transition: background .2s, border-color .2s;
  display: flex;
  flex-direction: column;
}
.board-col.is-over { background: #eadcc8; border-color: var(--clay); }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 5px 6px 11px; }
.col-title { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--ink-3); }
.col-title i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.col-title i.todo { background: #a99d8c; }
.col-title i.doing { background: var(--clay); }
.col-title i.review { background: var(--gold); }
.col-title i.done { background: var(--olive); }
.col-count { min-width: 20px; height: 19px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: rgba(33, 30, 26, .06); font-size: 9.5px; color: var(--ink-3); }
.col-add { width: 22px; height: 22px; display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: 6px; background: transparent; color: var(--muted); }
.col-add:hover { border-color: var(--clay); color: var(--clay); }
.col-add svg { width: 12px; height: 12px; }
.board-col .col-body { display: flex; flex-direction: column; gap: 8px; min-height: 60px; flex: 1; }
.col-empty { padding: 18px 8px; text-align: center; font-size: 10.5px; color: #a99d8c; border: 1px dashed var(--line-strong); border-radius: 8px; }

.task-card {
  position: relative;
  padding: 11px 12px 10px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: 0 1px 1px rgba(46, 38, 27, .03);
  cursor: grab;
  transition: border-color .18s, box-shadow .18s, transform .15s;
  overflow: hidden;
}
.task-card.is-locked { cursor: pointer; }
.task-card.is-locked .task-title { color: var(--ink-2); }
.task-card.is-locked:active { cursor: pointer; }
.task-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.task-card:active { cursor: grabbing; }
.task-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--line-strong); }
.task-card.p-high::before { background: var(--gold); }
.task-card.p-urgent::before { background: var(--clay); }
.task-card.p-low::before { background: #b9b3a4; }
.task-card.is-done { opacity: .62; }
.task-card.is-done .task-title { text-decoration: line-through; text-decoration-color: var(--muted); }
.task-title { font-size: 12.5px; font-weight: 500; line-height: 1.5; color: var(--ink); margin-bottom: 6px; word-break: break-word; }
.task-detail { margin: -2px 0 7px; font-size: 10.5px; color: var(--muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-sheet-link { display: inline-flex; margin: -1px 0 7px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--clay-deep); font-family: var(--sans); font-size: 9px; cursor: pointer; }
.task-sheet-link:hover { border-color: var(--clay); }
.task-audience { display: inline-flex; align-items: center; padding: 2px 6px; border-radius: 3px; background: rgba(107, 113, 89, .1); color: var(--olive); font-size: 9px; }
.task-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; }
.task-assignee { display: inline-flex; align-items: center; gap: 5px; font-size: 9.5px; color: var(--ink-3); min-width: 0; }
.task-assignee .avatar { width: 18px; height: 18px; font-size: 8px; }
.task-assignee span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-due { display: inline-flex; align-items: center; gap: 3px; font-size: 9px; color: var(--muted); white-space: nowrap; }
.task-due svg { width: 10px; height: 10px; }
.task-due.is-overdue { color: var(--danger); }
.task-flag { font-size: 8px; letter-spacing: .08em; color: var(--clay-deep); text-transform: uppercase; }

/* =========================================================
   Digest
   ========================================================= */

.digest-page { padding-top: 34px; }
.digest-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; max-width: 880px; margin: 0 auto 22px; }
.digest-head .eyebrow { color: var(--clay); }
.digest-date { margin: 8px 0 6px; font-family: var(--serif); font-weight: 400; font-size: 38px; letter-spacing: .02em; line-height: 1.2; }
.digest-lede { margin: 0; color: var(--muted); font-size: 12px; letter-spacing: .02em; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 880px; margin: 0 auto 18px; }
.stat-card { padding: 15px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.stat-card strong { display: block; font-family: var(--serif); font-size: 27px; font-weight: 400; line-height: 1.1; color: var(--ink); }
.stat-card span { font-size: 9.5px; letter-spacing: .08em; color: var(--muted); }
.digest-body {
  max-width: 880px;
  margin: 0 auto;
  padding: 34px 38px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  min-height: 280px;
}
.digest-body.prose { font-size: 14px; line-height: 1.85; }
.digest-body .prose h3, .digest-body h3 { font-size: 18px; margin-top: 24px; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.digest-body h3:first-child { margin-top: 0; }
.digest-foot { max-width: 880px; margin: 14px auto 0; font-size: 10px; color: var(--muted); letter-spacing: .03em; text-align: right; }

.empty-state { text-align: center; padding: 48px 20px; }
.empty-mark { display: block; font-family: var(--serif); font-size: 40px; color: var(--clay); line-height: 1; margin-bottom: 14px; }
.empty-state h4 { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 21px; }
.empty-state p { margin: 0 auto; max-width: 380px; color: var(--muted); font-size: 12px; line-height: 1.8; }

/* =========================================================
   Members
   ========================================================= */

.members-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.members-intro .eyebrow { color: var(--clay); }
.members-intro h3 { margin: 8px 0 0; font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: .02em; }
.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 12px; }
.members-log { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.members-log-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.members-log-head .eyebrow { margin: 0 0 5px; color: var(--clay); }
.members-log-head h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 23px; }
.members-log-hint { margin: 0 0 12px; color: var(--muted); font-size: 10.5px; line-height: 1.7; }
.audit-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.audit-filters .filter-chip { height: 31px; font-size: 10.5px; }
.audit-filters .filter-chip span { margin-left: 5px; opacity: .7; }
.audit-list { display: flex; flex-direction: column; gap: 12px; }
.audit-group { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }
.audit-person { display: flex; align-items: center; gap: 8px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.audit-person .avatar { width: 26px; height: 26px; font-size: 10px; }
.audit-person div { min-width: 0; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.audit-person strong { font-size: 11.5px; font-weight: 500; }
.audit-person small { color: var(--muted); font-size: 9px; }
.audit-events { display: flex; flex-direction: column; }
.audit-event { display: grid; grid-template-columns: 65px minmax(0, 1fr); gap: 9px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.audit-event:last-child { border-bottom: 0; padding-bottom: 1px; }
.audit-event time { color: var(--muted); font-family: var(--mono); font-size: 8.5px; line-height: 1.7; }
.audit-event div { min-width: 0; }
.audit-event strong { display: block; color: var(--ink-2); font-size: 10.5px; font-weight: 500; line-height: 1.5; }
.audit-event small { display: block; margin-top: 2px; color: var(--muted); font-size: 9.5px; line-height: 1.55; overflow-wrap: anywhere; }

@media (max-width: 700px) {
  .members-log { margin-top: 24px; padding-top: 20px; }
  .members-log-head h3 { font-size: 22px; }
  .audit-filters .filter-chip { height: 38px; font-size: 11px; }
  .audit-event { grid-template-columns: 58px minmax(0, 1fr); gap: 7px; }
  .audit-event strong { font-size: 11px; }
  .audit-event small { font-size: 10px; }
}
.member-card {
  position: relative;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: transform .2s, box-shadow .2s;
  overflow: hidden;
}
.member-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.member-card .avatar { width: 50px; height: 50px; font-size: 20px; margin-bottom: 14px; }
.member-card h4 { margin: 0 0 3px; font-size: 15px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.member-card h4 .admin-star { color: var(--gold); font-size: 11px; }
.member-card .badge {
  height: 17px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--muted);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: .05em;
}
.member-role { font-size: 10.5px; color: var(--muted); letter-spacing: .03em; }
.member-role-select { width: 100%; margin-top: 5px; height: 30px; padding: 0 7px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink-3); font-family: var(--sans); font-size: 9px; }
.member-stats { display: flex; gap: 14px; margin: 15px 0 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.member-stats div { font-size: 9.5px; color: var(--muted); }
.member-stats strong { display: block; font-family: var(--serif); font-size: 17px; font-weight: 400; color: var(--ink); }
.member-presence { position: absolute; top: 20px; right: 20px; display: flex; align-items: center; gap: 5px; font-size: 8.5px; letter-spacing: .08em; color: var(--muted); }
.member-presence i { width: 6px; height: 6px; border-radius: 50%; background: #c3b9a8; }
.member-presence.is-online i { background: #7f9a6b; }
.member-collab { font-size: 10.5px; color: var(--clay-deep); background: none; border: 0; padding: 0; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.member-collab svg { width: 13px; height: 13px; flex: none; }
.member-collab:hover { text-decoration: underline; text-underline-offset: 3px; }

/* =========================================================
   Settings
   ========================================================= */

.settings-page { padding-top: 30px; }
.settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.settings-head .eyebrow { color: var(--clay); }
.settings-head h3 { margin: 8px 0 6px; font-family: var(--serif); font-weight: 400; font-size: 30px; }
.settings-head p { margin: 0; font-size: 12px; color: var(--muted); }
.admin-badge { font-size: 9px; letter-spacing: .12em; padding: 5px 10px; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--ink-3); white-space: nowrap; }
.admin-badge.is-admin { border-color: rgba(168, 137, 79, .45); color: #7c6331; background: rgba(168, 137, 79, .08); }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 1080px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.panel-head h4 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--ink); }
.panel-hint { margin: 0 0 16px; font-size: 10.5px; line-height: 1.7; color: var(--muted); }
.panel-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; flex-wrap: wrap; }
.status-pill { font-size: 9px; letter-spacing: .08em; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.status-pill.is-on { border-color: rgba(107, 113, 89, .4); background: rgba(107, 113, 89, .1); color: #5c6249; }
.status-pill.is-demo { border-color: rgba(180, 85, 45, .3); background: rgba(180, 85, 45, .08); color: var(--clay-deep); }
.data-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 18px; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.data-row div { display: flex; flex-direction: column; gap: 2px; }
.data-row strong { font-family: var(--serif); font-size: 24px; font-weight: 400; line-height: 1.1; }
.data-row span { font-size: 9.5px; color: var(--muted); }
.about-panel { display: flex; flex-direction: column; }
.about-copy { margin: 4px 0 16px; font-size: 12px; line-height: 1.85; color: var(--ink-3); }
.tech-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 20px; }
.tech-tags span { font-size: 9px; letter-spacing: .04em; padding: 4px 8px; border-radius: 4px; background: var(--paper-2); color: var(--ink-3); }
.about-panel .btn-danger-ghost { margin-top: auto; align-self: flex-start; }

/* =========================================================
   Modal / toast
   ========================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(33, 30, 26, .42);
  backdrop-filter: blur(7px);
  animation: fade .2s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(600px, 100%);
  max-height: 88dvh;
  overflow-y: auto;
  padding: 26px 28px;
  background: var(--paper);
  border-radius: 15px;
  box-shadow: var(--shadow-lg);
  animation: modal-in .28s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.modal-head h3 { margin: 4px 0 0; font-family: var(--serif); font-weight: 400; font-size: 24px; }
.modal-close {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  flex: none;
}
.modal-close:hover { border-color: var(--ink); color: var(--ink); }
.modal-close svg { width: 14px; height: 14px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.modal-actions .spacer { flex: 1; }
.modal .field textarea { height: 82px; padding: 10px 13px; resize: vertical; }
.modal .two-col { gap: 10px; }
.confirm-text { margin: 0 0 8px; font-size: 13px; line-height: 1.85; color: var(--ink-3); }
.extract-list { display: flex; flex-direction: column; gap: 9px; margin: 14px 0; }
.extract-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 106px 82px 118px 26px;
  gap: 7px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}
.extract-row input, .extract-row select { height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); font-size: 11.5px; outline: none; width: 100%; }
.extract-row textarea { grid-column: 1 / -1; width: 100%; min-height: 64px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 12px; line-height: 1.6; resize: vertical; outline: none; }
.extract-row input:focus, .extract-row select:focus, .extract-row textarea:focus { border-color: var(--ink); }
.extract-row .row-del { width: 28px; height: 28px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 5px; }
.extract-row .row-del:hover { color: var(--danger); background: rgba(163, 59, 46, .08); }
.extract-row .row-del svg { width: 13px; height: 13px; }
.extract-loading { display: flex; align-items: center; gap: 9px; padding: 20px 4px; color: var(--muted); font-size: 12px; }

.toast-root { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  letter-spacing: .02em;
  box-shadow: var(--shadow-md);
  animation: toast-in .25s cubic-bezier(.2, .8, .2, 1) both;
  max-width: min(90vw, 480px);
  text-align: center;
}
.toast.is-error { background: var(--danger); }
.toast.is-out { animation: toast-out .2s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* =========================================================
   Mobile
   ========================================================= */

.bottom-nav { display: none; }

/* =========================================================
   Style sheets
   ========================================================= */

.sheets-page { padding-top: 30px; }
.sheets-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.sheets-head h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 400; font-size: 30px; letter-spacing: .02em; }
.sheet-lede { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }

.sheet-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.sheet-filters .filter-chip { display: inline-flex; align-items: center; gap: 6px; }
.sheet-filters .filter-chip span {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(33, 30, 26, .07);
  font-size: 8.5px;
  color: var(--ink-3);
}
.sheet-filters .filter-chip.is-active span { background: rgba(246, 241, 232, .18); color: var(--paper); }

.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.sheet-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  position: relative;
}
.sheet-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.sheet-cover { position: relative; height: 176px; background: #e9e1d4; overflow: hidden; }
.sheet-cover img { width: 100%; height: 100%; object-fit: contain; display: block; transition: transform .5s; }
.sheet-card:hover .sheet-cover img { transform: scale(1.015); }
.sheet-cover-empty { width: 100%; height: 100%; display: grid; place-items: center; color: var(--line-strong); }
.sheet-cover-empty svg { width: 38px; height: 38px; stroke-width: 1.1; }
.sheet-status {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: .04em;
  white-space: nowrap;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, .9);
  color: var(--ink-3);
}
.sheet-cover > .sheet-status { position: absolute; left: 10px; bottom: 10px; backdrop-filter: blur(6px); }
.sheet-status-draft { border-color: var(--line-strong); color: var(--ink-3); }
.sheet-status-ready { border-color: rgba(180, 85, 45, .3); background: rgba(180, 85, 45, .1); color: var(--clay-deep); }
.sheet-status-warehouse { border-color: rgba(168, 137, 79, .4); background: rgba(168, 137, 79, .12); color: #80652f; }
.sheet-status-cutting { border-color: rgba(78, 93, 108, .35); background: rgba(78, 93, 108, .09); color: #465665; }
.sheet-status-cutting_done { border-color: rgba(107, 113, 89, .38); background: rgba(107, 113, 89, .1); color: #596043; }
.sheet-status-production { border-color: rgba(107, 113, 89, .45); background: rgba(107, 113, 89, .16); color: #4e563a; }
.sheet-status-completed { border-color: rgba(107, 113, 89, .3); background: rgba(107, 113, 89, .08); color: #6c7356; }
.sheet-todo {
  position: absolute;
  right: 10px;
  top: 10px;
  height: 21px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--clay);
  color: #fff;
  font-size: 8.5px;
  letter-spacing: .05em;
  box-shadow: 0 4px 12px rgba(180, 85, 45, .3);
}
.sheet-card-body { padding: 14px 15px 13px; }
.sheet-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.sheet-card-code { font-family: var(--mono); font-size: 10px; letter-spacing: .08em; color: var(--clay-deep); }
.sheet-card-top .sheet-status { height: 20px; padding: 0 7px; font-size: 8.5px; }
.sheet-card h4 { margin: 0 0 4px; font-family: var(--serif); font-weight: 400; font-size: 19px; line-height: 1.35; color: var(--ink); }
.sheet-card-sub { margin: 0 0 11px; font-size: 10.5px; color: var(--muted); }
.sheet-confirm-dots { display: flex; align-items: center; gap: 4px; padding: 9px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sheet-confirm-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.sheet-confirm-dots i.is-done { background: var(--olive); }
.sheet-confirm-dots span { margin-left: 4px; font-size: 9px; color: var(--muted); }
.sheet-card-foot { display: flex; justify-content: space-between; gap: 6px; margin-top: 9px; font-size: 9px; color: var(--muted); white-space: nowrap; }
.sheet-card-foot span:last-child { margin-left: auto; }

.sheet-empty { grid-column: 1 / -1; padding: 70px 20px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 14px; background: rgba(255, 253, 248, .4); }
.sheet-empty .empty-mark { display: block; font-family: var(--serif); font-size: 42px; color: var(--clay); margin-bottom: 10px; }
.sheet-empty h4 { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 22px; }
.sheet-empty p { margin: 0 auto 18px; max-width: 420px; color: var(--muted); font-size: 12px; line-height: 1.8; }

/* 款式页 · 新版布局 */
.sheets-page-v2 { padding-top: 22px; padding-bottom: 104px; }
.sheets-page-v2 .sheets-head { align-items: flex-start; margin-bottom: 16px; gap: 12px; }
.sheets-heading { min-width: 0; }
.sheets-heading .eyebrow { color: var(--clay); margin: 0 0 8px; }
.sheets-page-v2 .sheets-head h3 { margin: 0 0 7px; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.2; letter-spacing: .01em; }
.sheets-page-v2 .sheet-lede { margin: 0; font-size: 12px; line-height: 1.75; }
.sheets-head-actions { flex: none; flex-wrap: wrap; justify-content: flex-end; }
.sheets-head-actions .btn { height: 44px; }
.sheet-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 13px;
  margin-bottom: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-size: 17px;
}
.sheet-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
}
.sheet-search input::placeholder { color: var(--muted); }
.sheets-page-v2 .sheet-filters { margin-bottom: 8px; gap: 7px; }
.sheets-page-v2 .filter-chip { min-height: 44px; height: 44px; padding: 0 13px; font-size: 12px; }
.sheet-utility { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin-bottom: 16px; }
.sheet-utility-btn {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--clay-deep);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sheet-utility-btn:disabled { color: var(--muted); opacity: .55; text-decoration: none; }
.sheet-utility-count { margin-left: auto; color: var(--muted); font-size: 10px; }
.sheets-page-v2 .sheet-grid { grid-template-columns: 1fr; gap: 14px; }
.sheets-page-v2 .sheet-card { --sheet-cover-height: 154px; display: grid; grid-template-columns: 38% minmax(0, 1fr); min-height: var(--sheet-cover-height); border-radius: 8px; }
.sheets-page-v2 .sheet-cover { height: 100%; min-height: var(--sheet-cover-height); background: #e9e1d4; border-right: 1px solid var(--line); }
.sheets-page-v2 .sheet-cover img {
  position: absolute;
  inset: 0;
  object-fit: contain;
  object-position: center;
}
/* 有补货时卡片变高：图片保持原高度，在左侧区域内垂直居中 */
.sheets-page-v2 .has-replenishment .sheet-cover img { top: calc(50% - var(--sheet-cover-height) / 2); bottom: auto; height: var(--sheet-cover-height); }
.sheets-page-v2 .sheet-card:hover .sheet-cover img { transform: none; }
.sheet-cover-tag {
  position: absolute;
  left: 11px;
  top: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(255, 253, 248, .9);
  color: var(--ink-3);
  font-size: 9px;
  letter-spacing: .05em;
  backdrop-filter: blur(6px);
}
.sheets-page-v2 .sheet-card-body { display: flex; flex-direction: column; min-width: 0; padding: 12px 13px 10px; }
.sheets-page-v2 .sheet-card-code { color: var(--clay-deep); font-size: 10.5px; letter-spacing: .05em; }
.sheets-page-v2 .sheet-card h4 { font-size: 18px; line-height: 1.35; margin: 2px 0 4px; }
.sheets-page-v2 .sheet-card-sub { margin: 0 0 8px; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheets-page-v2 .sheet-confirm-dots { border: 0; border-top: 1px solid var(--line); padding: 7px 0 4px; }
.sheets-page-v2 .sheet-card-foot { margin-top: auto; padding-top: 5px; font-size: 9.5px; gap: 8px; white-space: normal; }
.sheets-page-v2 .sheet-card-foot span { min-width: 0; overflow-wrap: anywhere; }
.sheets-page-v2 .sheet-card-foot span:last-child { margin-left: auto; text-align: right; }
.sheets-page-v2 .sheet-card-foot span:nth-child(2) { display: block; }

.flow-help-list { margin: 0; padding-left: 20px; }
.flow-help-list li { margin: 10px 0; font-size: 12px; line-height: 1.75; color: var(--muted); }
.flow-help-list li strong { display: block; color: var(--ink); font-size: 12px; font-weight: 500; }
.flow-help-list li span { display: block; margin-top: 2px; }

@media (min-width: 701px) {
  .sheets-page-v2 .sheet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .sheets-page-v2 .sheet-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sheets-page-v2 .sheet-cover { height: 100%; }
}

/* Detail */
.sheet-detail-page { padding-top: 22px; }
.sheet-detail-top { max-width: 1180px; margin: 0 auto; }
.back-link { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 0; color: var(--muted); font-size: 11px; margin-bottom: 14px; }
.back-link:hover { color: var(--ink); }
.back-link svg { width: 14px; height: 14px; }
.sheet-hero {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  position: relative;
}
.sheet-hero-media {
  width: 190px;
  height: 190px;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper-2);
  cursor: zoom-in;
  border: 1px solid var(--line);
}
.sheet-hero-media img { width: 100%; height: 100%; object-fit: contain; display: block; background: #e9e1d4; }
.sheet-hero-media .sheet-cover-empty { cursor: default; }
.sheet-hero-copy { min-width: 0; flex: 1; padding-top: 4px; }
.sheet-hero-copy .eyebrow { color: var(--clay); font-size: 8px; }
.sheet-hero-copy h2 { margin: 8px 0 5px; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.25; letter-spacing: .02em; }
.sheet-hero-copy h2 span { margin-left: 10px; font-size: 19px; color: var(--ink-3); }
.sheet-hero-sub { margin: 0 0 16px; color: var(--muted); font-size: 11.5px; }
.sheet-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 10px; color: var(--muted); }
.sheet-hero-meta .sheet-status { height: 23px; font-size: 9.5px; }
.sheet-hero-actions { position: absolute; right: 18px; top: 18px; }
.upload-btn { cursor: pointer; font-size: 10.5px; height: 32px; padding: 0 11px; }
.upload-btn svg { width: 13px; height: 13px; }

.sheet-stepper {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  margin: 14px 0 18px;
  padding: 13px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.sheet-step {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  min-width: 0;
  width: calc(100% + 8px);
  margin: -6px -4px;
  padding: 6px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.sheet-step:hover { background: rgba(107, 113, 89, .07); }
.sheet-step:focus-visible { outline: 2px solid var(--clay); outline-offset: 1px; }
.sheet-step:not(:last-child)::after { content: ""; position: absolute; right: 10px; top: 12px; width: calc(100% - 34px); height: 1px; background: var(--line); }
.sheet-step.is-done:not(:last-child)::after { background: var(--olive); }
.step-dot {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  font-size: 9.5px;
  color: var(--muted);
  position: relative;
  z-index: 1;
}
.step-dot svg { width: 11px; height: 11px; }
.sheet-step.is-done .step-dot { background: var(--olive); border-color: var(--olive); color: #fff; }
.sheet-step.is-current .step-dot { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.sheet-step strong { display: block; font-size: 10.5px; font-weight: 500; color: var(--ink-3); white-space: nowrap; }
.sheet-step.is-current strong { color: var(--ink); }
.sheet-step small { display: block; font-size: 8.5px; color: var(--muted); white-space: nowrap; }
.sheet-stepper-hint { margin: -9px 2px 10px; text-align: right; font-size: 8.5px; color: var(--muted); letter-spacing: .02em; }

.sheet-layout { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 16px; max-width: 1180px; margin: 0 auto; align-items: start; }
.sheet-main { min-width: 0; display: flex; flex-direction: column; gap: 13px; }
.sheet-layout-production { grid-template-columns: minmax(0, 1fr); }
.sheet-hero-production h2 { overflow-wrap: anywhere; }
.sheet-detail-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 12px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.sheet-detail-nav button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
}
.sheet-detail-nav button[aria-current="page"] { background: var(--ink); color: var(--paper); }
.sheet-production-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet-production-nav .btn { min-height: 44px; }
.sheet-production-nav [aria-pressed="true"] { border-color: var(--ink); color: var(--ink); background: var(--card); }
.sheet-batch-picker { min-width: 0; }
.sheet-batch-picker select { width: 100%; min-width: 0; min-height: 44px; font-size: 16px; }
.sheet-side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 12px; }

.sheet-section { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 19px 20px; scroll-margin-top: 12px; }
.sheet-section.is-jump-highlight { animation: sheet-jump 1.3s ease; }
@keyframes sheet-jump {
  0% { box-shadow: 0 0 0 0 rgba(180, 95, 69, .28); background: rgba(180, 95, 69, .08); }
  100% { box-shadow: 0 0 0 1px rgba(180, 95, 69, 0); background: var(--card); }
}
.locked-section { background: rgba(255, 253, 248, .55); }
.sheet-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.sheet-section-title { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.section-no { font-family: var(--mono); font-size: 9px; color: var(--clay); letter-spacing: .1em; }
.sheet-section-title h3 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 19px; letter-spacing: .02em; }
.section-role { font-size: 9px; color: var(--muted); letter-spacing: .04em; }
.section-ok { display: inline-flex; align-items: center; gap: 4px; font-size: 9px; color: var(--olive); white-space: nowrap; }
.section-ok svg { width: 11px; height: 11px; }
.section-pending { font-size: 9px; color: var(--muted); border: 1px dashed var(--line-strong); padding: 3px 7px; border-radius: 4px; white-space: nowrap; }
.section-state { font-size: 9px; color: var(--clay-deep); background: rgba(180, 85, 45, .07); border: 1px solid rgba(180, 85, 45, .22); padding: 3px 7px; border-radius: 4px; white-space: nowrap; }
.sheet-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.sheet-col-span { grid-column: 1 / -1; }
.sheet-section .field { margin-bottom: 9px; }
.sheet-section .field input, .sheet-section .field textarea { background: var(--paper); }
.sheet-section .field textarea { height: 66px; padding: 9px 12px; }
.sheet-section .field-label { font-size: 9.5px; }
.sheet-subhead { margin: 15px 0 8px; font-size: 10px; font-weight: 600; letter-spacing: .06em; color: var(--ink-3); }
.sheet-subhead span { font-weight: 400; color: var(--muted); margin-left: 4px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 13px; flex-wrap: wrap; }
.lock-note { margin: 10px 0 0; font-size: 10.5px; color: var(--muted); line-height: 1.7; }

.replenishment-form { margin-top: 4px; }
.replenishment-rows { display: flex; flex-direction: column; gap: 8px; }
.replenishment-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}
.replenishment-color { display: flex; flex-direction: column; gap: 3px; justify-content: flex-end; margin: 0; }
.replenishment-color input { width: 100%; }
.replenishment-sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.replenishment-size { display: flex; flex-direction: column; gap: 3px; justify-content: flex-end; min-width: 52px; flex: 1; }
.replenishment-color .field-label,
.replenishment-size span {
  display: block;
  height: 14px;
  margin: 0;
  padding: 0;
  font-size: 10px;
  font-weight: 600;
  line-height: 14px;
  letter-spacing: .04em;
  color: var(--ink-3);
}
.replenishment-size span { text-align: center; color: var(--muted); font-weight: 400; }
.replenishment-row input {
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  outline: none;
}
.replenishment-row input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(33, 30, 26, .06); }
.replenishment-size input { min-width: 48px; text-align: center; }
.replenishment-note-input { margin-top: 4px; }

/* 数字输入去掉浏览器上下加减按钮 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.replenishment-records { display: flex; flex-direction: column; gap: 8px; }
.replenishment-record { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.replenishment-record-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; }
.replenishment-status { font-size: 9px; padding: 2px 7px; border-radius: 999px; background: var(--paper-2); color: var(--muted); }
.replenishment-status.is-doing { color: var(--clay); background: rgba(180, 85, 45, .08); }
.replenishment-status.is-done { color: var(--olive); background: rgba(107, 113, 89, .1); }
.replenishment-lines { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 10.5px; color: var(--ink-2); }
.replenishment-note { margin: 6px 0 0; font-size: 10px; color: var(--muted); }
.replenishment-meta { margin: 6px 0 0; font-size: 9px; color: var(--muted); }
.replenishment-form-total { margin: 10px 0 2px; text-align: right; color: var(--muted); font-size: 10px; }
.replenishment-form-total strong { margin: 0 3px; color: var(--clay-deep); font-family: var(--serif); font-size: 18px; font-weight: 400; }
.replenishment-task-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 0; border: 0; background: none; color: var(--clay-deep); font-size: 10px; text-decoration: underline; text-underline-offset: 3px; }
.replenishment-task-link svg { width: 12px; height: 12px; }

.sheet-owner-rows { display: flex; flex-direction: column; gap: 6px; }
.owner-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
.owner-table { width: 100%; border-collapse: collapse; font-size: 10.5px; min-width: 380px; }
.owner-table th { padding: 7px 8px; background: var(--paper-2); color: var(--ink-3); font-weight: 500; text-align: center; font-size: 9px; letter-spacing: .04em; white-space: nowrap; border-bottom: 1px solid var(--line); }
.owner-table th.owner-color-col { text-align: left; min-width: 108px; }
.owner-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: center; }
.owner-table tbody tr:last-child td { border-bottom: 0; }
.owner-table input { width: 100%; min-width: 48px; height: 32px; padding: 0 7px; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; font-size: 11px; text-align: center; outline: none; }
.owner-table input.fo-color { text-align: left; min-width: 96px; }
.owner-table input:focus { border-color: var(--ink); }
.owner-table input:disabled { background: transparent; border-color: transparent; color: var(--ink); }
.owner-row-total { font-family: var(--serif); font-size: 15px !important; color: var(--ink); width: 48px; }
.owner-total-row td { background: var(--paper-2); font-size: 9px; color: var(--muted); font-weight: 500; }
.owner-total-row td:first-child { text-align: left; padding-left: 10px; }
.owner-total-row .owner-size-total, .owner-total-row .owner-grand-total { font-family: var(--serif); font-size: 14px; color: var(--ink); }
.sheet-row { display: grid; grid-template-columns: 1fr 100px 28px; gap: 6px; align-items: center; }
.sheet-row input { height: 36px; padding: 0 9px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; outline: none; font-size: 12px; width: 100%; }
.sheet-row input:focus { border-color: var(--ink); }
.row-del { width: 26px; height: 26px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); border-radius: 5px; padding: 0; }
.row-del:hover { color: var(--danger); background: rgba(163, 59, 46, .08); }
.row-del svg { width: 12px; height: 12px; }
.text-add { border: 0; background: none; padding: 6px 0; color: var(--clay-deep); font-size: 10.5px; }
.sheet-section .text-add { display: block; width: fit-content; min-height: 32px; margin-left: auto; margin-right: 0; padding: 8px 0 6px; text-align: right; }
.text-add:hover { text-decoration: underline; text-underline-offset: 3px; }
.sheet-total { margin: 9px 0 11px; padding: 8px 10px; background: var(--paper); border-radius: 6px; font-size: 10.5px; color: var(--muted); }
.sheet-total strong { font-family: var(--serif); font-size: 18px; font-weight: 400; color: var(--ink); margin: 0 3px; }

.sheet-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
.table-scroll-hint { margin: 4px 2px 9px; text-align: right; font-size: 9px; color: var(--muted); letter-spacing: .03em; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: 10.5px; min-width: 520px; }
.sheet-table th { padding: 7px 8px; background: var(--paper-2); color: var(--ink-3); font-weight: 500; text-align: left; font-size: 9px; letter-spacing: .04em; white-space: nowrap; border-bottom: 1px solid var(--line); }
.sheet-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.sheet-table tr:last-child td { border-bottom: 0; }
.sheet-table input { width: 100%; min-width: 54px; height: 30px; padding: 0 6px; background: transparent; border: 1px solid transparent; border-radius: 4px; font-size: 10.5px; outline: none; }
.sheet-table input:hover { border-color: var(--line); }
.sheet-table input:focus { border-color: var(--ink); background: var(--paper); }
.sheet-table input:disabled { color: var(--ink-3); }
.size-table { min-width: 760px; }
.size-table input { min-width: 48px; text-align: center; }
.table-empty { text-align: center; color: var(--muted); padding: 14px 8px !important; font-size: 10px; }

.purchase-simple-fields { max-width: 680px; display: flex; flex-direction: column; gap: 12px; }
.purchase-item { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.purchase-item-head { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.purchase-item-head strong { font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--ink-3); }
.purchase-item-remove { min-width: 60px; min-height: 44px; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; }
.purchase-item-remove:hover { color: var(--danger); background: rgba(163, 59, 46, .07); }
.purchase-simple .field { margin-bottom: 12px; }
.purchase-simple .field:last-child { margin-bottom: 0; }
.purchase-simple .field .purchase-supplier { height: 48px; }
.purchase-simple .field .purchase-note {
  height: 96px;
  min-height: 96px;
  padding: 12px 13px;
  line-height: 1.65;
  resize: vertical;
}
.purchase-simple .field .purchase-note:disabled {
  background: var(--paper-2);
  color: var(--muted);
  cursor: not-allowed;
}
.purchase-add-material { width: 100%; max-width: 680px; min-height: 44px; margin-top: 12px; border: 1px dashed var(--line-strong); border-radius: 9px; background: transparent; color: var(--clay-deep); font-size: 12px; font-weight: 500; }
.purchase-add-material:hover { border-color: var(--clay); background: rgba(180, 85, 45, .04); }

.material-block { margin-top: 12px; }
.material-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.material-head h4 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .05em; color: var(--ink-3); }
.material-table { min-width: 760px; }

.receipt-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.receipt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 9px; background: var(--paper); border-radius: 6px; font-size: 10px; color: var(--ink-3); }
.receipt-type { font-size: 8px; padding: 2px 5px; border-radius: 3px; background: var(--paper-3); color: var(--ink-3); }
.receipt-row strong { font-size: 10.5px; font-weight: 500; color: var(--ink); }
.receipt-meta { margin-left: auto; font-size: 8.5px; color: var(--muted); }
.receipt-note { flex-basis: 100%; font-size: 9px; color: var(--muted); }
.receipt-form { display: grid; grid-template-columns: 74px 1.2fr .8fr .8fr .6fr 1fr auto; gap: 5px; align-items: center; padding: 9px; border: 1px dashed var(--line-strong); border-radius: 7px; }
.receipt-form select, .receipt-form input { height: 32px; min-width: 0; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); font-size: 10px; outline: none; }
.receipt-form .btn { height: 32px; padding: 0 9px; font-size: 10px; }

.cutting-form { padding: 12px; background: var(--paper); border-radius: 8px; margin-bottom: 12px; }
.cutting-form .field { margin-bottom: 6px; }
.cut-order-list { display: flex; flex-direction: column; gap: 7px; }
.cut-order { padding: 11px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.cut-order-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cut-order-head strong { font-size: 12px; font-weight: 500; }
.cut-order-meta { margin-left: 7px; font-size: 9px; color: var(--muted); }
.cut-status { font-size: 8.5px; padding: 3px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.cut-status-received { color: var(--clay-deep); border-color: rgba(180, 85, 45, .3); background: rgba(180, 85, 45, .07); }
.cut-status-done { color: var(--olive); border-color: rgba(107, 113, 89, .35); background: rgba(107, 113, 89, .08); }
.cut-order-line { margin-top: 5px; font-size: 10px; color: var(--ink-3); }
.cut-order-line strong { font-family: var(--serif); font-size: 16px; font-weight: 400; }
.cut-order-note { margin: 5px 0 0; font-size: 9.5px; color: var(--muted); }
.cut-done-line { margin-top: 6px; font-size: 9.5px; color: var(--olive); }
.cut-finish { display: flex; gap: 6px; margin-top: 8px; }
.cut-finish input { flex: 1; height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); font-size: 10px; outline: none; }
.cut-finish .btn { height: 32px; padding: 0 10px; font-size: 10px; }
.production-send { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.production-send .field { flex: 1 1 180px; margin: 0; }
.production-info p { margin: 0 0 6px; font-size: 11px; color: var(--ink-3); line-height: 1.7; }
.production-total { margin: 8px 0 12px; text-align: right; color: var(--ink-3); font-size: 10px; }
.production-total strong { margin: 0 2px; color: var(--ink); font-family: var(--serif); font-size: 19px; font-weight: 400; }
.production-table .prod-qty-input { width: 72px; min-height: 36px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; text-align: center; }
.big-ok { font-size: 11px; margin-top: 10px; }

.sheet-side-card { background: var(--card); border: 1px solid var(--line); border-radius: 11px; padding: 15px; }
.sheet-side-card h4 { margin: 0 0 11px; font-size: 10px; font-weight: 600; letter-spacing: .08em; color: var(--ink-3); }
.confirm-list { display: flex; flex-direction: column; gap: 9px; }
.confirm-row { display: flex; gap: 8px; align-items: flex-start; }
.confirm-dot { width: 16px; height: 16px; flex: none; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; color: transparent; margin-top: 1px; }
.confirm-row.is-done .confirm-dot { background: var(--olive); border-color: var(--olive); color: #fff; }
.confirm-dot svg { width: 9px; height: 9px; }
.confirm-row strong { display: block; font-size: 10.5px; font-weight: 500; color: var(--ink-2); }
.confirm-row small { display: block; font-size: 8.5px; color: var(--muted); margin-top: 1px; }
.ready-note { margin: 10px 0 0; padding: 7px 8px; border-radius: 5px; background: rgba(107, 113, 89, .09); color: #5f6649; font-size: 9px; line-height: 1.6; }
.sheet-history { display: flex; flex-direction: column; gap: 9px; max-height: 360px; overflow-y: auto; }
.history-row { display: flex; gap: 7px; }
.history-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--clay); margin-top: 5px; flex: none; }
.history-row strong { display: block; font-size: 9.5px; font-weight: 500; color: var(--ink-2); line-height: 1.45; }
.history-row small { display: block; font-size: 8px; color: var(--muted); margin-top: 1px; }
.history-row p { margin: 2px 0 0; font-size: 8.5px; color: var(--muted); line-height: 1.5; }

.sheet-image-modal img { width: 100%; max-height: 72vh; object-fit: contain; background: var(--paper-2); border-radius: 8px; display: block; }

/* Fabric slip upload */
.modal.sheet-modal-wide { width: min(980px, 100%); }
.fabric-slip-top { display: flex; gap: 16px; padding: 12px; background: var(--paper); border-radius: 10px; margin-bottom: 14px; }
.fabric-slip-preview {
  width: 190px;
  height: 150px;
  flex: none;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: hidden;
}
.fabric-slip-preview img { width: 100%; height: 100%; object-fit: contain; }
.fabric-slip-preview small { font-size: 9px; color: var(--muted); }
.fabric-slip-preview .sheet-cover-empty svg { width: 28px; height: 28px; }
.fabric-slip-tools { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: flex-start; gap: 7px; }
.fabric-slip-tools .btn { height: 34px; font-size: 10.5px; padding: 0 12px; }
.fabric-slip-tools .btn svg { width: 13px; height: 13px; }
.fabric-slip-status { flex-basis: 100%; margin: 4px 0 0; font-size: 10px; line-height: 1.6; color: var(--muted); }
.fabric-slip-status.is-error { color: var(--danger); }
.fabric-slip-status.is-ok { color: var(--olive); }
.fabric-slip-meta { display: grid; grid-template-columns: .8fr 1.3fr .8fr .8fr .8fr; gap: 8px; }
.fabric-slip-meta.two { grid-template-columns: 1fr 1fr; }
.fabric-slip-meta .field { margin-bottom: 8px; }
.fabric-slip-meta input { height: 36px; }
.fabric-match { margin: 4px 0 10px; padding: 8px 10px; border-radius: 6px; font-size: 10.5px; line-height: 1.6; background: var(--paper); color: var(--ink-3); border-left: 2px solid var(--line-strong); }
.fabric-match.is-ok { color: #4f5a3f; background: rgba(107, 113, 89, .09); border-left-color: var(--olive); }
.fabric-match.is-warn { color: #7c5a2c; background: rgba(168, 137, 79, .1); border-left-color: var(--gold); }
.fabric-slip-lines-head { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 6px; }
.fabric-slip-lines-head h4 { margin: 0; font-size: 10px; font-weight: 600; letter-spacing: .06em; color: var(--ink-3); }
.material-lines-table { min-width: 760px; }
.material-lines-table input { min-width: 54px; }
.material-lines-table .fs-fabric { min-width: 90px; }
.material-lines-table .fs-confirmed { background: rgba(107, 113, 89, .08); border-color: rgba(107, 113, 89, .3); font-weight: 600; }
.cutting-lines-table { min-width: 420px; }
.cutting-lines-table input { min-width: 48px; }
.fabric-slip-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 9px 10px; background: var(--paper); border-radius: 7px; font-size: 10.5px; color: var(--ink-3); }
.fabric-slip-summary strong { font-family: var(--serif); font-size: 18px; font-weight: 400; color: var(--ink); }
.fabric-review-check { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; }
.fabric-review-check input { width: 14px; height: 14px; accent-color: var(--clay); }
.fabric-receipts { display: flex; flex-direction: column; gap: 9px; }
.fabric-receipt { border: 1px solid var(--line); border-radius: 8px; background: var(--paper); padding: 10px 11px; }
.fabric-receipt-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.fabric-receipt-type { display: inline-block; margin-right: 5px; padding: 1px 5px; border-radius: 3px; background: var(--paper-3); color: var(--ink-3); font-size: 8px; vertical-align: 1px; }
.fabric-receipt-head strong { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink); }
.fabric-receipt-head span { display: block; font-size: 9px; color: var(--muted); margin-top: 2px; }
.fabric-receipt-total { font-family: var(--serif); font-size: 15px; color: var(--clay-deep); }
.fabric-receipt-body { display: flex; gap: 9px; margin-top: 8px; align-items: flex-start; }
.fabric-receipt-body img { width: 80px; height: 104px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); cursor: zoom-in; flex: none; }
.fabric-receipt-body .sheet-table-wrap { flex: 1; min-width: 0; }
/* 手机：物料明细为纵向卡片，不设最小宽度；宽屏再恢复表格宽度（见文末 min-width 媒体查询） */
.fabric-receipt-foot { margin-top: 7px; font-size: 8.5px; color: var(--muted); }
.cutting-receipt-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 7px; font-size: 9px; color: var(--ink-3); }
.cutting-receipt-meta span { background: var(--paper-3); padding: 3px 6px; border-radius: 3px; }


/* Mobile adjustments */
@media (max-width: 900px) {
  .sheets-page { padding-top: 18px; }
  .sheets-head { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 14px; }
  .sheets-head h3 { font-size: 24px; }
  .sheet-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .sheet-cover { height: 130px; }
  .sheet-card-body { padding: 11px; }
  .sheet-card h4 { font-size: 16px; }
  .sheet-card-foot { font-size: 8px; }
  .sheet-detail-page { padding: 14px; }
  .sheet-hero { flex-direction: column; gap: 12px; padding: 14px; }
  .sheet-hero-media { width: 100%; height: 190px; }
  .sheet-hero-copy h2 { font-size: 23px; }
  .sheet-hero-copy h2 span { display: block; margin: 3px 0 0; font-size: 15px; }
  .sheet-hero-actions { position: static; margin-top: 4px; }
  .sheet-stepper { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 10px 8px; gap: 0; }
  .sheet-step { flex-direction: column; align-items: flex-start; gap: 4px; }
  .sheet-step:not(:last-child)::after { display: none; }
  .sheet-step strong { font-size: 9px; white-space: normal; }
  .sheet-step small { display: none; }
  .step-dot { width: 21px; height: 21px; font-size: 8.5px; }
  .sheet-layout { grid-template-columns: 1fr; }
  .sheet-side { position: static; }
  .sheet-section { padding: 15px 14px; }
  .sheet-section-head { flex-direction: column; gap: 6px; }
  .sheet-form-grid { grid-template-columns: 1fr; gap: 0; }
  .sheet-col-span { grid-column: auto; }
  .receipt-form { grid-template-columns: 1fr 1fr; }
  .receipt-form .btn { grid-column: 1 / -1; }
  .production-send { flex-direction: column; align-items: stretch; }
  .sheet-card-foot span:nth-child(2) { display: none; }
}
@media (max-width: 520px) {
  .sheet-grid { grid-template-columns: 1fr; }
  .sheet-cover { height: 172px; }
  .sheet-stepper { overflow: visible; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .sheet-hero-media { height: 180px; }
  .sheet-step strong { font-size: 8px; }
}

@media (max-width: 1200px) {
  .chat-layout { grid-template-columns: minmax(0, 1fr) 292px; }
  .timeline { padding-left: 26px; padding-right: 26px; }
  .composer-wrap { padding-left: 26px; padding-right: 26px; }
}

@media (max-width: 1080px) {
  .chat-layout { grid-template-columns: 1fr; }
  .context-rail { display: none; }
}

@media (max-width: 900px) {
  body { overflow: hidden; }
  .composer-modes { flex-wrap: wrap; overflow-x: visible; row-gap: 3px; padding-bottom: 2px; }
  .mode-chip { height: 30px; font-size: 11.5px; }
  .shell { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .rail { display: none; }
  .bottom-nav {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    height: calc(62px + env(safe-area-inset-bottom, 0px));
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px));
    background: var(--ink);
    border-top: 1px solid rgba(246, 241, 232, .08);
    z-index: 40;
  }
  .bottom-nav button {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: rgba(246, 241, 232, .42);
    font-size: 9px;
    letter-spacing: .04em;
    border-radius: 8px;
  }
  .bottom-nav button svg { width: 19px; height: 19px; }
  .bottom-nav button em { font-style: normal; }
  .bottom-badge {
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(10px);
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--clay);
    color: #fff;
    font-family: var(--sans);
    font-size: 8.5px;
    font-style: normal;
    line-height: 15px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--ink);
  }
  .bottom-badge.hidden { display: none; }
  .bottom-nav button.is-active { color: var(--paper); background: rgba(246, 241, 232, .07); }
  .topbar { height: calc(64px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 16px 0; gap: 12px; }
  .topbar-title { min-width: 0; }
  .topbar-title h2 { font-size: 19px; }
  .topbar-title .eyebrow { display: none; }
  .topbar-sub { display: none; }
  .topbar-actions { gap: 8px; }
  .online-stack { display: none; }
  .topbar-me { display: grid; }
  .ai-pill { height: 28px; padding: 0 9px; font-size: 9.5px; }
  .timeline { padding: 18px 14px 8px; }
  .composer-wrap { padding: 4px 10px 8px; }
  .composer { border-radius: 13px; }
  .composer-modes { padding: 7px 8px 0; }
  .composer textarea { font-size: 16px; padding: 9px 13px 2px; }
  .composer-bar { padding: 4px 7px 7px 9px; }
  .kbd-hint { display: none; }
  .mode-hint { display: none; }
  .send-btn { width: 38px; height: 38px; }
  .composer-foot { display: none; }
  .page { padding: 18px 14px 34px; }
  .page-head { margin-bottom: 14px; }
  .board { display: flex; overflow-x: auto; gap: 10px; padding-bottom: 10px; scroll-snap-type: x mandatory; }
  .board-col { min-width: 78vw; scroll-snap-align: start; }
  .digest-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .digest-date { font-size: 30px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .digest-body { padding: 22px 20px; }
  .settings-grid { grid-template-columns: 1fr; }
  .members-intro { flex-direction: column; align-items: flex-start; gap: 12px; }
  .members-intro h3 { font-size: 24px; }
  .members-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .member-card { padding: 15px; }
  .member-card .avatar { width: 42px; height: 42px; font-size: 17px; margin-bottom: 10px; }
  .modal { padding: 22px 18px; }
  .extract-row { grid-template-columns: minmax(0, 1fr); gap: 9px; align-items: stretch; }
  .extract-row select.priority { display: block; }
  .extract-row input, .extract-row select { min-height: 44px; height: 44px; font-size: 16px; }
  .extract-row textarea { min-height: 88px; font-size: 16px; }
  .extract-row .row-del { width: 44px; height: 44px; justify-self: end; }
  .two-col { grid-template-columns: 1fr; gap: 0; }
  .field input, .field select, .field textarea, .login-form input { font-size: 16px; }
}

@media (max-width: 700px) {
  .channel-bar { padding: 8px 12px 6px; gap: 4px; }
  #channel-current-name { max-width: 142px; }
  .channel-action { padding: 0 7px; }
  .channel-new { font-size: 8.5px; }
  .channel-create-form .channel-member-list { grid-template-columns: 1fr; }
  .board { display: flex; flex-direction: column; overflow: visible; gap: 12px; padding-bottom: 0; scroll-snap-type: none; }
  .board-col { width: 100%; min-width: 0; min-height: auto; scroll-snap-align: none; }
  .board-col .col-body { max-height: none; }
  .board-col .col-head { position: sticky; top: 0; z-index: 2; background: var(--paper); }
  .modal-actions {
    position: sticky;
    bottom: -22px;
    z-index: 3;
    margin: 14px -18px -22px;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: 1px solid var(--line);
  }
  .fabric-slip-review .sheet-table-wrap { border: 0; background: transparent; }
  .material-lines-table { min-width: 0; }
  .material-lines-table thead { display: none; }
  .material-lines-table, .material-lines-table tbody, .material-lines-table tr, .material-lines-table td { display: block; }
  .material-lines-table tr { margin: 0 0 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); }
  .material-lines-table td { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: center; gap: 8px; padding: 3px 0; border: 0; }
  .material-lines-table td::before { content: attr(data-label); font-size: 9px; color: var(--muted); }
  .material-lines-table td.fabric-row-delete { display: block; padding-top: 4px; text-align: right; }
  .material-lines-table td.fabric-row-delete::before { display: none; }
  .material-lines-table input { width: 100%; min-width: 0; height: 32px; font-size: 14px; background: var(--paper); border-color: var(--line); }
  .receipt-lines-table { min-width: 0; }
  .receipt-lines-table thead { display: none; }
  .receipt-lines-table, .receipt-lines-table tbody, .receipt-lines-table tr, .receipt-lines-table td { display: block; }
  .receipt-lines-table tr { margin: 0 0 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
  .receipt-lines-table td { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 7px; padding: 2px 0; border: 0; }
  .receipt-lines-table td::before { content: attr(data-label); font-size: 9px; color: var(--muted); }
  .cutting-lines-table { min-width: 0; }
  .cutting-lines-table th, .cutting-lines-table td { padding-left: 4px; padding-right: 4px; }
  .cutting-lines-table input { min-width: 0; font-size: 14px; }
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: 100dvh; overflow-y: auto; }
  .login-art { min-height: 220px; padding: 26px 24px 22px; }
  .dressform { width: 150px; right: -12px; top: 6px; opacity: .5; }
  .art-copy { margin-top: 30px; }
  .art-copy .eyebrow { display: none; }
  .art-copy h1 { font-size: 33px; line-height: 1.25; }
  .art-lede { display: none; }
  .art-foot { display: none; }
  .login-panel { padding: 30px 22px 40px; place-items: start center; }
  .login-form h2 { font-size: 32px; }
  .login-form .hint { margin-bottom: 22px; }
  .role-chips .chip { height: 30px; font-size: 11px; }
  .members-grid { grid-template-columns: 1fr; }
  .settings-head { flex-direction: column; gap: 10px; }
  .digest-body { font-size: 13.5px; }
  .msg { gap: 9px; margin-bottom: 20px; }
  .avatar { width: 32px; height: 32px; font-size: 13px; }
  .msg-text { font-size: 14px; }
  .ai-card { padding: 17px 16px 8px; border-radius: 2px 14px 14px 14px; }
  .ai-card .prose { font-size: 13.5px; }
  .msg-actions { display: none; }
  .ai-card-foot .model-tag, .ai-card-foot .spacer { display: none; }
  .ai-card-foot { gap: 3px; }
  .board-col { min-height: 62vh; }
  .digest-date { font-size: 27px; }
}

@media (max-width: 420px) {
  .members-grid { grid-template-columns: 1fr; }
  .stat-row { gap: 7px; }
  .stat-card { padding: 11px 12px; }
  .stat-card strong { font-size: 23px; }
}

@media (max-width: 700px) {
  .modal.sheet-modal-wide { width: 100%; }
  .fabric-slip-top { flex-direction: column; gap: 10px; }
  .fabric-slip-preview { width: 100%; height: 170px; }
  .fabric-slip-tools .btn { flex: 1; justify-content: center; }
  .fabric-slip-meta { grid-template-columns: 1fr 1fr; gap: 0 8px; }
  .fabric-slip-summary { flex-direction: column; align-items: flex-start; }
  .fabric-receipt-body { flex-direction: column; }
  .fabric-receipt-body img { width: 100%; height: 160px; object-fit: contain; }
  .fabric-review-check { white-space: normal; }
}

/* AI direct panel */
.ai-direct-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--paper);
  border-left: 1px solid var(--line);
}
.ai-direct-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 20px 18px 8px; flex: none; }
.ai-direct-head h3 { margin: 3px 0 0; font-family: var(--serif); font-weight: 400; font-size: 22px; letter-spacing: -.01em; }
.ai-direct-head h3 span { display: inline-block; margin-left: 5px; font-family: var(--sans); font-size: 9px; letter-spacing: .1em; color: var(--muted); vertical-align: 3px; }
.ai-direct-hint { flex: none; margin: 0 18px 8px; font-size: 10px; line-height: 1.6; color: var(--muted); }
.ai-direct-close { display: none; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink-3); font-size: 19px; line-height: 1; }
.ai-direct-messages { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 9px; padding: 8px 14px 12px; }
.ai-direct-empty { margin: auto 0; padding: 12px 4px; color: var(--muted); font-size: 11px; line-height: 1.8; text-align: center; }
.ai-direct-empty strong { display: block; margin-bottom: 5px; color: var(--ink); font-family: var(--serif); font-size: 18px; font-weight: 400; }
.ai-msg { max-width: 94%; padding: 9px 11px; border-radius: 10px; font-size: 12px; line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-msg.user { align-self: flex-end; background: var(--ink); color: var(--paper); border-bottom-right-radius: 3px; }
.ai-msg.assistant { align-self: flex-start; background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-2); border-bottom-left-radius: 3px; }
.ai-msg-label { display: block; margin-bottom: 3px; font-size: 8px; letter-spacing: .08em; color: var(--muted); }
.ai-msg.user .ai-msg-label { color: rgba(246, 241, 232, .55); }
.ai-draft-card { align-self: stretch; margin-top: 7px; padding: 9px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--paper); }
.ai-draft-card h5 { margin: 0 0 6px; font-size: 11px; font-weight: 600; }
.ai-draft-card p { margin: 0 0 7px; font-size: 9.5px; line-height: 1.6; color: var(--muted); }
.ai-draft-card select { width: 100%; height: 34px; margin-bottom: 6px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); font-family: var(--sans); font-size: 11px; color: var(--ink); }
.ai-draft-actions { display: flex; gap: 6px; }
.ai-draft-actions .btn { flex: 1; height: 32px; padding: 0 8px; font-size: 9.5px; }
.ai-direct-suggestions { flex: none; display: flex; flex-wrap: wrap; gap: 5px; padding: 0 14px 8px; }
.ai-direct-attachment {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 14px 4px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper-2);
  font-size: 9px;
  color: var(--muted);
}
.ai-direct-attachment img { width: 38px; height: 38px; object-fit: cover; border-radius: 5px; flex: none; }
.ai-direct-attachment span { flex: 1; min-width: 0; }
.ai-direct-attachment button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--card); color: var(--ink-3); font-size: 15px; line-height: 1; cursor: pointer; }
.ai-photo-btn {
  width: 36px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink-3);
  cursor: pointer;
}
.ai-photo-btn svg { width: 17px; height: 17px; }
.ai-photo-btn:hover { border-color: var(--clay); color: var(--clay); }
.ai-image-menu {
  position: absolute;
  left: 14px;
  bottom: 58px;
  z-index: 8;
  min-width: 132px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}
.ai-image-menu button { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); font-family: var(--sans); font-size: 11px; text-align: left; cursor: pointer; }
.ai-image-menu button:hover { background: var(--paper-2); }
.ai-msg-image { display: block; width: 100%; max-height: 240px; object-fit: cover; border-radius: 7px; margin: 5px 0; cursor: zoom-in; border: 1px solid rgba(33, 30, 26, .08); }
.ai-suggestion { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--ink-3); font-family: var(--sans); font-size: 9px; line-height: 1.3; }
.ai-suggestion:hover { border-color: var(--clay); color: var(--clay-deep); }
.ai-direct-form { position: relative; flex: none; display: flex; align-items: flex-end; gap: 7px; padding: 9px 14px 8px; border-top: 1px solid var(--line); }
.ai-direct-form textarea { flex: 1; min-width: 0; height: 40px; max-height: 120px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); resize: none; font-family: var(--sans); font-size: 16px; line-height: 1.45; color: var(--ink); outline: none; }
.ai-direct-form textarea:focus { border-color: var(--ink); }
.ai-direct-form .send-btn { flex: none; width: 40px; height: 40px; }
.ai-direct-foot { flex: none; display: none; margin: 0; padding: 0 14px 10px; font-size: 8.5px; line-height: 1.5; color: var(--muted); }
.ai-direct-fab { display: none; }
.ai-direct-launch { display: none; }

@media (max-width: 1500px) and (min-width: 1081px) {
  .chat-layout { grid-template-columns: minmax(0, 1fr) 360px; }
  .context-rail { display: none; }
}

@media (min-width: 1081px) {
  .ai-direct-form { padding-bottom: 6px; }
  .ai-direct-form textarea { height: 38px; }
  .ai-direct-suggestions { padding-bottom: 5px; }
}

@media (max-width: 520px) {
  .ai-pill { display: none; }
}

@media (max-width: 1080px) {
  .ai-direct-launch {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(246, 241, 232, .16);
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--sans);
    font-size: 9.5px;
    letter-spacing: .03em;
    white-space: nowrap;
  }
  .ai-direct-panel { display: none; }
  .ai-direct-panel.is-open {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 78;
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    padding-top: env(safe-area-inset-top);
  }
  .ai-direct-panel.is-open .ai-direct-close { display: grid; place-items: center; }
  .ai-direct-panel.is-open .ai-direct-foot { display: none; }
  .ai-direct-panel.is-open .ai-direct-form { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .ai-direct-fab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    position: fixed;
    right: 14px;
    bottom: calc(74px + env(safe-area-inset-bottom));
    z-index: 45;
    height: 36px;
    padding: 0 13px;
    border: 1px solid rgba(246, 241, 232, .16);
    border-radius: 999px;
    background: var(--ink);
    color: var(--paper);
    box-shadow: 0 5px 18px rgba(33, 30, 26, .22);
    font-family: var(--sans);
    font-size: 10px;
    letter-spacing: .04em;
  }
  .ai-direct-panel.is-open .ai-direct-messages { padding-bottom: 16px; }
  body.ai-direct-open { overflow: hidden; }
}

@media (max-width: 700px) {
  .sheets-page-v2 { padding-top: 18px; padding-left: 14px; padding-right: 14px; }
  .sheets-page-v2 .sheets-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .sheets-page-v2 .sheets-head h3 { font-size: 28px; }
  .sheets-head-actions { justify-content: flex-start; }
  .sheets-head-actions .btn { min-height: 40px; }
  .sheets-page-v2 .sheet-cover { height: 100%; min-height: 154px; }
  .sheets-page-v2 .sheet-card-foot { flex-wrap: nowrap; }
  .sheets-page-v2 .sheet-card-foot span:last-child { margin-left: auto; text-align: right; }

  .replenishment-sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .replenishment-size { min-width: 0; }
  .replenishment-size input { min-height: 40px; font-size: 16px; }
  .replenishment-color input { min-height: 40px; }
  .replenishment-row .field-label, .replenishment-size span { font-size: 11px; height: 15px; line-height: 15px; }
  .eyebrow { font-size: 11px; }
  .field-label { font-size: 12px; }
  .panel-hint { font-size: 12px; }
  .topbar-sub { font-size: 12px; }
  .task-title { font-size: 14px; line-height: 1.5; }
  .task-detail { font-size: 12px; line-height: 1.55; }
  .task-assignee, .task-due, .task-audience, .task-sheet-link { font-size: 11px; }
  .task-card { padding: 14px 14px 12px 16px; }
  .filter-chip { height: 44px; padding: 0 14px; font-size: 12px; }
  .btn { height: 44px; font-size: 14px; }
  .icon-btn { width: 42px; height: 42px; }
  .modal-close { width: 44px; height: 44px; }
  .col-add { width: 44px; height: 44px; border-radius: 8px; }
  .col-add svg { width: 16px; height: 16px; }
  .channel-current { height: 40px; font-size: 13px; }
  .channel-action { height: 38px; font-size: 11px; }
  .notif-group h4 { font-size: 11px; }
  .notif-item { padding: 12px 10px; min-height: 52px; }
  .notif-item strong { font-size: 13px; }
  .notif-item small { font-size: 11px; }
  .member-role { font-size: 11.5px; }
  .member-role-select { height: 40px; font-size: 12px; }
  .field input, .field select, .field textarea { font-size: 16px; }
  .bottom-nav button em { font-size: 10.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}



/* 补货录入 · 按 2026-11-23 移动端设计包重做 */
.replenishment-guide {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border-left: 2px solid var(--clay);
  background: var(--paper);
}
.replenishment-guide strong { font-size: 13px; font-weight: 500; }
.replenishment-guide span { color: var(--muted); font-size: 12px; line-height: 1.6; }
.replenishment-entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.replenishment-entry-head h4 { margin: 0; font-size: 15px; font-weight: 600; }
.replenishment-entry-head > span { color: var(--muted); font-size: 11px; text-align: right; }
.replenishment-rows { gap: 12px; }
.replenishment-row {
  display: block;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.replenishment-color-line {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 12px 0;
}
.replenishment-color-line .replenishment-color { flex: 1; min-width: 0; margin: 0; }
.replenishment-color-line .field-label { font-size: 12px; }
.replenishment-color-line input { min-height: 44px; font-size: 16px; }
.replenishment-remove {
  min-width: 56px;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.replenishment-remove:disabled { opacity: .35; }
.replenishment-size-head {
  display: flex;
  justify-content: space-between;
  padding: 12px 12px 6px;
  color: var(--muted);
  font-size: 11px;
}
.replenishment-sizes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}
.replenishment-size { display: flex; min-width: 0; gap: 5px; flex-direction: column; }
.replenishment-size > span:first-child { color: var(--ink-3); font-size: 12px; text-align: left; }
.replenishment-unit { position: relative; display: block; height: auto; }
.replenishment-size .replenishment-unit,
.replenishment-unit .replenishment-unit { height: auto; min-height: 0; margin: 0; padding: 0; line-height: normal; color: var(--ink); font-weight: 400; }
.replenishment-unit input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  text-align: left;
}
.replenishment-unit input:focus { border-color: var(--clay); outline: 2px solid rgba(166, 83, 50, .16); outline-offset: 1px; }
.replenishment-unit em {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  pointer-events: none;
}
.replenishment-color-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
}
.replenishment-color-total strong { color: var(--ink); font-size: 13px; font-weight: 500; }
.replenishment-form-actions { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 16px; }
.replenishment-form-actions .text-add { min-height: 44px; font-size: 12px; }
.replenishment-note-field { margin-top: 4px; }
.replenishment-note-field textarea { min-height: 76px; padding: 12px; resize: vertical; line-height: 1.6; }
.replenishment-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.replenishment-total > span { display: block; color: var(--muted); font-size: 12px; }
.replenishment-total strong { display: flex; align-items: baseline; gap: 5px; margin-top: 2px; font-family: var(--serif); font-size: 28px; font-weight: 400; }
.replenishment-total em { font-family: var(--sans); font-size: 12px; font-style: normal; }
.replenishment-submit .btn { min-width: 190px; }

@media (max-width: 700px) {
  .replenishment-entry-head { flex-direction: column; gap: 4px; }
  .replenishment-entry-head > span { text-align: left; }
  .replenishment-sizes { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }
  .replenishment-submit {
    position: static;
    margin: 16px 0 0;
    padding: 16px 0 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .replenishment-submit .btn { flex: 1; min-width: 0; padding: 0 12px; font-size: 13px; }
  .replenishment-total { flex: none; }
  .replenishment-record { background: var(--card); }
  .replenishment-record-head { font-size: 13px; }
  .replenishment-lines { font-size: 12px; line-height: 1.7; }
  .replenishment-note, .replenishment-meta { font-size: 11px; line-height: 1.6; }
}

/* 手机端单据表格：字段纵排卡片，避免局部横滑 */
@media (max-width: 700px) {
  .sheet-table-wrap.is-mobile-cards,
  .owner-table-wrap.is-mobile-cards { overflow: visible; border: 0; background: transparent; }
  .mobile-card-table { min-width: 0; width: 100%; border-collapse: separate; }
  .mobile-card-table thead { display: none; }
  .mobile-card-table,
  .mobile-card-table tbody,
  .mobile-card-table tr,
  .mobile-card-table td { display: block; width: 100%; }
  .mobile-card-table tbody tr {
    margin: 0 0 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
  }
  .mobile-card-table tbody tr:last-child { margin-bottom: 0; }
  .mobile-card-table td {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 3px 0;
    border: 0;
    text-align: left;
  }
  .mobile-card-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 10px;
    line-height: 1.4;
  }
  .mobile-card-table td.mobile-cell-action,
  .mobile-card-table td[data-label=""] {
    display: block;
    min-height: 0;
    padding-top: 5px;
    text-align: right;
  }
  .mobile-card-table td.mobile-cell-action::before,
  .mobile-card-table td[data-label=""]::before { display: none; }
  .mobile-card-table input,
  .mobile-card-table select { width: 100%; min-width: 0; min-height: 40px; font-size: 16px; }
  .mobile-card-table .row-del { min-width: 44px; min-height: 40px; }
}

@media (max-width: 700px) {
  .send-btn { width: 44px; height: 44px; }
  .channel-action { height: 44px; }
  .sheet-step strong { font-size: 10px; line-height: 1.35; }
  .step-dot { width: 24px; height: 24px; font-size: 9px; }
  .sheet-stepper-hint { font-size: 10px; }
}

@media (max-width: 700px) {
  .modal-actions {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }
}

.sheet-hero-actions { display: flex; align-items: center; gap: 8px; }
.sheet-hero-actions .btn,
.sheet-hero-actions .upload-btn { min-height: 44px; height: auto; flex: none; }
.sheet-hero-actions .upload-btn {
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
}

/* 聊天功能临时停用 */
#view-chat { position: relative; }
#view-chat.is-disabled .chat-layout { visibility: hidden; pointer-events: none; }
.chat-disabled {
  position: absolute;
  inset: 0;
  padding: 28px 20px;
  display: grid;
  place-items: center;
  background: var(--paper);
  z-index: 2;
}
.chat-disabled .coming-soon-card {
  width: min(100%, 360px);
  padding: 34px 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.coming-soon-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: 0 auto 16px;
  border-radius: 15px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 28px;
}
.chat-disabled .eyebrow { margin: 0 0 7px; color: var(--clay); }
.chat-disabled h3 { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 28px; }
.chat-disabled p:last-child { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.8; }
body.chat-disabled #ai-direct-open,
body.chat-disabled #ai-pill { display: none !important; }

@media (max-width: 700px) {
  .chat-disabled { padding: 20px 14px; }
  .chat-disabled .coming-soon-card { padding: 30px 20px; }
  .chat-disabled h3 { font-size: 26px; }
}



/* 消除 body 首行空白导致的 20px 顶部偏移，避免底栏被裁切 */
body { display: flex; flex-direction: column; }

/* 协作同步、表单校验与移动触控 */
.sync-status { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.sync-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--olive); }
.sync-status.is-offline { color: var(--danger); }
.sync-status.is-offline::before { background: var(--danger); }
.sync-status.is-syncing::before { background: var(--gold); }
.is-invalid { border-color: var(--danger) !important; outline: 2px solid rgba(163, 59, 46, .12) !important; outline-offset: 1px; }
.channel-history { display: flex; justify-content: center; margin: 0 auto 16px; }
.channel-history .btn { min-height: 44px; }
.task-collaborators { display: grid; grid-template-columns: 1fr; gap: 6px; max-height: 220px; overflow-y: auto; }
.task-audit-info { margin: 0 0 14px; padding: 10px 12px; border-left: 2px solid var(--olive); background: var(--paper-2); }
.task-audit-info p { margin: 3px 0; color: var(--ink-3); font-size: 11px; line-height: 1.6; }
.task-autostage-hint { border-left-color: var(--gold); }
.task-deliverable, .task-review-meta { margin: 6px 0 0; color: var(--ink-3); font-size: 11px; line-height: 1.55; }
.task-review-meta { color: var(--muted); }
.channel-picker-unread { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--clay); color: #fff; font-size: 10px; line-height: 18px; text-align: center; }
.channel-member-option { min-height: 44px; }
.channel-member-option input { width: 20px; height: 20px; flex: none; }
.fabric-review-check { min-height: 44px; }
.fabric-review-check input { width: 20px; height: 20px; flex: none; }

@media (min-width: 701px) {
  .task-collaborators { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 700px) {
  .sync-status { font-size: 9px; }
  .modal .field input, .modal .field select { min-height: 44px; }
  .fabric-slip-tools .btn { min-height: 44px; height: 44px; }
  .fabric-slip-meta input, .fabric-slip-meta select { min-height: 44px; height: 44px; }
  .material-lines-table input, .cutting-lines-table input { min-height: 44px; height: 44px; font-size: 16px; }
  .cutting-lines-table .row-del { min-width: 44px; min-height: 44px; }
  .receipt-form input, .receipt-form select { min-height: 44px; font-size: 16px; }
  .cut-finish { flex-direction: column; }
  .cut-finish input, .cut-finish .btn { min-height: 44px; height: 44px; font-size: 16px; }
}
#app { flex: 1; min-height: 0; }

/* =========================================================
   Mobile UI Redesign System (390x844 primary, 360x800 tested)
   Senior UI systematic refinement: typography, touch targets,
   first-screen density, bottom-sheet modals, horizontal pills,
   compact cards, and unified spacing across all mobile views.
   ========================================================= */
@media (max-width: 700px) {
  /* 1. Global shell, topbar & bottom navigation */
  .topbar {
    height: calc(56px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 14px 0;
    gap: 8px;
    background: rgba(246, 241, 232, .92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
  .topbar-title {
    min-width: 0;
    flex: 1 1 auto;
  }
  .topbar-title h2 {
    font-size: 18px;
    letter-spacing: .02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-actions {
    gap: 6px;
    flex: none;
  }
  .sync-status {
    font-size: 11px;
    gap: 4px;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(33, 30, 26, .04);
  }
  .sync-status::before { width: 7px; height: 7px; }
  .icon-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 253, 248, .72);
    border-color: var(--line);
  }
  .topbar-me {
    width: 38px;
    height: 38px;
    background: transparent;
  }
  .topbar-me .avatar { width: 34px; height: 34px; font-size: 13px; }
  .notif-badge {
    top: -2px;
    right: -2px;
    min-width: 17px;
    height: 17px;
    font-size: 10px;
    line-height: 17px;
    font-weight: 600;
    box-shadow: 0 0 0 2px var(--paper);
  }
  .ai-direct-launch {
    height: 36px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .02em;
    box-shadow: 0 4px 12px -6px rgba(33, 30, 26, .45);
  }

  .bottom-nav {
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 5px 8px calc(5px + env(safe-area-inset-bottom, 0px));
    gap: 4px;
    background: rgba(33, 30, 26, .97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid rgba(246, 241, 232, .1);
  }
  .bottom-nav button {
    gap: 4px;
    border-radius: 10px;
    color: rgba(246, 241, 232, .56);
    transition: color .18s, background .18s, transform .12s;
  }
  .bottom-nav button:active { transform: scale(.96); }
  .bottom-nav button svg { width: 20px; height: 20px; }
  .bottom-nav button em {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .03em;
    line-height: 1.1;
  }
  .bottom-nav button.is-active {
    color: var(--paper);
    background: rgba(246, 241, 232, .11);
  }
  .bottom-nav button.is-active::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2.5px;
    border-radius: 0 0 3px 3px;
    background: var(--clay);
  }
  .bottom-badge {
    top: 3px;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 600;
    line-height: 17px;
  }

  .page {
    padding: 14px 14px 28px;
  }

  /* 2. Native-feel Bottom Sheet Modals */
  .modal-overlay {
    align-items: flex-end;
    justify-items: stretch;
    padding: 0;
    background: rgba(33, 30, 26, .48);
  }
  .modal {
    position: relative;
    width: 100%;
    max-width: 100%;
    max-height: 90dvh;
    padding: 18px 16px 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -14px 40px -16px rgba(24, 19, 13, .45);
    animation: sheet-up .26s cubic-bezier(.2, .85, .25, 1) both;
  }
  .modal::before {
    content: "";
    display: block;
    width: 38px;
    height: 4px;
    margin: -6px auto 14px;
    border-radius: 999px;
    background: var(--line-strong);
    opacity: .85;
  }
  @keyframes sheet-up {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .modal-head {
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
  }
  .modal-head h3 {
    margin: 2px 0 0;
    font-size: 20px;
    line-height: 1.3;
  }
  .modal-close {
    width: 40px;
    height: 40px;
    background: var(--card);
  }
  .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 6;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 16px -16px 0;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(246, 241, 232, .96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 20px -14px rgba(33, 30, 26, .28);
  }
  .modal-actions .spacer { display: none; }
  .modal-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
  }
  .modal .field { margin-bottom: 13px; }
  .modal .field-label { font-size: 12px; }
  .modal > :last-child:not(.modal-actions) {
    margin-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }

  /* Toast positioned safely above bottom nav */
  .toast-root {
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 28px);
  }
  .toast {
    font-size: 13px;
    padding: 11px 18px;
  }

  /* 3. Login View: compact editorial header + elevated form sheet */
  .login {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: 100dvh;
    overflow-y: auto;
    background: var(--paper);
  }
  .login-art {
    min-height: 152px;
    padding: calc(20px + env(safe-area-inset-top, 0px)) 20px 30px;
  }
  .login-brand .brand-mark { width: 34px; height: 34px; font-size: 18px; }
  .login-brand .brand-word { font-size: 17px; }
  .dressform { width: 136px; right: -8px; top: 4px; opacity: .45; }
  .art-copy { margin-top: 18px; }
  .art-copy h1 { font-size: 26px; line-height: 1.24; }
  .login-panel {
    position: relative;
    z-index: 2;
    margin-top: -18px;
    padding: 24px 20px calc(28px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px 22px 0 0;
    background: var(--paper);
    box-shadow: 0 -10px 28px -18px rgba(33, 30, 26, .45);
  }
  .login-form h2 { font-size: 26px; margin: 6px 0 6px; }
  .login-form .hint { font-size: 13px; line-height: 1.65; margin-bottom: 18px; }
  .login-form .field { margin-bottom: 14px; }
  .login-form .btn-block { height: 48px; font-size: 15px; font-weight: 500; }
  .chips { gap: 8px; }
  .chip,
  .role-chips .chip {
    height: 38px;
    padding: 0 14px;
    font-size: 13px;
  }
  .fineprint { font-size: 11.5px; margin-top: 16px; }

  /* 4. Style Sheets List: maximize first-screen cards */
  .sheets-page-v2 {
    padding: 14px 14px 32px;
  }
  .sheets-page-v2 .sheets-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
  }
  .sheets-heading .eyebrow { display: none; }
  .sheets-page-v2 .sheets-head h3 {
    margin: 0;
    font-size: 21px;
    line-height: 1.25;
  }
  .sheets-page-v2 .sheet-lede { display: none; }
  .sheets-head-actions {
    gap: 6px;
    flex-wrap: nowrap;
  }
  .sheets-head-actions .btn {
    height: 40px;
    min-height: 40px;
    padding: 0 13px;
    font-size: 13px;
  }
  .sheet-search {
    min-height: 44px;
    padding: 0 12px;
    margin-bottom: 10px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(46, 38, 27, .03);
  }
  .sheets-page-v2 .sheet-filters {
    gap: 4px;
    margin: 0 0 10px;
  }
  .sheets-page-v2 .filter-chip {
    flex: none;
    height: 44px;
    min-height: 44px;
    padding: 0 5px;
    gap: 3px;
    font-size: 12.5px;
  }
  .sheet-filters .filter-chip span {
    min-width: 18px;
    height: 18px;
    font-size: 11px;
  }
  .sheet-utility {
    gap: 8px;
    margin-bottom: 12px;
  }
  .sheet-utility-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--card);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
  }
  .sheet-utility-btn:active:not(:disabled) {
    background: var(--paper-2);
    border-color: var(--clay);
    color: var(--clay-deep);
  }
  .sheet-utility-count {
    font-size: 11.5px;
    color: var(--muted);
  }

  .sheets-page-v2 .sheet-grid {
    gap: 11px;
  }
  .sheets-page-v2 .sheet-card {
    grid-template-columns: 112px minmax(0, 1fr);
    border-radius: 14px;
    box-shadow: 0 2px 10px -8px rgba(33, 30, 26, .28);
  }
  .sheet-todo {
    left: 7px;
    right: auto;
    top: 7px;
    height: 22px;
    padding: 0 8px;
    font-size: 10.5px;
    font-weight: 500;
  }
  .sheets-page-v2 .sheet-card-body {
    padding: 11px 12px 10px;
  }
  .sheet-card-top {
    gap: 6px;
    margin-bottom: 3px;
  }
  .sheets-page-v2 .sheet-card-code {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
  }
  .sheet-card-top .sheet-status {
    height: 22px;
    padding: 0 7px;
    font-size: 11px;
    border-radius: 6px;
  }
  .sheets-page-v2 .sheet-card h4 {
    font-size: 16.5px;
    line-height: 1.32;
    margin: 2px 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .sheets-page-v2 .sheet-card-sub {
    font-size: 12px;
    margin: 0 0 8px;
  }
  .sheets-page-v2 .sheet-confirm-dots {
    padding: 6px 0 4px;
    gap: 5px;
  }
  .sheet-confirm-dots i { width: 7px; height: 7px; }
  .sheet-confirm-dots span { font-size: 11px; }
  .sheets-page-v2 .sheet-card-foot {
    font-size: 11.5px;
    padding-top: 4px;
    color: var(--ink-3);
  }

  /* 5. Style Sheet Detail: clear hierarchy & legible micro-copy */
  .sheet-detail-page {
    padding: 12px 14px 32px;
  }
  .back-link {
    min-height: 38px;
    padding: 0 10px 0 6px;
    margin-bottom: 10px;
    border-radius: 999px;
    background: var(--paper-2);
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 500;
  }
  .sheet-hero {
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    box-shadow: 0 2px 12px -8px rgba(33, 30, 26, .24);
  }
  .sheet-hero-media {
    height: 172px;
    border-radius: 12px;
  }
  .sheet-hero-copy { padding-top: 0; }
  .sheet-hero-copy .eyebrow { font-size: 11px; }
  .sheet-hero-copy h2 {
    margin: 4px 0 5px;
    font-size: 22px;
    line-height: 1.25;
  }
  .sheet-hero-copy h2 span {
    margin: 3px 0 0;
    font-size: 16px;
    color: var(--ink-2);
  }
  .sheet-hero-sub {
    margin: 0 0 10px;
    font-size: 12.5px;
    line-height: 1.5;
  }
  .sheet-hero-meta {
    gap: 6px 10px;
    font-size: 12px;
    color: var(--ink-3);
  }
  .sheet-hero-meta .sheet-status {
    height: 24px;
    padding: 0 9px;
    font-size: 11.5px;
    border-radius: 6px;
  }
  .sheet-hero-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    width: 100%;
    gap: 8px;
    margin-top: 4px;
  }
  .sheet-hero-actions .btn,
  .sheet-hero-actions .upload-btn {
    width: 100%;
    height: 42px;
    min-height: 42px;
    justify-content: center;
    font-size: 13px;
  }

  .sheet-stepper {
    position: relative;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 12px 0 8px;
    padding: 12px 6px 10px;
    border-radius: 14px;
    gap: 2px;
  }
  .sheet-step {
    width: 100%;
    margin: 0;
    padding: 4px 2px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 5px;
  }
  .sheet-step:not(:last-child)::after {
    display: block;
    left: calc(50% + 14px);
    right: auto;
    top: 16px;
    width: calc(100% - 24px);
    height: 1.5px;
  }
  .step-dot {
    width: 26px;
    height: 26px;
    font-size: 11px;
    font-weight: 600;
  }
  .sheet-step strong {
    font-size: 11px;
    line-height: 1.25;
    letter-spacing: 0;
  }
  .sheet-step.is-current {
    background: rgba(180, 85, 45, .07);
    border-radius: 10px;
  }
  .sheet-step.is-current strong {
    color: var(--clay-deep);
    font-weight: 600;
  }
  .sheet-stepper-hint {
    margin: 0 2px 12px;
    font-size: 11px;
  }

  .sheet-section {
    padding: 16px 14px;
    border-radius: 14px;
  }
  .sheet-section-head {
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--paper-2);
  }
  .section-no { font-size: 11px; font-weight: 600; }
  .sheet-section-title h3 { font-size: 18px; }
  .section-role { font-size: 11.5px; }
  .section-ok,
  .section-pending,
  .section-state {
    font-size: 11.5px;
    padding: 4px 9px;
    border-radius: 6px;
  }
  .sheet-section .field-label { font-size: 12px; }
  .sheet-subhead { font-size: 12px; margin: 14px 0 8px; }
  .lock-note { font-size: 12px; line-height: 1.65; }
  .sheet-total { font-size: 12.5px; padding: 10px 12px; border-radius: 10px; }
  .table-scroll-hint { font-size: 11px; margin: 6px 2px 10px; }
  .sheet-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 8px;
    margin-top: 14px;
  }
  .sheet-actions .btn {
    width: 100%;
    height: 44px;
    font-size: 13.5px;
  }
  .text-add { font-size: 12.5px; font-weight: 500; }

  /* Receipts, cutting, production & side cards readability */
  .receipt-row { padding: 10px 11px; border-radius: 10px; font-size: 12px; gap: 6px 8px; }
  .receipt-type { font-size: 11px; padding: 2px 6px; }
  .receipt-row strong { font-size: 12.5px; }
  .receipt-meta, .receipt-note { font-size: 11.5px; }
  .fabric-receipt { padding: 12px; border-radius: 12px; }
  .fabric-receipt-type { font-size: 10.5px; padding: 2px 6px; }
  .fabric-receipt-head strong { font-size: 13.5px; }
  .fabric-receipt-head span { font-size: 11.5px; }
  .fabric-receipt-foot { font-size: 11px; }
  .cutting-receipt-meta { font-size: 11.5px; gap: 6px; }
  .cutting-receipt-meta span { padding: 4px 8px; border-radius: 6px; }
  .cut-order { padding: 12px; border-radius: 12px; }
  .cut-order-head strong { font-size: 13.5px; }
  .cut-order-meta { font-size: 11.5px; }
  .cut-status { font-size: 11px; padding: 3px 8px; }
  .cut-order-line { font-size: 12.5px; }
  .cut-order-note, .cut-done-line { font-size: 12px; }
  .production-info p { font-size: 12.5px; }
  .production-total { font-size: 12.5px; }
  .big-ok { font-size: 13px; }
  .sheet-side-card { padding: 15px 14px; border-radius: 14px; }
  .sheet-side-card h4 { font-size: 12px; }
  .confirm-row strong { font-size: 13px; }
  .confirm-row small { font-size: 11.5px; }
  .ready-note { font-size: 12px; padding: 9px 10px; border-radius: 8px; }
  .history-row strong { font-size: 12.5px; }
  .history-row small, .history-row p { font-size: 11px; }

  /* Fabric & cutting upload modals */
  .fabric-slip-top { border-radius: 12px; padding: 12px; }
  .fabric-slip-preview { height: 156px; border-radius: 10px; }
  .fabric-slip-preview small { font-size: 11.5px; }
  .fabric-slip-status { font-size: 12px; }
  .fabric-match { font-size: 12px; padding: 10px 12px; border-radius: 8px; }
  .fabric-slip-lines-head h4 { font-size: 12px; }
  .fabric-slip-summary { font-size: 12.5px; padding: 10px 12px; border-radius: 10px; }
  .material-lines-table tr { padding: 10px 11px; border-radius: 10px; }
  .material-lines-table td::before,
  .receipt-lines-table td::before,
  .mobile-card-table td::before {
    font-size: 11.5px;
    color: var(--ink-3);
  }
  .mobile-card-table tbody tr { padding: 10px 12px; border-radius: 10px; }

  /* 6. Tasks Page: clean segmented filters & priority cards */
  .tasks-page-v2 {
    padding: 14px 14px 32px;
  }
  .task-quick-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 7px;
    margin: 0 -14px 11px;
    padding: 0 14px 2px;
  }
  .task-quick-filters::-webkit-scrollbar { display: none; }
  .task-quick-filters .filter-chip {
    flex: none;
    height: 38px;
    min-height: 38px;
    padding: 0 13px;
    font-size: 12.5px;
  }
  .task-actions {
    gap: 8px;
    margin-bottom: 12px;
  }
  .task-actions .btn {
    height: 44px;
    font-size: 13px;
    padding: 0 12px;
  }
  .task-focus-card {
    padding: 15px 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    box-shadow: 0 12px 28px -20px rgba(33, 30, 26, .6);
  }
  .task-focus-card .eyebrow { font-size: 11px; margin-bottom: 6px; }
  .task-focus-card h3 { font-size: 18px; line-height: 1.38; margin-bottom: 5px; }
  .task-focus-meta { font-size: 12px; color: rgba(246, 241, 232, .72); }
  .task-focus-stats { margin-top: 12px; padding-top: 11px; }
  .task-focus-stats strong { font-size: 22px; }
  .task-focus-stats span { font-size: 11px; color: rgba(246, 241, 232, .68); }

  .task-status-filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
    gap: 4px;
    padding: 4px;
    margin: 0 0 12px;
    border-radius: 12px;
    background: var(--paper-2);
    border: 1px solid var(--line);
  }
  .task-status-filters::-webkit-scrollbar { display: none; }
  .task-status-chip {
    flex: 1 0 auto;
    min-height: 38px;
    padding: 0 11px;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 500;
    gap: 4px;
  }
  .task-status-chip span {
    font-size: 11px;
    opacity: .8;
  }
  .task-list-card.task-card {
    padding: 13px 14px 12px 16px;
    border-radius: 14px;
    box-shadow: 0 2px 10px -8px rgba(33, 30, 26, .22);
  }
  .tasks-page-v2 .task-card::before {
    display: block;
    width: 3px;
  }
  .task-priority,
  .task-stage-tag,
  .task-done-tag {
    min-height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
  }
  .task-title { font-size: 15px; line-height: 1.45; }
  .task-detail { font-size: 12.5px; line-height: 1.55; }
  .task-assignee, .task-due, .task-audience, .task-sheet-link {
    font-size: 11.5px;
  }
  .task-sheet-link { padding: 3px 8px; border-radius: 6px; }
  .task-list-empty p { font-size: 12.5px; }

  /* 7. Chat View & AI Direct Fullscreen Panel */
  .channel-bar {
    padding: 8px 12px;
    gap: 6px;
    background: rgba(246, 241, 232, .94);
  }
  .channel-current {
    flex: 1 1 auto;
    min-width: 0;
    height: 38px;
    padding: 0 8px 0 4px;
    font-size: 13.5px;
  }
  #channel-current-name { max-width: none; }
  .channel-current-meta { font-size: 11px; flex: none; }
  .channel-action {
    flex: none;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    background: var(--card);
    font-size: 12px;
    font-weight: 500;
  }
  .channel-new { font-size: 12px; }
  .timeline {
    padding: 14px 12px 8px;
  }
  .msg { gap: 9px; margin-bottom: 16px; }
  .msg-head .name { font-size: 13px; }
  .msg-head .role, .msg-head time { font-size: 11px; }
  .msg-head .badge { font-size: 10.5px; height: 20px; }
  .msg-text { font-size: 14.5px; line-height: 1.7; }
  .ai-card { padding: 15px 15px 10px; border-radius: 4px 16px 16px 16px; }
  .ai-card .prose { font-size: 14px; line-height: 1.75; }
  .composer-wrap { padding: 6px 10px 8px; }
  .composer { border-radius: 16px; box-shadow: 0 2px 12px -8px rgba(33, 30, 26, .25); }
  .composer-modes {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 6px;
    padding: 8px 10px 2px;
  }
  .composer-modes::-webkit-scrollbar { display: none; }
  .mode-chip {
    flex: none;
    height: 32px;
    padding: 0 11px;
    font-size: 12px;
  }
  .composer-tools { gap: 6px; }
  .composer-tools .tool-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }
  .ai-switch { font-size: 12px; gap: 6px; }
  .send-btn { width: 42px; height: 42px; }

  /* AI Direct fullscreen polish */
  .ai-direct-panel.is-open .ai-direct-head {
    padding: 14px 16px 10px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    background: rgba(246, 241, 232, .94);
  }
  .ai-direct-head h3 { font-size: 20px; }
  .ai-direct-head h3 span { font-size: 11.5px; }
  .ai-direct-close {
    width: 40px;
    height: 40px;
    background: var(--card);
    font-size: 20px;
  }
  .ai-direct-hint {
    margin: 10px 16px 4px;
    font-size: 12px;
  }
  .ai-direct-messages {
    padding: 10px 14px 14px;
    gap: 10px;
  }
  .ai-direct-empty { font-size: 13px; }
  .ai-msg {
    max-width: 90%;
    padding: 11px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.68;
  }
  .ai-msg-label { font-size: 11px; margin-bottom: 4px; }
  .ai-direct-suggestions {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 14px 8px;
    gap: 7px;
  }
  .ai-direct-suggestions::-webkit-scrollbar { display: none; }
  .ai-suggestion {
    flex: none;
    min-height: 34px;
    padding: 6px 12px;
    background: var(--card);
    font-size: 12px;
  }
  .ai-draft-card { padding: 12px; border-radius: 10px; }
  .ai-draft-card h5 { font-size: 13px; }
  .ai-draft-card p { font-size: 12px; }
  .ai-draft-card select { height: 42px; font-size: 16px; }
  .ai-draft-actions .btn { height: 40px; font-size: 12.5px; }
  .ai-direct-form { padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  .ai-photo-btn { width: 42px; height: 42px; border-radius: 10px; }
  .ai-direct-form .send-btn { width: 42px; height: 42px; }

  /* 8. Members Page: compact horizontal business-card layout */
  .members-intro {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
  }
  .members-intro h3 {
    margin: 0;
    font-size: 20px;
    line-height: 1.25;
  }
  .members-intro .btn {
    flex: none;
    height: 40px;
    padding: 0 13px;
    font-size: 12.5px;
  }
  .members-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .member-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 4px;
    align-items: start;
    padding: 14px 14px 13px;
    border-radius: 14px;
    box-shadow: 0 2px 10px -8px rgba(33, 30, 26, .22);
  }
  .member-card .avatar {
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 44px;
    height: 44px;
    font-size: 17px;
    margin: 2px 0 0;
  }
  .member-card h4 {
    grid-column: 2;
    margin: 0;
    padding-right: 54px;
    font-size: 16px;
  }
  .member-card .badge {
    height: 20px;
    padding: 0 7px;
    font-size: 11px;
  }
  .member-card > .member-role:first-of-type {
    grid-column: 2;
    font-size: 12.5px;
  }
  .member-role-select {
    grid-column: 1 / -1;
    margin-top: 8px;
    height: 42px;
    font-size: 16px;
    border-radius: 9px;
  }
  .member-presence {
    top: 14px;
    right: 14px;
    font-size: 11px;
    letter-spacing: .04em;
  }
  .member-stats {
    grid-column: 1 / -1;
    margin: 10px 0 8px;
    padding-top: 10px;
    gap: 20px;
  }
  .member-stats div { font-size: 11.5px; }
  .member-stats strong { font-size: 18px; }
  .member-card > .member-role:last-child,
  .member-collab {
    grid-column: 1 / -1;
    font-size: 12.5px;
    min-height: 36px;
    align-items: center;
  }
  .member-collab {
    justify-content: center;
    width: 100%;
    padding: 0 12px;
    border: 1px solid rgba(180, 85, 45, .28);
    border-radius: 9px;
    background: rgba(180, 85, 45, .05);
    font-weight: 500;
  }

  .members-log {
    margin-top: 22px;
    padding-top: 18px;
  }
  .members-log-head h3 { font-size: 20px; }
  .members-log-hint { font-size: 12px; margin-bottom: 10px; }
  .audit-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin: 0 -14px 12px;
    padding: 0 14px 2px;
    gap: 7px;
  }
  .audit-filters::-webkit-scrollbar { display: none; }
  .audit-filters .filter-chip {
    flex: none;
    height: 38px;
    font-size: 12px;
  }
  .audit-group { padding: 12px 13px; border-radius: 14px; }
  .audit-person strong { font-size: 13.5px; }
  .audit-person small { font-size: 11.5px; }
  .audit-event { grid-template-columns: 74px minmax(0, 1fr); gap: 8px; padding: 9px 0; }
  .audit-event time { font-size: 11px; }
  .audit-event strong { font-size: 13px; }
  .audit-event small { font-size: 12px; }

  /* 9. Settings Page: unified card rhythm & full-width controls */
  .settings-page {
    padding: 14px 14px 32px;
  }
  .settings-head {
    gap: 8px;
    margin-bottom: 14px;
  }
  .settings-head h3 {
    margin: 0 0 4px;
    font-size: 22px;
  }
  .settings-head p { font-size: 12.5px; line-height: 1.6; }
  .admin-badge {
    align-self: flex-start;
    font-size: 11px;
    padding: 5px 11px;
  }
  .settings-grid { gap: 12px; }
  .settings-page > #password-form,
  .settings-page > #face-panel {
    margin-top: 12px;
  }
  .panel {
    padding: 16px 15px;
    border-radius: 14px;
    box-shadow: 0 2px 10px -8px rgba(33, 30, 26, .2);
  }
  .panel-head { margin-bottom: 8px; }
  .panel-head h4 { font-size: 15px; letter-spacing: .03em; }
  .panel-hint { font-size: 12px; line-height: 1.65; margin-bottom: 14px; }
  .status-pill { font-size: 11px; padding: 4px 10px; }
  .data-row { padding: 12px 0; margin: 6px 0 14px; }
  .data-row strong { font-size: 22px; }
  .data-row span { font-size: 11.5px; }
  .about-copy { font-size: 13px; line-height: 1.75; }
  .tech-tags { gap: 6px; margin-bottom: 16px; }
  .tech-tags span { font-size: 11px; padding: 4px 9px; border-radius: 6px; }
  .panel-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 8px;
    margin-top: 8px;
  }
  .panel-actions .btn,
  #password-form .btn,
  #face-panel .btn,
  .about-panel .btn-danger-ghost {
    width: 100%;
    height: 44px;
    font-size: 14px;
  }

  /* 10. Notifications modal readability */
  .notif-group h4 { font-size: 12px; margin-bottom: 8px; }
  .notif-item { padding: 12px; border-radius: 12px; gap: 10px; }
  .notif-item strong { font-size: 13.5px; }
  .notif-item small { font-size: 12px; }
  .notif-empty { font-size: 13px; }
}

/* Narrow phone fine-tuning (360x800) */
@media (max-width: 375px) {
  .topbar { padding-left: 12px; padding-right: 12px; gap: 6px; }
  .topbar-title h2 { font-size: 17px; }
  .sync-status { font-size: 10.5px; padding: 3px 6px; }
  .ai-direct-launch { padding: 0 10px; font-size: 11.5px; }
  .sheets-page-v2 .sheet-card { grid-template-columns: 100px minmax(0, 1fr); }
  .sheets-head-actions .btn { padding: 0 10px; font-size: 12.5px; }
  .sheet-step strong { font-size: 10.5px; }
  .audit-event { grid-template-columns: 66px minmax(0, 1fr); }
}

/* 表单控件统一收缩，避免选项、日期与动态行撑宽容器 */
.field, .two-col > *, .sheet-form-grid > *, .settings-grid > *, .fabric-slip-meta > * { min-width: 0; }
.field input, .field select, .field textarea { min-width: 0; max-width: 100%; }
.two-col, .sheet-form-grid, .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fabric-slip-meta { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.fabric-slip-meta.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.design-size-list, .size-qty-list { display: flex; flex-direction: column; gap: 8px; }
.design-size-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.design-size-row select, .size-qty-row select, .size-qty-row input, .sheet-table select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.size-qty-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(84px, .65fr) 52px; gap: 8px; align-items: center; }
.size-qty-editor .text-add { margin-top: 8px; }
.size-row-remove { min-width: 52px; min-height: 44px; padding: 6px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; }
.size-row-remove:hover { color: var(--danger); background: rgba(163, 59, 46, .07); }
.cut-finish .field { margin-bottom: 0; }

@media (max-width: 700px) {
  .two-col, .sheet-form-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .fabric-slip-meta, .fabric-slip-meta.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .design-size-row select, .size-qty-row select, .size-qty-row input,
  .mobile-card-table select, .cutting-lines-table select { height: 44px; min-height: 44px; font-size: 16px; }
  .size-qty-row { grid-template-columns: minmax(0, 1fr) minmax(78px, .65fr) 50px; gap: 6px; }
  .mobile-card-table input.fo-color,
  .mobile-card-table input.fs-fabric,
  .mobile-card-table input.prod-qty-input { width: 100%; min-width: 0; }
  .fabric-receipt-body .sheet-table.mobile-card-table { min-width: 0; }
}


/* 管理员 · 成员管理（添加 / 编辑 / 重置密码 / 移除） */
.member-admin-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.member-admin-hint { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.member-admin-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 8px; }
.member-act {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  transition: border-color .18s, color .18s, background .18s;
}
.member-act:hover { border-color: var(--clay); color: var(--clay-deep); }
.member-act.is-danger { border-color: rgba(163, 59, 46, .3); color: var(--danger); }
.member-act.is-danger:hover { background: rgba(163, 59, 46, .07); border-color: var(--danger); }
.member-admin-toggle { display: flex; gap: 8px; align-items: flex-start; min-height: 44px; margin: 4px 0 8px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.member-admin-toggle input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--clay); }

@media (max-width: 700px) {
  .member-admin-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .member-admin-bar .btn { width: 100%; height: 44px; font-size: 14px; }
  .member-card .member-admin-actions { grid-column: 1 / -1; }
  .member-act { flex: 1 1 0; min-height: 44px; font-size: 13px; }
}

/* 弹窗未保存修改提示条（替代原生 confirm，兼容 iPhone 主屏幕模式） */
.discard-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -4px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(180, 85, 45, .3);
  border-radius: 10px;
  background: rgba(180, 85, 45, .08);
  color: var(--clay-deep);
  font-size: 12.5px;
}
.discard-bar span { flex: 1 1 auto; min-width: 0; }
.discard-bar button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 500;
}
.discard-leave { border: 1px solid var(--clay); background: var(--clay); color: #fff; }
.discard-stay { border: 1px solid var(--line-strong); background: var(--card); color: var(--ink-2); }
@media (max-width: 700px) {
  .discard-bar button { min-height: 42px; }
}

/* 维护状态 / 未保存提醒：手机基础样式 */
.hint.login-hint-alert {
  color: #9a2f1f;
  background: #fbebe6;
  border: 1px solid #e8b8aa;
  border-radius: 10px;
  padding: 10px 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* 岗位频道分发：消息里的填写链接 + 频道切换未读提示（手机基础样式） */
.msg-sheet-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.msg-sheet-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  max-width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}
.msg-sheet-link span { min-width: 0; overflow-wrap: anywhere; }
.msg-sheet-link svg { width: 14px; height: 14px; flex: none; }
.msg-sheet-link.is-done { background: transparent; color: var(--ink-3); border-color: var(--line-strong); }
.ai-msg .msg-sheet-links { margin-top: 8px; }
.channel-current { position: relative; }
.channel-switch-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--clay);
  color: #fff;
  font-size: 10px;
  line-height: 18px;
  text-align: center;
  flex: none;
}
/* 应用内确认面板：替代浏览器原生确认框，与软件风格统一。手机基础样式为底部面板 */
.confirm-layer {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(33, 30, 26, .46);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .18s ease both;
}
.confirm-sheet {
  width: 100%;
  max-height: 86dvh;
  overflow-y: auto;
  padding: 10px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  box-shadow: var(--shadow-lg);
  animation: confirm-up .26s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes confirm-up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
.confirm-grip { width: 38px; height: 4px; margin: 0 auto 16px; border-radius: 999px; background: var(--line-strong); }
.confirm-sheet .eyebrow { color: var(--clay); letter-spacing: .18em; }
.confirm-sheet.is-danger .eyebrow { color: var(--danger); }
.confirm-sheet h3 {
  margin: 6px 0 14px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.confirm-facts {
  display: grid;
  gap: 1px;
  margin: 0 0 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}
.confirm-facts div { display: flex; align-items: baseline; gap: 12px; padding: 10px 12px; background: var(--card); }
.confirm-facts dt { flex: none; min-width: 48px; color: var(--muted); font-size: 12px; }
.confirm-facts dd { margin: 0; min-width: 0; color: var(--ink); font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.confirm-sheet .confirm-text { margin: 0; font-size: 13px; line-height: 1.7; color: var(--ink-3); }
.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.confirm-actions .btn { justify-content: center; width: 100%; min-height: 46px; font-size: 14px; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #8a2f24; border-color: #8a2f24; }

@media (min-width: 768px) {
  .confirm-layer { align-items: center; padding: 20px; }
  .confirm-sheet { width: min(440px, 100%); padding: 24px 26px; border-radius: 16px; }
  .confirm-grip { display: none; }
  .confirm-actions { display: flex; justify-content: flex-end; }
  .confirm-actions .btn { width: auto; min-width: 108px; }
}
/* 款式页精简：分页加载、双图、岗位相关环节（手机基础样式） */
.sheet-utility-count { margin-left: 0; }
.sheet-more { display: flex; justify-content: center; padding: 14px 0 8px; }
.sheet-more-btn { width: 100%; min-height: 44px; font-size: 13px; white-space: normal; }
.sheet-more-end { margin: 0; color: var(--muted); font-size: 12px; }
.sheet-cover-count {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(33, 30, 26, .62);
  color: #fff;
  font-size: 10px;
  line-height: 18px;
}
.sheet-hero-media.has-two { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); }
.sheet-hero-media.has-two img { min-width: 0; }
.sheet-role-hint {
  margin: 4px 0 0;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.ns-images { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ns-image {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #e9e1d4;
}
.ns-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ns-image-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(33, 30, 26, .66);
  color: #fff;
  font-size: 18px;
  line-height: 1;
}
.ns-image-add {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  aspect-ratio: 1 / 1;
  padding: 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--card);
}
.ns-image-add .btn { min-height: 40px; padding: 0 10px; }
.ns-image-add small { color: var(--muted); font-size: 11px; text-align: center; }
@media (min-width: 768px) {
  .sheet-more-btn { width: auto; }
  .ns-images { grid-template-columns: repeat(2, 160px); }
}
/* 物料单入库记录：手机先行。卡片撑满可用宽度、长文字换行；宽屏再恢复表格最小宽度 */
.fabric-receipt { min-width: 0; max-width: 100%; }
.fabric-receipt-head > div { min-width: 0; }
.fabric-receipt-head strong, .fabric-receipt-head span { overflow-wrap: anywhere; }
.fabric-receipt-total { flex: none; white-space: nowrap; }
.fabric-receipt-body { min-width: 0; }
.receipt-lines-table td { overflow-wrap: anywhere; }
@media (min-width: 701px) {
  .fabric-receipt-body .sheet-table:not(.mobile-card-table) { min-width: 430px; }
}
/* 任务卡片 / 岗位分派 / 单据录入（手机基础样式） */
.msg-task-card {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--clay);
  border-radius: 10px;
  background: var(--card);
}
.msg-task-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.msg-task-role { color: var(--clay-deep); font-size: 12px; font-weight: 600; }
.msg-task-state { padding: 1px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-3); font-size: 11px; }
.msg-task-state.s-review { background: #f4e7c8; color: #7a5a14; }
.msg-task-state.s-done { background: #e3ead9; color: #4b5a33; }
.msg-task-card strong { color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
.msg-task-card small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.task-status-chip.is-alert span { color: var(--danger); opacity: 1; font-weight: 600; }
.extract-row.extract-card { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.extract-card.is-pending { border-color: #d8a24a; box-shadow: inset 3px 0 0 #d8a24a; }
.extract-card .x-title { font-weight: 500; }
.x-field { display: grid; gap: 4px; min-width: 0; }
.x-field > span { color: var(--muted); font-size: 12px; }
.x-pending { margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #f4e1bd; color: #7a5a14; font-size: 11px; font-weight: 600; }
.extract-row.extract-card select, .extract-row.extract-card input, .extract-row.extract-card textarea { width: 100%; height: auto; min-width: 0; min-height: 44px; font-size: 16px; }
.extract-card .x-remove { justify-self: start; min-height: 40px; }
.extract-empty { padding: 12px; border: 1px dashed var(--line-strong); border-radius: 10px; text-align: center; }
.slip-recorder { margin: 0 0 10px; padding: 8px 10px; border-radius: 8px; background: var(--paper-2); color: var(--ink-3); font-size: 13px; overflow-wrap: anywhere; }
.slip-recorder strong { color: var(--ink); font-weight: 500; }
.slip-actions { flex-wrap: wrap; gap: 8px; }
.slip-actions .btn { flex: 1 1 140px; min-height: 44px; }
.sheet-step.is-static { cursor: default; opacity: .72; }
.upstream-summary { background: var(--paper-2); }
.upstream-list { display: grid; gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--line); }
.upstream-list div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 9px 12px; background: var(--card); }
.upstream-list dt { color: var(--muted); font-size: 12px; }
.upstream-list dd { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
@media (min-width: 768px) {
  .extract-row.extract-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .extract-card .x-title, .extract-card .x-detail { grid-column: 1 / -1; }
}
/* 首单数量：手机卡片模式下「合计」行带尺码属性（S / M / L … / 总计） */
@media (max-width: 700px) {
  .mobile-card-table tfoot { display: block; margin-top: 8px; }
  .mobile-card-table tfoot tr.owner-total-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--paper-2);
  }
  .mobile-card-table tfoot td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-height: 0;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: var(--card);
    text-align: left;
  }
  .mobile-card-table tfoot td::before { content: attr(data-label); color: var(--muted); font-size: 12px; line-height: 1.3; }
  .mobile-card-table tfoot td.owner-total-title {
    grid-column: 1 / -1;
    padding: 0 2px 2px;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
  }
  .mobile-card-table tfoot td.owner-total-title::before,
  .mobile-card-table tfoot td.owner-total-pad { display: none; }
  .mobile-card-table tfoot .owner-size-total,
  .mobile-card-table tfoot .owner-grand-total { font-family: var(--serif); font-size: 18px; color: var(--ink); }
  .mobile-card-table tfoot .owner-grand-total { grid-column: 1 / -1; flex-direction: row; align-items: baseline; justify-content: space-between; border: 1px solid var(--line-strong); }
}
/* ===== 第二阶段：颜色确认 / 工艺单 / 生产批次 / 全屏看图（手机基础样式） ===== */
.color-confirm { margin: 0 0 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.color-confirm-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
.color-confirm-list { display: grid; gap: 8px; }
.color-confirm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.color-confirm-row input { min-height: 44px; font-size: 16px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); min-width: 0; }
.color-confirm-row .row-del { min-height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); }
.color-confirm-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.color-confirm-actions .btn { min-height: 44px; }
.tech-pack { margin: 0 0 14px; }
.tech-pack-files { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.tech-pack-file { margin: 0; min-width: 0; }
.tech-pack-file img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; background: #e9e1d4; cursor: zoom-in; }
.tech-pack-file figcaption { margin-top: 4px; font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; white-space: pre-wrap; }
.tech-pack-file figcaption small { display: block; color: var(--muted); font-size: 11px; }
.tech-pack-form { margin-top: 10px; display: grid; gap: 4px; }
.tech-pack-form .upload-btn { justify-self: start; min-height: 44px; }

.batch-card { margin: 0 0 14px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--card); min-width: 0; }
.batch-card.is-focused { border-color: var(--clay); box-shadow: 0 0 0 2px rgba(180, 85, 45, .18); }
.batch-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.batch-head strong { display: block; font-family: var(--serif); font-size: 18px; font-weight: 400; color: var(--ink); }
.batch-head span { color: var(--muted); font-size: 12px; }
.batch-stage { flex: none; padding: 2px 9px; border-radius: 999px; background: var(--paper-2); color: var(--ink-3) !important; font-size: 12px !important; }
.batch-stage.s-production { background: #e3ead9; color: #4b5a33 !important; }
.batch-stage.s-ready { background: #f4e7c8; color: #7a5a14 !important; }
.batch-meta { margin: 6px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.batch-block { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); min-width: 0; }
.batch-block h5 { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.batch-qty { display: grid; gap: 6px; }
.batch-qty-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 6px; }
.batch-qty-color { flex: 0 0 100%; font-size: 13px; color: var(--ink-2); }
.batch-qty-cell { display: grid; grid-template-rows: auto auto auto; min-width: 56px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); text-align: center; }
.batch-qty-cell em { font-style: normal; font-size: 11px; color: var(--muted); }
.batch-qty-cell b { font-family: var(--serif); font-size: 16px; font-weight: 400; }
.batch-qty-cell i { font-style: normal; font-size: 12px; color: var(--clay-deep); border-top: 1px solid var(--line); }
.batch-qty-total { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 8px 10px; border-radius: 8px; background: var(--paper-2); font-size: 13px; }
.batch-qty-total b { font-family: var(--serif); font-size: 18px; font-weight: 400; }
.batch-legend { margin: 4px 0 0; font-size: 11px; color: var(--muted); }
.batch-lines { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.batch-lines li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.batch-lines li small { grid-column: 2; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.batch-lines li .batch-required { grid-column: 2; justify-self: start; }
.batch-line-type { grid-row: span 2; align-self: start; padding: 1px 6px; border-radius: 4px; background: var(--paper-3); font-size: 11px; }
.batch-required { padding: 1px 7px; border-radius: 999px; background: #f4e1bd; color: #7a5a14; font-size: 11px; font-style: normal; font-weight: 600; }
.batch-optional { padding: 1px 7px; border-radius: 999px; background: var(--paper-2); color: var(--muted); font-size: 11px; font-style: normal; }
.batch-line-edit { margin-bottom: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.batch-line-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; }
.batch-line-grid .field { margin-bottom: 8px; min-width: 0; }
.batch-line-grid input, .batch-line-grid select { min-height: 44px; font-size: 16px; width: 100%; min-width: 0; }
.batch-line-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.batch-required-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 14px; }
.batch-required-toggle input { width: 20px; height: 20px; }
.batch-line-foot .row-del { min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); }
.batch-slips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.batch-slips img, .batch-slip img { width: 72px; height: 96px; object-fit: cover; border: 1px solid var(--line); border-radius: 6px; cursor: zoom-in; display: block; }
.batch-slip { position: relative; display: grid; gap: 2px; font-size: 11px; color: var(--muted); }
.batch-slip button { position: absolute; top: -6px; right: -6px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(33, 30, 26, .7); color: #fff; font-size: 16px; }
.batch-slip-upload { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.batch-slip-upload .btn { flex: 1 1 140px; min-height: 44px; }
.batch-purchase-actions, .batch-release-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.batch-purchase-actions .btn, .batch-release-actions .btn { width: 100%; min-height: 46px; justify-content: center; white-space: normal; }
.batch-receive-list { display: grid; gap: 8px; }
.batch-receive-line { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); min-width: 0; }
.batch-receive-line.is-pending { border-color: #d8a24a; }
.batch-receive-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.batch-receive-line small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.batch-receive-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; margin-top: 6px; }
.batch-receive-form .field { margin-bottom: 8px; min-width: 0; }
.batch-receive-form input { min-height: 44px; font-size: 16px; width: 100%; min-width: 0; }
.batch-receive-form .sheet-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.batch-receive-form .btn { min-height: 44px; width: 100%; justify-content: center; }
.batch-cut-record { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 0; }
.batch-cut-record img { width: 64px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; }
.batch-cut-record:not(:has(img)) { grid-template-columns: minmax(0, 1fr); }
.batch-cut-record small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.batch-cut-rows { display: grid; gap: 8px; margin: 10px 0; }
.batch-cut-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.batch-cut-row small { display: block; color: var(--muted); font-size: 12px; }
.batch-cut-row input { min-height: 44px; font-size: 16px; text-align: center; width: 100%; min-width: 0; }
.batch-missing-list { margin: 0 0 6px; padding: 0; list-style: none; display: grid; gap: 8px; }
.batch-missing-list li { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid #e8b8aa; border-radius: 10px; background: #fbebe6; font-size: 13px; overflow-wrap: anywhere; }
.batch-missing-list li strong { color: var(--ink); }
.batch-missing-state { justify-self: start; padding: 1px 8px; border-radius: 999px; background: #fff; color: var(--danger); font-style: normal; font-size: 12px; font-weight: 600; }
.batch-history { margin-top: 10px; font-size: 12px; }
.batch-history summary { min-height: 36px; line-height: 36px; color: var(--ink-3); cursor: pointer; }
.batch-history p { margin: 4px 0; overflow-wrap: anywhere; }
.batch-history small { display: block; color: var(--muted); }

.image-viewer { position: fixed; inset: 0; z-index: 130; display: flex; flex-direction: column; background: rgba(18, 16, 13, .96); color: #fff; }
.image-viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px 14px; }
.image-viewer-bar strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 14px; }
.image-viewer-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.image-viewer-tools button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .28); border-radius: 50%; background: rgba(255, 255, 255, .08); color: #fff; font-size: 20px; }
.image-viewer-tools button svg { width: 18px; height: 18px; }
.image-viewer-tools span { min-width: 44px; text-align: center; font-size: 12px; color: rgba(255, 255, 255, .8); }
.image-viewer-stage { flex: 1; overflow: auto; display: flex; align-items: flex-start; justify-content: flex-start; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
.image-viewer-stage img { display: block; width: 100%; max-width: none; height: auto; margin: auto; user-select: none; }
@media (min-width: 768px) {
  .batch-line-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* 品类单选 / 尺码多选下拉（按钮式，点开不弹键盘；手机基础样式） */
.picker { position: relative; min-width: 0; }
.picker-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--paper);
  color: var(--ink); font-family: var(--sans); font-size: 16px; text-align: left;
}
.picker-trigger.is-empty .picker-text { color: #a1957f; }
.picker-trigger:disabled { background: var(--paper-2); color: var(--ink); cursor: default; }
.picker-trigger:disabled .picker-caret { display: none; }
.picker.is-open .picker-trigger { border-color: var(--ink); }
.picker-text { min-width: 0; overflow-wrap: anywhere; line-height: 1.4; }
.picker-caret { flex: none; color: var(--muted); font-size: 14px; }
.picker-panel {
  margin-top: 6px; padding: 8px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--card); box-shadow: var(--shadow-sm);
}
.picker-single .picker-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.picker-single .picker-panel.hidden, .picker-multi .picker-panel.hidden { display: none; }
.picker-option {
  min-height: 44px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); color: var(--ink-2); font-family: var(--sans); font-size: 15px;
}
.picker-option.is-selected { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.picker-group + .picker-group { margin-top: 8px; }
.picker-group-label { margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.picker-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.picker-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.picker-count { color: var(--muted); font-size: 13px; }
.picker-done { min-height: 44px; min-width: 96px; justify-content: center; }
.picker-legacy { margin: 6px 0 0; color: #7a5a14; font-size: 12px; overflow-wrap: anywhere; }
.sheet-category-filter { display: flex; gap: 6px; margin: 0 0 10px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sheet-category-filter::-webkit-scrollbar { display: none; }
.category-chip { flex: none; min-height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.category-chip.is-active { border-color: var(--ink); background: var(--ink); color: var(--paper); }
@media (min-width: 768px) {
  .picker-panel { position: absolute; z-index: 20; left: 0; right: 0; }
  .picker-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
/* 小衣频道业务卡片（手机基础样式） */
.xa-card-slot { margin-top: 10px; min-width: 0; }
.xa-card { display: grid; gap: 10px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--card); min-width: 0; }
.xa-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.xa-title { display: grid; gap: 2px; min-width: 0; }
.xa-title strong { font-size: 15px; color: var(--ink); }
.xa-title span { font-size: 13px; color: var(--ink-3); overflow-wrap: anywhere; }
.xa-state { flex: none; padding: 2px 9px; border-radius: 999px; background: var(--paper-2); color: var(--ink-3); font-size: 12px; }
.xa-state.s-done { background: #e3ead9; color: #4b5a33; }
.xa-state.s-pick { background: #f4e7c8; color: #7a5a14; }
.xa-error, .xa-warn { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.xa-error { background: #fbebe6; color: #9a2f1f; border: 1px solid #e8b8aa; }
.xa-warn { background: #fbf3e2; color: #7a5a14; border: 1px solid #ead6a6; }
.xa-candidates { display: grid; gap: 8px; }
.xa-candidate { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 10px; align-items: center; min-height: 64px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); text-align: left; color: var(--ink); }
.xa-candidate img, .xa-thumb-empty { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: #e9e1d4; display: grid; place-items: center; color: var(--muted); }
.xa-candidate strong { display: block; font-size: 15px; }
.xa-candidate small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.xa-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.xa-search input { min-height: 44px; font-size: 16px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); min-width: 0; }
.xa-search .btn { min-height: 44px; }
.xa-form { display: grid; gap: 8px; min-width: 0; }
.xa-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; align-items: center; font-size: 14px; }
.xa-label { color: var(--muted); font-size: 12px; }
.xa-row select, .xa-row input, .xa-grid input, .xa-grid select, .xa-alloc-row select, .xa-alloc-row input { width: 100%; min-width: 0; min-height: 44px; font-size: 16px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
.xa-sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.xa-size { display: grid; gap: 4px; font-size: 13px; color: var(--ink-3); text-align: center; }
.xa-size input { min-height: 44px; font-size: 16px; text-align: center; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); width: 100%; min-width: 0; }
.xa-sum { margin: 0; padding: 8px 10px; border-radius: 8px; background: var(--paper-2); font-size: 13px; }
.xa-sum.is-off { background: #fbebe6; color: #9a2f1f; }
.xa-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.xa-actions .btn { width: 100%; min-height: 46px; justify-content: center; }
.xa-done { display: grid; gap: 8px; font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.xa-slip-image { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; align-items: end; }
.xa-slip-image img { width: 88px; height: 112px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.xa-slip-image small { color: var(--muted); font-size: 12px; }
.xa-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.xa-grid label { display: grid; gap: 4px; min-width: 0; }
.xa-sub { margin: 4px 0 0; font-size: 14px; font-weight: 600; }
.xa-line { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); min-width: 0; }
.xa-alloc { display: grid; gap: 8px; }
.xa-alloc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 8px; padding: 8px; border: 1px dashed var(--line-strong); border-radius: 8px; background: var(--card); }
.xa-alloc-row > span { grid-column: 1 / -1; font-size: 13px; overflow-wrap: anywhere; }
.xa-alloc-row > span small { display: block; color: var(--muted); font-size: 12px; }
.xa-unalloc { margin: 0; font-size: 13px; color: var(--ink-3); }
.xa-unalloc.is-off { color: #9a2f1f; font-weight: 600; }
/* 工艺单 PDF 文件卡与预览（手机基础样式） */
.tech-pack-files:has(.tech-pack-pdf) { grid-template-columns: minmax(0, 1fr); }
.tech-pack-pdf { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; min-height: 60px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); text-align: left; color: var(--ink); }
.tech-pack-pdf-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 8px; background: #a33b2e; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; }
.tech-pack-pdf-text { min-width: 0; }
.tech-pack-pdf-text strong { display: block; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; white-space: pre-wrap; }
.tech-pack-pdf-text small { display: block; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.pdf-viewer .pdf-frame { flex: 1; width: 100%; border: 0; background: #fff; }
.pdf-download { display: grid; place-items: center; min-width: 56px; height: 44px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; color: #fff; text-decoration: none; font-size: 13px; }
.owner-zero-hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
/* 到货单原图按钮（收货明细行内） */
.batch-receipt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.batch-slip-image { min-height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--card); color: var(--ink-2); font-size: 12px; }
.xa-slip-image img.is-missing { opacity: .4; }
/* 文字型删除按钮（颜色确认、本批物料行）：取消通用 .row-del 的 26px 固定宽高，按文字撑开，手机触控 ≥44px */
.color-confirm-row .row-del,
.batch-line-foot .row-del {
  width: auto;
  height: auto;
  min-width: 64px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink-3);
}
.color-confirm-row .row-del:hover,
.batch-line-foot .row-del:hover { color: var(--danger); border-color: rgba(163, 59, 46, .4); }
/* 资料确认三段 + 首单批次 */
.sheet-card-first { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: #f4e7c8; color: #7a5a14; font-size: 11px; white-space: nowrap; }
.sheet-card-first.is-done { background: #e3ead9; color: #4b5a33; }
.confirm-subhead { margin: 14px 0 8px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 14px; }
/* 第四阶段：岗位办理卡（手机基础样式） */
.xa-batch { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper); min-width: 0; }
.xa-batch-main { display: grid; gap: 2px; min-width: 0; }
.xa-batch-main strong { font-family: var(--serif); font-size: 17px; font-weight: 400; }
.xa-batch-main span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.xa-batch-stage { flex: none; padding: 2px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-3); font-size: 11px; }
.xa-batch-switch summary { min-height: 36px; line-height: 36px; color: var(--ink-3); font-size: 13px; cursor: pointer; }
.xa-batch-pick { display: grid; gap: 8px; }
.xa-batch-option { display: grid; gap: 2px; width: 100%; min-height: 56px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); text-align: left; color: var(--ink); }
.xa-batch-option strong { font-size: 15px; }
.xa-batch-option span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.xa-batch-option em { color: #9a2f1f; font-size: 12px; font-style: normal; }
.xa-batch-option:disabled { opacity: .6; }
.xa-batch-switch .xa-batch-option { margin-top: 6px; }
.xa-task-line { margin: 0; color: var(--ink-3); font-size: 12px; }
.xa-detail { justify-self: start; }
.xa-pline-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.xa-text-del { width: auto !important; height: auto !important; min-width: 64px; min-height: 44px; padding: 0 14px; font-size: 15px; white-space: nowrap; border: 1px solid var(--line-strong) !important; border-radius: 8px; color: var(--ink-3); background: transparent; }
.xa-merch-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; font-size: 12px; }
.xa-merch-summary span, .xa-merch-summary strong { padding: 2px 8px; border-radius: 999px; background: var(--paper-2); }
.xa-merch-summary .st-missing { background: #fbebe6; color: #9a2f1f; }
.xa-merch-summary .st-arrived { background: #fbf3e2; color: #7a5a14; }
.xa-merch-summary .st-confirmed { background: #e3ead9; color: #4b5a33; }
.xa-merch-summary strong { background: #9a2f1f; color: #fff; font-weight: 600; }
.xa-merch-summary strong.ok { background: #4b5a33; }
.xa-merch-lines { display: grid; gap: 8px; }
.xa-merch-line { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); min-width: 0; }
.xa-merch-line.s-missing { border-color: #e8b8aa; }
.xa-merch-line.s-arrived { border-color: #ead6a6; }
.xa-merch-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.xa-merch-line small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.xa-merch-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.xa-merch-state { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.xa-receive { min-height: 44px; }
.xa-block { padding: 1px 7px; border-radius: 999px; background: #fbebe6; color: #9a2f1f; font-size: 11px; font-style: normal; font-weight: 600; }
.xa-citems { display: grid; gap: 8px; }
.xa-citem { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) minmax(0, .9fr) auto; gap: 6px; align-items: center; }
.xa-citem input { width: 100%; min-width: 0; min-height: 44px; font-size: 16px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.xa-citem .xa-text-del { min-width: 56px; padding: 0 10px; }
.xa-diff-count { margin-left: 6px; color: #7a5a14; font-size: 12px; font-weight: 400; }
.xa-compare-wrap { overflow-x: auto; }
.xa-compare { width: 100%; border-collapse: collapse; font-size: 13px; }
.xa-compare th, .xa-compare td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.xa-compare th { color: var(--muted); font-weight: 500; font-size: 12px; }
.xa-compare tr.is-diff td { background: #fbf3e2; color: #7a5a14; font-weight: 600; }
.xa-prod-qty { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; padding: 8px 10px; border-radius: 8px; background: var(--paper-2); font-size: 13px; }
.xa-prod-qty b { font-family: var(--serif); font-size: 18px; font-weight: 400; }
.xa-ready { margin: 0; padding: 8px 10px; border-radius: 8px; background: #e3ead9; color: #4b5a33; font-size: 13px; }
.xa-missing { padding: 8px 10px; border: 1px solid #e8b8aa; border-radius: 10px; background: #fbebe6; }
.xa-missing ul { margin: 4px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.xa-missing li { font-size: 13px; overflow-wrap: anywhere; }
.xa-missing em { margin-left: 4px; padding: 1px 6px; border-radius: 999px; background: #fff; color: #9a2f1f; font-style: normal; font-size: 12px; font-weight: 600; }
.xa-mini-link { margin-left: 6px; min-height: 32px; padding: 0 10px; border: 1px solid #e8b8aa; border-radius: 999px; background: #fff; color: #9a2f1f; font-size: 12px; }
/* 首次登录修改初始密码 */
.initial-password-form { display: grid; gap: 4px; }
.initial-password-form input { min-height: 44px; font-size: 16px; }
.initial-password-form .modal-actions .btn { min-height: 46px; }
/* 基本信息内嵌的「设计确认」子区块（不再是独立卡片） */
.sheet-section .sheet-subsection { margin: 16px 0 0; padding: 14px 0 0; border: 0; border-top: 1px dashed var(--line-strong); border-radius: 0; background: transparent; box-shadow: none; }
.sheet-subsection-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin: 0 0 10px; }
.sheet-subsection-head span { color: var(--muted); font-size: 12px; font-weight: 400; overflow-wrap: anywhere; }
/* 基本信息里的颜色列表（设计确认已并入） */
.basic-colors .color-confirm-list { margin-top: 4px; }

/* 工艺单：上传人可删除（文件卡 + 「删除」按钮同一行） */
.tech-pack-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; min-width: 0; }
.tech-pack-row .tech-pack-pdf { min-width: 0; }
.tech-pack-description-field textarea { width: 100%; min-height: 44px; font-size: 16px; line-height: 1.5; overflow: hidden; overflow-wrap: anywhere; resize: none; }
.tech-pack-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.tech-pack-del { width: auto !important; height: auto !important; min-width: 64px; min-height: 44px; padding: 0 14px; font-size: 15px; white-space: nowrap; border: 1px solid var(--line-strong) !important; border-radius: 8px; color: #9a2f1f; background: transparent; }
/* 04 物料：面料 / 辅料分组 */
.purchase-group { display: grid; gap: 10px; min-width: 0; }
.purchase-group + .purchase-group { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line-strong); }
.purchase-group-head { display: flex; align-items: baseline; gap: 8px; margin: 0; }
.purchase-group-head span { color: var(--muted); font-size: 12px; font-weight: 400; }
.purchase-group-list { display: grid; gap: 10px; min-width: 0; }
.purchase-group .purchase-add-material { margin-top: 0; }
.purchase-item[data-type="辅料"] { border-left: 3px solid #b48a3c; }
.purchase-item[data-type="面料"] { border-left: 3px solid #6c7a8c; }
.bom-group-head { display: flex; align-items: baseline; gap: 6px; margin: 10px 0 4px; font-size: 14px; }
.bom-group-head span { color: var(--muted); font-size: 12px; font-weight: 400; }
/* 裁床物料需求：齐料状态与标题同一行 */
.bom-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.bom-state { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.bom-state.is-short { background: #fbebe6; color: #9a2f1f; }
.bom-state.is-ready { background: #e3ead9; color: #4b5a33; }
/* 款式列表：「资料确认中」可点，跳到第一个未确认的资料 */
.sheet-status-jump { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 0; font: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.sheet-status-jump:active { transform: scale(.97); }
/* 款式列表：补货批次进度（第几批 · 当前步骤，可点直达） */
.sheet-card-replenish { display: grid; gap: 6px; margin-top: 8px; }
.replenish-step { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 6px 10px; border: 1px solid #ead6a6; border-radius: 8px; background: #fbf6ea; color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; min-width: 0; }
.replenish-preview { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; }
.replenish-preview .replenish-step {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: 'name status' 'dots status';
  align-content: center;
  gap: 3px 5px;
  padding: 6px;
}
.replenish-preview .replenish-step-name { grid-area: name; }
.replenish-preview .replenish-step-dots { grid-area: dots; justify-self: start; }
.replenish-preview .replenish-step-now { grid-area: status; white-space: normal; text-align: right; }
.replenish-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; min-width: 44px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper-2); color: var(--ink); font: inherit; font-size: 12px; white-space: nowrap; cursor: pointer; }
.replenish-toggle::after { content: ''; width: 5px; height: 5px; border: solid currentColor; border-width: 0 1px 1px 0; transform: translateY(-2px) rotate(45deg); }
.replenish-toggle[aria-expanded="true"]::after { transform: translateY(1px) rotate(225deg); }
.replenish-rounds:not([hidden]) { display: grid; gap: 6px; }
.replenish-step.is-done { border-color: var(--line); background: var(--paper-2); color: var(--muted); }
.replenish-step-name { font-weight: 600; white-space: nowrap; }
.replenish-step-dots { display: inline-flex; gap: 4px; justify-self: center; }
.replenish-step-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.replenish-step-dots i.is-done { background: #4b5a33; }
.replenish-step-dots i.is-current { background: #b48a3c; box-shadow: 0 0 0 3px rgba(180, 138, 60, .25); }
.replenish-step-now { color: #7a5a14; font-weight: 600; white-space: nowrap; }
.replenish-step.is-done .replenish-step-now { color: var(--muted); }

/* 款式单已取消品类选择：品类筛选整行隐藏 */
.sheet-category-filter[hidden] { display: none; }
.task-collaboration-entry { min-height: 44px; margin-block: 6px; }
.task-collaboration-body, .task-collaboration-list, .task-collaboration-form { display: grid; gap: 10px; min-width: 0; }
.task-collaboration-body p, .task-collaboration-list button { overflow-wrap: anywhere; white-space: pre-wrap; }
.task-collaboration-form input:not([type="checkbox"]), .task-collaboration-form select { min-width: 0; max-width: 100%; font-size: 16px; }
.task-collaboration-body .btn { min-height: 44px; white-space: normal; }
.task-collaboration-form fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 8px; }
.task-collaboration-choice { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.task-collaboration-card { display: grid; gap: 6px; overflow-wrap: anywhere; }
