/* ==========================================================================
   肘界 Elboverse — 纸上痛车（Paper & Ink）Design Language v1.1
   设计参照 open-design.ai：纸张底色 / 墨色层级 / 1px 细线 / 唯一强调色痛界绿
   ========================================================================== */
@font-face {
  font-family: 'Albert Sans';
  src: url(/assets/brand/albert-sans-latin.woff2) format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #FAFAFA;
  --paper-warm: #F5F5F3;
  --paper-dark: #EFEFED;
  --bone: #FFFFFF;
  --ink: #1F1F1C;
  --ink-soft: #43423E;
  --ink-mute: #5E5D57;
  --ink-faint: #8C8B85;
  --acid: #63FE13;
  --acid-soft: #83FF3B;
  --acid-deep: #218C00;
  --acid-tint: color-mix(in srgb, #63FE13 12%, #FFFFFF);
  --acid-ink: #16190F;
  --line: #D9D9D6;
  --line-hover: #BFBFBC;
  --line-soft: #F0F0EE;
  --shadow: 0 30px 60px -30px rgba(31, 31, 28, .16);
  --shadow-btn: 0 14px 26px -16px rgba(31, 31, 28, .42);
  --r-card: 16px;
  --r-lg: 20px;
  --ease: cubic-bezier(.25, .1, .25, 1);
  --font: 'Albert Sans', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;

  /* 兼容别名（旧组件引用） */
  --bg: var(--paper);
  --card: var(--bone);
  --text: var(--ink);
  --text-2: var(--ink-mute);
  --text-3: var(--ink-faint);
  --accent: var(--acid-deep);
  --accent-hover: #1E7E00;
  --border: var(--line);
  --radius: 14px;
  --radius-lg: var(--r-lg);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }
a { color: inherit; }
img { display: block; }
.num, .car-specs, .spec, .selection-specs strong, .quota, .gen-timer strong, .history-item-meta small {
  font-feature-settings: 'tnum'; font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }

/* ---------- 微标签：签名元素 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-faint);
}
.tag .dot { width: 7px; height: 7px; border-radius: 2px; background: var(--acid); display: inline-block; }
.tag em { font-style: normal; color: var(--acid-deep); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 500; letter-spacing: -.005em;
  border-radius: 999px; padding: 12px 22px;
  border: 1px solid transparent; white-space: nowrap;
  transition: transform .18s var(--ease), background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-primary { background: var(--ink); color: #fff; box-shadow: var(--shadow-btn); }
.btn-primary:hover { transform: translateY(-1px); background: var(--ink-soft); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:active { transform: scale(0.98); }
.btn-ghost:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; }

/* Global focus styles for keyboard navigation */
a:focus-visible {
  outline: 2px solid var(--acid-deep);
  outline-offset: 2px;
  border-radius: 4px;
}
.generating-banner { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; width: min(560px, calc(100vw - 32px)); max-width: min(560px, calc(100vw - 32px)); box-sizing: border-box; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; color: #f7f8fa; background: rgba(23,25,29,0.92); box-shadow: var(--shadow-lg); font-size: 13px; line-height: 1.5; }
.generating-banner #generating-banner-text { min-width: 0; flex: 1 1 auto; }
.generating-banner.generating-done { background: rgba(31,138,61,0.94); }
.generating-banner.generating-clickable { cursor: pointer; }
.generating-banner.generating-clickable:hover { background: rgba(23,25,29,0.98); }
.generating-banner.generating-clickable.generating-done:hover { background: rgba(31,138,61,1); }
.generating-banner button { display: inline-grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; margin: -10px -10px -10px 0; padding: 0; color: #f7f8fa; font-size: 18px; line-height: 1; border-radius: 8px; cursor: pointer; }
.generating-banner button:hover { background: rgba(255,255,255,0.15); }
.btn-ghost:hover { background: rgba(31, 31, 28, .04); border-color: var(--line-hover); transform: translateY(-1px); }
.btn-sm { padding: 8px 16px; font-size: 12.5px; }
.btn-lg { padding: 15px 30px; font-size: 15.5px; }
.btn:disabled { opacity: .5; pointer-events: none; }

.btn-spinner {
  width: 15px; height: 15px; border-radius: 50%; display: none;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.btn.loading .btn-spinner { display: inline-block; }
.btn.loading .btn-label { opacity: .8; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 会员活动条 ---------- */
.campaign {
  position: fixed; top: 0; left: 0; right: 0; z-index: 101; height: 36px;
  display: flex; align-items: center; justify-content: center; padding: 0 20px;
  background: var(--acid-tint); border-bottom: 1px solid color-mix(in srgb, #63FE13 30%, #FFF);
  text-align: center; overflow: hidden; white-space: nowrap;
}
.campaign a { font-size: 12.5px; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.campaign strong { font-weight: 700; }
.campaign .go { padding: 4px 10px; border-radius: 6px; background: var(--acid); color: var(--acid-ink); font-weight: 700; line-height: 1; }

/* 香肘会员：隐藏开通会员活动条（导航与内容自动上移） */
body.no-campaign .campaign { display: none; }
body.no-campaign .nav { top: 0; }
body.no-campaign main { padding-top: 58px; }

/* ---------- 顶部导航 ---------- */
.nav {
  position: fixed; top: 36px; left: 0; right: 0; z-index: 100;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; height: 58px;
  display: flex; align-items: center; gap: 26px; padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: block;
  transition: transform .18s var(--ease);
}
.brand-name { font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; }
.brand-name em { font-style: normal; font-weight: 500; color: var(--ink-faint); font-size: 12px; margin-left: 6px; letter-spacing: .04em; }
.nav-spacer { flex: 1; }
.nav-auth { display: flex; align-items: center; min-width: 0; gap: 10px; }
.nav-start { flex-shrink: 0; }

.steps { display: flex; gap: 20px; list-style: none; margin: 0 auto; }
.step {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-faint);
  padding: 5px 10px; border-radius: 999px;
  transition: all .4s var(--ease); background: transparent;
}
.step i {
  font-style: normal; font-size: 10px; font-weight: 800;
}
.step.active { color: var(--ink); }
.step.active i { color: var(--acid-deep); }
.step.done { color: var(--ink-mute); }
.step.done i { color: var(--acid-deep); }

/* 手机步骤指示 */
.m-step-indicator { display: none; flex-direction: column; align-items: center; gap: 4px; margin: 0 auto; }
.m-step-indicator .lab { font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.m-prog { display: flex; gap: 3px; }
.m-prog i { width: 15px; height: 3px; border-radius: 2px; background: var(--line); }
.m-prog i.on { background: var(--acid); }
.m-prog i.done { background: var(--ink); }

/* 导航：账号区 */
.nav-user { position: relative; display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.member-badge { display: inline-flex; flex: none; align-items: center; max-width: 100%; padding: 3px 10px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.badge-normal { border: 1px solid var(--line); color: var(--ink-mute); }
.badge-xiangzhou { background: var(--acid); color: var(--acid-ink); }
.nav-quota { font-size: 12px; color: var(--ink-mute); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.nav-user-btn { display: inline-flex; flex: 0 1 260px; align-items: center; min-width: 0; max-width: 260px; gap: 7px; border: 1px solid var(--line); font-size: 13px; color: var(--ink); font-weight: 600; padding: 4px 9px 4px 4px; border-radius: 999px; background: var(--bone); overflow: hidden; }
.nav-user-identity { display: inline-flex; flex: 1 1 auto; align-items: center; min-width: 0; gap: 7px; overflow: hidden; }
.nav-user-name { display: block; flex: 1 1 auto; min-width: 0; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-chevron { flex: none; color: var(--ink-faint); font-size: 14px; line-height: 1; }
.nav-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 150px; padding: 6px;
  border-radius: 14px; background: var(--bone); border: 1px solid var(--line); box-shadow: var(--shadow);
  display: flex; flex-direction: column; z-index: 50;
}
.nav-menu a, .nav-menu button { display: block; padding: 9px 12px; font-size: 13px; color: var(--ink); text-decoration: none; text-align: left; border-radius: 9px; }
.nav-menu a:hover, .nav-menu button:hover { background: var(--paper); }

/* 配额 10 段 */
.quota-seg { display: inline-flex; align-items: center; gap: 3px; }
.quota-seg i { width: 5px; height: 14px; border-radius: 2px; background: var(--line-soft); }
.quota-seg i.on { background: var(--acid); }
.quota-seg.sm i { width: 4px; height: 10px; }

/* 第二步配额条 */
.quota-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--paper-warm); border: 1px solid var(--line); }
.quota-bar-label { font-size: 12.5px; color: var(--ink-mute); font-weight: 600; white-space: nowrap; }
.quota-bar-tip { font-size: 12.5px; color: var(--ink-faint); }
.quota-bar-track { flex: 1; height: 6px; border-radius: 3px; background: var(--line-soft); overflow: hidden; }
.quota-bar-track i { display: block; height: 100%; border-radius: 3px; background: var(--acid); transition: width .4s var(--ease); }

/* 弹窗 */
.quota-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; background: rgba(31,31,28,.45); backdrop-filter: blur(4px); }
.quota-modal-card { width: min(360px, calc(100vw - 48px)); padding: 28px 26px; border-radius: var(--r-lg); background: var(--bone); text-align: center; box-shadow: 0 40px 80px -40px rgba(31,31,28,.4); border: 1px solid var(--line); }
.quota-modal-card h3 { font-size: 17px; margin-bottom: 10px; }
.quota-modal-card p { font-size: 13.5px; color: var(--ink-mute); line-height: 1.6; margin-bottom: 20px; }
.quota-modal-actions { display: flex; flex-direction: column; gap: 10px; }
.quota-modal-actions .btn { width: 100%; justify-content: center; }

/* ---------- 页面切换 ---------- */
main { padding-top: 94px; min-height: 100vh; }
.page { display: none; max-width: 1200px; margin: 0 auto; padding: 44px 24px 96px; }
.page.active { display: block; animation: pageIn .5s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Hero ---------- */
.hero { text-align: center; margin: 26px 0 44px; }
.hero h1 {
  font-size: clamp(36px, 5vw, 58px); font-weight: 700;
  letter-spacing: -.03em; line-height: 1.1;
}
.hero h1 mark {
  background: var(--acid); color: var(--acid-ink);
  padding: 2px 16px 6px; border-radius: 10px;
  display: inline-block; transform: rotate(-1.2deg);
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.hero p { margin-top: 16px; font-size: 17.5px; color: var(--ink-mute); max-width: 600px; margin-left: auto; margin-right: auto; }

/* 首页工作台头部优化 - 电脑版 */
@media (min-width: 769px) {
  .home-workbench-head {
    margin: 40px auto 48px;
    max-width: 920px;
  }
  .home-workbench-head h1 {
    font-size: 54px;
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1.12;
  }
  .home-workbench-head h1 mark {
    padding: 4px 18px 7px;
    border-radius: 13px;
  }
  .home-workbench-head p {
    margin-top: 16px;
    font-size: 18px;
    max-width: 720px;
    line-height: 1.6;
  }
}
.hero .cta-row { margin-top: 28px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.home-actions {
  width: min(720px, 100%); margin: 28px auto 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px;
}
.home-actions.history-enabled { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-action {
  min-width: 0; min-height: 86px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 22px; align-items: center; gap: 13px;
  padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--bone); color: var(--ink); text-align: left;
  transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.home-action:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: var(--shadow); }
.home-action:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; }
.home-action-new { background: var(--ink); color: #fff; border-color: var(--ink); }
.home-action-new:hover { background: #292925; }
.home-action-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 6px; background: var(--acid); color: var(--acid-ink); }
.home-action-icon svg { width: 22px; height: 22px; }
.home-action-history .home-action-icon { background: #DFF7FF; color: #00677E; }
.home-action-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.home-action-copy strong { font-size: 18px; font-weight: 700; letter-spacing: 0; }
.home-action-copy small { color: currentColor; opacity: .62; font-size: 11.5px; line-height: 1.35; }
.home-action-copy small b { font-size: 13px; opacity: 1; }
.home-action-arrow { width: 20px; height: 20px; opacity: .65; }
.hero-catalog-link { margin-top: 13px; padding: 6px 10px; color: var(--ink-mute); font-size: 12px; font-weight: 600; }
.hero-catalog-link:hover { color: var(--acid-deep); }
.hero-stats { margin-top: 44px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; }
.hero-stat { flex: 1; padding: 20px 14px; }
.hero-stat + .hero-stat { border-left: 1px solid var(--line-soft); }
.hero-stat b { display: block; font-size: 21px; font-weight: 700; letter-spacing: -.01em; font-feature-settings: 'tnum'; }
.hero-stat span { display: block; margin-top: 3px; font-size: 10px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.grad-text { color: var(--acid-deep); }

/* ---------- 卡片 ---------- */
.card { background: var(--bone); border-radius: var(--r-lg); border: 1px solid var(--line); }

/* ---------- 车型选择工作区 ---------- */
.vehicle-hero { margin: 18px 0 30px; }
.vehicle-hero h1 { font-size: clamp(34px, 4vw, 48px); }
.vehicle-hero p { max-width: 700px; margin: 12px auto 0; font-size: 16.5px; }

.vehicle-layout { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 22px; align-items: start; }
.vehicle-catalog { min-width: 0; }
.catalog-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; min-height: 44px; }
.car-search {
  flex: 1 1 240px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line); padding-bottom: 9px;
  color: var(--ink-faint); transition: border-color .18s var(--ease);
}
.car-search:focus-within { border-bottom-color: var(--ink); }
.car-search svg { width: 17px; height: 17px; flex: none; }
.car-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14.5px; }
.car-search input::placeholder { color: var(--ink-faint); }

.filter-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--ink-soft); font-size: 12.5px; font-weight: 500;
  transition: all .18s var(--ease); background: transparent;
}
.filter-btn:hover { background: var(--acid-tint); border-color: var(--acid); color: var(--acid-deep); }
.filter-btn.active { background: var(--acid); border-color: var(--acid); color: var(--acid-ink); font-weight: 700; }
.car-count { margin-left: auto; color: var(--ink-faint); font-size: 12px; white-space: nowrap; font-feature-settings: 'tnum'; }

.sel-hint {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-soft); background: var(--acid-tint);
  border: 1px solid color-mix(in srgb, #63FE13 40%, #FFF);
  padding: 6px 13px; border-radius: 999px; white-space: nowrap; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
}
.sel-hint i { width: 6px; height: 6px; border-radius: 50%; background: var(--acid); flex: none; }
.sel-hint.flash { animation: hintFlash .9s var(--ease); }
@keyframes hintFlash { 0%, 100% { box-shadow: none; } 30% { box-shadow: 0 0 0 6px var(--acid-tint); } }

.car-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.car-card {
  min-width: 0; background: var(--bone); border-radius: var(--r-card); padding: 11px 11px 15px;
  border: 1px solid var(--line); text-align: left;
  position: relative; overflow: hidden;
  transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.car-card:hover { transform: translateY(-2px); border-color: var(--line-hover); box-shadow: var(--shadow); }
.car-card:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; }
.car-card.selected { border: 1.5px solid var(--acid); }
.car-card.saved-car { order: -1; border-color: color-mix(in srgb, var(--acid) 46%, var(--line)); }
.car-card.saved-car .card-topline span:first-child::before { content: '我的车型 / '; color: var(--acid-deep); }
.car-card.saved-car .car-sub { color: var(--acid-deep); }
.car-card .car-sil {
  height: 108px; display: grid; place-items: center; margin-bottom: 11px;
  background: var(--paper-dark); border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line-soft);
}
.car-card .car-sil svg { width: 82%; height: auto; }
.car-card .car-sil.car-photo { height: 108px; }
.card-topline { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--ink-faint); font-size: 9.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.car-card h3 { margin-top: 5px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.car-card .car-sub { margin-top: 1px; font-size: 12px; color: var(--ink-faint); }
.car-card .car-specs { display: flex; gap: 6px; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.car-card .spec { font-size: 11px; font-weight: 600; color: var(--ink-mute); background: transparent; border: 1px solid var(--line-soft); border-radius: 999px; padding: 3px 9px; font-feature-settings: 'tnum'; }
.car-card .check {
  position: absolute; z-index: 3; top: 16px; right: 16px; width: 22px; height: 22px;
  border-radius: 50%; background: var(--acid); color: var(--acid-ink); border: 1.5px solid rgba(255,255,255,.9);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 800;
  opacity: 0; transform: scale(.55);
  transition: all .25s var(--ease); box-shadow: 0 4px 12px -4px rgba(33,140,0,.5);
}
.car-card.selected .check { opacity: 1; transform: scale(1); }

/* 年份切换（多年款车型卡内） */
.year-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.year-switch .yr { padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 600; color: var(--ink-faint); cursor: pointer; transition: all .18s var(--ease); letter-spacing: 0; text-transform: none; }
.year-switch .yr.active { background: var(--acid); color: var(--acid-ink); }

.catalog-empty { padding: 72px 24px; text-align: center; background: var(--bone); border: 1px dashed var(--line-hover); border-radius: var(--r-card); }
.catalog-empty b, .catalog-empty span { display: block; }
.catalog-empty b { font-size: 17px; }
.catalog-empty span { margin-top: 5px; color: var(--ink-faint); font-size: 13px; }

/* 右侧选中面板 */
.selection-panel { position: sticky; top: 80px; min-height: 548px; padding: 20px; overflow: hidden; }
.selection-empty { min-height: 506px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.selection-empty-icon {
  width: 64px; height: 64px; display: grid; place-items: center; margin-bottom: 18px;
  border-radius: 18px; color: var(--acid-deep); background: var(--acid-tint); border: 1px solid color-mix(in srgb, #63FE13 30%, #FFF);
}
.selection-empty h2 { font-size: 20px; }
.selection-empty p { max-width: 270px; margin-top: 8px; color: var(--ink-mute); font-size: 13px; }
.selection-empty ul { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 22px; list-style: none; }
.selection-empty li { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 12px; color: var(--ink-faint); background: var(--paper-warm); border: 1px solid var(--line-soft); font-size: 10.5px; }
.selection-empty li i { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--paper-dark); color: var(--ink-mute); font-style: normal; font-size: 10px; font-weight: 700; }

.selection-visual { height: 178px; display: grid; place-items: center; border-radius: 14px; overflow: hidden; background: var(--paper-dark); border: 1px solid var(--line-soft); }
.selection-visual svg { width: 84%; }
.selection-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 16px; }
.selection-label { display: block; color: var(--acid-deep); font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.selection-heading h2 { margin-top: 3px; font-size: 22px; letter-spacing: -.02em; }
.selection-heading p { margin-top: 2px; color: var(--ink-faint); font-size: 12.5px; }
.selection-status { flex-shrink: 0; padding: 4px 9px; border-radius: 999px; color: var(--acid-deep); background: var(--acid-tint); border: 1px solid color-mix(in srgb, #63FE13 30%, #FFF); font-size: 10px; font-weight: 700; }
.selection-status.online, .selection-status.manual { color: var(--ink-mute); background: var(--paper-warm); border-color: var(--line); }
.selection-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.selection-specs div { padding: 10px 11px; border-radius: 12px; background: var(--paper-warm); border: 1px solid var(--line-soft); }
.selection-specs span, .selection-specs strong { display: block; }
.selection-specs span { color: var(--ink-faint); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.selection-specs strong { margin-top: 3px; font-size: 11.5px; line-height: 1.35; }
.year-selector { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--paper-warm); border: 1px solid var(--line-soft); }
.year-selector-label { display: block; margin-bottom: 8px; color: var(--ink-mute); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.year-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.year-option { min-height: 36px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: var(--bone); font-size: 12.5px; font-weight: 600; transition: all .18s var(--ease); }
.year-option:hover { border-color: var(--acid); color: var(--acid-deep); background: var(--acid-tint); }
.year-option.active { background: var(--acid); border-color: var(--acid); color: var(--acid-ink); }
.selection-note { margin-top: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink-mute); background: var(--paper-warm); border: 1px solid var(--line-soft); font-size: 11px; line-height: 1.5; }
.selection-actions { display: grid; gap: 8px; margin-top: 14px; }
.selection-actions .btn-primary { width: 100%; }
.selection-history { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.selection-history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.selection-history-head h3 { font-size: 13px; font-weight: 700; }
.selection-history-head span { font-size: 11px; color: var(--ink-faint); font-feature-settings: 'tnum'; }
.selection-history-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.selection-history-item { display: flex; flex-direction: column; gap: 5px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-align: left; transition: border-color .18s var(--ease), box-shadow .18s var(--ease); }
.selection-history-item:hover { border-color: var(--acid); box-shadow: var(--shadow); }
.selection-history-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--paper-dark); }
.selection-history-item-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.selection-history-item-meta strong { font-size: 11px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selection-history-item-meta small { font-size: 9.5px; color: var(--ink-faint); }
.selection-history-item-meta .history-item-badge { align-self: flex-start; padding: 1px 4px; color: var(--acid-ink); background: var(--acid); font-size: 8px; font-weight: 700; line-height: 1.15; }

/* ---------- 自定义车型 ---------- */
.custom-car { margin-top: 22px; padding: 26px; display: grid; grid-template-columns: 300px 1fr; gap: 22px 28px; align-items: center; }
.section-kicker { display: block; margin-bottom: 5px; color: var(--acid-deep); font-size: 10px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.custom-car-head h3 { font-size: 20px; font-weight: 700; letter-spacing: -.015em; }
.custom-car-head p { color: var(--ink-mute); font-size: 13px; margin-top: 6px; }
.custom-car-form { display: grid; grid-template-columns: 1fr 1.2fr .8fr auto; gap: 9px; }
.custom-car-form input,
.manual-car-form input,
.manual-car-form select {
  min-width: 0; width: 100%; padding: 11px 13px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper-warm);
  color: var(--ink); outline: none; transition: border-color .18s var(--ease);
}
.custom-car-form input:focus,
.manual-car-form input:focus,
.manual-car-form select:focus { border-color: var(--ink); }
.cc-result {
  grid-column: 1 / -1; padding: 16px; background: var(--paper-warm);
  border: 1px solid var(--line); border-radius: 14px;
  display: flex; align-items: center; gap: 16px; animation: pageIn .45s var(--ease) both;
}
.cc-result-visual { width: 132px; height: 84px; flex-shrink: 0; display: grid; place-items: center; border-radius: 12px; overflow: hidden; background: var(--paper-dark); border: 1px solid var(--line-soft); }
.cc-result-visual svg { width: 86%; }
.cc-result .cc-info { min-width: 0; flex: 1; font-size: 13px; color: var(--ink); }
.cc-result .cc-info b, .cc-manual-copy b { display: block; font-size: 15px; }
.cc-result .cc-info span, .cc-manual-copy span { color: var(--ink-mute); display: block; margin-top: 3px; font-size: 12px; }
.cc-image-status { color: var(--acid-deep) !important; }
.cc-image-status.failed { color: #a33a2b !important; }
.cc-year-note { color: #8a5a00 !important; }
.cc-source { font-size: 11px !important; color: var(--ink-faint) !important; }
.cc-manual-copy { min-width: 210px; max-width: 280px; }
.manual-car-form { flex: 1; display: grid; grid-template-columns: 1.1fr repeat(4, minmax(92px, 1fr)) auto; gap: 8px; align-items: end; }
.manual-car-form label span { display: block; margin: 0 0 4px 2px; color: var(--ink-faint); font-size: 10px; font-weight: 600; }

/* ---------- 设计页 ---------- */
.design-layout { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; }
.selected-car { padding: 20px; position: sticky; top: 80px; }
.selected-car .car-sil {
  height: 108px; display: grid; place-items: center;
  background: var(--paper-dark); border-radius: 12px; margin-bottom: 15px;
  overflow: hidden; border: 1px solid var(--line-soft);
}
.selected-car .car-sil svg { width: 85%; }
.selected-car h3 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.selected-car p { font-size: 12.5px; color: var(--ink-faint); margin-top: 3px; }
.selected-car .car-specs { display: flex; gap: 6px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.selected-car .spec { font-size: 11px; font-weight: 600; color: var(--ink-mute); background: transparent; border: 1px solid var(--line-soft); border-radius: 999px; padding: 3px 9px; }

.design-card { padding: 28px; }
.prompt-builder { display: grid; gap: 20px; }
.generation-source { display: inline-flex; align-items: center; gap: 6px; margin-top: 9px; color: var(--ink-faint); font-size: 11px; font-weight: 600; }
.generation-source::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--line-hover); }
.generation-source.cloud { color: var(--acid-deep); }
.generation-source.cloud::before { background: var(--acid); }
.generation-source.local { color: var(--ink-mute); }
.generation-source.local::before { background: var(--ink-mute); }

/* ---------- 生成页（墨色黑章） ---------- */
#page-generating { max-width: none; padding: 0; background: var(--ink); color: #fff; min-height: 100vh; display: none; }
#page-generating.active { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; overflow-y: auto; animation: generatingIn .5s var(--ease) both; }
@keyframes generatingIn { from { opacity: 0; } to { opacity: 1; } }
body[data-step="2"] .nav, body[data-step="2"] .campaign, body[data-step="2"] .site-footer { display: none; }
body[data-step="2"] main { padding-top: 0; }
.generating-wrap { width: 100%; max-width: 560px; margin: 0 auto; text-align: center; padding: 72px 24px; }
.gen-context { margin: -4px auto 26px; color: rgba(255,255,255,.48); font-size: 12px; letter-spacing: .04em; }
.gen-orb {
  width: 88px; height: 88px; margin: 0 auto 30px; border-radius: 50%;
  background: transparent; padding: 3px; border: 1px solid rgba(255,255,255,.18);
  position: relative; overflow: hidden;
}
.gen-orb::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 40%, var(--acid) 40% 60%, transparent 60% 100%);
  animation: orbSpin 1.6s linear infinite;
}
.gen-orb-core { position: absolute; inset: 6px; border-radius: 50%; background: var(--ink); }
@keyframes orbSpin { to { transform: rotate(360deg); } }
.generating-wrap h2 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.generating-wrap .tag { color: var(--acid); margin-bottom: 16px; }
.gen-steps { list-style: none; margin: 30px auto 0; max-width: 420px; text-align: left; }
.gen-steps li {
  font-size: 13.5px; color: rgba(255,255,255,.38); padding: 8px 0;
  display: flex; align-items: center; gap: 12px; font-feature-settings: 'tnum';
}
.gen-steps li::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 1px solid rgba(255,255,255,.25); background: transparent; transition: all .3s var(--ease);
}
.gen-steps li.active { color: #fff; font-weight: 600; }
.gen-steps li.active::before { border-color: var(--acid); background: radial-gradient(circle, var(--acid) 0 40%, transparent 42%); animation: pulse 1.1s ease infinite; }
.gen-steps li.done { color: rgba(255,255,255,.8); }
.gen-steps li.done::before { border-color: var(--acid); background: var(--acid); }
@keyframes pulse { 50% { opacity: .45; } }
.progress { height: 6px; border-radius: 3px; background: rgba(255,255,255,.14); overflow: hidden; margin-top: 26px; }
.progress-bar { height: 100%; width: 0%; border-radius: 3px; background: var(--acid); transition: width .5s var(--ease); }
.gen-timer {
  margin-top: 20px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13px; color: rgba(255,255,255,.55);
}
.gen-timer strong { font-weight: 600; color: #fff; min-width: 52px; text-align: left; }
.gen-timer-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--acid); animation: genPulse 1.2s ease infinite; }
@keyframes genPulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 254, 19, .45); }
  70% { box-shadow: 0 0 0 9px rgba(99, 254, 19, 0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 254, 19, 0); }
}
.gen-wait-hint { margin: 14px auto 0; max-width: 420px; text-align: center; font-size: 12.5px; color: rgba(255,255,255,.42); line-height: 1.6; }
.gen-home-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; margin: 22px auto 0; padding: 10px 16px; border: 1px solid rgba(255,255,255,.22); border-radius: 6px; color: rgba(255,255,255,.86); background: rgba(255,255,255,.05); font: inherit; font-size: 12.5px; cursor: pointer; transition: border-color .18s var(--ease), background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease); }
.gen-home-btn svg { width: 16px; height: 16px; flex: none; }
.gen-home-btn:hover { border-color: var(--acid); color: var(--acid); background: rgba(99,254,19,.08); transform: translateY(-1px); }
.gen-home-btn:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
[data-flow="modify"] .gen-orb::before { background: conic-gradient(from 0deg, transparent 0 32%, #8ad7ff 32% 58%, transparent 58% 100%); }
[data-flow="redesign"] .gen-orb::before { background: conic-gradient(from 0deg, transparent 0 32%, #ffcb66 32% 58%, transparent 58% 100%); }
[data-flow="engineering"] .gen-orb::before { background: conic-gradient(from 0deg, transparent 0 32%, #c6a6ff 32% 58%, transparent 58% 100%); }

/* ---------- 方案板工作台 ---------- */
#page-studio { max-width: 1500px; padding-top: 20px; }
.studio-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 20px; align-items: start; }
.scheme-board {
  min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg);
  color: #F7F8FA; background: var(--ink); box-shadow: 0 18px 60px rgba(31,31,28,.2);
}
.board-head { min-height: 82px; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 8px 10px 16px; }
.board-head h2 { font-size: clamp(22px, 2.4vw, 32px); line-height: 1.15; letter-spacing: 0; }
.board-head p { margin-top: 5px; color: rgba(255,255,255,.45); font-size: 12px; }
.board-palette { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.board-palette > span { color: rgba(255,255,255,.72); font-size: 11px; font-weight: 700; }
.board-swatches { display: flex; gap: 4px; }
.board-swatches i { width: 23px; height: 23px; border: 2px solid rgba(255,255,255,.24); border-radius: 3px; }
.board-summary {
  display: grid; grid-template-columns: 146px minmax(210px, 1fr) minmax(210px, auto); gap: 14px; align-items: stretch;
  margin-bottom: 8px; padding: 10px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); border-radius: 12px;
}
.board-reference { position: relative; min-height: 92px; overflow: hidden; background: #30343A; border-radius: 8px; }
.board-reference img { width: 100%; height: 100%; min-height: 92px; object-fit: cover; display: block; filter: saturate(.88) contrast(1.03); }
.board-reference span { position: absolute; left: 7px; bottom: 7px; padding: 3px 6px; color: var(--acid-ink); background: var(--acid); font-size: 9px; font-weight: 800; border-radius: 4px; }
.board-summary-copy { min-width: 0; align-self: center; }
.board-type { display: inline-block; padding: 3px 7px; color: var(--acid-ink); background: var(--acid); font-size: 9px; font-weight: 800; border-radius: 4px; }
.board-summary-copy strong { display: block; margin-top: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.board-summary-copy p { margin-top: 4px; color: rgba(255,255,255,.45); font-size: 10.5px; }
.board-spec-list { display: grid; gap: 6px; align-content: center; padding-left: 14px; border-left: 1px solid rgba(255,255,255,.1); }
.board-spec-list span { color: rgba(255,255,255,.62); font-size: 10.5px; line-height: 1.5; }
.sheet-view { margin-top: 10px; }
.sheet-zoom { position: relative; display: block; width: 100%; cursor: zoom-in; border-radius: 10px; overflow: hidden; }
#sheet-canvas { width: 100%; display: block; border: 1px solid rgba(255,255,255,.1); background: #fff; }
.sheet-hint { position: absolute; z-index: 2; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 4px 10px; color: #F7F8FA; background: rgba(18,21,26,.72); font-size: 10px; font-weight: 600; border-radius: 999px; pointer-events: none; }
.board-error {
  margin-top: 10px; display: flex; align-items: flex-start; gap: 14px;
  padding: 22px 20px; border: 1px solid rgba(255,93,80,.34); border-radius: 12px;
  background: rgba(255,93,80,.07);
}
.board-error-icon {
  flex-shrink: 0; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  color: #FF5D50; border: 1.5px solid rgba(255,93,80,.62); border-radius: 999px;
  font-size: 17px; font-weight: 800; line-height: 1;
}
.board-error-copy { min-width: 0; }
.board-error h3 { font-size: 16px; }
.board-error p { margin-top: 6px; color: rgba(255,255,255,.62); font-size: 11.5px; line-height: 1.7; word-break: break-word; }
.mv-ai-tag { position: absolute; z-index: 2; top: 7px; right: 7px; padding: 4px 7px; color: var(--acid-ink); background: var(--acid); font-size: 9px; font-weight: 800; letter-spacing: .05em; border-radius: 4px; }
.board-photo-note { margin-top: 6px; color: rgba(255,255,255,.42); font-size: 10.5px; }
.board-foot { display: flex; align-items: center; gap: 10px; padding: 12px 4px 0; }
.board-foot span { flex-shrink: 0; padding: 3px 7px; color: var(--acid-ink); background: var(--acid); font-size: 9px; font-weight: 800; border-radius: 4px; }
.board-foot p { color: rgba(255,255,255,.45); font-size: 9.5px; line-height: 1.5; }

.angle-dialog {
  width: fit-content; max-width: 82vw; padding: 14px 16px 16px; margin: auto;
  border: 1px solid rgba(255,255,255,.13); border-radius: 14px;
  color: #F7F8FA; background: var(--ink); box-shadow: 0 30px 100px rgba(0,0,0,.55);
}
.angle-dialog::backdrop { background: rgba(31,31,28,.68); backdrop-filter: blur(3px); }
.angle-dialog-head { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 0 4px 10px; }
.angle-dialog-head span { color: rgba(255,255,255,.45); font-size: 10px; }
.angle-dialog-head h3 { font-size: 20px; }
.angle-close { width: 36px; height: 36px; color: #F4F5F7; font-size: 26px; line-height: 1; }
.angle-dialog-body { display: flex; justify-content: center; }
#angle-focus-canvas { display: block; max-width: 100%; background: #fff; border-radius: 4px; }
.angle-dialog-foot { display: flex; justify-content: center; align-items: center; gap: 12px; padding-top: 14px; }
.angle-dialog-foot .btn { border: 0; }
.angle-download-btn { text-decoration: none; }
.angle-close-btn { min-width: 128px; }
/* 深色弹窗内：下载用浅底深字（墨色主按钮在墨色底上看不见），关闭用浅色描边。 */
.angle-dialog-foot .angle-download-btn { min-width: 128px; background: #F1F3EA; color: #16190F; box-shadow: none; }
.angle-dialog-foot .angle-download-btn:hover { background: #FFFFFF; color: #16190F; }
.angle-dialog-foot .btn-ghost { color: #f7f8fa; border: 1px solid rgba(255,255,255,0.45); }
.angle-dialog-foot .btn-ghost:hover { color: #ffffff; background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.8); }

.chat { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--bone); box-shadow: 0 14px 32px -28px rgba(31,31,28,.55); align-self: start; container-type: inline-size; }
.studio-prompt-form { padding: 10px 22px 22px; display: flex; flex-direction: column; gap: 0; }
.studio-field { display: flex; flex-direction: column; gap: 6px; font-size: 10px; color: var(--ink-faint); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.studio-field { padding: 12px 0 10px; border-bottom: 1px solid var(--line-soft); }
.studio-field input {
  width: 100%; padding: 9px 2px 10px; font-size: 14px;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink);
  outline: none; transition: border-color .18s var(--ease); letter-spacing: normal; text-transform: none; font-weight: 400;
}
.studio-field input::placeholder { color: var(--ink-faint); }
.studio-field input:focus { border-bottom-color: var(--ink); }
.studio-field textarea {
  width: 100%; padding: 9px 2px 10px; font-size: 14px; font-family: inherit;
  border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink);
  outline: none; resize: vertical; line-height: 1.6; min-height: 68px;
  transition: border-color .18s var(--ease); letter-spacing: normal; text-transform: none; font-weight: 400;
}
.studio-field textarea::placeholder { color: var(--ink-faint); }
.studio-field textarea:focus { border-bottom-color: var(--ink); }
.studio-generation-note { min-height: 18px; margin: 13px 0 2px; font-size: 11.5px; color: var(--ink-faint); line-height: 1.5; }
#studio-regenerate-btn { width: 100%; margin-top: 10px; color: var(--ink); background: transparent; border-color: var(--line-hover); }
#studio-regenerate-btn:hover { background: var(--paper-dark); }
#studio-modify-btn { width: 100%; margin: 14px 0 0; color: var(--acid-ink); background: var(--acid); border-color: var(--acid); }
#studio-modify-btn:hover { background: #b8ed00; border-color: #b8ed00; }
.modify-dialog { position: fixed; inset: 0; margin: auto; width: min(560px, calc(100vw - 24px)); height: fit-content; max-height: calc(100vh - 24px); border: 1px solid var(--line); border-radius: 16px; padding: 0; overflow: hidden; color: var(--ink); background: var(--bone); box-shadow: 0 40px 100px rgba(31,31,28,.32); }
.modify-dialog[open] { display: flex; flex-direction: column; }
.modify-dialog::backdrop { background: rgba(31,31,28,.68); backdrop-filter: blur(3px); }
.modify-dialog-shell { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; gap: 14px; padding: 22px 24px 24px; overflow-y: auto; overscroll-behavior: contain; }
.modify-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-right: -8px; }
.modify-dialog-head h2 { font-size: 22px; line-height: 1.3; }
.modify-source-preview { display: block; width: 100%; max-height: 240px; object-fit: contain; border-radius: 10px; background: var(--paper-dark); }
.modify-hint { margin: 0; color: var(--ink-mute); font-size: 13px; line-height: 1.65; }
.modify-field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; }
.modify-instruction { min-height: 120px; resize: vertical; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bone); color: var(--ink); font: inherit; font-size: 15px; font-weight: 400; line-height: 1.6; }
.modify-instruction::placeholder { color: var(--ink-faint); }
.modify-instruction:hover { border-color: var(--line-hover); }
.modify-instruction:focus-visible { outline: none; border-color: var(--acid-deep); box-shadow: 0 0 0 3px rgba(99, 254, 19, .18); }
.modify-error { margin: 0; color: #B42318; font-size: 13px; }
.modify-actions { display: flex; justify-content: flex-end; gap: 10px; }
.studio-history { padding: 0 22px 18px; border-top: 1px solid var(--line); }
.studio-history-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; }
.studio-history-head h4 { font-size: 13px; font-weight: 700; }
.studio-history-head span { font-size: 10.5px; color: var(--ink-faint); font-feature-settings: 'tnum'; }
.studio-history-empty { font-size: 11.5px; color: var(--ink-faint); line-height: 1.6; padding: 4px 0 10px; }
.studio-history-empty a { color: var(--acid-deep); font-weight: 600; }
.studio-history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item { display: flex; align-items: center; gap: 10px; padding: 7px; border: 1px solid var(--line); border-radius: 12px; background: var(--bone); text-align: left; transition: border-color .18s var(--ease), box-shadow .18s var(--ease); }
.history-item:hover { border-color: var(--acid); box-shadow: var(--shadow); }
.history-item img { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--paper-dark); }
.history-item-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.history-item-meta strong { font-size: 12px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item-meta small { font-size: 10px; color: var(--ink-faint); }
.history-item-meta .history-item-badge { align-self: flex-start; margin-top: 1px; padding: 2px 5px; color: var(--acid-ink); background: var(--acid); font-size: 9px; font-weight: 700; line-height: 1.15; }
.chat-head { padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.chat-head h3 { font-size: 17px; font-weight: 700; }
.chat-head p { font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }
.restart { margin: 0 18px 16px; font-size: 13px; }

/* ---------- 用户历史设计中心 ---------- */
body.history-mode .steps,
body.history-mode .m-step-indicator,
body.history-mode .nav-start,
body.history-mode .mobile-dock { display: none !important; }
body.history-mode { padding-bottom: 0; }
.history-page { max-width: 1120px; }
.history-page-head { padding: 2px 0 8px; }
.history-back { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 28px; color: var(--ink-mute); font-size: 13px; font-weight: 600; }
.history-back:hover { color: var(--acid-deep); }
.history-back svg { width: 17px; height: 17px; }
/* 标题独占一行宽度；份数与名额收成一行说明文字，不再做成挤在标题旁的小方框。 */
.history-title-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 32px; }
.history-title-copy { min-width: 0; flex: 1 1 360px; }
.history-title-row h1 { font-size: 38px; line-height: 1.12; letter-spacing: 0; }
.history-title-row p { margin-top: 10px; color: var(--ink-mute); font-size: 14px; line-height: 1.6; }
.history-meta { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: baseline; margin: 0 0 4px; color: var(--ink-mute); font-size: 13px; line-height: 1.5; font-feature-settings: 'tnum'; white-space: nowrap; }
.history-total { color: var(--ink-mute); font-size: 13px; }
.history-total b { color: var(--ink); font-size: 13px; font-weight: 700; font-feature-settings: 'tnum'; }
.history-meta .history-quota::before { content: "·"; margin: 0 8px; color: var(--ink-faint); font-weight: 400; }
.history-groups { display: flex; flex-direction: column; gap: 36px; padding-top: 30px; }
.history-group { min-width: 0; }
.history-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.history-group-head h2 { font-size: 20px; letter-spacing: 0; }
.history-group-head span { color: var(--ink-faint); font-size: 12px; font-feature-settings: 'tnum'; }
.history-card-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.history-card {
  display: flex; min-width: 0; flex-direction: column; overflow: hidden; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--bone); text-align: left;
  transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.history-card:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: var(--shadow); }
.history-card:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; }
.history-card-image { position: relative; display: block; flex: 0 0 auto; min-height: 0; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-dark); }
.history-card-image img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.history-card-engineering-sheet .history-card-image { aspect-ratio: 9 / 16; }
.history-card-engineering-sheet .history-card-image img { object-fit: contain; }
.history-card-image.is-generating { display: flex; align-items: center; justify-content: center; }
.history-card-placeholder { position: absolute; inset: 0; display: flex; width: 100%; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--ink-faint); font-size: 11px; }
.history-card-placeholder-icon { width: 22px; height: 22px; border: 2px solid var(--line); border-radius: 50%; background: transparent; }
.history-card-placeholder.is-generating .history-card-placeholder-icon { border-color: var(--line); border-top-color: var(--acid-deep); animation: spin .8s linear infinite; }
.history-card-year { position: absolute; left: 7px; bottom: 7px; padding: 3px 7px; border-radius: 4px; color: #fff; background: rgba(31,31,28,.82); font-size: 11px; font-weight: 600; line-height: 1.3; }
.history-card-copy { display: flex; min-width: 0; min-height: 86px; flex: 0 0 auto; flex-direction: column; justify-content: flex-start; gap: 1px; padding: 11px 12px 12px; }
.history-card-copy strong { display: block; overflow: hidden; color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.history-card-copy small { display: block; margin-top: 4px; color: var(--ink-faint); font-size: 12px; line-height: 1.4; font-feature-settings: 'tnum'; }
.history-card-copy .history-card-badge { align-self: flex-start; margin-top: 5px; padding: 2px 6px; border-radius: 4px; color: var(--acid-ink); background: var(--acid); font-size: 11px; font-weight: 600; line-height: 1.3; }
.history-card-copy .history-card-status { min-width: 0; margin-top: 3px; color: var(--acid-deep); line-height: 1.4; overflow-wrap: anywhere; }
.history-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-top: 22px; border-bottom: 1px solid var(--line-soft); }
.history-type-tabs { display: flex; gap: 8px; }
.history-type-tab { appearance: none; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-faint); cursor: pointer; min-height: 44px; padding: 10px 14px; font: inherit; font-size: 15px; font-weight: 600; }
.history-type-tab.is-active { color: var(--ink); border-bottom-color: var(--acid-deep); }
.history-type-tab b { margin-left: 4px; color: var(--ink-faint); font-size: .85em; font-weight: 600; }
.history-view-control { display: inline-flex; flex: none; align-items: center; gap: 9px; margin-left: auto; padding-bottom: 7px; }
.history-view-switch { display: inline-flex; flex: none; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper-dark); }
.history-view-tab {
  display: inline-flex; appearance: none; min-height: 36px; align-items: center; justify-content: center; gap: 6px; padding: 7px 14px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--ink-mute); cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap; touch-action: manipulation;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.history-view-tab svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.history-view-tab:hover { color: var(--ink); }
.history-view-tab:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; }
.history-view-tab:active { box-shadow: inset 0 0 0 999px rgba(31,31,28,.06); }
/* 选中段是浮起的白色块（深色外观下由 appearance.css 反转为浅底深字），不再用整块墨色压住页面。 */
.history-view-tab.is-active,
.history-view-tab[aria-pressed="true"] { border-color: var(--line); background: var(--bone); color: var(--ink); box-shadow: 0 1px 3px rgba(31,31,28,.12); }
.history-type-note { margin: 12px 0 0; color: var(--ink-faint); font-size: 13px; line-height: 1.6; }
.history-dialog-panel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 14px; }
.history-dialog-panel { display: flex; min-width: 0; flex-direction: column; gap: 6px; border: 1px solid var(--line-soft); padding: 8px; background: var(--paper); }
.history-dialog-panel img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--paper-dark); }
.history-dialog-panel small { color: var(--ink-faint); }
.history-dialog-panel-error { color: #B42318 !important; overflow-wrap: anywhere; }
.history-panel-retry { align-self: flex-start; margin-top: 2px; }
/* 重新生成确认弹层：原生 dialog 顶置层 + 视口居中。
   全局 * { margin: 0 } 会重置 dialog 的 UA margin:auto，这里必须显式恢复。 */
.engineering-regeneration-dialog {
  position: fixed;
  inset: 0;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bone);
  color: var(--ink);
  box-shadow: 0 40px 100px rgba(31, 31, 28, .32);
  overflow: hidden;
}
.engineering-regeneration-dialog[open] { display: flex; }
.engineering-regeneration-dialog::backdrop { background: rgba(31, 31, 28, .68); backdrop-filter: blur(3px); }
.engineering-regeneration-shell { display: flex; min-width: 0; flex-direction: column; gap: 12px; padding: 24px; }
.engineering-regeneration-dialog h3 { margin: 0; font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; }
.engineering-regeneration-dialog p { margin: 0; color: var(--ink-mute); font-size: 13.5px; line-height: 1.65; }
.engineering-regeneration-dialog p strong { color: var(--ink); }
.engineering-regeneration-dialog ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; color: var(--ink-faint); font-size: 12px; line-height: 1.55; }
.engineering-regeneration-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.engineering-regeneration-actions .btn { min-width: 0; }
@media (max-width: 680px) {
  .engineering-regeneration-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .engineering-regeneration-shell { padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .engineering-regeneration-actions { flex-direction: column; }
  .engineering-regeneration-actions .btn { width: 100%; white-space: normal; }
}
.engineering-cta { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-top: 16px; padding: 14px; border: 1px solid var(--line); background: var(--acid-tint); }
.engineering-cta-copy { min-width: 0; }
.engineering-cta-copy strong { display: block; }
.engineering-cta-copy p { margin: 6px 0 0; color: var(--ink-mute); font-size: 13px; line-height: 1.6; }
.engineering-cta-note { grid-column: 1 / -1; margin: 0; color: var(--ink-faint); font-size: 12px; line-height: 1.6; }
.engineering-save-source { white-space: nowrap; }
.engineering-bundle-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.engineering-bundle-actions .btn { min-width: 0; flex: 1 1 150px; text-align: center; text-decoration: none; }
/* 结果页右栏通常只有 320–350px；避免按钮固有宽度挤压说明栏。 */
@container (max-width: 520px) {
  .engineering-cta { grid-template-columns: 1fr; }
  .engineering-cta > .btn { width: 100%; min-width: 0; }
  .engineering-cta .engineering-save-source,
  #engineering-generate-btn { white-space: normal; line-height: 1.35; }
}
.history-card-status { color: var(--acid-deep) !important; }
.engineering-preflight-dialog {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  width: min(760px, calc(100vw - 28px));
  max-width: 760px;
  max-height: min(880px, calc(100vh - 28px));
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 14px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(31,31,28,.22);
}
.engineering-preflight-dialog[open] { display: grid; place-items: center; }
.engineering-preflight-dialog::backdrop { background: rgba(31,31,28,.64); backdrop-filter: blur(3px); }
.engineering-preflight-shell { display: flex; min-width: 0; max-height: min(880px, calc(100vh - 28px)); flex-direction: column; overflow: auto; padding: 22px; }
.engineering-preflight-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-right: -8px; }
.engineering-preflight-head h2 { font-size: 22px; line-height: 1.3; }
.engineering-preflight-source { display: flex; min-width: 0; align-items: center; gap: 12px; margin-top: 18px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bone); }
.engineering-preflight-source img { width: 92px; height: 64px; flex: 0 0 auto; object-fit: cover; border-radius: 6px; background: var(--paper-dark); }
.engineering-preflight-source div { min-width: 0; }
.engineering-preflight-source strong, .engineering-preflight-source small { display: block; overflow-wrap: anywhere; }
.engineering-preflight-source small { margin-top: 4px; color: var(--ink-faint); font-size: 11px; }
.engineering-preflight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.engineering-preflight-section { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bone); }
.engineering-preflight-section h3 { font-size: 14px; }
.engineering-preflight-vehicle { margin-top: 7px; color: var(--acid-deep); font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.engineering-spec-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 13px; }
.engineering-spec-fields label { min-width: 0; color: var(--ink-mute); font-size: 12px; }
.engineering-spec-fields input { display: block; width: 100%; min-width: 0; margin-top: 5px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--paper); font: inherit; font-size: 14px; }
/* 提醒块用整圈细边框 + 浅底，不用左侧色条。 */
.engineering-preflight-warning { margin-top: 11px; padding: 9px 11px; border: 1px solid color-mix(in srgb, #C47C00 32%, transparent); border-radius: 8px; color: #7C4A00; background: #FFF8E6; font-size: 12.5px; line-height: 1.6; overflow-wrap: anywhere; }
.engineering-preflight-panels { display: grid; gap: 7px; margin-top: 11px; }
.engineering-preflight-panel { display: flex; min-width: 0; justify-content: space-between; gap: 8px; padding: 8px 9px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.engineering-preflight-panel span { color: var(--ink-mute); text-align: right; overflow-wrap: anywhere; }
.engineering-preflight-meta { margin-top: 11px; color: var(--ink-faint); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.engineering-preflight-rules { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.engineering-confirm-check { display: flex; align-items: flex-start; gap: 8px; color: var(--ink); font-size: 13px; line-height: 1.55; }
.engineering-confirm-check input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--ink); }
.engineering-preflight-rules p { margin-top: 8px; color: var(--ink-faint); font-size: 12px; line-height: 1.6; }
.engineering-preflight-error { margin-top: 12px; color: #B42318; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.engineering-preflight-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.engineering-preflight-actions .btn { min-width: 132px; }
.history-state { min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 42px 20px; text-align: center; }
.history-state b { font-size: 16px; }
.history-state span { color: var(--ink-faint); font-size: 12.5px; }
.history-state .btn { margin-top: 9px; }
.history-loader { width: 24px; height: 24px; border: 2px solid var(--line); border-top-color: var(--acid-deep); border-radius: 50%; animation: spin .8s linear infinite; }
.history-error b { color: #B42318; }
.history-empty-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 8px; background: #DFF7FF; color: #00677E !important; }
.history-empty-icon svg { width: 27px; height: 27px; }
.history-more-row { display: flex; justify-content: center; padding-top: 28px; }

/* ---------- 作品详情弹窗 ----------
   桌面：左图右文，操作栏固定在右栏底部；≤960px：图在上、文在下、操作栏贴底；≤680px：整屏展开。
   dialog 自身 fixed + inset 0 + margin auto：全局 * { margin: 0 } 会清掉 UA 的居中，
   以前手机端还被改成 position: relative，弹窗跟着文档顶部走，打开时图片落在视口上方。 */
.history-dialog {
  position: fixed; inset: 0; margin: auto;
  width: min(1040px, calc(100vw - 48px)); height: min(760px, calc(100dvh - 48px));
  max-width: none; max-height: none; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 16px; background: var(--bone); color: var(--ink);
  box-shadow: 0 40px 100px rgba(31,31,28,.32);
}
.history-dialog::backdrop { background: rgba(31,31,28,.68); backdrop-filter: blur(3px); }
.history-dialog-shell {
  position: relative; display: grid; height: 100%; min-height: 0;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "media info" "media footer";
}
.history-dialog-scroll { display: contents; }
.history-dialog-media { grid-area: media; position: relative; display: flex; min-width: 0; min-height: 0; align-items: center; justify-content: center; overflow: auto; background: var(--paper-dark); }
.history-dialog-media:has(> .history-dialog-panel-grid:not([hidden])) { display: block; }
/* 详情默认完整展示整张方案板，避免纵向多视图只露出上半段；原像素文件仍可直接下载。
   图片元素铺满展示区，由 object-fit: contain 在元素内留边，不裁图。 */
#history-dialog-image { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.history-dialog-generating { min-height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--ink-faint); font-size: 13px; }
.history-dialog-generating[hidden] { display: none; }
.history-dialog-generating-ring { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--acid-deep); animation: spin .8s linear infinite; }
.history-dialog-empty { min-height: 420px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 28px; color: var(--ink-faint); text-align: center; }
.history-dialog-empty[hidden] { display: none; }
.history-dialog-empty-mark { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line-hover); border-radius: 50%; color: var(--ink-mute); font-size: 22px; line-height: 1; }
.history-dialog-empty strong { color: var(--ink); font-size: 15px; }
.history-dialog-empty span:last-child { max-width: 300px; font-size: 13px; line-height: 1.65; }
.history-dialog-info { grid-area: info; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 28px 28px 20px; }
.history-dialog-footer { grid-area: footer; display: grid; gap: 10px; padding: 16px 28px 24px; border-top: 1px solid var(--line-soft); background: var(--bone); }
/* 关闭按钮：各弹窗共用外观；详情与作品大图里定位在右上角。 */
.history-dialog-close { display: grid; flex: none; width: 40px; height: 40px; place-items: center; border-radius: 50%; color: var(--ink-mute); font-size: 24px; line-height: 1; transition: background .18s var(--ease), color .18s var(--ease); }
.history-dialog-close:hover { color: var(--ink); background: var(--paper-warm); }
.history-dialog-close:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; }
.history-dialog-shell > .history-dialog-close,
.showcase-dialog-shell > .history-dialog-close { position: absolute; z-index: 3; top: 16px; right: 16px; }
.history-dialog-info h2 { margin-right: 44px; font-size: 24px; line-height: 1.3; overflow-wrap: anywhere; }
.history-dialog-car { margin-top: 6px; color: var(--acid-deep); font-size: 14px; font-weight: 600; }
.history-detail-list { display: grid; gap: 0; margin-top: 20px; border-top: 1px solid var(--line); }
.history-detail-list div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.history-detail-list div[hidden] { display: none; }
.history-detail-list dt { color: var(--ink-faint); font-size: 12px; font-weight: 500; line-height: 1.65; }
.history-detail-list dd { min-width: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.history-dialog-note { margin-top: 14px; color: var(--ink-faint); font-size: 12px; line-height: 1.7; }
.history-dialog-note:empty { display: none; }
.history-dialog-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 10px; }
.history-dialog-actions:not(:has(> :not([hidden]))) { display: none; }
/* 固定两列：下载与继续修改并排，工程总稿独占一行；没有「继续修改」时下载按钮占满整行。 */
.history-dialog-actions:not(:has(> .history-action-modify:not([hidden]))) .history-action-download { grid-column: 1 / -1; }
.history-dialog-actions .btn,
.history-dialog-footer .engineering-bundle-actions .btn { min-width: 0; min-height: 46px; justify-content: center; padding: 0 16px; border-radius: 999px; text-align: center; text-decoration: none; }
.history-dialog-actions .btn-icon-action { display: inline-flex; width: 42px; height: 42px; flex: 0 0 42px; align-items: center; justify-content: center; padding: 0; }
.history-dialog-actions .btn-icon-action svg,
.history-dialog-actions .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.history-dialog-actions .btn-icon-action svg { width: 19px; height: 19px; stroke-width: 2.2; }
.history-dialog-actions .btn-icon-action:hover { color: var(--ink); background: var(--paper-warm); }
.history-dialog-actions .history-action-download,
.history-dialog-actions .history-action-modify { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); border-color: var(--line-hover); }
.history-dialog-actions .history-action-engineering { display: inline-flex; grid-column: 1 / -1; width: 100%; align-items: center; gap: 8px; }
#history-dialog-engineering { white-space: nowrap; line-height: 1.35; }
.history-dialog-footer .engineering-bundle-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; border: 0; }
.history-dialog-footer .engineering-bundle-actions .btn { flex: 1 1 150px; width: auto; }
/* 删除是最后一步的低频操作：放在信息末尾，做成红字文字按钮，不和下载、生成并排抢位置。 */
.history-action-delete { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin: 16px 0 0 -10px; padding: 0 10px; border-radius: 8px; color: #B3261E; font-size: 13px; font-weight: 600; }
.history-action-delete svg { width: 15px; height: 15px; flex: none; }
.history-action-delete:hover { background: color-mix(in srgb, #B3261E 8%, transparent); }
.history-action-delete:focus-visible { outline: 2px solid #B3261E; outline-offset: 2px; }

@media (max-width: 960px) {
  .history-dialog { width: min(720px, calc(100vw - 32px)); height: fit-content; max-height: calc(100dvh - 32px); }
  .history-dialog[open] { display: flex; flex-direction: column; }
  .history-dialog-shell { display: flex; flex: 1 1 auto; flex-direction: column; height: auto; }
  .history-dialog-scroll { display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .history-dialog-media { min-height: 240px; max-height: 60dvh; overflow: hidden; }
  .history-dialog-media:has(> .history-dialog-panel-grid:not([hidden])) { max-height: none; overflow: visible; }
  #history-dialog-image { height: auto; max-height: 60dvh; }
  .history-dialog-info { overflow: visible; padding: 20px 24px 18px; }
  .history-dialog-info h2 { margin-right: 0; }
  .history-dialog-footer { flex: none; padding: 12px 24px 16px; border-top-color: var(--line); }
  /* 关闭按钮压在图片右上角，深色圆底保证任何图片上都看得清。 */
  .history-dialog-shell > .history-dialog-close,
  .showcase-dialog-shell > .history-dialog-close { top: 10px; right: 10px; width: 44px; height: 44px; color: #fff; background: rgba(24,25,22,.56); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .history-dialog-shell > .history-dialog-close:hover,
  .showcase-dialog-shell > .history-dialog-close:hover { color: #fff; background: rgba(24,25,22,.78); }
}

@media (max-width: 680px) {
  .history-dialog { width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; border: 0; border-radius: 0; box-shadow: none; }
  .history-dialog-shell { height: 100%; }
  .history-dialog-media { min-height: 220px; max-height: 58dvh; }
  #history-dialog-image { max-height: 58dvh; }
  .history-dialog-generating,
  .history-dialog-empty { min-height: 240px; }
  .history-dialog-info { padding: 18px 18px 22px; }
  .history-dialog-info h2 { font-size: 21px; }
  .history-dialog-footer { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -14px 26px -26px rgba(31,31,28,.7); }
  .history-dialog-actions .btn { font-size: 14px; }
  .history-dialog-shell > .history-dialog-close { top: calc(10px + env(safe-area-inset-top)); }
  .history-action-delete { min-height: 44px; }
}

/* ---------- 登录弹层（未登录点生成唤起） ---------- */
.login-overlay {
  position: fixed; inset: 0; z-index: 320;
  display: flex; align-items: center; justify-content: center;
  background: rgba(250, 250, 250, .6); backdrop-filter: blur(4px);
  padding: 24px;
}
.login-modal {
  width: min(420px, 100%); background: var(--bone); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 30px 32px 26px;
  box-shadow: 0 60px 120px -50px rgba(31,31,28,.45);
  animation: pageIn .35s var(--ease) both;
}
.login-modal h3 { margin-top: 12px; font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.login-modal .why { margin-top: 7px; font-size: 12.5px; color: var(--ink-mute); line-height: 1.7; }
.login-modal .field { margin-top: 18px; }
.login-modal .field label { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.login-modal .field input {
  width: 100%; padding: 9px 2px 11px; font-size: 15px;
  border: 0; border-bottom: 1px solid var(--line); background: transparent;
  color: var(--ink); outline: none; transition: border-color .18s var(--ease);
}
.login-modal .field input:focus { border-bottom-color: var(--ink); }
.login-modal .field input::placeholder { color: var(--ink-faint); }
.login-modal .row { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 12.5px; color: var(--ink-mute); }
.login-modal .row a { color: var(--ink-mute); }
.login-modal .row a:hover { color: var(--ink); }
.login-modal .row a.go { color: var(--acid-deep); font-weight: 600; }
.login-modal .btn { margin-top: 20px; width: 100%; }
.login-modal .auth-error { margin-top: 14px; padding: 9px 12px; border-radius: 10px; background: #FFF0F0; border: 1px solid #F5C2C2; color: #B42318; font-size: 12.5px; line-height: 1.5; }
.login-upsell {
  margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--acid-tint); border: 1px solid color-mix(in srgb, #63FE13 35%, #FFF);
  border-radius: 12px; padding: 11px 15px;
}
.login-upsell .t { font-size: 12.5px; color: var(--ink); }
.login-upsell .t b { display: block; font-size: 13px; }
.login-upsell .t span { font-size: 11px; color: var(--ink-mute); }
.login-upsell a { font-size: 12px; font-weight: 700; color: var(--acid-deep); white-space: nowrap; text-decoration: none; }
.login-close {
  position: absolute; top: 14px; right: 14px; width: 32px; height: 32px;
  border-radius: 50%; color: var(--ink-faint); font-size: 20px; line-height: 1;
}
.login-modal { position: relative; }

/* ---------- 手机底部悬浮栏 ---------- */
.mobile-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.mobile-dock .sel { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; }
.mobile-dock .sel > div { flex: 1; min-width: 0; }
.mobile-dock .sel img { width: 42px; height: 31px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line-soft); flex: none; background: var(--paper-dark); }
.mobile-dock .sel .t { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mobile-dock .sel .s { font-size: 10.5px; color: var(--ink-faint); }
.mobile-dock .sel .chg { font-size: 10.5px; color: var(--acid-deep); font-weight: 600; flex: none; }
.mobile-dock .btn { flex: none; padding: 12px 18px; font-size: 12.5px; }
.mobile-dock .btn-primary { background: var(--ink); color: #fff; font-weight: 600; }
.mobile-dock .hint-t { flex: 1; font-size: 12px; color: var(--ink-mute); display: inline-flex; align-items: center; gap: 7px; }
.mobile-dock .hint-t i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-hover); }
.mobile-dock .hint-t i.on { background: var(--acid); }
.mobile-dock .btn.hint-btn { background: transparent; border: 1px solid var(--line); color: var(--ink-faint); box-shadow: none; pointer-events: none; }
.mobile-dock .cost { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; font-size: 10.5px; color: var(--ink-mute); }
body.has-dock { padding-bottom: 64px; }
body.has-dock .site-footer { padding-bottom: 84px; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--paper);
  padding: 46px 0 40px; color: var(--ink-mute); font-size: 12.5px;
}
.site-footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: start; gap: 30px 64px;
}
.site-footer-brand { display: grid; gap: 9px; align-content: start; justify-items: start; }
.site-footer-name {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); font-size: 14px; font-weight: 700; letter-spacing: -.01em;
}
.site-footer-name::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--acid); flex: none; }
.site-footer-copy { color: var(--ink-faint); line-height: 1.75; }
.site-footer a { color: var(--ink-mute); text-decoration: none; }
.site-footer a:hover { color: var(--acid-deep); }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 3px; }
.site-footer-links a { font-weight: 600; }
.site-footer-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 联系方式：不可点击的微信号给出复制入口，邮箱走 mailto */
.site-contact { display: grid; gap: 12px; justify-items: start; }
.site-contact-title { color: var(--ink); font-size: 13px; font-weight: 700; letter-spacing: .01em; }
.site-contact-list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.site-contact-item { display: flex; align-items: center; gap: 10px; }
.site-contact-key { flex: none; color: var(--ink-faint); font-size: 12px; }
.site-contact-value { color: var(--ink); font-size: 13px; font-weight: 600; font-feature-settings: 'tnum'; }
a.site-contact-value { border-bottom: 1px solid var(--line-hover); }
a.site-contact-value:hover { color: var(--acid-deep); border-bottom-color: var(--acid-deep); }
.site-contact-copy {
  flex: none; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bone); color: var(--ink-mute);
  font: 600 11.5px/1.35 var(--font); cursor: pointer;
  transition: border-color .18s var(--ease), color .18s var(--ease), background .18s var(--ease);
}
.site-contact-copy:hover { border-color: var(--acid-deep); color: var(--acid-deep); background: var(--acid-tint); }
.site-contact-copy:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; }
.site-contact-copy.is-copied { border-color: var(--acid-deep); color: var(--acid-deep); background: var(--acid-tint); }

/* ---------- 图片来源页 ---------- */
.credits-page { min-height: 100vh; padding: 64px 24px; background: var(--paper); }
.credits-shell { max-width: 880px; margin: 0 auto; }
.credits-back { display: inline-flex; margin-bottom: 28px; color: var(--acid-deep); text-decoration: none; font-weight: 600; }
.credits-card { padding: 32px; }
.credits-card h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -.035em; }
.credits-card > p { margin-top: 10px; color: var(--ink-mute); line-height: 1.7; }
.credits-list { display: grid; gap: 14px; margin-top: 26px; }
.credit-item { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--bone); }
.credit-item h2 { font-size: 17px; }
.credit-item p { margin-top: 6px; color: var(--ink-mute); font-size: 13px; line-height: 1.65; }
.credit-item a { color: var(--acid-deep); }

/* ---------- 实车照片 ---------- */
.car-sil.car-photo { position: relative; overflow: hidden; }
.car-photo-wrap { position: relative; display: block; width: 100%; height: 100%; }
.car-photo-wrap svg { position: absolute; inset: 0; width: 82%; margin: auto; }
.car-photo-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 10px;
}
.cc-source { color: var(--ink-faint); margin-top: 2px; display: block; }

/* ---------- 用户徽章（导航） ---------- */
.user-chip { display: inline-flex; align-items: center; gap: 7px; padding: 3px 9px 3px 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--bone); white-space: nowrap; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.nav-quota b { font-weight: 700; color: var(--ink); }

/* ---------- 手机底部悬浮栏状态格 ---------- */
.mobile-dock .dock-state { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; }
.mobile-dock .dock-state .btn[style*="flex"] { flex: 1; }
.mobile-dock .cost b { font-weight: 700; color: var(--ink); }

/* ---------- 登录弹层错误 ---------- */
.login-overlay .auth-error { margin-top: 14px; padding: 9px 12px; border-radius: 10px; background: #FFF0F0; border: 1px solid #F5C2C2; color: #B42318; font-size: 12.5px; line-height: 1.5; }

/* ---------- 响应式 ---------- */
@media (max-width: 1120px) {
  .vehicle-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .car-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .manual-car-form { grid-template-columns: repeat(3, minmax(110px, 1fr)); }
  .studio-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .board-summary { grid-template-columns: 120px minmax(180px, 1fr); }
  .history-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board-spec-list { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; padding: 8px 0 0; border-left: 0; border-top: 1px solid rgba(255,255,255,.1); }
}

@media (max-width: 960px) {
  .steps { display: none; }
  .m-step-indicator { display: flex; }
  .vehicle-layout, .design-layout, .studio-layout, .custom-car { grid-template-columns: 1fr; }
  .selection-panel { position: static; min-height: 0; }
  .selection-empty { min-height: 320px; }
  .custom-car-form { grid-template-columns: 1fr 1fr .7fr auto; }
  .cc-result { flex-wrap: wrap; }
  .cc-manual-copy { max-width: none; width: 100%; }
  .studio-layout { height: auto; }
  .chat { position: static; height: 480px; }
  .selected-car { position: static; }
  .engineering-cta { grid-template-columns: 1fr; }
  .engineering-cta .btn { width: 100%; }
  .history-dialog-panel-grid { padding: 10px; gap: 8px; }
  .engineering-bundle-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .engineering-bundle-actions .btn { width: 100%; }
}

@media (max-width: 680px) {
  body { font-size: 15px; }
  .nav-inner { gap: 10px; padding: 0 14px; height: 54px; }
  .brand-name em { display: none; }
  .nav-start { display: none; }
  .nav-auth a:nth-child(2) { display: none; }
  .nav-auth .btn-sm { padding: 6px 12px; font-size: 11.5px; }
  .nav-quota { display: none; }
  .nav-auth { flex: 0 1 auto; gap: 7px; }
  .nav-user { width: clamp(116px, 38vw, 152px); gap: 0; }
  .nav-user-btn { width: 100%; max-width: 100%; flex-basis: 100%; gap: 5px; padding: 3px 7px 3px 3px; font-size: 12px; white-space: nowrap; }
  .nav-user-identity { gap: 5px; }
  .nav-user-name { max-width: none; }
  .member-badge { display: inline-flex; max-width: 45px; padding: 3px 5px; font-size: 9px; overflow: hidden; text-overflow: ellipsis; }
  .nav-user-chevron { font-size: 13px; }
  .nav-history { flex: 0 0 auto; max-width: 84px; overflow: hidden; padding: 6px 8px; font-size: 11px; text-overflow: ellipsis; }
  .campaign a { font-size: 11.5px; }
  body.no-campaign main { padding-top: 54px; }
  .campaign { height: 30px; }
  .campaign a { font-size: 11px; }
  .nav { top: 30px; }
  main { padding-top: 84px; }
  .page { padding: 26px 16px 88px; }
  body[data-step="2"] main { padding-top: 0; }

  .hero { margin: 14px 0 30px; }
  .hero h1 { font-size: clamp(30px, 8.4vw, 40px); }
  .hero p { font-size: 14px; }
  .hero .cta-row .btn { width: 100%; max-width: 320px; }
  .hero .cta-row { gap: 8px; }
  .home-actions, .home-actions.history-enabled { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .home-action { min-height: 104px; grid-template-columns: 32px minmax(0, 1fr); align-content: center; gap: 8px; padding: 11px 9px; }
  .home-action-icon { width: 32px; height: 32px; }
  .home-action-icon svg { width: 18px; height: 18px; }
  .home-action-copy strong { font-size: 15px; }
  .home-action-copy small { font-size: 9.5px; }
  .home-action-arrow { display: none; }
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; }
  .hero-stat { padding: 14px 10px; }
  .hero-stat + .hero-stat { border-left: 0; }
  .hero-stat:nth-child(odd) { border-right: 1px solid var(--line-soft); }
  .hero-stat:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
  .hero-stat b { font-size: 17px; }
  .vehicle-hero { margin: 10px 0 22px; }

  .catalog-toolbar { gap: 10px; }
  .car-search { flex-basis: 100%; }
  .filter-group { width: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .filter-group::-webkit-scrollbar { display: none; }
  .filter-btn { flex: 0 0 auto; }
  .car-count { margin-left: 0; }
  .sel-hint { order: 3; }
  .car-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .car-card { padding: 8px 8px 11px; }
  .car-card .car-sil { height: 88px; }
  .car-card h3 { font-size: 13.5px; }
  .car-card .car-sub { font-size: 10.5px; }
  .card-topline { font-size: 8.5px; }
  .car-card .spec { font-size: 9.5px; padding: 2px 7px; }
  .year-switch .yr { font-size: 9px; padding: 1px 6px; }
  .car-card .check { top: 12px; right: 12px; width: 19px; height: 19px; font-size: 10px; }
  .catalog-empty { padding: 56px 18px; }

  .selection-panel { padding: 16px; }
  .selection-visual { height: 150px; }
  .selection-specs { grid-template-columns: 1fr; }
  .custom-car { padding: 18px; }
  .custom-car-form { grid-template-columns: 1fr; }
  .custom-car-form .btn { width: 100%; }
  .cc-result-visual { width: 100%; height: 150px; }
  .cc-result > .btn { width: 100%; }
  .manual-car-form { grid-template-columns: 1fr 1fr; width: 100%; }
  .manual-car-form .btn { grid-column: 1 / -1; }

  .history-page { padding-left: 16px; padding-right: 16px; }
  .history-back { margin-bottom: 22px; }
  /* 手机端标题独占整行，份数与名额放到说明下面，避免「我的历史设 / 计」这类孤字折行。 */
  .history-title-row { display: block; }
  .history-title-row h1 { font-size: 28px; }
  .history-title-row p { font-size: 13px; }
  .history-meta { margin: 10px 0 0; }
  /* 类型页签一行、整理方式一行；分割线跟着页签走，第二行不再悬在线下。 */
  .history-controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 18px; border-bottom: 0; }
  .history-type-tabs { width: 100%; border-bottom: 1px solid var(--line-soft); }
  .history-type-tab { flex: 1 1 0; }
  .history-view-control { width: 100%; margin-left: 0; padding-bottom: 0; }
  .history-view-switch { flex: 1 1 auto; }
  .history-view-tab { flex: 1 1 0; min-height: 44px; padding-inline: 12px; }
  .history-groups { gap: 30px; padding-top: 24px; }
  .history-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .history-group-head h2 { font-size: 18px; }
  .history-card-copy { min-height: 86px; padding: 10px 10px 11px; }
  .history-card-copy strong { font-size: 14px; }
  .engineering-preflight-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }
  .engineering-preflight-shell { max-height: calc(100vh - 16px); padding: 16px; }
  .engineering-preflight-head h2 { font-size: 21px; }
  .engineering-preflight-source { margin-top: 13px; }
  .engineering-preflight-source img { width: 76px; height: 54px; }
  .engineering-preflight-grid { grid-template-columns: 1fr; gap: 9px; margin-top: 10px; }
  .engineering-preflight-section { padding: 11px; }
  .engineering-preflight-actions { position: sticky; bottom: -16px; margin: 14px -16px -16px; padding: 11px 16px calc(11px + env(safe-area-inset-bottom)); background: var(--paper); border-top: 1px solid var(--line); }
  .engineering-preflight-actions .btn { min-width: 0; flex: 1 1 0; }

  .design-layout { gap: 14px; }
  .design-card { padding: 20px 16px; }
  .selected-car { padding: 16px; }

  .generating-wrap { padding: 48px 20px; }
  .generating-wrap h2 { font-size: 23px; }
  .gen-context { margin-bottom: 22px; line-height: 1.5; }
  .gen-home-btn { width: 100%; max-width: 320px; }

  #page-studio { padding-left: 10px; padding-right: 10px; }
  .scheme-board { padding: 7px; }
  .board-head { min-height: 72px; padding: 7px 5px 12px; }
  .board-head h2 { font-size: 22px; }
  .board-palette { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
  .board-palette > span { font-size: 10px; }
  .board-swatches { gap: 3px; }
  .board-swatches i { width: 16px; height: 16px; }
  .board-summary { grid-template-columns: 100px minmax(0, 1fr); gap: 9px; padding: 8px; }
  .board-summary-copy strong { white-space: normal; font-size: 12px; }
  .board-spec-list { grid-template-columns: 1fr; }
  .board-foot { align-items: flex-start; }
  .angle-dialog { padding: 7px; }
  .chat { height: 480px; }
}


/* ============ 首页直达工作区（20260821-homev2） ============ */

/* Logo 可点击 */
button.brand { cursor: pointer; text-align: left; }
button.brand:hover .brand-mark { transform: rotate(-6deg); }
button.brand:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; border-radius: 10px; }

/* 导航历史入口 */
.nav-history { white-space: nowrap; }
.nav-history-count { display: inline-block; min-width: 20px; margin-left: 2px; padding: 1px 7px; border-radius: 999px; background: var(--acid); color: var(--acid-ink); font-size: 10.5px; font-weight: 700; font-feature-settings: 'tnum'; }

/* 紧凑工作区头部：保留品牌句，压缩高度让表单直达首屏 */
.home-workbench-head { margin: 22px 0 26px; text-align: center; }
.home-workbench-head h1 { font-size: clamp(32px, 4vw, 44px); }
.home-workbench-head p { margin-top: 12px; }
.home-workbench-head .hero-stats { margin-top: 22px; }

/* 车型输入卡 */
.vehicle-input-card { padding: 22px 20px; position: sticky; top: 80px; }
#vehicle-input-card { display: none !important; }
.field-label { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; color: var(--ink-faint); font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.field-label em { padding: 1px 6px; border-radius: 4px; color: var(--acid-deep); border: 1px solid var(--line); font-size: 9px; font-style: normal; letter-spacing: .1em; }
.vehicle-input-wrap { position: relative; display: flex; align-items: center; }
#vehicle-input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; font-size: 15.5px; font-weight: 500; padding: 8px 34px 10px 2px; outline: none; border-radius: 0; color: var(--ink); transition: border-color .18s var(--ease); }
#vehicle-input::placeholder { color: var(--ink-faint); font-weight: 400; }
#vehicle-input:focus { border-bottom-color: var(--ink); }
#vehicle-input.input-error { border-bottom-color: #B42318; }
#vehicle-input-clear { position: absolute; right: 2px; width: 26px; height: 26px; border-radius: 50%; color: var(--ink-faint); font-size: 18px; line-height: 1; }
#vehicle-input-clear:hover { background: var(--acid-tint); color: var(--ink); }

.vehicle-suggestions { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 40; background: var(--bone); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow-x: hidden; overflow-y: auto; max-height: min(340px, calc(100dvh - 160px)); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 6px; }
.suggestion-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 10px; cursor: pointer; text-align: left; touch-action: manipulation; }
.suggestion-item:hover, .suggestion-item.active { background: var(--acid-tint); }
.suggestion-item:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: -2px; }
.suggestion-thumb { flex: 0 0 64px; height: 40px; display: grid; place-items: center; background: var(--paper-dark); border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; }
.suggestion-thumb .car-photo-wrap, .suggestion-thumb .car-photo-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.suggestion-thumb svg { width: 78%; }
.suggestion-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.suggestion-copy strong { font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestion-copy small { font-size: 11px; color: var(--ink-faint); letter-spacing: .04em; }

.unverified-vehicle-note { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--paper-warm); border: 1px solid var(--line); color: var(--ink-mute); font-size: 12px; line-height: 1.55; }
.unverified-vehicle-note:empty { display: none; }

.vehicle-selected { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.vehicle-selected .car-sil { height: 96px; display: grid; place-items: center; background: var(--paper-dark); border-radius: 12px; overflow: hidden; border: 1px solid var(--line-soft); margin-bottom: 12px; }
.vehicle-selected .car-sil svg { width: 85%; }
.vehicle-selected .car-photo-wrap { display: block; width: 100%; height: 100%; }
.vehicle-selected .car-photo-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vehicle-selected-copy h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.vehicle-selected-copy p { font-size: 12px; color: var(--ink-faint); margin-top: 3px; }
.vehicle-selected-copy .selection-label { font-size: 9.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--acid-deep); }

/* 首页工作区布局（复用 design-layout 双栏） */
#home-design-workbench { max-width: 1240px; margin: 0 auto; }
#home-design-workbench .design-card { min-width: 0; }

/* 用户作品区 */
#public-showcase { max-width: 1240px; margin: 64px auto 0; }
.showcase-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.showcase-head h2 { font-size: 30px; font-weight: 650; letter-spacing: -.02em; }
.showcase-head p { margin-top: 7px; font-size: 13px; color: var(--ink-mute); }
.showcase-shuffle { flex: 0 0 auto; min-height: 38px; padding: 0 16px; border: 1px solid var(--line-hover); border-radius: 999px; background: transparent; color: var(--ink); font-size: 12px; font-weight: 650; cursor: pointer; transition: background .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease); }
.showcase-shuffle:hover { border-color: var(--ink); background: var(--acid-tint); }
.showcase-shuffle:active { transform: translateY(1px); }
.showcase-shuffle:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; }
.showcase-shuffle:disabled { cursor: wait; opacity: .52; }
.showcase-grid { min-width: 0; transition: opacity .18s var(--ease); }
.showcase-grid.is-refreshing { opacity: .48; pointer-events: none; }
.showcase-card { min-width: 0; display: flex; text-align: left; background: var(--bone); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease); }
.showcase-card:hover { transform: translateY(-2px); border-color: var(--line-hover); box-shadow: 0 18px 38px -30px rgba(31,31,28,.55); }
.showcase-card:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; }
.showcase-thumb { position: relative; min-width: 0; min-height: 0; display: block; background: var(--paper-dark); overflow: hidden; }
.showcase-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }
.showcase-card-body { position: relative; min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto 32px; align-items: center; gap: 12px; padding: 12px 13px; background: var(--bone); }
.showcase-card-heading { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.showcase-card-title { color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.showcase-card-vehicle { color: var(--ink-faint); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.showcase-card-date { max-width: 100%; color: var(--ink-faint); font-size: 10px; line-height: 1.25; font-feature-settings: 'tnum'; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.showcase-card-meta { min-width: 0; display: flex; align-items: center; gap: 8px; }
.showcase-avatar { flex: 0 0 26px; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--acid); color: var(--acid-ink); font-size: 12px; font-weight: 700; }
.showcase-author-name { max-width: 116px; color: var(--ink); font-size: 10.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.showcase-time { flex: 0 0 auto; font-size: 10px; color: var(--ink-faint); font-feature-settings: 'tnum'; }
.showcase-card-arrow { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); font-size: 18px; line-height: 1; }
.showcase-side, .showcase-more, .showcase-mobile-rail { min-width: 0; }
.showcase-rail-head { display: none; }
.showcase-rail-timeline { display: none; }
.showcase-state { padding: 34px 20px; border: 1px dashed var(--line); border-radius: 8px; text-align: center; color: var(--ink-mute); font-size: 13px; }
.showcase-state .btn { margin-top: 12px; }
.showcase-loading { min-width: 0; display: grid; grid-template-columns: minmax(0,1.82fr) minmax(320px,1fr); grid-template-rows: 230px 230px 152px; gap: 16px; }
.showcase-loading[hidden] { display: none; }
.showcase-skeleton { display: block; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--paper-dark); animation: showcasePulse 1.2s ease-in-out infinite alternate; }
.showcase-skeleton-feature { grid-column: 1; grid-row: 1 / 3; }
.showcase-skeleton-more { grid-column: 1 / -1; grid-row: 3; }
@keyframes showcasePulse { from { opacity: .5; } to { opacity: .92; } }

/* 作品只读大图：dialog 自身是铺满视口的透明层，卡片在其中居中；桌面左图右文，≤960px 图在上。 */
.showcase-dialog { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 20px; border: 0; background: transparent; }
.showcase-dialog[open] { display: grid; place-items: center; }
.showcase-dialog::backdrop { background: rgba(31,31,28,.68); backdrop-filter: blur(3px); }
.showcase-dialog-shell { position: relative; display: grid; width: min(1060px, 100%); max-height: calc(100dvh - 40px); margin: auto; grid-template-columns: minmax(0, 1fr) minmax(280px, .5fr); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bone); box-shadow: 0 40px 100px rgba(31,31,28,.32); }
.showcase-dialog-scroll { display: contents; }
.showcase-dialog-media { min-width: 0; min-height: 420px; overflow: auto; padding: 0; background: var(--paper-dark); }
.showcase-dialog-media img { display: block; width: 100%; max-width: none; height: auto; max-height: none; object-fit: contain; }
/* 占位缩略图与最终大图之间的过渡：轻微降透明度提示还在加载，而不是让用户以为已经是成品画质。 */
.showcase-dialog-media img.is-loading { opacity: .72; filter: saturate(.92); }
.showcase-dialog-info { min-width: 0; overflow-y: auto; overscroll-behavior: contain; padding: 28px 28px 24px; }
.showcase-dialog-info h2 { margin-right: 44px; font-size: 24px; line-height: 1.3; overflow-wrap: anywhere; }
.showcase-dialog-meta { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; color: var(--ink-mute); font-size: 13px; }
.showcase-dialog-brief { margin-top: 22px; }
.showcase-dialog-brief h3 { color: var(--ink); font-size: 14px; font-weight: 600; }
.showcase-dialog-brief .history-detail-list { margin-top: 9px; }

/* 旧目录隐藏容器：DOM 保留，不占高度不进焦点 */
#legacy-vehicle-catalog[hidden] { display: none; }
#legacy-vehicle-catalog .vehicle-layout, #legacy-vehicle-catalog .custom-car { margin-top: 56px; }
#legacy-vehicle-catalog { margin-top: 0; }
#legacy-vehicle-catalog .vehicle-layout { display: grid; }

@media (max-width: 960px) {
  #home-design-workbench { gap: 16px; }
  .vehicle-input-card { position: static; }
  #public-showcase { margin-top: 56px; }
  .showcase-grid { display: block; width: 100%; }
  .showcase-card--feature { width: 100%; height: auto; flex-direction: column; }
  .showcase-card--feature .showcase-thumb { height: clamp(340px, 53vw, 460px); }
  .showcase-card--feature .showcase-card-body { min-height: 76px; }
  .showcase-rail-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; color: var(--ink); font-size: 12px; font-weight: 700; }
  .showcase-rail-progress { color: var(--ink-faint); font-size: 10px; font-feature-settings: 'tnum'; }
  .showcase-mobile-rail { width: 100%; display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .showcase-mobile-rail::-webkit-scrollbar { display: none; }
  .showcase-rail-timeline { width: 100%; height: 3px; display: flex; gap: 6px; margin-top: 10px; }
  .showcase-rail-timeline-segment { position: relative; flex: 1 1 0; height: 3px; border-radius: 999px; background: var(--line); overflow: hidden; }
  .showcase-rail-timeline-segment::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--ink); transform: scaleX(0); transform-origin: left center; }
  .showcase-rail-timeline.is-running .showcase-rail-timeline-segment.is-active::after { animation: showcaseRailAutoplay var(--showcase-rail-autoplay-ms, 5000ms) linear forwards; }
  .showcase-card--rail { flex: 0 0 min(62vw, 320px); height: 430px; flex-direction: column; scroll-snap-align: start; scroll-snap-stop: always; }
  .showcase-card--rail .showcase-thumb { flex: 1 1 auto; }
  .showcase-card--rail .showcase-card-body { min-height: 76px; grid-template-columns: minmax(0,1fr) 30px; gap: 8px; }
  .showcase-card--rail .showcase-card-meta { grid-column: 1; margin-top: 2px; }
  .showcase-card--rail .showcase-card-heading { align-self: end; }
  .showcase-card--rail .showcase-card-meta .showcase-time { display: none; }
  .showcase-card--rail .showcase-card-arrow { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .showcase-loading { grid-template-columns: 1fr 1fr; grid-template-rows: 430px 190px; gap: 12px; }
  .showcase-skeleton-feature { grid-column: 1 / -1; grid-row: 1; }
  .showcase-skeleton-more { display: none; }
  /* 图在上、文在下，只有内层一个滚动区；关闭按钮固定在卡片右上角，不随内容滚走。 */
  .showcase-dialog-shell { display: flex; flex-direction: column; }
  .showcase-dialog-scroll { display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .showcase-dialog-media { min-height: 0; max-height: none; overflow: visible; }
  .showcase-dialog-media img { max-height: none; }
  .showcase-dialog-info { overflow: visible; }
  .showcase-dialog-info h2 { margin-right: 0; }
}

@keyframes showcaseRailAutoplay { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 680px) {
  .home-workbench-head { margin: 12px 0 20px; text-align: left; }
  .home-workbench-head h1 { font-size: clamp(28px, 8.4vw, 36px); }
  .home-workbench-head p { font-size: 13.5px; }
  #home-design-workbench { gap: 14px; }
  .vehicle-input-card { padding: 16px; }
  #public-showcase { margin-top: 48px; }
  .showcase-head { align-items: flex-start; gap: 10px; margin-bottom: 14px; }
  .showcase-head > div { min-width: 0; flex: 1; }
  .showcase-head h2 { font-size: 22px; }
  .showcase-head p { max-width: 250px; margin-top: 5px; font-size: 11.5px; line-height: 1.5; }
  .showcase-shuffle { min-height: 44px; padding: 0 14px; }
  .showcase-card--feature .showcase-thumb { height: min(92vw, 380px); }
  .showcase-card--feature .showcase-card-body { min-height: 74px; grid-template-columns: minmax(0,1fr) 30px; gap: 8px; }
  .showcase-card--feature .showcase-card-meta { grid-column: 1; margin-top: 2px; }
  .showcase-card--feature .showcase-card-meta .showcase-time { display: none; }
  .showcase-card--feature .showcase-card-arrow { grid-column: 2; grid-row: 1 / 3; align-self: center; }
  .showcase-author-name { max-width: 142px; }
  /* 一屏只展示一张完整作品，避免下一张被截断后像坏图。 */
  .showcase-card--rail { flex-basis: 100%; height: 420px; }
  .showcase-card--rail .showcase-card-body { flex: 0 0 104px; min-height: 104px; padding: 12px; align-items: start; }
  .showcase-card--rail .showcase-card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; white-space: normal; }
  .showcase-card--rail .showcase-card-vehicle,
  .showcase-card--rail .showcase-card-date { white-space: normal; line-height: 1.35; }
  .showcase-rail-head { margin-top: 16px; }
  .showcase-loading { grid-template-rows: 430px 170px; }
  .showcase-dialog { padding: 8px; }
  .showcase-dialog-shell { width: 100%; max-height: calc(100dvh - 16px); }
  .showcase-dialog-info { padding: 18px 18px 22px; }
  .showcase-dialog-info h2 { font-size: 21px; }
  .nav-history { padding: 6px 10px; font-size: 11.5px; }
}

/* 首屏工具优先：压缩首页头部与表单垂直节奏，保证桌面首屏可提交 */
#page-car { padding-top: 20px; }
#page-car .home-workbench-head { margin-top: 10px; margin-bottom: 16px; }
#home-design-workbench .design-card { padding-top: 20px; padding-bottom: 20px; }
#home-design-workbench #prompt-builder { gap: 12px; }
@media (max-width: 680px) {
  #page-car { padding-top: 18px; }
  #page-car .home-workbench-head { margin-top: 6px; margin-bottom: 14px; }
  #home-design-workbench .design-card { padding-top: 16px; padding-bottom: 16px; }
  #home-design-workbench #prompt-builder { gap: 14px; }
}

/* 手机端主操作常驻：保持唯一 #generate-btn，避免可选字段把核心动作推离首屏 */
@media (max-width: 680px) {
  #home-design-workbench { padding-bottom: 132px; }
}
@media (max-width: 680px) {
  /* 首页底部操作栏需相对 viewport 定位；避免 pageIn transform 创建 fixed containing block */
  #page-car.active { animation: none; }
}

/* 主编精选：桌面一张主视觉、两张侧卡、底部最多三张作品 */
@media (min-width: 961px) {
  .showcase-grid { display: grid; grid-template-columns: minmax(0,1.82fr) minmax(320px,1fr); grid-template-rows: 476px auto; gap: 16px; }
  .showcase-card--feature { grid-column: 1; grid-row: 1; flex-direction: column; }
  .showcase-card--feature .showcase-thumb { flex: 0 0 400px; }
  .showcase-card--feature .showcase-card-body { min-height: 76px; border-top: 1px solid var(--line-soft); }
  .showcase-side { grid-column: 2; grid-row: 1; display: grid; grid-template-rows: repeat(2,minmax(0,1fr)); gap: 16px; }
  .showcase-card--side { height: 230px; flex-direction: row; }
  .showcase-card--side .showcase-thumb { flex: 0 0 44%; height: 100%; }
  .showcase-card--side .showcase-card-body { flex: 1; grid-template-columns: minmax(0,1fr) 30px; grid-template-rows: auto auto; align-content: center; gap: 12px 8px; border-left: 1px solid var(--line-soft); }
  .showcase-card--side .showcase-card-heading { grid-column: 1 / -1; }
  .showcase-card--side .showcase-card-meta { grid-column: 1; }
  .showcase-card--side .showcase-card-meta .showcase-time { display: none; }
  .showcase-card--side .showcase-card-arrow { grid-column: 2; grid-row: 2; }
  .showcase-more { --showcase-more-count: 3; grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(var(--showcase-more-count),minmax(0,1fr)); gap: 16px; }
  .showcase-card--more { height: 168px; flex-direction: row; }
  .showcase-card--more .showcase-thumb { flex: 0 0 148px; height: 100%; }
  .showcase-card--more .showcase-card-body { flex: 1; grid-template-columns: minmax(0,1fr) 30px; grid-template-rows: auto auto; align-content: center; gap: 13px 8px; border-left: 1px solid var(--line-soft); }
  .showcase-card--more .showcase-card-heading { grid-column: 1 / -1; }
  .showcase-card--more .showcase-card-meta { grid-column: 1; }
  .showcase-card--more .showcase-card-meta .showcase-time { display: none; }
  .showcase-card--more .showcase-card-arrow { grid-column: 2; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .showcase-card, .showcase-shuffle, .showcase-grid { transition: none; }
  .showcase-skeleton { animation: none; opacity: .72; }
}

/* 首页双焦点首屏：桌面精选作品与设计入口同屏，移动端维持原有上下顺序 */
.home-desktop-split { min-width: 0; }
.home-title-mobile, .home-subtitle-mobile { display: none; }
.vehicle-input-desktop-block { min-width: 0; }
.board-head-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.board-restart { min-height: 40px; padding: 8px 13px; color: #f7f8fa; border-color: rgba(255,255,255,.25); }
.board-restart:hover { color: var(--acid-ink); background: var(--acid); border-color: var(--acid); }
.board-restart svg { flex: none; }
.studio-field span em { margin-left: 4px; color: var(--ink-faint); font-size: 10px; font-style: normal; font-weight: 500; letter-spacing: 0; text-transform: none; }

@media (min-width: 961px) {
  /* 首页双栏布局优化：更大气、居中、对齐 */
  .home-desktop-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(480px, 560px);
    gap: 48px;
    align-items: start;
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 40px;
  }

  /* 左侧作品展示区 */
  #public-showcase {
    grid-column: 1;
    grid-row: 1;
    max-width: none;
    margin: 0;
  }

  #public-showcase .showcase-head {
    align-items: flex-start;
    margin-bottom: 20px;
  }

  #public-showcase .showcase-head h2 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -.025em;
  }

  #public-showcase .showcase-head p {
    font-size: 14.5px;
    line-height: 1.6;
  }

  #public-showcase .showcase-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 14px;
  }

  #public-showcase .showcase-card--feature {
    grid-column: 1;
    grid-row: auto;
    flex-direction: column;
    border-radius: 14px;
  }

  #public-showcase .showcase-card--feature .showcase-thumb {
    flex: 0 0 auto;
    height: clamp(360px, 34vw, 480px);
  }

  #public-showcase .showcase-card--feature .showcase-card-body {
    min-height: 76px;
    border-top: 1px solid var(--line-soft);
    padding: 13px 15px;
  }

  #public-showcase .showcase-side {
    grid-column: 1;
    grid-row: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  #public-showcase .showcase-side {
    grid-template-rows: 155px;
  }

  #public-showcase .showcase-card--side {
    height: 155px;
    flex-direction: column;
    border-radius: 12px;
  }

  #public-showcase .showcase-card--side .showcase-thumb {
    flex: 1 1 auto;
    height: auto;
  }

  #public-showcase .showcase-card--side .showcase-card-body {
    min-height: 58px;
    grid-template-columns: minmax(0,1fr) 28px;
    gap: 8px;
    padding: 10px 12px;
  }

  #public-showcase .showcase-card--side .showcase-card-heading { grid-column: 1; }
  #public-showcase .showcase-card--side .showcase-card-meta { display: none; }
  #public-showcase .showcase-card--side .showcase-card-arrow {
    grid-column: 2;
    grid-row: 1;
    width: 26px;
    height: 26px;
    font-size: 16px;
  }

  #public-showcase .showcase-more {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: repeat(var(--showcase-more-count), minmax(0, 1fr));
    gap: 14px;
  }

  #public-showcase .showcase-card--more {
    height: 135px;
    flex-direction: column;
    border-radius: 12px;
  }

  #public-showcase .showcase-card--more .showcase-thumb {
    flex: 1 1 auto;
    height: auto;
  }

  #public-showcase .showcase-card--more .showcase-card-body {
    min-height: 50px;
    grid-template-columns: minmax(0,1fr) 26px;
    gap: 6px;
    padding: 8px 10px;
  }

  #public-showcase .showcase-card--more .showcase-card-heading { grid-column: 1; }
  #public-showcase .showcase-card--more .showcase-card-meta { display: none; }
  #public-showcase .showcase-card--more .showcase-card-arrow {
    grid-column: 2;
    grid-row: 1;
    width: 24px;
    height: 24px;
    font-size: 14px;
  }

  /* 右侧设计表单区 */
  #home-design-workbench {
    grid-column: 2;
    grid-row: 1;
    max-width: none;
    margin: 0;
    display: block;
  }

  #home-design-workbench .vehicle-input-card { display: none; }

  #home-design-workbench .design-card {
    padding: 24px 26px;
    border-radius: 18px;
    box-shadow: 0 2px 12px -4px rgba(31, 31, 28, .08);
  }

  #home-design-workbench .vehicle-input-desktop-block {
    display: block;
    margin: 0 0 16px;
    padding: 0 0 16px;
    border-bottom: 0;
  }

  #home-design-workbench .vehicle-input-desktop-block .field-label {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 9px;
  }

  /* 标题区域对齐优化 */
  #page-car .home-workbench-head {
    max-width: 1400px;
    margin: 6px auto 20px;
    text-align: left;
    padding: 0 40px;
  }

  #page-car .home-workbench-head p {
    margin-left: 0;
  }
}

/* 桌面双栏标题对齐：作品区标题与设计卡主标题的顶边对齐（设计卡 22px 内边距 + 1px 描边；去掉眉批后同步下调）。 */
@media (min-width: 961px) {
  #public-showcase .showcase-head {
    padding-top: 23px;
    margin-bottom: 28px;
  }

  /* 车型输入框过渡：边框与焦点态由上方 #home-design-workbench 规则统一定义。 */
  .vehicle-input-wrap input {
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
  }

  /* 配额条优化 */
  .quota-bar {
    padding: 12px 16px;
    border-radius: 14px;
  }

  /* 生成按钮优化 */
  .generate-cta {
    min-height: 52px;
    font-weight: 600;
    letter-spacing: -.01em;
    box-shadow: 0 4px 16px -6px rgba(31, 31, 28, .3);
  }

  .generate-cta:hover {
    box-shadow: 0 6px 20px -6px rgba(31, 31, 28, .4);
  }
}

/* 961–1180px 不足以容纳 560px 表单与完整作品栏，改为上下排列。 */
@media (min-width: 961px) and (max-width: 1180px) {
  .home-desktop-split {
    display: block;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 32px;
  }

  #home-design-workbench,
  #public-showcase {
    width: 100%;
    max-width: none;
  }

  #public-showcase {
    margin-top: 56px;
  }

  #public-showcase .showcase-card--feature .showcase-thumb {
    height: clamp(400px, 52vw, 520px);
  }
}

@media (max-width: 960px) {
  .home-title-desktop, .home-subtitle-desktop { display: none; }
  .home-title-mobile, .home-subtitle-mobile { display: inline; }
  .home-desktop-split { display: contents; }
  .vehicle-input-card { display: block; }
  .vehicle-input-desktop-block { display: block; }
  .board-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .board-head-actions { width: 100%; flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
  .board-restart { min-height: 44px; }
}

/* 移动端：主操作回到表单正常文档流，不再持续覆盖输入区域 */
@media (max-width: 680px) {
  #home-design-workbench { padding-bottom: 0; }
  .mobile-generator-return[hidden] { display: none !important; }
  .mobile-generator-return { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 90; transform: translateX(-50%); }
  .mobile-generator-return .btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: 999px; box-shadow: 0 14px 30px -18px rgba(31,31,28,.55); }
  /* 手机页脚：单列左对齐，联系方式与上方用细线分隔，保持 44px 触控高度 */
  .site-footer { padding: 34px 0 calc(30px + env(safe-area-inset-bottom)); font-size: 13px; }
  .site-footer-inner { grid-template-columns: minmax(0, 1fr); gap: 26px; padding: 0 20px; }
  .site-footer-links { gap: 4px 18px; }
  .site-footer-links a, a.site-contact-value { display: inline-flex; align-items: center; min-height: 44px; }
  .site-contact { width: 100%; padding-top: 22px; border-top: 1px solid var(--line-soft); }
  .site-contact-item { min-height: 44px; }
  .site-contact-copy { min-height: 44px; padding: 10px 14px; }
  body.has-mobile-generator-return .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* 结果工作台移动端：侧栏内容按实际高度展开，避免固定高度造成页脚提前出现。 */
@media (max-width: 960px) {
  #page-studio .chat {
    height: auto;
    min-height: 0;
  }
}

/* 生成中页面返回首页文字操作：与等待说明融合，不模拟取消按钮 */
.gen-return-home { display: inline; min-height: 44px; margin: -10px -8px; padding: 10px 8px; color: var(--acid-deep); font: inherit; font-weight: 650; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; vertical-align: baseline; }
.gen-return-home:hover { color: var(--ink); }
.gen-return-home:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; border-radius: 6px; }

/* ==========================================================================
   设计层级统一：让可点、可填、可读一眼可分
   规则：
   - 可点击控件=墨色文字+描边/实底，悬停有变化，键盘有 focus 环
   - 输入框=下划线细线，聚焦转墨色；placeholder 一律淡墨，绝不用正文色
   - 辅助说明/提示=灰墨 12px，永不与按钮同色；错误=深红 #B42318
   - 强调色 acid 只用于激活/选中/主进度/高亮关键词，不用于普通正文
   - 标签与说明不共用一套样式
   ========================================================================== */

/* 1. 文案层级 */
.home-workbench-head p { color: var(--ink-mute); }
.hero p { color: var(--ink-mute); }

/* 2. 卡片标题与说明 */
#public-showcase .showcase-head p { color: var(--ink-mute); }
.showcase-state { color: var(--ink-mute); }

/* 3. 输入框：聚焦与占位分明 */
#vehicle-input { color: var(--ink); }
#vehicle-input::placeholder { color: var(--ink-faint); }

/* 5. 按钮 hover 统一反馈 + 键盘焦点 */
#generate-btn:focus-visible,
#nav-start:focus-visible,
#account-history:focus-visible,
#reset-home-form:focus-visible,
.btn:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; }

/* 6. 链接与文字按钮 */
.hero-catalog-link { color: var(--ink-mute); }
.hero-catalog-link:hover { color: var(--acid-deep); }

/* 7. 错误与成功反馈 */
.runtime-error { color: #B42318 !important; }
.auth-error-ok { color: #1E7E00 !important; }

/* 8. 统一卡内标题层级，避免多个标题视觉等价 */
#vehicle-input-card h3 { color: var(--ink); font-weight: 700; }

/* ==========================================================================
   首页工具型层级（v2 视觉统一）
   ========================================================================== */

/* 主按钮唯一：高对比墨色实底，其余操作不与其竞争 */
#home-design-workbench #generate-btn { background: var(--ink); color: #fff; font-weight: 600; }
#home-design-workbench #generate-btn:hover { background: var(--ink-soft); }
#home-design-workbench #reset-home-form { color: var(--ink-mute); border-color: var(--line); }
#home-design-workbench #reset-home-form:hover { color: var(--ink); border-color: var(--line-hover); background: rgba(31,31,28,.04); }

/* 字段标签最深，输入值次之，占位最浅 */
.field-label { color: var(--ink-mute); }
.field-label em { color: var(--ink-mute); border-color: var(--line); background: var(--paper); }
#vehicle-input { color: var(--ink); }
#vehicle-input::placeholder { color: var(--ink-faint); opacity: 1; }

/* 状态提示弱化：只有圆点用绿，文字用中性灰，不与主按钮竞争 */
.generation-source { color: var(--ink-mute); }
.generation-source.cloud { color: var(--ink-soft); }
.generation-source.local { color: var(--ink-mute); }

/* 移动端：字段标签不裁切，快速输入换行 */
@media (max-width: 680px) {
  .field-label { font-size: 11px; letter-spacing: .06em; }
}

.inspiration-jump[hidden] { display: none !important; }
.inspiration-jump { display: none; }

@media (max-width: 960px) {
  .inspiration-jump {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    display: block;
  }
  .inspiration-jump button {
    min-height: 44px;
    padding: 10px 15px;
    border: 1px solid var(--line-hover);
    border-radius: 999px;
    color: var(--ink);
    background: rgba(255, 255, 252, .94);
    box-shadow: 0 10px 24px -18px rgba(31,31,28,.62);
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(10px);
  }
  .inspiration-jump button:active { transform: translateY(1px); }
  .inspiration-jump button:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; }
}

@media (min-width: 681px) {
  #page-car .home-workbench-head { margin-bottom: 10px; }
  #home-design-workbench .design-card { padding-bottom: 8px; }
  #home-design-workbench #prompt-builder { gap: 10px; }
  #home-design-workbench .generation-source { margin-top: 6px; }
}

/* ---------- 个人中心：全站头像展示 ---------- */
.avatar-img { width: 24px; height: 24px; border-radius: 50%; background: var(--bone); border: 1px solid var(--line); flex: none; }
.showcase-avatar-img { width: 100%; height: 100%; border-radius: 50%; display: block; }
.showcase-dialog-meta { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
.showcase-dialog-avatar { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: var(--bone); }
.showcase-dialog-avatar[hidden] { display: none; }

/* ---------- 首页设计要求：移动优先的三步工作流 ---------- */
#home-design-workbench .design-card {
  position: relative;
  padding: 24px;
}

#home-design-workbench #prompt-builder {
  display: block;
}

/* 车型框与相邻主题框共用同一套四边框外观（桌面与手机都要）：
   基础规则 #vehicle-input 只声明 border-bottom 却带 border-radius，会渲染成缺上半部分的 U 形。
   本规则是 ID + 类，特异度压过基础规则；写在无 media 段，避免只修桌面、手机仍是下划线样式。 */
#home-design-workbench .vehicle-input-wrap input {
  height: 48px;
  padding: 10px 40px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bone);
  font-size: 16px;
  font-weight: 500;
}

#home-design-workbench .vehicle-input-wrap input:focus,
#home-design-workbench .vehicle-input-wrap input:focus-visible {
  border-color: var(--acid-deep);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 254, 19, .16);
}

#home-design-workbench .vehicle-input-wrap input.input-error {
  border-color: #B42318;
}

/* 车型与主题属于同一步骤，插槽本身不再重复承担字段间距。 */
#home-design-workbench .vehicle-input-desktop-block {
  margin: 0;
  padding: 0;
}

#home-design-workbench .generation-source {
  margin-top: 8px;
  font-size: 10.5px;
}

@media (min-width: 681px) {
  #home-design-workbench .design-card {
    padding: 20px;
  }
}

@media (max-width: 680px) {
  #home-design-workbench .design-card {
    padding: 16px;
  }
}

/* 桌面首屏最终收束：三个主动作保持一行，避免登录提示把操作区竖向撑开。 */
@media (min-width: 961px) {
  /* 大屏首页给标题和工作区足够的横向呼吸感。 */
  #page-car {
    max-width: 1680px;
    padding-inline: clamp(24px, 3vw, 56px);
  }

  #page-car .home-workbench-head {
    width: min(100%, 1440px);
    max-width: none;
    margin: 14px auto 34px;
    padding: 0;
    text-align: center;
  }

  #page-car .home-workbench-head h1 {
    font-size: clamp(46px, 5.2vw, 72px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: 0;
  }

  #page-car .home-workbench-head h1 mark {
    padding: 5px 22px 9px;
    border-radius: 14px;
  }

  #page-car .home-workbench-head p {
    max-width: 760px;
    margin: 17px auto 0;
    font-size: 19px;
    line-height: 1.5;
    text-align: center;
  }

  /* 去掉英文眉批后，标题直接承担首屏开头：与导航之间留出一行呼吸空间。 */
  #page-car .home-workbench-head {
    margin-top: 22px;
    margin-bottom: 30px;
  }

  #page-car .home-workbench-head h1 {
    font-size: clamp(46px, 5.2vw, 72px);
    line-height: 1.08;
    letter-spacing: 0;
  }

  #page-car .home-workbench-head p {
    margin: 17px auto 0;
    line-height: 1.5;
    text-align: center;
  }

  #home-design-workbench .generation-source {
    margin-top: 4px;
  }
}

/* ========================================================================== 
   首页灵感流与紧凑表单（20260823-home-inspiration-flow）
   首页仅把酸性绿留给已选标签与最终生成动作；其余层级用纸白和灰墨表达。
   ========================================================================== */

/* 拍扁表单：步骤和字段只保留一层浅边框，不再叠加绿色底或内衬卡片。 */
#home-design-workbench .design-card {
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 32px -30px rgba(31, 31, 28, .42);
}

.field-label em {
  color: var(--ink-mute);
  border: 1px solid var(--line);
  background: var(--paper);
}

/* 非核心状态不抢主 CTA 的酸性绿。 */
.campaign {
  background: var(--paper);
  border-bottom-color: var(--line);
}

.quota-seg i.on,
.nav-history-count {
  color: var(--ink-mute);
  background: var(--paper-dark);
}

#page-car .section-kicker,
#home-design-workbench .design-card-head .section-kicker,
#home-design-workbench .generation-source.cloud {
  color: var(--ink-faint);
}

/* 首页唯一高亮动作：开始生成。 */
#home-design-workbench #generate-btn,
#mobile-dock-generate {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(31, 31, 28, .24);
}

#home-design-workbench #generate-btn:hover,
#mobile-dock-generate:hover {
  background: var(--ink-soft);
  color: #fff;
}

#home-design-workbench #generate-btn:focus-visible,
#mobile-dock-generate:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

#public-showcase .showcase-avatar {
  color: var(--ink-mute);
  background: var(--paper-dark);
}

/* 公开作品现在由“查看”与“带入”两条独立操作构成。 */
.showcase-card {
  position: relative;
}

.showcase-open {
  width: 100%;
  min-width: 0;
  height: 100%;
  display: flex;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.showcase-card--feature .showcase-open,
.showcase-card--side .showcase-open,
.showcase-card--rail .showcase-open,
.showcase-card--more .showcase-open {
  flex: 1 1 auto;
}

.showcase-card--feature .showcase-open,
.showcase-card--rail .showcase-open {
  flex-direction: column;
}

.showcase-card--side .showcase-open,
.showcase-card--more .showcase-open {
  flex-direction: row;
}

.showcase-open:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.showcase-card-actions {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: end;
  padding: 14px;
  background: rgba(24, 25, 22, .58);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s var(--ease);
}

.showcase-card:hover .showcase-card-actions,
.showcase-card:focus-within .showcase-card-actions {
  opacity: 1;
}

.showcase-apply {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, .76);
  border-radius: 6px;
  color: #fff;
  background: rgba(24, 25, 22, .94);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .72);
}

.showcase-apply:hover {
  color: var(--ink);
  border-color: #ccff00;
  background: #ccff00;
}

.showcase-apply:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.inspiration-apply-feedback,
.mobile-inspiration-feedback {
  margin: 8px 0 0;
  color: var(--ink-mute);
  font-size: 11px;
  line-height: 1.45;
}

/* 仅移动端：Hero 后给出一条轻量的灵感橱窗，再进入表单。 */
.mobile-inspiration-strip,
.mobile-generate-dock {
  display: none;
}

.mobile-inspiration-strip[hidden],
.mobile-generate-dock[hidden] {
  display: none !important;
}

@media (max-width: 960px) {
  .mobile-inspiration-strip {
    display: block;
    min-width: 0;
    margin: 0 0 16px;
    padding: 0;
  }

  .mobile-inspiration-strip-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
  }

  .mobile-inspiration-strip h2 {
    color: var(--ink);
    font-size: 16px;
    line-height: 1.3;
  }

  .mobile-inspiration-hint {
    flex: 0 0 auto;
    color: var(--ink-faint);
    font-size: 12px;
  }

  .mobile-inspiration-rail {
    display: flex;
    gap: 10px;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-inspiration-rail::-webkit-scrollbar {
    display: none;
  }

  .mobile-inspiration-card {
    position: relative;
    flex: 0 0 min(76vw, 300px);
    height: 118px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--ink);
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .mobile-inspiration-card > img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center 36%;
    opacity: .83;
  }

  .mobile-inspiration-card::after {
    position: absolute;
    inset: 40% 0 0;
    content: '';
    background: linear-gradient(transparent, rgba(20, 21, 18, .88));
    pointer-events: none;
  }

  .mobile-inspiration-card-copy {
    position: absolute;
    z-index: 1;
    left: 11px;
    right: 10px;
    bottom: 9px;
    display: grid;
    gap: 2px;
    min-width: 0;
    padding-right: 86px;
    color: #fff;
  }

  .mobile-inspiration-card-copy span,
  .mobile-inspiration-card-copy small {
    overflow: hidden;
    color: rgba(255, 255, 255, .72);
    font-size: 10px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-inspiration-card-copy strong {
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-inspiration-apply {
    position: absolute;
    z-index: 2;
    top: 9px;
    right: 9px;
    min-width: 44px;
    min-height: 44px;
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, .72);
    border-radius: 5px;
    color: #fff;
    background: rgba(24, 25, 22, .8);
    font: inherit;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
  }

  .mobile-inspiration-apply:active {
    transform: translateY(1px);
  }

  .mobile-inspiration-apply:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
  }

  .mobile-generate-dock {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 92;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 252, .93);
    box-shadow: 0 -12px 28px -28px rgba(31, 31, 28, .72);
    backdrop-filter: blur(12px);
  }

  .mobile-generate-dock:not([hidden]) {
    display: grid;
  }

  .mobile-generate-dock #mobile-dock-reset,
  .mobile-generate-dock #mobile-dock-generate {
    min-height: 46px;
    border-radius: 7px;
  }

  .mobile-generate-dock #mobile-dock-reset {
    min-width: 78px;
    padding-inline: 11px;
    color: var(--ink-mute);
    background: var(--bone);
  }

  body.has-mobile-generate-dock #page-car {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  /* 手机上的公开作品只保留查看；带入交互由上方灵感条承担。 */
  #public-showcase .showcase-card-actions {
    display: none;
  }

  #public-showcase .showcase-card--side .showcase-open,
  #public-showcase .showcase-card--more .showcase-open {
    flex-direction: column;
  }
}

/* 900px 高度的桌面首屏仍需同时露出车型、主题和生成动作。 */
@media (min-width: 961px) and (max-height: 920px) {
  #page-car {
    padding-top: 12px;
  }

  #page-car .home-workbench-head {
    margin-bottom: 2px;
  }

  #home-design-workbench .vehicle-input-desktop-block {
    margin: 0;
    padding: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .showcase-card-actions {
    transition: none;
  }

  .showcase-rail-timeline-segment.is-active::after {
    transform: scaleX(1);
  }
}

/* 首页车型候选：完整匹配列表在有限视口内独立滚动，避免长品牌列表被静默截断。 */
.vehicle-suggestions {
  max-height: min(420px, calc(100dvh - 150px));
  min-height: 0;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  touch-action: pan-y;
}

.vehicle-suggestions::-webkit-scrollbar {
  width: 8px;
}

.vehicle-suggestions::-webkit-scrollbar-thumb {
  border: 2px solid var(--bone);
  border-radius: 8px;
  background: var(--line-hover);
}

/* 手机端与 vivo X300 Ultra：动态视口、安全区和 44px 触控目标。 */
@media (max-width: 520px) {
  .campaign {
    height: calc(44px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) calc(12px + env(safe-area-inset-right)) 0 calc(12px + env(safe-area-inset-left));
  }

  .campaign a { min-height: 44px; }
  .campaign-copy { display: none; }
  .nav { top: calc(44px + env(safe-area-inset-top)); }

  .nav-inner {
    gap: 6px;
    height: 56px;
    min-width: 0;
    padding-right: calc(10px + env(safe-area-inset-right));
    padding-left: calc(10px + env(safe-area-inset-left));
  }

  .brand {
    gap: 6px;
  }

  .brand-name {
    font-size: 14px;
  }

  .brand,
  .nav-inner .btn,
  .nav-user-btn { min-height: 44px; }

  .btn,
  #vehicle-input,
  .manual-car-form select,
  .manual-car-form input { min-height: 44px; }

  #vehicle-input { padding-right: 46px; }
  /* 空值时清除按钮隐藏，不为它预留空间挤掉车型提示；输入后恢复触控避让。 */
  #home-design-workbench #vehicle-input:placeholder-shown { padding-right: 2px; }
  #vehicle-input-clear { right: -7px; width: 44px; height: 44px; }

  .nav-spacer {
    min-width: 0;
  }

  .nav-auth {
    flex: 0 1 auto;
    gap: 4px;
    min-width: 0;
  }

  .nav-user {
    width: clamp(100px, 27vw, 112px);
  }

  .nav-user-btn {
    gap: 4px;
    padding: 3px 7px 3px 4px;
  }

  .member-badge, .nav-user-chevron { display: none; }

  .nav-history {
    display: inline-flex;
    flex: 0 0 52px;
    justify-content: center;
    min-width: 52px;
    max-width: 52px;
    min-height: 44px;
    gap: 3px;
    padding: 4px 5px;
  }

  .nav-history svg { width: 17px; height: 17px; }
  .nav-history-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .nav-history-count {
    min-width: 16px;
    margin-left: 0;
    padding-inline: 4px;
    font-size: 9.5px;
  }

  .appearance-toggle,
  .appearance-menu-toggle { min-width: 44px; height: 44px; }
  .appearance-menu-toggle { width: 44px; }

  main { padding-top: calc(100px + env(safe-area-inset-top)); }
  body.no-campaign .nav { top: env(safe-area-inset-top); }
  body.no-campaign main { padding-top: calc(56px + env(safe-area-inset-top)); }

  .showcase-apply,
  .site-footer a,
  .history-back,
  .history-type-tab,
  .history-dialog-close { min-height: 44px; }

  .site-footer a,
  .history-dialog-close { min-width: 44px; }

  .angle-close,
  .showcase-card-arrow { width: 44px; height: 44px; }

  /* 44px 圆形触控标识需要同宽网格列；卡片四周统一使用 16px 间距。 */
  .showcase-card--feature .showcase-card-body,
  .showcase-card--rail .showcase-card-body {
    grid-template-columns: minmax(0, 1fr) 44px;
    column-gap: 12px;
    padding: 16px;
  }

  .showcase-card--rail .showcase-card-body {
    flex-basis: 140px;
    min-height: 140px;
  }

  .modify-dialog,
  .engineering-regeneration-dialog,
  .engineering-preflight-dialog,
  .showcase-dialog-shell { max-height: calc(100dvh - 16px); }
  .modify-dialog-shell {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

main,
#page-generating,
.credits-page { min-height: 100dvh; }

.engineering-regeneration-dialog,
.engineering-preflight-dialog,
.engineering-preflight-shell,
.modify-dialog { max-height: calc(100dvh - 40px); }

@media (max-width: 520px) {
  .engineering-regeneration-dialog,
  .engineering-preflight-dialog,
  .engineering-preflight-shell,
  .modify-dialog { max-height: calc(100dvh - 16px); }

  .modify-dialog-shell { max-height: calc(100dvh - 24px); }
}

/* ---------- 作品保留期（spec 03 / D-25、D-26） ---------- */
.history-card-expiry {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(31, 31, 28, .72);
  color: #fff;
}
.history-card-expiry.is-soon { background: var(--warn, #B45309); }
.history-card.is-expired .history-card-image { background: var(--paper-dark); }
.history-card.is-expired .history-card-copy strong { color: var(--ink-mute); }
.history-dialog-expiry,
.board-expiry-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-mute);
}
.history-dialog-expiry.is-soon,
.board-expiry-note.is-soon { color: var(--warn, #B45309); font-weight: 600; }
.history-quota { font-size: 13px; color: var(--ink-mute); }
.history-quota.is-full { color: var(--warn, #B45309); font-weight: 600; }
.angle-expiry-note { display: block; margin-top: 6px; font-size: 12px; color: var(--ink-mute); }
/* 删除确认：原生 dialog 顶层居中。全局 * { margin: 0 } 会清掉 UA 的 margin: auto，
   以前这里没恢复，桌面和手机都贴在左上角。 */
.history-delete-dialog {
  position: fixed; inset: 0; margin: auto;
  width: min(400px, calc(100vw - 32px)); height: fit-content; max-height: calc(100dvh - 32px);
  padding: 0; overflow: auto;
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--bone); color: var(--ink);
  box-shadow: 0 30px 80px -24px rgba(31, 31, 28, .45);
}
.history-delete-dialog::backdrop { background: rgba(20, 20, 18, .5); }
.history-delete-shell { padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 8px; }
.history-delete-shell h2 { margin: 0; font-size: 18px; line-height: 1.4; }
.history-delete-body { margin: 0; color: var(--ink-mute); font-size: 14px; line-height: 1.6; }
.history-delete-error { margin: 0; color: #B3261E; font-size: 13px; line-height: 1.6; }
.history-delete-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.history-delete-actions .btn { min-width: 96px; min-height: 44px; }
@media (max-width: 480px) {
  .history-delete-actions .btn { flex: 1 1 0; min-width: 0; min-height: 46px; }
}
.btn-danger { background: #B3261E; border-color: #B3261E; color: #fff; }
.btn-danger:hover { background: #99201A; border-color: #99201A; }

/* ===== 首页设计要求卡（方案一，issue 05）===== */
#home-design-workbench .brief-card { background: var(--bone); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); }
.brief-head { margin-bottom: 14px; }
.brief-head h2 { margin: 0 0 4px; font-size: 22px; line-height: 1.3; }
.brief-head p { margin: 0; color: var(--ink-mute); font-size: 14px; }

.brief-step { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 16px; margin-top: 12px; }
.brief-step-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.brief-step-head strong { font-size: 16px; }
.brief-idx { display: inline-grid; place-items: center; width: 30px; height: 26px; border-radius: 7px; background: var(--acid); color: var(--acid-ink); font-weight: 700; font-size: 13px; }
.brief-badge { font-style: normal; font-size: 12px; line-height: 20px; border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; color: var(--ink-mute); }
.brief-badge.is-required { border-color: var(--acid-deep); color: var(--acid-deep); }
.brief-tip { margin-left: auto; color: var(--ink-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.brief-tip.is-near { color: var(--warn); font-weight: 600; }

.brief-label { display: block; font-size: 13px; color: var(--ink-soft); margin: 10px 0 4px; }
.brief-input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; background: var(--bone); color: var(--ink); font: inherit; font-size: 15px; }
.brief-input::placeholder { color: var(--ink-faint); }
.brief-input:hover { border-color: var(--line-hover); }
.brief-input:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; }
.brief-area { height: auto; min-height: 104px; padding: 10px 12px; resize: vertical; line-height: 1.6; display: block; }
.brief-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.brief-hint { margin: 0 0 10px; color: var(--ink-mute); font-size: 13px; }
.brief-field-hint { margin: 6px 0 0; font-size: 13px; color: var(--ink-mute); }
.brief-field-hint.is-error { color: #B3261E; }
.brief-field-hint.is-warn { color: #B54708; }

.brief-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.brief-chip-label { font-size: 12px; color: var(--ink-faint); margin-right: 2px; }
.brief-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; border: 1px solid var(--line); background: var(--bone); color: var(--ink); border-radius: 999px; padding: 4px 12px; font-size: 13px; line-height: 1.5; cursor: pointer; transition: background .15s, border-color .15s; }
.brief-chip:hover { border-color: var(--line-hover); }
.brief-chip:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; }
.brief-chip[aria-pressed="true"] { background: var(--acid-tint); border-color: var(--acid-deep); color: var(--acid-deep); font-weight: 600; }
.brief-chip[aria-pressed="true"]::before { content: "✓"; font-size: 11px; }
.brief-chip i { width: 11px; height: 11px; flex: none; border-radius: 50%; background: var(--chip-color); border: 1px solid rgba(0, 0, 0, .15); }

.brief-compliance { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--acid-tint); border: 1px solid color-mix(in srgb, var(--acid-deep) 35%, var(--bone)); cursor: pointer; }
.brief-compliance input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--ink); }
.brief-compliance strong { display: block; font-size: 14px; }
.brief-compliance small { color: var(--ink-mute); font-size: 12px; }

.brief-ref-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.brief-ref-add { aspect-ratio: 1; border: 1.5px dashed var(--line-hover); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; cursor: pointer; color: var(--ink-mute); font-size: 12px; text-align: center; }
.brief-ref-add:hover, .brief-ref-add.is-drag { border-color: var(--acid-deep); background: var(--acid-tint); }
.brief-ref-add:focus-within { outline: 2px solid var(--acid-deep); outline-offset: 2px; }
.brief-ref-add[hidden] { display: none; }
.brief-ref-plus { font-size: 22px; line-height: 1; }
.brief-ref-add small { font-size: 10px; color: var(--ink-faint); line-height: 1.2; }
.brief-thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.brief-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brief-thumb-no { position: absolute; left: 4px; bottom: 4px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 10px; border-radius: 4px; padding: 0 4px; }
.brief-thumb-rm { position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; line-height: 1; }
.brief-thumb-rm::after { content: ""; position: absolute; inset: -6px; }

.brief-error { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 13px; color: #B3261E; background: color-mix(in srgb, #B3261E 8%, var(--bone)); border: 1px solid color-mix(in srgb, #B3261E 30%, var(--bone)); }
.brief-error a, .brief-error button { color: inherit; font-weight: 600; text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }
.brief-service-note { margin: 12px 0 0; font-size: 12px; color: var(--ink-faint); }
#home-design-workbench .brief-card .quota-bar { margin-top: 14px; }

.brief-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; }
.brief-btn { height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line); background: var(--bone); color: var(--ink); cursor: pointer; font: inherit; font-size: 15px; font-weight: 600; }
.brief-btn:hover { border-color: var(--line-hover); }
.brief-btn:focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 2px; }
.brief-btn:disabled { opacity: .55; cursor: not-allowed; }
.brief-btn.is-primary { flex: 1; max-width: 260px; background: var(--ink); color: #fff; border-color: var(--ink); }

.brief-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; max-width: min(90vw, 560px); padding: 10px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 14px; white-space: pre-wrap; }
.brief-toast[hidden] { display: none; }
body.has-mobile-generate-dock .brief-toast { bottom: calc(96px + env(safe-area-inset-bottom)); }

/* 卡片内部节奏：沿用改版前的紧凑节奏，只按键名替换到新结构 */
#home-design-workbench .brief-card .brief-step:first-of-type { margin-top: 0; }
#home-design-workbench .brief-card #prompt-builder { display: block; }

@media (max-width: 560px) {
  #home-design-workbench .brief-card { padding: 16px; }
  .brief-grid2 { grid-template-columns: 1fr; }
  .brief-ref-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ≤960px 时「找找灵感」常驻卡片右上角：标题区让出按钮宽度，避免正文压到按钮下。 */
@media (max-width: 960px) {
  .brief-head { padding-right: 104px; }
}

@media (max-width: 680px) {
  #home-design-workbench { padding-bottom: 0; }
  /* 手机触控目标 ≥44px：快速选与参考图移除按钮都按项目标准放大。 */
  .brief-chip { min-height: 44px; padding: 4px 14px; }
  .brief-thumb-rm { width: 30px; height: 30px; }
  #home-design-workbench .brief-actions {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 16px;
  }
  #home-design-workbench .brief-actions #reset-home-form,
  #home-design-workbench .brief-actions .quota-bar,
  #home-design-workbench .brief-actions #generate-btn { width: 100%; max-width: none; }
  #home-design-workbench .brief-actions .quota-bar { order: 1; }
  #home-design-workbench .brief-actions #generate-btn { order: 2; min-height: 48px; }
  #home-design-workbench .brief-actions #reset-home-form { order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  .brief-chip, .brief-input, .brief-btn { transition: none; }
}

/* ==========================================================================
   全站样式走查（2026-10）：中文排版、标签与弹窗收口
   - 标题、说明和提示统一均衡断行，避免手机上「设 / 计」这类单字落行；
   - 中文标签不再套英文小标签的大写 + 宽字距，统一 12–13px 常规字距；
   - 输入框聚焦统一用品牌绿描边，不再落回系统默认焦点色。
   ========================================================================== */
/* Chrome 的 text-wrap: pretty 只处理单个「词」落行，中文两三个字落到末行时不起作用；
   balance 会把 6 行以内的短文案均匀分行，末行不会只剩「计」「保存。」。
   只写 text-wrap-style 长属性：不改 text-wrap-mode，white-space: nowrap 的元素保持不换行。 */
h1, h2, h3, h4, p, li, dt, dd, small, label, figcaption,
.history-dialog-empty span,
.history-state span,
.showcase-state,
.auth-error,
.engineering-preflight-warning { text-wrap-style: balance; }
/* 固定文案的长标题：只在 <wbr> 标出的词组边界换行，避免「照 / 片」这种拆词；过窄时再兜底任意断行。 */
.credits-card h1 { word-break: keep-all; overflow-wrap: anywhere; }
/* 用户主题标题（app.js setSegmentedTitle）：按「 · 」、括号、分句标点整段换行，段内只在词边界（<wbr>）换行；
   单词过长时由标题自带的 overflow-wrap: anywhere 兜底。 */
.title-seg { display: inline-block; max-width: 100%; }
.title-words { word-break: keep-all; }

/* 没有自带焦点样式的输入框统一用品牌绿；:where 把优先级压到最低，组件自己的焦点规则照常生效。 */
:where(input, textarea, select):focus-visible { outline: 2px solid var(--acid-deep); outline-offset: 1px; }

/* 弹窗操作区已经有分隔线和底色，主按钮不再叠一层悬浮投影。 */
.history-dialog-footer .btn-primary,
.modify-actions .btn-primary,
.engineering-preflight-actions .btn-primary,
.engineering-regeneration-actions .btn-primary { box-shadow: none; }

/* 首页车型标签与「设计主题」等字段标签同一套样式。 */
.field-label,
#home-design-workbench .vehicle-input-desktop-block .field-label { display: block; margin: 0 0 4px; color: var(--ink-soft); font-size: 13px; font-weight: 400; letter-spacing: 0; text-transform: none; }

/* 生成中页与登录弹层的小标签：保留绿点，去掉英文式大写宽字距。 */
.tag { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: none; }

/* 结果页右栏字段标签：和首页表单同名、同层级。 */
.studio-field { gap: 4px; color: var(--ink-soft); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.studio-field input,
.studio-field textarea { font-size: 15px; }
.studio-generation-note { font-size: 12.5px; line-height: 1.6; }
.chat-head p { font-size: 13px; }
.studio-history-head span { font-size: 12px; }
.history-item-meta strong { font-size: 13px; }
.history-item-meta small { font-size: 11.5px; }

/* 登录弹层字段标签 */
.login-modal .field label { margin-bottom: 6px; color: var(--ink-soft); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; }
.login-modal .why { font-size: 13px; }
.login-modal h3 { margin-top: 0; }

/* 首页「02」步骤的「不填也能生成」：窄屏放不下时单独起一行，与标题左对齐，不再孤零零挂在右侧。 */
@media (max-width: 560px) {
  .brief-step-head .brief-tip:not([aria-live]) { flex-basis: 100%; margin-left: 38px; }
}

/* 结果页方案板（深色画布）：小字号按手机可读下限提一档。 */
.board-head p { font-size: 13px; }
.board-palette > span { font-size: 12px; }
.board-summary-copy p,
.board-spec-list span { font-size: 12px; }
.board-summary-copy strong { font-size: 15px; }
.board-type,
.board-reference span,
.mv-ai-tag,
.board-foot span { font-size: 11px; font-weight: 700; letter-spacing: 0; }
.sheet-hint { font-size: 12px; }
.board-foot p { font-size: 12px; line-height: 1.6; }
.board-photo-note { font-size: 12px; line-height: 1.6; }

/* 首页作品卡与灵感条的元信息 */
.showcase-card-vehicle,
.showcase-author-name { font-size: 12px; }
.showcase-card-date,
.showcase-time { font-size: 11.5px; }
@media (max-width: 960px) {
  .mobile-inspiration-card-copy span,
  .mobile-inspiration-card-copy small { font-size: 11.5px; }
  .mobile-inspiration-card-copy strong { font-size: 14px; }
  .mobile-inspiration-apply { font-size: 12px; }
}
@media (max-width: 680px) {
  .showcase-head p { max-width: none; font-size: 13px; }
  .engineering-confirm-check { min-height: 44px; }
  .modify-dialog-shell { padding: 18px 18px calc(20px + env(safe-area-inset-bottom)); }
  .modify-actions .btn { flex: 1 1 0; }
  .history-card-year { font-size: 11px; }
  /* 登录弹层与图片来源页的文字入口：触控区补到 44px。 */
  .login-close { width: 44px; height: 44px; top: 8px; right: 8px; }
  .login-modal .row a,
  .login-upsell a { display: inline-flex; align-items: center; min-height: 44px; }
  .login-modal .row { margin-top: 6px; }
  .credits-back { min-height: 44px; align-items: center; margin-bottom: 16px; }
}
