@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=IBM+Plex+Mono:wght@400;500&family=Noto+Sans+SC:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap');

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

:root,
[data-theme="cool"] {
  /* Chorma cool：近白画布 + 墨黑 + 青天蓝强调 */
  --bg: #f3f5f8;
  --bg-elevated: #ffffff;
  --bg-sidebar: #eef2f6;
  --bg-soft: #f3f4f6;
  --ink: #0b1220;
  --ink-2: #1e293b;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent-rgb: 14, 138, 154;
  --accent-2-rgb: 37, 99, 235;
  --accent: #0e8a9a;
  --accent-hover: #0b7381;
  --accent-soft: rgba(var(--accent-rgb), 0.12);
  --accent-ink: #0a6673;
  --accent-2: #2563eb;
  --accent-2-ink: #1d4ed8;
  --danger: #e11d48;
  --warn: #b45309;
  --ok: #0e8a9a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 1px 0 rgba(15, 23, 42, 0.04), 0 10px 28px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 1px 0 rgba(15, 23, 42, 0.05), 0 28px 64px rgba(15, 23, 42, 0.1);
  --font: 'DM Sans', 'Noto Sans SC', -apple-system, sans-serif;
  --font-display: 'Syne', 'DM Sans', 'Noto Sans SC', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --sidebar-w: 200px;
  --glow-accent: rgba(var(--accent-rgb), 0.07);
  --glow-accent-strong: rgba(var(--accent-rgb), 0.14);
  --glow-accent-2: rgba(var(--accent-2-rgb), 0.05);
  --glow-accent-2-strong: rgba(var(--accent-2-rgb), 0.1);
  --login-page-bg: linear-gradient(165deg, #f8fafc 0%, #eef3f8 48%, #e8eef5 100%);
  --sc-shell-bg: linear-gradient(180deg, #f7f9fc 0%, #eef2f7 100%);
  --sc-orb-gradient: linear-gradient(135deg, rgba(var(--accent-rgb), 0.85), rgba(var(--accent-2-rgb), 0.55));
  --sc-orb-shadow: 0 18px 40px rgba(var(--accent-rgb), 0.25);
  --text: var(--ink);
  --text-muted: var(--muted);
  --surface: var(--bg-elevated);
  --surface-2: var(--bg-soft);
  --border: var(--line);
  --success: var(--ok);
  --warning: var(--warn);
  --radius-md: var(--radius);
}

[data-theme="warm"] {
  /* Chorma warm：奶油黄底 + 暖棕墨 + 陶土橙强调（Notion / Linear 暖色科技风） */
  --bg: #faf7f0;
  --bg-elevated: #fffdf8;
  --bg-sidebar: #f3ede0;
  --bg-soft: #f0e9dc;
  --ink: #1c1408;
  --ink-2: #3d2f1a;
  --muted: #7a6b52;
  --muted-2: #a89878;
  --line: #e8dcc8;
  --line-strong: #d4c4a8;
  --accent-rgb: 217, 119, 87;
  --accent-2-rgb: 193, 120, 23;
  --accent: #d97757;
  --accent-hover: #c6613f;
  --accent-soft: rgba(var(--accent-rgb), 0.14);
  --accent-ink: #9a4a28;
  --accent-2: #c17817;
  --accent-2-ink: #8a5a0a;
  --ok: #8a6b1a;
  --warn: #c17817;
  --shadow-sm: 0 1px 0 rgba(60, 40, 10, 0.04);
  --shadow-md: 0 1px 0 rgba(60, 40, 10, 0.04), 0 10px 28px rgba(60, 40, 10, 0.06);
  --shadow-lg: 0 1px 0 rgba(60, 40, 10, 0.05), 0 28px 64px rgba(60, 40, 10, 0.1);
  --glow-accent: rgba(var(--accent-rgb), 0.1);
  --glow-accent-strong: rgba(var(--accent-rgb), 0.16);
  --glow-accent-2: rgba(var(--accent-2-rgb), 0.08);
  --glow-accent-2-strong: rgba(var(--accent-2-rgb), 0.12);
  --login-page-bg: linear-gradient(165deg, #fffdf8 0%, #faf4e8 48%, #f5ead8 100%);
  --sc-shell-bg: linear-gradient(180deg, #faf6ee 0%, #f0e8da 100%);
  --sc-orb-gradient: linear-gradient(135deg, rgba(var(--accent-rgb), 0.85), rgba(var(--accent-2-rgb), 0.55));
  --sc-orb-shadow: 0 18px 40px rgba(var(--accent-rgb), 0.22);
  --text: var(--ink);
  --text-muted: var(--muted);
  --surface: var(--bg-elevated);
  --surface-2: var(--bg-soft);
  --border: var(--line);
  --success: #8a6b1a;
  --warning: var(--warn);
  --radius-md: var(--radius);
}

body {
  font-family: var(--font);
  background:
    radial-gradient(1000px 520px at 8% -10%, var(--glow-accent), transparent 55%),
    radial-gradient(800px 480px at 100% 0%, var(--glow-accent-2), transparent 50%),
    var(--bg);
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.hidden { display: none !important; }
.muted { color: var(--muted-2); }
.center-pad { text-align: center; padding: 48px 0; color: var(--muted); }
.center-pad-sm { text-align: center; padding: 24px 0; color: var(--muted); }

.field-hint {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* ========== Brand ========== */
.brand {
  display: flex;
  align-items: center;
  padding: 28px 20px 20px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
}

.brand-text {
  margin-left: 12px;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 8px;
}

.login-brand .brand-mark {
  width: 52px;
  height: 52px;
}

.detail-span { grid-column: span 2; }
.page-ellipsis { padding: 0 4px; color: var(--muted-2); }

/* ========== Login (AI product landing feel) ========== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 520px at 12% 8%, var(--glow-accent-strong), transparent 55%),
    radial-gradient(720px 460px at 92% 88%, var(--glow-accent-2-strong), transparent 52%),
    var(--login-page-bg);
}

.login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 24px;
  position: relative;
  z-index: 1;
  animation: riseIn 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.login-card {
  background: color-mix(in srgb, var(--bg-elevated) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  border-radius: 20px;
  padding: 40px 32px 32px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px) saturate(1.15);
}

.login-card h1,
.login-brand .brand-name {
  font-family: var(--font-display);
  font-size: 28px;
  text-align: center;
  color: var(--ink);
  font-weight: 750;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.login-subtitle {
  text-align: center;
  color: var(--muted);
  margin: 18px 0 28px;
  font-size: 14px;
}

.login-tip {
  text-align: center;
  color: var(--muted-2);
  font-size: 12px;
  margin-top: 20px;
  font-family: var(--font-mono);
}

.login-tip a {
  color: var(--accent);
  text-decoration: none;
}

.login-tip a:hover {
  text-decoration: underline;
}

/* ========== Forms ========== */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  margin-bottom: 7px;
  font-weight: 500;
  color: var(--ink-2);
  font-size: 13px;
}

.form-input,
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-group input:read-only {
  background: #f7f7f8;
  color: var(--muted);
  cursor: default;
}

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

.mode-switch {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  margin: 0 0 10px;
  background: var(--bg-soft, #f3f4f6);
  border-radius: 10px;
}
.mode-switch-btn {
  border: 0;
  background: transparent;
  color: var(--muted, #6b7280);
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.mode-switch-btn.active {
  background: #fff;
  color: var(--text, #111);
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.duration-input-row {
  align-items: center;
  margin: 0;
}
.unit-label {
  flex: 0 0 auto;
  color: var(--muted, #6b7280);
  font-size: 13px;
  padding-top: 2px;
}
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; }

.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
  text-align: center;
}

.success-msg {
  color: var(--success, #059669);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
  text-align: center;
}

.success-msg.hidden { display: none; }

/* ========== Buttons ========== */
.btn {
  padding: 9px 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 550;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s, opacity 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: #1a1a1a;
  transform: translateY(-1px);
}

.btn-primary:disabled,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #efeff1;
  color: var(--ink-2);
}

.btn-secondary:hover { background: #e5e5e8; }

.btn-outline {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
}

.btn-outline:hover {
  background: #fff;
  border-color: #cfcfd6;
}

.btn-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block {
  width: 100%;
  padding: 12px 16px;
  font-size: 14.5px;
}

/* ========== Layout ========== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: color-mix(in srgb, var(--bg-sidebar) 72%, transparent);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  border-right: 1px solid transparent;
  background-clip: padding-box;
  box-shadow: inset -1px 0 0 var(--line);
  z-index: 20;
  backdrop-filter: blur(12px);
}

.nav-menu {
  flex: 1;
  padding: 4px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  cursor: pointer;
  border-radius: 8px;
  margin-bottom: 2px;
  font-size: 13.5px;
  font-weight: 550;
  letter-spacing: -0.01em;
  background: transparent;
  border: none;
  font-family: inherit;
  text-align: left;
}

.nav-item:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--ink);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  box-shadow: none;
  outline: none;
  font-weight: 650;
}

.nav-icon {
  flex-shrink: 0;
  font-size: 14px;
  width: 20px;
  text-align: center;
  line-height: 1;
  opacity: 0.72;
  font-family: var(--font-mono);
  transition: opacity 0.12s, color 0.12s;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
  opacity: 1;
}

.nav-item.active .nav-icon {
  color: var(--accent);
}

.sidebar-footer {
  padding: 14px 12px 16px;
  border-top: 1px solid var(--line);
}

.theme-switch {
  display: flex;
  gap: 4px;
  padding: 3px;
  margin: 0 0 12px;
  background: var(--bg-soft);
  border-radius: 10px;
}

.theme-switch-btn {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}

.theme-switch-btn:hover {
  color: var(--ink-2);
}

.theme-switch-btn.active {
  background: var(--bg-elevated);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.login-theme-switch {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.login-theme-switch .theme-switch {
  margin: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 4px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.user-role {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 1px;
}

.btn-logout {
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  border-radius: 10px;
  cursor: pointer;
  font-size: 12.5px;
  transition: all 0.12s;
  font-family: inherit;
}

.btn-logout:hover {
  background: #fff;
  color: var(--danger);
  border-color: #fecaca;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 36px 40px 64px;
  min-height: 100vh;
  max-width: 1240px;
  animation: riseIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.page-inline-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
}

.workspace-header {
  display: none;
}

.workspace-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.tabs {
  display: inline-flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: none;
  width: auto;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.page-header h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.04em;
}

/* ========== Tabs (segmented, not ERP underline) ========== */
.tabs.segmented {
  padding: 4px;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 12px;
  gap: 2px;
}

.tab {
  padding: 8px 16px;
  margin-right: 0;
  margin-bottom: 0;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--muted);
  border: none;
  border-bottom: none;
  border-radius: 9px;
  transition: color 0.12s, background 0.12s, box-shadow 0.12s;
  background: transparent;
  font-family: inherit;
  letter-spacing: -0.01em;
}

.tab:hover { color: var(--ink); }

.tab.active {
  color: var(--ink);
  background: #fff;
  border-bottom-color: transparent;
  box-shadow: var(--shadow-sm);
}

/* ========== Panels & command bar ========== */
.panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel + .panel { margin-top: 16px; }

.panel-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.85);
}

.panel-section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.panel-section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent-soft, rgba(14, 116, 144, 0.12));
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.panel-list .command-bar {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 250, 252, 0.85);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-bar .form-input {
  width: 200px;
  border-radius: 9px;
  padding-left: 14px;
  background: #fff;
}
.filter-bar .filter-date {
  width: 142px;
  min-width: 142px;
}
.filter-date-sep {
  color: var(--muted-2);
  font-size: 13px;
  align-self: center;
}
.toolbar-right { display: flex; gap: 8px; }

.table-surface {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.table-surface .data-table th {
  background: transparent;
  padding: 12px 18px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.table-surface .data-table td {
  padding: 16px 18px;
  border-bottom-color: rgba(226, 232, 240, 0.8);
}

.table-surface .data-table tbody tr:hover {
  background: rgba(var(--accent-rgb), 0.04);
}

.table-surface .data-table tbody tr:last-child td {
  border-bottom: none;
}

.panel-list .pagination {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
  margin-top: 0;
}

/* ========== Tables ========== */
.table-container {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
  background: #fafafa;
  padding: 12px 18px;
  text-align: left;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  letter-spacing: 0.01em;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-2);
  vertical-align: middle;
}

.data-table tbody tr { transition: background 0.1s; }
.data-table tbody tr:hover { background: #fafafa; }
.data-table tbody tr:last-child td { border-bottom: none; }

.data-table td:first-child strong {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12.5px;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.text-center {
  text-align: center;
  color: var(--muted-2);
  padding: 48px !important;
}

/* ========== Status ========== */
.status-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}

.status-pending { background: #f4f4f5; color: #71717a; }
.status-picked { background: #e0f2fe; color: #0369a1; }
.status-transit { background: #fef3c7; color: #a16207; }

.dest-enroute {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #a16207;
  font-size: 12.5px;
  font-weight: 500;
}
.status-delivering { background: #dcfce7; color: #15803d; }
.status-signed { background: var(--accent-soft); color: var(--accent-ink); }
.status-abnormal { background: #fee2e2; color: #b91c1c; }

/* ========== Actions ========== */
.action-btns { display: flex; gap: 4px; }

.action-btn {
  padding: 4px 8px;
  font-size: 12.5px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: all 0.1s;
  font-family: inherit;
  font-weight: 550;
  text-decoration: none;
}

.action-btn:hover {
  background: transparent;
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.action-btn.danger { color: #e11d48; }
.action-btn.danger:hover { background: #fff1f2; }

/* ========== Pagination ========== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
}

.page-btn {
  padding: 7px 12px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  transition: all 0.1s;
  font-family: inherit;
}

.page-btn:hover {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.page-btn.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.page-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ========== Modal ========== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 13, 13, 0.4);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
}

.modal.show { display: flex; }

.modal-content {
  background: #fff;
  border-radius: 20px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-lg { max-width: 680px; }

.modal-header {
  padding: 20px 22px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.03em;
}

.modal-close {
  background: #f4f4f5;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all 0.12s;
  display: grid;
  place-items: center;
}

.modal-close:hover { background: #e4e4e7; color: var(--ink); }
.modal-body { padding: 8px 22px 20px; overflow-y: auto; flex: 1; }

.modal-footer {
  padding: 14px 22px 20px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ========== Stats ========== */
.stats-cards,
.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stat-card,
.metric-item {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 22px 24px;
  box-shadow: none;
  transition: background 0.15s;
  position: relative;
}

.metric-item + .metric-item::before,
.stats-cards .stat-card + .stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 1px;
  background: var(--line);
}

.stat-card:hover,
.metric-item:hover {
  border-color: transparent;
  box-shadow: none;
  background: rgba(var(--accent-rgb), 0.03);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.05;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
}

.stat-blue .stat-value,
.metric-blue .stat-value { color: #0284c7; }
.stat-green .stat-value,
.metric-green .stat-value { color: var(--accent-ink); }
.stat-red .stat-value,
.metric-red .stat-value { color: #e11d48; }

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.chart-card-wide { grid-column: 1 / -1; }

.chart-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.chart-card-title-row h3 { margin-bottom: 0; }

.chart-card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chart-card-actions .mode-switch {
  margin: 0;
}

.stock-neg {
  color: #e11d48;
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.stock-frac {
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stock-num { font-weight: 650; color: var(--ink); }
.stock-slash { margin: 0 2px; color: var(--muted-2); font-weight: 400; }
.stock-open { color: var(--muted); font-weight: 500; }
.stock-frac.stock-neg .stock-num { color: #e11d48; }

.stock-warn { color: var(--warn); font-weight: 700; margin-left: 4px; }
.stock-tip { font-size: 11px; color: var(--warn); margin-top: 2px; }
.openings-intro { margin-bottom: 14px; }

.opening-input {
  width: 88px;
  padding: 7px 10px;
  text-align: right;
  font-family: var(--font-mono);
  border-radius: 8px;
}

.chart-card-head { margin-bottom: 14px; }
.chart-card-head h3 { margin-bottom: 4px; }

.chart-hint {
  font-size: 12.5px;
  color: var(--muted-2);
  line-height: 1.5;
}

.region-table-wrap {
  box-shadow: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafa;
}

.region-table th,
.region-table td { padding: 11px 14px; }

.region-table td:not(:first-child),
.region-table th:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.region-total-row td {
  background: #f4f4f5;
  border-top: 1px solid var(--line);
}

.city-detail {
  color: var(--muted);
  font-size: 12.5px;
  max-width: 180px;
  font-family: var(--font) !important;
  text-align: left !important;
}

/* Duration — hero metric like AI dashboards */
.duration-goal-card {
  background:
    radial-gradient(480px 220px at 100% 0%, rgba(var(--accent-rgb), 0.1), transparent 55%),
    color-mix(in srgb, var(--bg-elevated) 78%, transparent);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.duration-goal-card::after {
  display: none;
}

.duration-goal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  position: relative;
}

.duration-goal-head h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: -0.03em;
}

.duration-goal-numbers {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.duration-current {
  font-size: 36px;
  font-weight: 650;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.05em;
}

.duration-sep { color: var(--muted-2); font-size: 18px; }
.duration-target { font-size: 16px; color: var(--muted); font-weight: 500; }

.duration-progress {
  height: 8px;
  background: #efeff1;
  border-radius: 999px;
  overflow: hidden;
}

.duration-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.duration-goal-card.reached .duration-current { color: var(--accent-ink); }
.duration-goal-card.reached .duration-progress-fill { background: var(--accent); }

.duration-goal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
}

.chart-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}

.chart-card h3 {
  font-family: var(--font-display);
  font-size: 16px;
  margin-bottom: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
}

.chart-placeholder { min-height: 200px; }

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 180px;
  padding-bottom: 28px;
  position: relative;
}

.bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.bar {
  width: 100%;
  max-width: 40px;
  margin: 0 auto;
  background: var(--ink);
  border-radius: 6px 6px 2px 2px;
  min-height: 4px;
  transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0.88;
}

.bar-label {
  font-size: 11px;
  color: var(--muted-2);
  position: absolute;
  bottom: 0;
  font-family: var(--font-mono);
}

.rank-list { display: flex; flex-direction: column; gap: 12px; }
.rank-item { display: flex; align-items: center; gap: 12px; }
.rank-name { width: 60px; font-size: 13px; flex-shrink: 0; color: var(--ink-2); }
.rank-bar-wrap {
  flex: 1;
  height: 8px;
  background: #efeff1;
  border-radius: 999px;
  overflow: hidden;
}
.rank-bar {
  height: 100%;
  background: var(--ink);
  border-radius: 999px;
  transition: width 0.3s;
  opacity: 0.85;
}
.rank-count {
  width: 48px;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  font-family: var(--font-mono);
}

/* Timeline */
.timeline { position: relative; padding-left: 22px; }

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 1.5px;
  background: var(--line-strong);
}

.timeline-item { position: relative; padding-bottom: 18px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -22px;
  top: 3px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px var(--ink);
}

.timeline-item:last-child .timeline-dot {
  background: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent);
}

.timeline-time {
  font-size: 12px;
  color: var(--muted-2);
  margin-bottom: 3px;
  font-family: var(--font-mono);
}

.timeline-content { font-size: 13.5px; color: var(--ink-2); }
.timeline-address { font-size: 12px; color: var(--muted-2); margin-top: 2px; }

.detail-section { margin-bottom: 22px; }
.detail-section:last-child { margin-bottom: 0; }

.detail-section h4 {
  font-size: 12px;
  margin-bottom: 14px;
  color: var(--muted);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-weight: 550;
  letter-spacing: 0.02em;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}

.detail-item { display: flex; font-size: 13.5px; }
.detail-label { color: var(--muted-2); width: 78px; flex-shrink: 0; }
.detail-value { color: var(--ink-2); flex: 1; }

/* Responsive helpers */
.mobile-only { display: none !important; }
.desktop-only { display: block; }
.mobile-topbar { display: none; }
.mobile-bottom-nav { display: none; }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 15, 0.35);
  z-index: 40;
  border: 0;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn:active { background: rgba(0,0,0,0.06); }

.btn-sm {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 10px;
}

.shipment-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shipment-card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.shipment-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.shipment-card-heading {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shipment-card-tn {
  font-size: 14px;
  letter-spacing: -0.01em;
  word-break: break-all;
  color: var(--ink);
}

.shipment-card-project {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.shipment-card-route {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 550;
}

.shipment-card-route .route-arrow {
  color: var(--muted-2);
  font-weight: 400;
}

.shipment-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 12px;
}

.shipment-card-meta > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.meta-k {
  width: auto;
  flex-shrink: 0;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.meta-v {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  word-break: break-word;
}

.shipment-card-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.shipment-card-actions .action-btn {
  flex: 1;
  min-width: 0;
  justify-content: center;
  padding: 10px 8px;
  border-radius: 8px;
  background: var(--bg-soft);
  text-decoration: none !important;
}

.shipment-card-actions .action-btn:hover {
  background: #f1f5f9;
  color: var(--accent-ink);
}

.shipment-card-actions .action-btn.danger {
  color: #e11d48;
  background: #fff1f2;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 36px 12px;
  background: var(--bg-elevated);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

/* Responsive */
@media (max-width: 900px) {
  .stats-cards,
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric-item + .metric-item::before,
  .stats-cards .stat-card + .stat-card::before {
    display: none;
  }
  .metric-item,
  .stat-card {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 768px) {
  .mobile-only { display: flex !important; }
  .mobile-only.shipment-cards,
  .mobile-only.mobile-card-list { display: flex !important; flex-direction: column; }
  .desktop-only { display: none !important; }

  .workspace-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 18px;
    gap: 14px;
  }
  .workspace-title { font-size: 26px; }
  .workspace-actions { width: 100%; }
  .workspace-actions .btn { flex: 1; }
  .workspace-actions.editor-only { display: none; }

  .page-toolbar {
    margin-bottom: 12px;
  }
  .page-toolbar .workspace-actions.editor-only { display: none; }
  .page-inline-title {
    font-size: 20px;
    margin: 0;
  }
  .tabs.segmented {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .tabs.segmented::-webkit-scrollbar { display: none; }
  .tabs.segmented .tab {
    flex: 0 0 auto;
    text-align: center;
    white-space: nowrap;
    padding: 8px 14px;
  }

  .panel {
    border-radius: 16px;
    border: none;
    background: transparent;
    box-shadow: none;
  }
  .panel-list .command-bar {
    margin: 0 0 12px;
    padding: 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: 14px;
  }
  .panel-list .pagination {
    margin-top: 14px;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 30;
    margin: -18px -14px 14px;
    padding: 10px 12px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    background: rgba(243, 245, 248, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }

  .mobile-topbar-center {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
  }

  .mobile-topbar-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.03em;
    color: var(--ink);
    line-height: 1.15;
  }

  .mobile-topbar-sub {
    font-size: 11px;
    color: var(--muted-2);
    line-height: 1.2;
  }

  .mobile-ctx-btn {
    margin-left: auto;
    min-height: 36px;
    padding: 0 14px;
    flex-shrink: 0;
  }

  .icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    gap: 2px;
  }

  .mb-nav-item {
    flex: 1;
    position: relative;
    border: none;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    font-weight: 650;
    padding: 6px 4px 4px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-height: 48px;
    cursor: pointer;
  }

  .mb-nav-ico {
    font-size: 16px;
    line-height: 1;
    opacity: 0.85;
  }

  .mb-nav-item.active {
    color: var(--accent-ink);
    background: var(--accent-soft);
  }

  .mb-nav-dot {
    position: absolute;
    top: 6px;
    right: calc(50% - 18px);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2px #fff;
  }

  .sidebar-backdrop {
    display: block;
    z-index: 45;
  }
  .sidebar-backdrop[hidden] { display: none !important; }

  .sidebar {
    width: min(82vw, 300px);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    z-index: 55;
    box-shadow: var(--shadow-lg);
    background: var(--bg-sidebar);
    padding-top: env(safe-area-inset-top, 0px);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open { overflow: hidden; }

  .main-content {
    margin-left: 0;
    padding: 18px 14px calc(84px + env(safe-area-inset-bottom, 0px));
    max-width: none;
  }

  /* 手机端隐藏与顶栏重复的大标题 */
  .page-toolbar .page-inline-title { display: none; }
  #page-shipments .page-toolbar { display: none; }
  #page-projects .page-toolbar .workspace-actions,
  #page-users .page-toolbar .workspace-actions { display: none; }

  input.form-input,
  select.form-input,
  textarea.form-input,
  .form-group input,
  .form-group select,
  .form-group textarea,
  .sc-composer textarea,
  .sc-note-input {
    font-size: 16px !important; /* 避免 iOS 聚焦放大 */
  }

  .stats-cards,
  .metric-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    background: transparent;
    border: none;
    box-shadow: none;
  }
  .stat-card,
  .metric-item {
    padding: 14px 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--bg-elevated);
    box-shadow: var(--shadow-sm);
  }
  .metric-item + .metric-item::before,
  .stats-cards .stat-card + .stat-card::before {
    display: none;
  }
  .stat-value { font-size: 22px; }

  .charts-row { grid-template-columns: 1fr; gap: 12px; }
  .region-stats-row { grid-template-columns: 1fr; }
  .chart-card {
    border-radius: 16px;
    padding: 14px;
  }

  .filter-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: stretch;
  }
  .filter-bar #filterProject,
  .filter-bar #searchKeyword,
  .filter-bar #btnSearch {
    grid-column: 1 / -1;
  }
  .filter-bar .filter-date-sep {
    display: none;
  }
  .filter-bar .form-input,
  .filter-bar .filter-date,
  .filter-bar .btn {
    width: 100%;
    min-width: 0;
    min-height: 42px;
  }

  .toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .toolbar-right {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .toolbar-right .btn { width: 100%; }

  .duration-goal-card {
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
  }
  .duration-goal-head { flex-direction: column; gap: 6px; }
  .duration-goal-head h3 { font-size: 16px; }
  .duration-goal-head .chart-hint { font-size: 12px; line-height: 1.4; }
  .duration-current { font-size: 30px; }
  .duration-target { font-size: 16px; }
  .duration-goal-meta {
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 12px;
  }
  .project-duration-list { gap: 10px; }
  .project-duration-row {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
  .project-duration-row:last-child { border-bottom: none; }

  .stats-project-tabs {
    width: 100%;
    padding-bottom: 2px;
  }

  .form-row { flex-direction: column; gap: 0; }
  .mode-switch { width: 100%; }
  .mode-switch-btn { flex: 1; text-align: center; min-height: 40px; }

  .modal {
    align-items: flex-end;
    padding: 0;
  }
  .modal-content,
  .modal-lg {
    width: 100%;
    max-width: 100%;
    max-height: min(92vh, 100%);
    border-radius: 18px 18px 0 0;
    margin: 0;
  }
  .modal-header {
    padding: 16px 16px 8px;
  }
  .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 16px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    gap: 8px;
    padding: 12px 16px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }
  .modal-footer .btn {
    flex: 1;
    min-height: 44px;
  }

  .detail-grid { grid-template-columns: 1fr; gap: 10px; }
  .detail-label { width: 72px; }

  .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .region-table-wrap { overflow-x: auto; }
  .region-table th,
  .region-table td {
    padding: 10px 8px;
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 8px;
    font-size: 13px;
  }

  .toast-container {
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
    align-items: stretch;
  }
  .toast { min-width: 0; width: 100%; }

  .login-container { padding: 24px 16px; }
  .login-card { width: 100%; max-width: 100%; padding: 28px 20px; border-radius: 18px; }

  .pagination { flex-wrap: wrap; justify-content: center; gap: 6px; }
  .page-btn { min-width: 40px; min-height: 40px; }

  .shipment-cards { gap: 12px; }
  .shipment-card {
    padding: 14px;
    border-radius: 16px;
  }
  .shipment-card-actions .action-btn {
    min-height: 40px;
    font-size: 13px;
  }

  .mobile-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mobile-entity-card {
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
  }

  .mobile-entity-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
  }

  .mobile-entity-head strong {
    font-size: 15px;
    color: var(--ink);
  }

  .mobile-entity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13px;
    color: var(--ink-2);
  }

  .mobile-entity-grid span {
    display: block;
    font-size: 11px;
    color: var(--muted-2);
    margin-bottom: 2px;
  }

  .mobile-entity-desc {
    margin: 10px 0 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.45;
  }

  .mobile-entity-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
  }

  .mobile-entity-actions .action-btn {
    min-height: 40px;
    width: 100%;
    justify-content: center;
  }

  .nav-item[data-page="site-changes"],
  #mobileBottomNav .mb-nav-item[data-page="site-changes"] {
    display: none !important;
  }

  .nav-item {
    min-height: 44px;
    padding: 12px 14px;
  }
  .btn-logout {
    min-height: 42px;
  }

  /* AI 页：隐藏全局顶栏与底部导航，全屏聊天 */
  body.ai-page-active .mobile-topbar {
    display: none !important;
  }

  body.ai-page-active .mobile-bottom-nav {
    display: none;
  }

  body.ai-page-active .main-content {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    padding: 0;
  }

  body.ai-page-active:has(#page-site-changes:not(.hidden)) .main-content {
    padding-top: 0;
  }

  #page-site-changes {
    flex: 1;
    min-height: 0;
    height: auto;
    max-height: none;
    margin: 0;
    overflow: hidden;
  }

  .sc-shell,
  .sc-shell-chat {
    min-height: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
    grid-template-columns: 1fr;
    position: relative;
    box-shadow: none;
  }

  .sc-rail-backdrop {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 15;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }

  .sc-shell.rail-open .sc-rail-backdrop:not(.hidden) {
    display: block;
  }

  .sc-rail {
    display: none;
    position: absolute;
    z-index: 20;
    inset: 0 auto 0 0;
    width: min(86vw, 300px);
    background: rgba(247, 249, 252, 0.98);
    box-shadow: 12px 0 40px rgba(15, 23, 42, 0.12);
    padding-top: env(safe-area-inset-top, 0px);
  }

  .sc-shell.rail-open .sc-rail {
    display: flex;
  }

  .sc-rail-toggle,
  .sc-nav-btn,
  .sc-topbar-menu-wrap {
    display: inline-flex !important;
  }

  .sc-nav-btn,
  .sc-more-btn {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    flex-shrink: 0;
  }

  .sc-rail-toggle {
    flex-shrink: 0;
    min-height: 36px;
    padding: 6px 10px;
    font-size: 12.5px;
  }

  .sc-topbar {
    flex-shrink: 0;
    flex-direction: row;
    align-items: center;
    padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px;
    gap: 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
    background: rgba(247, 249, 252, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .sc-topbar-main {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  .sc-brand-inline { display: none; }

  .sc-auto-title {
    flex: 1;
    max-width: none;
    min-width: 0;
    font-size: 14px;
    font-weight: 650;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sc-pill {
    flex-shrink: 0;
    font-size: 10.5px;
    height: 22px;
    padding: 0 7px;
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sc-topbar-actions {
    display: none !important;
  }

  .sc-topbar-menu-wrap {
    position: relative;
    flex-shrink: 0;
  }

  .sc-topbar-menu-wrap.hidden {
    display: none !important;
  }

  .sc-action-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 148px;
    padding: 6px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .sc-action-menu.hidden {
    display: none !important;
  }

  .sc-action-menu-item {
    border: none;
    background: transparent;
    text-align: left;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink-2);
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    white-space: nowrap;
  }

  .sc-action-menu-item:hover,
  .sc-action-menu-item:focus-visible {
    background: var(--bg-soft);
    outline: none;
  }

  .sc-action-menu-item.sc-danger-ghost {
    color: var(--danger);
  }

  .sc-stage {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
  }

  .sc-topbar { order: 1; }
  .sc-thread { order: 2; flex: 1; }
  .sc-mobile-dock {
    order: 3;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .sc-thread {
    flex: 1;
    min-height: 0;
    padding: 8px 10px 12px;
    padding-bottom: calc(var(--sc-dock-height, 96px) + 8px);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .sc-msg {
    max-width: 92%;
    font-size: 14px;
    padding: 10px 12px;
  }

  .sc-msg.user {
    max-width: 88%;
  }

  .sc-thinking {
    max-width: 92%;
  }

  .sc-mobile-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--ai-vv-offset, 0px);
    z-index: 35;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0 8px calc(8px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, transparent 0%, rgba(247, 249, 252, 0.92) 24%, rgba(247, 249, 252, 0.98) 100%);
    pointer-events: none;
  }

  .sc-mobile-dock > * {
    pointer-events: auto;
  }

  .sc-composer-wrap {
    flex-shrink: 0;
    position: static;
    z-index: auto;
    padding: 0;
    background: transparent;
  }

  .sc-composer {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  }

  .sc-composer-tools {
    flex-direction: row;
    gap: 4px;
    padding-bottom: 2px;
  }

  .sc-icon-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .sc-composer textarea {
    min-height: 40px;
    max-height: 120px;
    padding: 8px 2px;
    line-height: 1.4;
  }

  .sc-send {
    min-width: 52px;
    min-height: 40px;
    padding: 8px 10px 8px 12px;
    border-radius: 12px;
    gap: 6px;
  }

  .sc-send-kbd {
    font-size: 10px;
    padding: 2px 5px;
  }

  .sc-composer-hint { display: none; }

  .sc-review-bar,
  #siteChangeGoLiveBar {
    margin: 0 0 6px;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    border: none;
    background: transparent;
    animation: none;
  }

  #siteChangeGoLiveBar:not(.hidden) {
    padding: 0;
    background: transparent;
  }

  .sc-golive-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    border: 1px solid rgba(var(--accent-2-rgb), 0.2);
    background: rgba(255, 255, 255, 0.94);
    border-radius: 12px;
    padding: 10px 12px;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-align: left;
  }

  .sc-golive-toggle strong {
    font-size: 13px;
    color: var(--ink);
  }

  .sc-golive-toggle-hint {
    font-size: 12px;
    color: var(--accent-2-ink);
    font-weight: 600;
    flex-shrink: 0;
  }

  #siteChangeGoLiveBar.is-expanded .sc-golive-toggle-hint::after {
    content: '收起';
  }

  #siteChangeGoLiveBar.is-expanded .sc-golive-toggle-hint {
    font-size: 0;
  }

  #siteChangeGoLiveBar.is-expanded .sc-golive-toggle-hint::after {
    font-size: 12px;
  }

  .sc-golive-body {
    margin-top: 6px;
    padding: 10px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(var(--accent-2-rgb), 0.08), rgba(var(--accent-rgb), 0.08));
    border: 1px solid rgba(var(--accent-2-rgb), 0.12);
  }

  .sc-golive-body.hidden {
    display: none !important;
  }

  .sc-golive-title {
    display: none;
  }

  .sc-review-copy span {
    font-size: 12px;
    line-height: 1.45;
  }

  .sc-review-actions,
  .sc-golive-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    margin-top: 8px;
  }

  .sc-golive-actions .btn,
  .sc-golive-actions select.sc-note-input,
  .sc-golive-actions .sc-note-input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
  }

  .sc-note-input {
    width: 100%;
    min-width: 0;
  }

  .sc-pending-strip {
    padding: 0 0 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .sc-pending-strip::-webkit-scrollbar { display: none; }

  .sc-pending-chip {
    flex-shrink: 0;
  }

  .sc-attach-preview {
    margin-bottom: 6px;
  }

  .sc-attach-chip {
    max-width: calc(100vw - 32px);
  }

  .sc-diff-drawer {
    left: 8px;
    right: 8px;
    bottom: calc(var(--sc-dock-height, 96px) + 8px + var(--ai-vv-offset, 0px));
    max-height: min(46dvh, 320px);
    border-radius: 14px;
  }

  .checkbox-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .checkbox-item {
    min-height: 40px;
    padding: 8px 10px;
  }
}

@media (max-width: 420px) {
  .stats-cards { grid-template-columns: 1fr 1fr; }
  .stat-label { font-size: 12px; }
  .shipment-card-tn { font-size: 13px; }
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
  animation: toastIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
  background: #fff;
  border: 1px solid var(--line);
}

.toast.success { color: #065f46; }
.toast.error { color: #9f1239; }
.toast.info { color: var(--ink-2); }
.toast.warning { color: #92400e; }
.toast-icon { font-size: 15px; opacity: 0.8; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

/* ========== Projects / scope ========== */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  max-height: 200px;
  overflow: auto;
}

.form-group .checkbox-item,
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  font-size: 13.5px;
  font-weight: 450;
  color: var(--ink);
  cursor: pointer;
}

.form-group .checkbox-item input[type="checkbox"],
.checkbox-item input[type="checkbox"] {
  width: auto;
  min-width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 3px;
  box-shadow: none;
  flex-shrink: 0;
  accent-color: var(--accent);
  background: transparent;
}

.form-group .checkbox-item input[type="checkbox"]:focus,
.checkbox-item input[type="checkbox"]:focus {
  box-shadow: none;
  border: none;
}

#userProjectsGroup.is-muted .checkbox-list {
  opacity: 0.55;
}

.project-duration-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.project-duration-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-2);
}

.project-duration-row strong {
  color: var(--ink);
  font-weight: 600;
}

.stats-project-tabs {
  max-width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}

.stats-project-tabs .tab {
  white-space: nowrap;
  flex: 0 0 auto;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.field-label-row label {
  margin-bottom: 0;
}

.field-label-actions {
  display: flex;
  gap: 10px;
}

.link-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  color: var(--accent-ink);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover { opacity: 0.8; }

.req-mark {
  color: #e11d48;
  font-weight: 600;
}

#userProjectsGroup.is-muted .checkbox-item {
  pointer-events: none;
}

/* 寄送列表双行合并单元格 */
.data-table-shipments td.cell-stack {
  vertical-align: middle;
  line-height: 1.35;
  padding-top: 10px;
  padding-bottom: 10px;
}

.cell-stack .stack-line {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}

.cell-stack .stack-line + .stack-line {
  margin-top: 2px;
}

.cell-stack .stack-sub {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 450;
}

/* ========== 改站 Studio ========== */
.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

body:has(#page-site-changes:not(.hidden)) .main-content {
  max-width: none;
  padding-top: 20px;
  padding-bottom: 20px;
}

#page-site-changes {
  padding: 0 !important;
  height: calc(100vh - 40px);
  max-height: calc(100vh - 40px);
}

.sc-shell {
  display: grid;
  grid-template-columns: 272px 1fr;
  height: 100%;
  min-height: 0;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background:
    radial-gradient(900px 420px at 12% -20%, var(--glow-accent-strong), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, var(--glow-accent-2), transparent 50%),
    var(--sc-shell-bg);
  box-shadow: var(--shadow-md);
}

.sc-shell-chat {
  grid-template-columns: 1fr;
}

.sc-brand-inline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-right: 8px;
}

.sc-chat-heading {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin: 0;
  line-height: 1;
}

.sc-auto-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  max-width: min(420px, 46vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-pending-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 0 22px 10px;
}

.sc-pending-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-2-ink);
  margin-right: 2px;
}

.sc-pending-chip {
  border: 1px solid rgba(var(--accent-2-rgb), 0.18);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sc-pending-chip em {
  font-style: normal;
  color: var(--muted);
  font-weight: 500;
}

.sc-pending-chip:hover,
.sc-pending-chip.active {
  background: rgba(var(--accent-2-rgb), 0.1);
  border-color: rgba(var(--accent-2-rgb), 0.35);
}

.sc-rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(226, 232, 240, 0.85);
}

.sc-rail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 18px 10px;
}

.sc-rail-kicker {
  display: block;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 4px;
}

.sc-rail-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin: 0;
}

.sc-new-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: none;
  background: var(--ink);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.sc-new-btn:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

.sc-new-btn:disabled,
.sc-new-btn.is-busy {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.sc-thread.is-loading {
  opacity: 0.72;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.sc-rail-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sc-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  border-radius: 14px;
  padding: 12px 12px 11px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: background 0.16s ease, transform 0.16s ease;
}

.sc-item:hover {
  background: rgba(255, 255, 255, 0.75);
}

.sc-item.active {
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 10px 24px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}

.sc-item-title {
  font-weight: 650;
  font-size: 13.5px;
  color: var(--ink);
  margin-bottom: 6px;
  word-break: break-word;
}

.sc-item-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
}

.sc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2);
  flex-shrink: 0;
}

.sc-dot.pending { background: var(--accent-2); box-shadow: 0 0 0 3px rgba(var(--accent-2-rgb), 0.15); }
.sc-dot.draft { background: #94a3b8; }
.sc-dot.applied { background: var(--accent); }
.sc-dot.rejected,
.sc-dot.failed { background: var(--danger); }
.sc-dot.approved { background: #0ea5e9; }

.sc-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.sc-topbar { order: 1; }
.sc-thread { order: 5; }
#siteChangePendingStrip { order: 2; }
#siteChangeGoLiveBar { order: 3; }
#siteChangeReviewBar { order: 4; }
#siteChangeComposerWrap { order: 6; }

.sc-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 40px 24px;
  animation: scFadeIn 0.35s ease;
}

.sc-empty-orb {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  margin-bottom: 8px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), transparent 50%),
    var(--sc-orb-gradient);
  box-shadow: var(--sc-orb-shadow);
  animation: scFloat 4s ease-in-out infinite;
}

.sc-empty-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin: 0;
}

.sc-empty-sub {
  color: var(--muted);
  max-width: 340px;
  margin: 0 0 8px;
  line-height: 1.55;
}

.sc-workbench {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  animation: scFadeIn 0.28s ease;
}

.sc-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 12px;
}

.sc-topbar-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  min-width: 0;
  flex: 1;
}

.sc-title-input {
  border: none;
  background: transparent;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  padding: 0;
  width: min(100%, 420px);
  outline: none;
}

.sc-title-input:disabled {
  opacity: 0.85;
}

.sc-title-input:focus {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.sc-pill {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.18);
  color: var(--muted);
}

.sc-pill.is-pending { background: rgba(var(--accent-2-rgb), 0.12); color: var(--accent-2-ink); }
.sc-pill.is-draft { background: rgba(148, 163, 184, 0.18); color: #64748b; }
.sc-pill.is-applied { background: var(--accent-soft); color: var(--accent-ink); }
.sc-pill.is-rejected,
.sc-pill.is-failed { background: rgba(225, 29, 72, 0.1); color: #be123c; }
.sc-pill.is-busy::after {
  content: '';
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
  /* 降低跳动感：用透明度代替缩放 */
  animation: scBusyDot 1.4s ease-in-out infinite;
}

.sc-meta-line {
  font-size: 12px;
  width: 100%;
}

.sc-topbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.sc-ghost-btn {
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sc-ghost-btn:hover {
  background: #fff;
  border-color: var(--line-strong);
}

.sc-review-bar {
  margin: 0 22px 10px;
  padding: 12px 14px;
  border-radius: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(var(--accent-2-rgb), 0.1), rgba(var(--accent-rgb), 0.1));
  border: 1px solid rgba(var(--accent-2-rgb), 0.12);
  animation: scSlideDown 0.28s ease;
}

#siteChangeGoLiveBar .sc-golive-body {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.sc-review-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sc-review-copy strong {
  font-size: 13.5px;
  color: var(--ink);
}

.sc-review-copy span {
  font-size: 12.5px;
  color: var(--muted);
}

.sc-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sc-note-input {
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  min-width: 160px;
  width: min(220px, 40vw);
}

.sc-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sc-msg {
  max-width: min(720px, 92%);
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.sc-msg.sc-msg-enter {
  animation: scMsgIn 0.22s ease;
}

.sc-queue-hint {
  color: var(--accent-2-ink);
  font-weight: 600;
}

.sc-thinking {
  align-self: flex-start;
  max-width: min(720px, 92%);
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.55);
  background: rgba(248, 250, 252, 0.92);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.sc-thinking-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--ink-2);
  margin-bottom: 6px;
}

.sc-thinking-head strong {
  font-weight: 650;
  font-size: 13px;
}

.sc-thinking-spinner {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(var(--accent-rgb), 0.25);
  border-top-color: var(--accent);
  animation: scSpin 0.8s linear infinite;
  flex-shrink: 0;
}

.sc-thinking-tool {
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.sc-thinking-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12.5px;
  color: var(--muted);
  max-height: 140px;
  overflow: hidden;
  mask-image: linear-gradient(180deg, #000 70%, transparent);
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
  font-style: italic;
}

.sc-thinking-partial {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink-2);
  font-size: 13px;
  max-height: 160px;
  overflow: hidden;
}

@keyframes scSpin {
  to { transform: rotate(360deg); }
}

.sc-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.2);
}

.sc-msg.assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.9);
  color: var(--ink-2);
  border-bottom-left-radius: 6px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.sc-msg.system {
  align-self: center;
  max-width: 100%;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
  padding: 4px 8px;
}

.sc-composer-wrap {
  padding: 0 22px 18px;
}

.sc-attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.sc-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(226, 232, 240, 0.95);
  font-size: 12px;
  color: var(--ink-2);
  max-width: 100%;
}

.sc-attach-chip img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 8px;
}

.sc-attach-chip button {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.sc-composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(8px);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sc-composer-tools {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 4px;
}

.sc-icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.04);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background 0.15s ease;
}

.sc-icon-btn:hover {
  background: var(--accent-soft);
}

.sc-danger-ghost {
  color: var(--danger) !important;
}

.sc-rail-toggle {
  display: none;
}

.sc-nav-btn,
.sc-topbar-menu-wrap,
.sc-golive-toggle {
  display: none;
}

.sc-mobile-dock {
  display: contents;
}

#siteChangeGoLiveBar.hidden .sc-golive-body {
  display: none;
}

@media (min-width: 769px) {
  #siteChangeGoLiveBar:not(.hidden) .sc-golive-body {
    display: flex !important;
  }
}

.sc-approvals-panel {
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  padding: 12px 12px 16px;
  max-height: 42%;
  overflow: auto;
}

.sc-approvals-head {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-2-ink);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.sc-approval-card {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(var(--accent-2-rgb), 0.16);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.sc-approval-card:hover,
.sc-approval-card.active {
  border-color: rgba(var(--accent-2-rgb), 0.4);
  background: #fff;
}

.sc-approval-card strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}

.sc-approval-card p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sc-approval-card .meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted-2);
}

.sc-item {
  position: relative;
}

.sc-item-del {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  font-size: 14px;
  line-height: 1;
}

.sc-item:hover .sc-item-del,
.sc-item.active .sc-item-del {
  opacity: 1;
}

.sc-item-del:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.sc-msg .sc-msg-atts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.sc-msg-att {
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: var(--muted);
}

.page-toolbar-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.iter-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 4px 2px 16px;
}

.iter-card {
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  border-radius: 14px;
  padding: 14px 16px;
}

.iter-card.is-rolled {
  opacity: 0.78;
}

.iter-card-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.iter-card-top strong {
  font-size: 15px;
  color: var(--ink);
}

.iter-card-meta {
  font-size: 12px;
  color: var(--muted);
}

.iter-card-summary {
  margin: 0 0 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

.iter-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 4px;
}

.iter-detail-btn {
  padding: 0;
  min-height: auto;
  font-size: 13px;
}

.iter-card-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(226, 232, 240, 0.95);
}

.iter-detail-loading,
.iter-detail-empty,
.iter-detail-error {
  font-size: 13px;
  color: var(--muted);
}

.iter-detail-error {
  color: var(--danger);
}

.iter-detail-files {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.iter-detail-body {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 360px;
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(248, 250, 252, 0.9);
}

.iter-detail-note {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}

.iter-card-plan,
.iter-card-flag {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
}

.iter-card-flag {
  color: var(--accent-2-ink);
  font-weight: 600;
}

.iter-card .sc-rollback-btn {
  width: auto;
  min-width: 140px;
  margin-top: 0;
  justify-content: center;
  color: var(--danger) !important;
  border-color: rgba(239, 68, 68, 0.25) !important;
}

.sc-approval-card.is-rolled {
  opacity: 0.72;
}


.sc-approval-card.is-rolled {
  opacity: 0.72;
}

.sc-golive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.sc-golive-actions .sc-note-input,
.sc-golive-actions select.sc-note-input {
  min-width: min(100%, 220px);
  flex: 1;
}


.sc-composer:focus-within {
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 16px 40px rgba(var(--accent-rgb), 0.1);
}

.sc-composer textarea {
  border: none;
  background: transparent;
  resize: none;
  min-height: 48px;
  max-height: 160px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  outline: none;
  padding: 6px 4px;
}

.sc-send {
  border: none;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
}

.sc-send-kbd {
  font: inherit;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 3px 6px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.sc-send:hover:not(:disabled) {
  background: var(--accent);
  transform: translateY(-1px);
}

.sc-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sc-composer-hint {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--muted-2);
  padding-left: 4px;
}

.sc-composer-wrap.is-locked .sc-composer {
  opacity: 0.55;
  pointer-events: none;
}

.sc-diff-drawer {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  max-height: 46%;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(11, 18, 32, 0.96);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
  animation: scSlideUp 0.25s ease;
  z-index: 5;
}

.sc-diff-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 600;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.sc-diff-head .sc-ghost-btn {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.3);
  color: #e2e8f0;
  padding: 5px 10px;
  font-size: 12px;
}

.sc-diff {
  margin: 0;
  padding: 14px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  color: #e2e8f0;
  white-space: pre;
}

@keyframes scFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes scMsgIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes scSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

@keyframes scSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes scFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes scPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@keyframes scBusyDot {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.sc-rail-backdrop {
  display: none;
}

@media (max-width: 900px) and (min-width: 769px) {
  .sc-composer {
    grid-template-columns: auto 1fr auto;
  }
}

/* ── 剧本采集页 ── */
.sc-page-panel { padding-top: 0; }
.sc-batch-tabs-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px 0;
  border-bottom: 1px solid var(--border);
}
.sc-batch-tabs {
  display: flex;
  align-items: stretch;
  gap: 6px;
  overflow-x: auto;
  flex: 1 1 auto;
  min-width: 0;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.sc-batch-tab {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: var(--surface-2);
  color: var(--text-muted);
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.sc-batch-tab:hover { color: var(--text); background: var(--surface); }
.sc-batch-tab.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  border-color: var(--border);
  box-shadow: inset 0 2px 0 var(--accent);
}
.sc-batch-tab-meta {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
}
.sc-batch-tab.active .sc-batch-tab-meta { color: var(--text-muted); }
.sc-batch-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
}
.sc-next-report {
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.sc-next-report.sc-overdue {
  color: var(--danger);
  font-weight: 600;
}
.sc-subtabs { margin: 12px 16px 0; }
.sc-tab-panel { padding: 16px; }
.sc-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 16px;
  align-items: start;
}
.sc-overview-main { display: flex; flex-direction: column; gap: 16px; }
.sc-overview-side { display: flex; flex-direction: column; gap: 12px; }
.sc-progress-hero {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface-2));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.sc-progress-hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.sc-progress-hero-title { font-size: 16px; font-weight: 700; margin: 0; }
.sc-progress-hero-sub { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; }
.sc-progress-bars { display: flex; flex-direction: column; gap: 10px; }
.sc-progress-row { display: flex; flex-direction: column; gap: 4px; }
.sc-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}
.sc-progress-track {
  height: 8px;
  background: color-mix(in srgb, var(--border) 60%, transparent);
  border-radius: 999px;
  overflow: hidden;
}
.sc-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.sc-progress-fill.is-success { background: var(--success); }
.sc-progress-fill.is-warning { background: var(--warning); }
.sc-progress-fill.is-danger { background: var(--danger); }
.sc-report-due-panel { margin-top: 0; }
.sc-report-due-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sc-report-due-k { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.sc-report-due-v { font-size: 20px; font-weight: 700; }
.sc-report-due-v.is-overdue { color: var(--danger); }
.sc-report-due-meta { font-size: 13px; color: var(--text-muted); }
.sc-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.sc-stat-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sc-stat-k { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.sc-stat-v { font-size: 22px; font-weight: 700; line-height: 1.2; }
.sc-stat-v-success { color: var(--success); }
.sc-stat-v-warning { color: var(--warning); }
.sc-stat-sub { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.sc-stat-meta { font-size: 12px; color: var(--text-muted); }
.sc-alert-panel {
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--border));
  border-radius: var(--radius-md);
  padding: 12px 16px;
}
.sc-alert-panel p { margin: 6px 0 10px; font-size: 14px; color: var(--text-muted); }
.sc-inner-panel { margin-top: 0; }
.sc-section-title { font-size: 15px; margin: 0 0 12px; }
.sc-latest-report { font-size: 14px; color: var(--text-muted); }
.sc-mat-pending { background: color-mix(in srgb, var(--warning) 15%, transparent); color: var(--warning); }
.sc-mat-purchased { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); }
.sc-mat-unavailable { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.sc-import-file-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sc-readonly-field {
  background: var(--surface-muted, color-mix(in srgb, var(--border) 25%, var(--surface)));
  color: var(--text-muted);
  cursor: not-allowed;
}
.sc-material-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
  background: var(--surface);
}
.sc-material-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.sc-material-meta { font-size: 13px; color: var(--text-muted); margin: 0 0 8px; }
.sc-material-note { font-size: 13px; margin: 0 0 8px; }
.sc-script-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.sc-script-summary-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.sc-script-summary-chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
}
.sc-script-summary-chip strong { color: var(--text); margin-right: 4px; }
.sc-script-list { display: flex; flex-direction: column; gap: 10px; }
.sc-script-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
.sc-script-card.is-blocked { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.sc-script-card.is-ready { border-color: color-mix(in srgb, var(--success) 25%, var(--border)); }
.sc-script-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  min-height: 64px;
}
.sc-script-card-head:hover { background: var(--surface-2); }
.sc-script-index {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}
.sc-script-card-main { flex: 1 1 auto; min-width: 0; }
.sc-script-card-title {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 4px;
  line-height: 1.35;
}
.sc-script-card-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
  margin: 0 0 6px;
}
.sc-script-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.sc-script-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}
.sc-script-card-toggle {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
  padding-top: 4px;
}
.sc-script-card-body {
  border-top: 1px solid var(--border);
  padding: 14px 16px 16px;
  font-size: 14px;
}
.sc-script-mats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}
.sc-mat-chip {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.sc-mat-chip.is-blocked {
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
  color: var(--danger);
}
.sc-mat-chip.is-ready {
  border-color: color-mix(in srgb, var(--success) 30%, var(--border));
  color: var(--success);
}
.sc-mat-chip.is-pending {
  border-color: color-mix(in srgb, var(--warning) 30%, var(--border));
  color: var(--warning);
}
.sc-script-overview {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
  line-height: 1.5;
}
.sc-step-list { margin: 10px 0 0; padding-left: 0; list-style: none; }
.sc-step-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.sc-step-list li:last-child { border-bottom: none; }
.sc-step-no {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
}
.sc-step-blocked { opacity: 0.55; }
.sc-step-tag { font-style: normal; font-size: 11px; color: var(--danger); margin-left: auto; }
.sc-report-timeline { display: flex; flex-direction: column; gap: 12px; }
.sc-report-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--surface);
}
.sc-report-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}
.sc-report-head span { color: var(--text-muted); }
.sc-report-body p { margin: 4px 0; font-size: 14px; }
.sc-report-period { font-size: 12px !important; color: var(--text-muted) !important; }
.sc-check-list { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow: auto; }
.sc-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}
.sc-material-name { font-weight: 600; margin: 0 0 12px; font-size: 16px; color: var(--ink); }
.sc-unavailable-warn { color: var(--danger); }

@media (max-width: 900px) {
  .sc-overview-layout { grid-template-columns: 1fr; }
  .sc-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .sc-stat-grid { grid-template-columns: 1fr; }
  .sc-batch-tabs-wrap { flex-direction: column; align-items: stretch; }
}

/* ── 剧本采集：独立移动端 App ── */
.sc-mobile-app {
  --sc-app-max: 100%;
  --sc-nav-h: 62px;
  margin: 0;
  height: 100dvh;
  height: 100vh;
  background: var(--bg);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.sc-app-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: var(--sc-app-max);
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.sc-m-top {
  flex-shrink: 0;
  z-index: 20;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line);
}

.sc-mobile-app .sc-m-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: var(--bg-elevated);
  border-bottom: none;
}

.sc-m-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  color: var(--ink);
}

.sc-m-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.sc-m-report-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent);
}

.sc-m-report-btn:active { transform: scale(0.97); }

.sc-m-countdown {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  border-bottom: 1px solid var(--line);
}

.sc-m-countdown.is-overdue {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 10%, var(--bg));
}

.sc-m-batch-bar {
  background: var(--bg-elevated);
}

.sc-m-batch-tabs {
  display: flex;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 10px 12px;
  border-bottom: none;
}

.sc-m-batch-tabs::-webkit-scrollbar { display: none; }

.sc-m-batch-tabs .sc-batch-tab {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 44px;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  box-shadow: none;
  background: var(--surface);
}

.sc-m-batch-tabs .sc-batch-tab.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  box-shadow: none;
}

.sc-batch-tab-title {
  font-size: 13px;
  font-weight: 600;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-m-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 14px 14px calc(var(--sc-nav-h) + 20px + env(safe-area-inset-bottom, 0px));
}

.sc-m-bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 4px;
  padding: 6px 8px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(12px) saturate(1.2);
  border-top: 1px solid var(--line);
  z-index: 30;
}

.sc-m-nav-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  border-radius: 12px;
}

.sc-m-nav-item.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-weight: 600;
}

.sc-m-nav-ico {
  font-size: 18px;
  line-height: 1;
}

.sc-m-fab {
  position: absolute;
  right: 16px;
  bottom: calc(var(--sc-nav-h) + 12px + env(safe-area-inset-bottom, 0px));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  z-index: 40;
}

.sc-m-panel-toolbar {
  position: sticky;
  top: -14px;
  z-index: 10;
  margin: -14px -14px 14px;
  padding: 14px 14px 10px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}

.sc-m-filter-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.sc-m-filter-chips::-webkit-scrollbar { display: none; }

.sc-filter-chip {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.sc-filter-chip.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--text);
  font-weight: 600;
}

.sc-m-search-wrap { margin-bottom: 10px; }

.sc-m-search {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 16px;
}

.sc-m-material-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sc-m-material-card {
  margin-bottom: 0;
  padding: 14px 16px;
  border-left-width: 4px;
}

.sc-m-material-card[data-mat-status="purchased"] { border-left-color: var(--success); }
.sc-m-material-card[data-mat-status="pending"] { border-left-color: var(--warning); }
.sc-m-material-card[data-mat-status="unavailable"] { border-left-color: var(--danger); }

.sc-m-quick-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 8px;
}

.sc-quick-btn {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.sc-quick-btn.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--text);
}

.sc-quick-btn[data-quick-status="purchased"].is-active {
  border-color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, var(--surface));
  color: var(--success);
}

.sc-quick-btn[data-quick-status="unavailable"].is-active {
  border-color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--danger);
}

.sc-m-detail-link {
  width: 100%;
  min-height: 40px;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  padding: 6px 0 0;
}

.sc-m-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.sc-m-overview {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  grid-template-areas:
    "hero"
    "due"
    "stats"
    "alert"
    "latest";
}

.sc-m-overview .sc-progress-hero { grid-area: hero; margin: 0; }
.sc-m-overview .sc-m-report-due { grid-area: due; }
.sc-m-overview .sc-m-stat-grid { grid-area: stats; }
.sc-m-overview .sc-alert-panel { grid-area: alert; }
.sc-m-overview .sc-m-latest-wrap { grid-area: latest; }

.sc-m-stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sc-m-report-due {
  padding: 16px 18px;
}

.sc-m-latest-wrap {
  padding: 16px 18px;
}

.sc-m-status-picker {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.sc-status-opt {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.sc-status-opt.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.sc-script-summary-chip.is-ready strong { color: var(--success); }
.sc-script-summary-chip.is-pending strong { color: var(--warning); }
.sc-script-summary-chip.is-blocked strong { color: var(--danger); }

.sc-script-card.is-expanded .sc-script-card-toggle { transform: rotate(180deg); }

.sc-mobile-app .empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: 14px;
}

body.sc-modal-open { overflow: hidden; }

.sc-mobile-app .modal {
  z-index: 2000;
  align-items: flex-end;
  padding: 0;
}

.sc-mobile-app .modal-content,
.sc-mobile-app .modal-lg {
  width: 100%;
  max-width: 100%;
  max-height: min(92dvh, 92vh);
  border-radius: 18px 18px 0 0;
  margin: 0;
}

.sc-mobile-app .modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.sc-mobile-app .modal-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
}

.sc-mobile-app .modal-footer .btn {
  flex: 1;
  min-height: 44px;
}

.sc-mobile-app .sc-tab-panel { padding: 0; }

.sc-mobile-app .toast-container {
  bottom: calc(var(--sc-nav-h) + 16px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 640px) {
  .sc-m-overview {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "hero hero"
      "due stats"
      "alert alert"
      "latest latest";
  }

  .sc-m-material-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .sc-script-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
  }

  .sc-script-list .sc-script-summary-bar {
    grid-column: 1 / -1;
  }

  .sc-script-list .empty-state {
    grid-column: 1 / -1;
  }
}

@media (min-width: 768px) {
  .sc-mobile-app {
    --sc-app-max: 720px;
    padding: 20px;
    background:
      radial-gradient(900px 480px at 10% -5%, var(--glow-accent), transparent 55%),
      radial-gradient(700px 420px at 100% 0%, var(--glow-accent-2), transparent 50%),
      var(--bg);
  }

  .sc-app-shell {
    height: calc(100dvh - 40px);
    height: calc(100vh - 40px);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
  }

  .sc-m-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .sc-mobile-app {
    --sc-app-max: 960px;
  }

  .sc-m-material-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sc-script-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
