/* 洛克王国 · 比赛阵容工坊 — 天空蓝工作台
   结构：紧凑页头 → 品牌条 → 阵容总览（导航） → 编辑 / 预览两栏 → 导出 → 页脚
   一屏之内先给阵容与预览，控件收成一条，操作区不再堆叠。 */
:root {
  --ink: #20354e; --muted: #50677e; --quiet: #526a82;
  --line: #dce7f1; --line-strong: #bfd2e5; --line-soft: #e9eff5;
  --page: #eef4fb; --surface: #fff; --surface-soft: #f6f9fc; --surface-tint: #edf4fc;
  --sky-1: #e7f3ff; --sky-2: #eef8ff; --sky-3: #e0eefc;
  --accent: #3075c1; --accent-strong: #2564ad; --accent-soft: #eaf3ff;
  --focus: #347ccc66; --danger-soft: #fbeaea;
  --radius: 10px; --radius-lg: 18px;
  --shadow: 0 8px 26px #3b608108; --shadow-soft: 0 2px 7px #3b60810c;
  --duration: 160ms;
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; color: var(--ink); background: var(--page); font-size: 14px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, .link-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 15px; color: inherit; border: 1px solid transparent; border-radius: var(--radius); background: transparent; cursor: pointer; text-decoration: none; transition: background var(--duration) ease, color var(--duration) ease, border-color var(--duration) ease, transform 120ms ease; }
button:active:not(:disabled) { transform: scale(.98); }
button:disabled { opacity: .46; cursor: not-allowed; }
button.is-busy { opacity: 1; cursor: progress; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
button svg, .search-input svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 17px; font-weight: 650; letter-spacing: .01em; }
.primary { min-height: 42px; color: #fff; background: var(--accent); font-weight: 600; box-shadow: 0 3px 9px #347ccc18; }
.primary:hover:not(:disabled) { background: var(--accent-strong); }
.secondary, .link-button { color: #49627c; background: var(--surface); border-color: var(--line); }
.secondary:hover:not(:disabled), .link-button:hover { color: var(--accent-strong); border-color: #a6c4e2; background: #f4f8fe; }
.text-button, .ghost { min-height: 32px; padding: 0 2px; color: var(--muted); font-size: 13px; }
.text-button:hover:not(:disabled), .ghost:hover:not(:disabled) { color: var(--accent-strong); }
.muted { color: var(--muted); font-size: 12px; }

/* ---------- 页头 ---------- */
.site-header { display: flex; align-items: center; gap: 34px; min-height: 56px; padding: 0 max(24px, calc((100vw - 1360px) / 2)); border-bottom: 1px solid var(--line); background: #fffffff0; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; white-space: nowrap; letter-spacing: .02em; }
.brand-mark { width: 27px; height: 27px; color: var(--accent); }
.brand-divider { margin: 0 7px; color: #afc5da; font-weight: 400; }
.site-nav { display: flex; align-self: stretch; font-size: 13px; }
.nav-current { position: relative; display: flex; align-items: center; color: var(--accent-strong); font-weight: 600; }
.nav-current::after { position: absolute; bottom: -1px; left: calc(50% - 11px); width: 22px; height: 2px; border-radius: 2px; background: var(--accent); content: ''; }
.credits { margin-left: auto; color: var(--quiet); font-size: 12px; white-space: nowrap; }
.app-shell { width: min(1360px, calc(100% - 48px)); margin: 0 auto; padding-top: 16px; }

/* ---------- 品牌条：只交代身份，把高度让给阵容 ---------- */
.studio-intro { position: relative; display: flex; align-items: center; gap: 24px; min-height: 76px; padding: 12px 24px; overflow: hidden; border: 1px solid #d7e7f7; border-radius: 16px; background: linear-gradient(100deg, var(--sky-1), var(--sky-2) 58%, var(--sky-3)); }
.intro-copy { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 16px; min-width: 0; }
h1 { color: #28496f; font-size: clamp(20px, 1.7vw, 23px); line-height: 1.35; font-weight: 650; letter-spacing: .01em; }
h1 span { color: #2f6cab; }
.intro-note { padding-left: 16px; border-left: 1px solid #c3dbef; color: var(--muted); font-size: 13px; }
.intro-art { position: relative; flex: none; margin-left: auto; width: 196px; height: 60px; }
.art-orbit { position: absolute; bottom: 0; left: 2px; width: 190px; height: 42px; border: 1px solid #ffffffdb; border-radius: 50%; background: #ffffff3d; transform: rotate(-6deg); }
.mascot { position: absolute; bottom: -3px; object-fit: contain; filter: drop-shadow(0 4px 4px #5a85a512); }
.mascot-water { left: 0; width: 58px; height: 58px; transform: rotate(-6deg); }
.mascot-light { z-index: 1; left: 52px; bottom: -6px; width: 72px; height: 72px; }
.mascot-fire { right: 0; width: 62px; height: 62px; transform: rotate(6deg); }

/* ---------- 阵容总览：唯一的栏位导航 ---------- */
.team-overview { margin: 16px 0 14px; }
.team-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 0 0 12px; }
.team-name-row label { color: var(--ink); font-size: 13px; font-weight: 600; }
.team-name-row label span { margin-left: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }
.team-name-row input { width: 280px; min-width: 0; max-width: 100%; height: 36px; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.team-name-row input:focus-visible { outline: 2px solid #75aef5; outline-offset: 2px; }
.team-name-row p { margin: 0; color: var(--muted); font-size: 12px; }
.section-head, .panel-heading, .slot-head, .palette-heading, .results-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head { margin-bottom: 10px; }
#team-overview-title { font-size: 16px; }
.count-chip { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; color: #3f6489; background: #dfebf7; font-size: 12px; font-weight: 500; letter-spacing: .03em; vertical-align: 1px; }
.group-actions, .group-switch { display: flex; align-items: center; }
.group-actions { gap: 16px; }
.group-switch { gap: 3px; padding: 3px; border-radius: var(--radius); background: #dfeaf5; }
.group-switch button { min-height: 30px; padding: 0 13px; border-radius: 7px; color: var(--muted); font-size: 13px; }
.group-switch button.active { color: #316ba8; background: #fff; box-shadow: var(--shadow-soft); }
.group-switch button span { color: var(--quiet); font-size: 12px; }
.ark-note { margin: -2px 0 10px; color: var(--muted); font-size: 13px; }
.slot-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.slot-summary[data-group='ark'] { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 648px; }
.summary-card { position: relative; justify-content: flex-start; gap: 10px; min-width: 0; min-height: 72px; padding: 9px 12px 9px 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #f8fbff; text-align: left; }
.summary-card:hover { border-color: #a9c5e2; background: #fff; }
.summary-card.active { border-color: #6ea3d8; background: #fff; box-shadow: 0 0 0 2px #6ea3d824, 0 6px 16px #3b608114; }
.summary-card.active .summary-index { color: var(--accent-strong); font-weight: 600; }
.summary-index { position: absolute; top: 3px; right: 7px; color: var(--quiet); font-size: 11px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.summary-picture { display: grid; flex: none; place-items: center; width: 44px; height: 46px; border-radius: 10px; background: #eaf2fa; }
.summary-picture img { width: 44px; height: 44px; object-fit: contain; }
.summary-plus { color: #95b2cb; font-size: 22px; font-weight: 300; }
.summary-text { display: block; min-width: 0; padding-right: 14px; }
.summary-text strong { display: block; overflow: hidden; color: #2b4765; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.summary-text > span { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 两栏工作区 ---------- */
.workspace { display: grid; grid-template-columns: minmax(340px, .76fr) minmax(0, 1.32fr); align-items: start; gap: 18px; }
.workbench, .preview-panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow); }
.workbench { padding: 20px 22px 22px; }
.preview-panel { overflow: hidden; }
.panel-heading { min-height: 28px; }
.heading-main { display: flex; align-items: center; gap: 9px; }
.editor-context { display: flex; align-items: center; gap: 10px; }
.slot-context { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.preview-jump { display: none; color: var(--accent-strong); font-size: 12px; font-weight: 600; }
.slot-list { margin-top: 14px; }

/* ---------- 批量填入：朴素的可展开条，不再是一张卡片 ---------- */
.bulk-panel { margin-top: 6px; border-block: 1px solid var(--line); }
.bulk-panel summary { display: flex; align-items: center; gap: 8px; padding: 10px 2px; color: #37689e; cursor: pointer; font-size: 13px; font-weight: 600; list-style: none; }
.bulk-panel summary::-webkit-details-marker { display: none; }
.bulk-panel summary::before { flex: none; width: 6px; height: 6px; border-right: 1.6px solid #7d9ab6; border-bottom: 1.6px solid #7d9ab6; transform: rotate(-45deg); transition: transform var(--duration) ease; content: ''; }
.bulk-panel[open] summary::before { transform: rotate(45deg); }
.bulk-panel summary > span { color: var(--quiet); font-size: 12px; font-weight: 400; }
.bulk-body { padding: 0 2px 12px; }
.bulk-body textarea { min-height: 74px; resize: vertical; background: #fff; font-size: 13px; }
.bulk-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.bulk-actions > span { color: var(--muted); font-size: 12px; }
.bulk-actions .primary { flex: none; min-height: 36px; padding-inline: 12px; font-size: 13px; box-shadow: none; }
.bulk-report { display: flex; flex-wrap: wrap; gap: 4px 6px; max-height: 92px; margin-top: 10px; padding-top: 8px; overflow-y: auto; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; overscroll-behavior: contain; }
.bulk-report > strong { flex: 1 0 100%; margin: 0 0 2px; color: #3f6890; font-size: 12px; font-weight: 500; }
.bulk-result { display: inline-flex; align-items: center; min-height: 0; height: 24px; margin: 0; padding: 0 9px; border-radius: 999px; background: #eef4fa; font-size: 12px; line-height: 1; text-align: left; white-space: nowrap; }
.bulk-result.success { color: #37648f; background: #e9f2fb; }
.bulk-result.success:hover { color: var(--accent-strong); background: #dcebfa; }
.bulk-result.warning { color: #8a5f2c; background: #fdf1de; }

/* ---------- 编辑卡 ---------- */
.slot-card { display: block; }
.slot-head { margin-bottom: 12px; }
.slot-head > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.slot-index { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 20px; padding: 0 5px; border-radius: 6px; color: #4d6f94; background: #ebf2fa; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.selected-name { overflow: hidden; font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.slot-head .slot-order-actions { flex: none; gap: 11px; }
.field { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: 12px; }
.field > span:first-child { font-weight: 500; }
input, select, textarea { min-width: 0; width: 100%; padding: 9px 12px; outline: none; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: #f9fbfd; }
input::placeholder, textarea::placeholder { color: var(--quiet); }
input:focus, select:focus, textarea:focus { border-color: #85add6; background: #fff; }
.search-input { position: relative; display: block; }
.search-input svg { position: absolute; top: 11px; left: 12px; color: #7894b0; }
.search-input input { height: 40px; padding-left: 38px; font-size: 14px; }
.slot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
select { height: 38px; font-size: 13px; }
.palette-heading { margin-top: 14px; color: var(--muted); font-size: 12px; }
.color-name { margin-left: 5px; color: #4d6f94; font-size: 12px; font-weight: 500; }
.color-row { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 5px; margin: 8px 0 14px; }
.swatch { position: relative; justify-self: stretch; width: 100%; min-height: 0; max-width: none; padding: 0; aspect-ratio: 1; border: 2px solid #fff; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 0 1px #d3dce555; }
.swatch:hover { transform: scale(1.12); }
.swatch.active { box-shadow: 0 0 0 1.5px #628fbe; }
.swatch.active::after { position: absolute; top: 50%; left: 50%; width: 4px; height: 8px; border: solid #37536f; border-width: 0 1.5px 1.5px 0; transform: translate(-50%, -62%) rotate(45deg); content: ''; }
.results-heading { margin-bottom: 8px; padding-top: 12px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 12px; }
.result-count { color: var(--quiet); font-size: 12px; }
.candidate-row { display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 8px; max-height: 258px; min-height: 132px; margin: -2px; padding: 2px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.candidate-row:has(.candidate) { min-height: 0; }
.candidate { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-content: center; gap: 8px; min-width: 0; min-height: 76px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; text-align: left; }
.candidate:hover { border-color: #b3cee8; background: #f6faff; }
.candidate.active { border-color: #83acda; background: #eff6ff; }
.candidate img { width: 48px; height: 54px; object-fit: contain; }
.candidate > span { display: grid; gap: 1px; min-width: 0; }
.candidate small { color: var(--quiet); font-size: 12px; }
.candidate strong { color: #355675; font-size: 13px; font-weight: 600; }
.candidate span span { color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.empty-candidates { display: flex; grid-column: 1 / -1; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 132px; padding: 18px 12px; color: var(--muted); text-align: center; }
.empty-candidates strong { color: #536f8b; font-size: 13px; font-weight: 500; }
.empty-candidates > span { font-size: 12px; }
.slot-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.slot-actions button { flex: 1; padding-inline: 8px; font-size: 13px; }

/* ---------- 预览：一条控件带，其余全给卡片 ---------- */
.preview-panel > .panel-heading { padding: 17px 22px 12px; }
#preview-title { scroll-margin-top: 16px; }
.live-label { display: inline-flex; align-items: center; gap: 5px; color: #4c7263; font-size: 12px; }
.live-label i { width: 5px; height: 5px; border-radius: 50%; background: #7cae9b; }
.view-switch { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.view-switch button { min-height: 28px; padding: 0 12px; border-radius: 6px; color: var(--muted); font-size: 13px; }
.view-switch button.active { color: #386fa9; background: #fff; box-shadow: var(--shadow-soft); }
.preview-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 20px; margin: 0 22px; padding: 9px 0; border-block: 1px solid var(--line-soft); }
.presentation-options { display: flex; align-items: center; gap: 16px; }
.layout-field { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); font-size: 12px; }
.layout-field > span { flex: none; }
.layout-field select { width: 132px; height: 32px; padding: 3px 8px; background: var(--surface-soft); }
.background-toggle { position: relative; display: flex; align-items: center; gap: 7px; min-height: 32px; color: var(--muted); font-size: 13px; cursor: pointer; }
.background-toggle input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.toggle-track { position: relative; flex: none; width: 32px; height: 19px; border: 1px solid #91a8be; border-radius: 12px; background: #b7c8d9; transition: background var(--duration) ease, border-color var(--duration) ease; }
.toggle-track::after { position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #29435e22; transition: transform var(--duration) ease; content: ''; }
.background-toggle input:checked + .toggle-track { border-color: var(--accent); background: var(--accent); }
.background-toggle input:checked + .toggle-track::after { transform: translateX(13px); }
.background-toggle input:focus-visible + .toggle-track { outline: 3px solid var(--focus); outline-offset: 3px; }
.background-toggle:has(input:disabled) { opacity: .46; cursor: not-allowed; }
.preview-options { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.preview-options > span { color: var(--quiet); font-size: 12px; }
.appearance-switch { display: flex; flex: none; gap: 14px; }
.appearance-switch button { min-height: 28px; padding: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); font-size: 13px; }
.appearance-switch button.active { border-bottom-color: #6d9fd2; color: var(--accent-strong); font-weight: 600; }
.preview-stage { min-height: 400px; padding: 18px 22px 20px; border-bottom: 1px solid var(--line-soft); background: #f0f6fc; }
.preview-stage.without-background { background-color: #edf3f9; background-image: linear-gradient(45deg, #e0eaf4 25%, transparent 25%), linear-gradient(-45deg, #e0eaf4 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e0eaf4 75%), linear-gradient(-45deg, transparent 75%, #e0eaf4 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.preview-stage:has(.preview-item:nth-child(4)[hidden]) { min-height: 0; }
.preview-stack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 14px; max-width: 744px; margin-inline: auto; }
.preview-card { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 14px; background: #fafdff; transition: outline-color var(--duration) ease; }
.preview-item.is-empty .preview-card { border: 1px dashed #c7d9e9; background: #f9fcff99; }
.preview-item.is-current .preview-card { outline: 2px solid #8ab4df; outline-offset: 3px; }
.preview-item.is-current .preview-order, .preview-item.is-current .preview-caption strong { color: #2f6fb0; font-weight: 600; }
.empty-card-number { position: absolute; top: 10px; left: 12px; color: var(--quiet); font-size: 12px; font-variant-numeric: tabular-nums; }
.empty-card-plus { position: absolute; top: 40%; left: 50%; color: #9cbad5; font-size: 30px; font-weight: 200; transform: translate(-50%, -50%); }
.empty-card-label { position: absolute; bottom: 22%; width: 100%; color: var(--quiet); font-size: 12px; text-align: center; }
.preview-item.has-selection .empty-card-number, .preview-item.has-selection .empty-card-plus, .preview-item.has-selection .empty-card-label { display: none; }
.rendered-card { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.preview-caption { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; padding: 6px 2px 0; color: var(--muted); }
.preview-order { flex: none; color: var(--quiet); font-size: 11px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.preview-item.is-empty .preview-caption { display: none; }
.preview-caption strong { display: none; min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.preview-meta { display: none; }
.preview-item.is-empty .preview-caption strong { color: var(--quiet); font-weight: 400; }
.preview-item.is-loading .rendered-card { opacity: .6; }
.preview-item.is-loading .preview-card::after { position: absolute; top: 10px; right: 10px; width: 13px; height: 13px; border: 2px solid #84a8cb55; border-top-color: #467eb7; border-radius: 50%; animation: loading .8s linear infinite; content: ''; }
.preview-retry { position: absolute; z-index: 2; inset: auto 5px 10px; min-height: 32px; color: #416d9c; background: #fffffff0; font-size: 12px; }
.preview-hint { margin: 14px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.preview-stack[data-view='strip'] { grid-template-columns: minmax(0, 232px); justify-content: center; }
.preview-stack[data-view='strip'] .preview-item:not(.has-selection) { display: none; }
.preview-stack[data-view='strip']:not(:has(.preview-item.has-selection:not([hidden]))) .preview-item:first-child { display: block; }
.preview-stack[data-composed='true'] { position: relative; display: block; width: 100%; }
.preview-stack[data-composed='true'] .preview-item { position: absolute; transition: left var(--duration) ease, top var(--duration) ease, width var(--duration) ease, height var(--duration) ease; }
.preview-stack[data-composed='true'] .preview-card { height: 100%; aspect-ratio: auto; }
.preview-stack[data-composed='true'] .preview-caption { display: none; }
.preview-stack[data-composed='true'] .preview-item.is-current .preview-card { outline-width: 1px; outline-offset: 2px; }
.preview-stack[data-show-background='false'] .preview-item:not(.is-empty) .preview-card { background: transparent; }
.preview-drag { position: absolute; z-index: 2; top: 8px; right: 8px; width: 28px; min-height: 28px; padding: 0; opacity: 0; border: 1px solid #d6e5f0; border-radius: 7px; color: #52799f; background: #fffffff2; cursor: grab; font-size: 18px; touch-action: none; transition: opacity 140ms ease; }
.preview-item:hover .preview-drag, .preview-drag:focus-visible { opacity: 1; }
.preview-item.is-dragging { position: relative; z-index: 4; opacity: .9; pointer-events: none; }
.preview-item.is-dragging .preview-card { outline-color: var(--accent); }
.preview-item.is-dragging .preview-drag { opacity: 1; cursor: grabbing; }
.preview-item.is-drop-target .preview-card { outline: 3px solid #508ac5; outline-offset: 3px; }

/* ---------- 导出 ---------- */
.export-area { padding: 14px 22px 18px; }
.export-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.export-description { display: grid; gap: 2px; min-width: 0; }
.export-description strong { font-size: 13px; font-weight: 600; }
.export-description > span { color: var(--muted); font-size: 12px; }
.export-toolbar .primary { flex: none; min-height: 40px; padding: 0 18px; font-size: 13px; }
.batch-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.batch-toolbar .secondary { justify-content: space-between; gap: 10px; min-height: 38px; padding-inline: 12px; font-size: 13px; }
.export-format { flex: none; color: var(--quiet); font-size: 12px; }
.page-footer { display: flex; justify-content: space-between; gap: 12px; padding: 20px 2px 24px; color: var(--quiet); font-size: 12px; }
.footer-credits { display: none; }
.toast { position: fixed; z-index: 10; bottom: 26px; left: 50%; max-width: min(90vw, 600px); padding: 11px 18px; border: 1px solid #476481; border-radius: 12px; color: #fff; background: #29435e; box-shadow: 0 5px 25px #24446620; font-size: 13px; transform: translateX(-50%); }
.toast.is-error { border-color: #a3757e; background: #85515b; }

@keyframes loading { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) {
  .studio-intro { animation: studio-enter 350ms ease-out both; }
  .team-overview { animation: studio-enter 350ms 50ms ease-out both; }
  .workspace { animation: studio-enter 350ms 100ms ease-out both; }
  @keyframes studio-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
}
@media (hover: none) { .preview-drag { width: 32px; min-height: 32px; opacity: 1; } }
/* 编辑时让预览留在视野里；成图/长条视图会高于屏幕，保持普通流。 */
@media (min-width: 861px) and (min-height: 840px) {
  .preview-panel { position: sticky; top: 16px; }
  .preview-panel:has(.preview-stack[data-composed='true']), .preview-panel:has(.preview-stack[data-view='strip']) { position: static; }
}
@media (max-width: 1180px) {
  .site-header { gap: 24px; padding-inline: 22px; }
  .app-shell { width: calc(100% - 40px); }
  .intro-art { width: 164px; }
  .mascot-light { left: 52px; }
  .mascot-fire { right: 0; }
  .summary-card { gap: 8px; padding: 9px 9px 9px 8px; }
  .summary-picture, .summary-picture img { width: 38px; height: 40px; }
  .workspace { grid-template-columns: minmax(320px, .82fr) minmax(0, 1.2fr); gap: 16px; }
  .workbench { padding: 18px 18px 20px; }
  .preview-panel > .panel-heading, .preview-controls { padding-inline: 18px; }
  .preview-controls { margin-inline: 0; }
  .preview-options { margin-left: 0; }
  .preview-options > span { max-width: 150px; text-align: right; }
  .preview-stage { padding: 16px 18px 18px; }
  .preview-stack { gap: 14px 12px; }
  .export-area { padding-inline: 18px; }
  .export-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
  .batch-toolbar { grid-template-columns: 1fr; }
  .color-row { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 7px; }
  .swatch { max-width: 30px; justify-self: center; }
}
@media (max-width: 960px) {
  .credits { display: none; }
  .site-header { justify-content: space-between; }
  .footer-credits { display: block; }
  .slot-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-card { gap: 11px; padding: 9px 12px 9px 10px; min-height: 76px; }
  .summary-picture, .summary-picture img { width: 42px; height: 44px; }
  .preview-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .live-label { display: none; }
}
@media (max-width: 860px) {
  .app-shell { width: calc(100% - 32px); padding-top: 14px; }
  .studio-intro { gap: 18px; padding-inline: 20px; }
  .intro-art { width: 140px; }
  .mascot-water { width: 44px; height: 44px; }
  .mascot-light { left: 42px; width: 56px; height: 56px; bottom: -4px; }
  .mascot-fire { width: 48px; height: 48px; }
  .art-orbit { width: 132px; height: 32px; }
  .workspace { grid-template-columns: 1fr; }
  .preview-jump { display: inline-flex; align-items: center; min-height: 30px; padding-inline: 9px; border: 1px solid #d4e4f4; border-radius: 7px; background: #f3f8ff; }
  .preview-stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .preview-options { margin-left: auto; }
  .export-toolbar { align-items: center; flex-direction: row; }
  .batch-toolbar { grid-template-columns: 1fr 1fr; }
  .color-row { grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 5px; }
  .swatch { max-width: none; justify-self: stretch; }
}
@media (max-width: 600px) {
  .team-name-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 10px; }
  .team-name-row input { width: 100%; height: 40px; font-size: 15px; }
  .team-name-row p { grid-column: 2; }
  .site-header { gap: 10px; min-height: 52px; padding-inline: 14px; }
  .brand { gap: 6px; font-size: 14px; }
  .brand-mark { width: 24px; height: 24px; }
  .brand-divider { margin-inline: 5px; }
  .site-nav { font-size: 12px; }
  .app-shell { width: calc(100% - 24px); padding-top: 12px; }
  .studio-intro { display: block; min-height: 0; padding: 13px 15px 14px; border-radius: 14px; }
  .intro-copy { display: block; padding-right: 84px; }
  h1 { font-size: 20px; line-height: 1.38; }
  h1 span { display: inline; }
  .intro-note { margin-top: 3px; padding-left: 0; border-left: 0; font-size: 12px; line-height: 1.6; }
  .intro-art { position: absolute; top: 50%; right: 8px; width: 74px; height: 44px; margin: 0; transform: translateY(-50%); }
  .mascot-water { left: 0; bottom: -1px; width: 30px; height: 30px; }
  .mascot-light { left: 21px; bottom: 0; width: 40px; height: 40px; }
  .mascot-fire { right: 0; bottom: -2px; width: 32px; height: 32px; }
  .art-orbit { bottom: -2px; left: 0; width: 74px; height: 22px; }
  .team-overview { margin-block: 14px 12px; }
  .section-head { flex-wrap: wrap; gap: 9px; margin-bottom: 9px; }
  .section-head h2 { font-size: 15px; }
  .group-actions { justify-content: space-between; gap: 10px; width: 100%; }
  .group-switch { flex: 1; max-width: 250px; }
  .group-switch button { flex: 1; padding-inline: 8px; }
  .ark-note { font-size: 12px; }
  .slot-summary { gap: 8px; }
  .summary-card { flex-direction: column; align-items: center; gap: 3px; min-height: 92px; padding: 9px 6px 8px; }
  .summary-picture { width: 40px; height: 40px; }
  .summary-picture img { width: 40px; height: 40px; }
  .summary-text { width: 100%; padding-right: 0; text-align: center; }
  .summary-text strong, .summary-text > span { font-size: 12px; }
  .summary-text > span { margin-top: 0; }
  .summary-index { top: 3px; right: 5px; }
  .workspace { gap: 14px; }
  .workbench { padding: 16px; border-radius: 15px; }
  .preview-panel { border-radius: 15px; }
  .panel-heading { gap: 8px; }
  .editor-context { gap: 8px; }
  .preview-jump { padding-inline: 8px; }
  .slot-grid { gap: 9px; }
  .palette-heading { flex-wrap: wrap; gap: 3px; }
  .color-row { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 7px; }
  .swatch { max-width: 30px; justify-self: center; }
  .candidate { grid-template-columns: 42px minmax(0, 1fr); gap: 7px; padding: 7px; }
  .candidate img { width: 42px; height: 48px; }
  .bulk-panel summary { padding: 10px 0; }
  .bulk-panel summary > span { margin-left: 2px; }
  .bulk-body { padding-inline: 0; }
  .bulk-actions { align-items: stretch; flex-direction: column; gap: 7px; }
  .bulk-actions .primary { min-height: 38px; }
  .preview-panel > .panel-heading { padding: 15px 16px 11px; }
  .view-switch button { padding-inline: 10px; }
  .preview-controls { margin-inline: 16px; gap: 7px 12px; }
  .presentation-options { flex: 1 0 100%; justify-content: space-between; }
  .layout-field { flex: 1; }
  .layout-field select { flex: 1; width: auto; min-width: 120px; height: 40px; font-size: 15px; }
  .background-toggle { min-height: 40px; }
  .preview-options { flex-wrap: wrap; gap: 4px 12px; margin-left: 0; }
  .preview-options > span { width: 100%; max-width: none; text-align: left; }
  .preview-stage { padding: 15px 16px 17px; }
  .preview-stack { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 11px; }
  .preview-card { border-radius: 12px; }
  .preview-caption { padding-top: 6px; }
  .export-area { padding: 14px 16px 16px; }
  .export-toolbar { align-items: stretch; flex-direction: column; gap: 10px; }
  .export-toolbar .primary { min-height: 42px; }
  .batch-toolbar { grid-template-columns: 1fr; gap: 8px; margin-top: 10px; }
  .batch-toolbar .secondary { min-height: 40px; }
  .page-footer { flex-wrap: wrap; gap: 5px; padding-block: 18px; }
}
@media (max-width: 360px) {
  .intro-copy { padding-right: 68px; }
  .intro-art { width: 60px; height: 34px; }
  .mascot-water { width: 25px; height: 25px; }
  .mascot-light { left: 17px; width: 33px; height: 33px; }
  .mascot-fire { width: 26px; height: 26px; }
  .art-orbit { width: 60px; height: 18px; }
  h1 { font-size: 19px; }
  .workbench { padding: 14px; }
  .editor-context { flex-wrap: wrap; justify-content: flex-end; gap: 2px 8px; }
  .slot-head { flex-wrap: wrap; gap: 4px; }
  .slot-order-actions { margin-left: auto; }
  .bulk-panel summary > span { display: block; margin: 1px 0 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
