:root {
  --bg: #0f1115;
  --bg-2: #161a21;
  --bg-3: #1d222b;
  --line: #2a313c;
  --text: #e8e6e1;
  --text-dim: #9aa3af;
  --gold: var(--ds-color-accent, #C9A95D);
  --gold-soft: var(--ds-color-accent-hover, #D7AD62);
  --green: #4caf7d;
  --red: #d65a5a;
  --radius: 10px;
  --sidebar-w: 225px;   /* 2026-08-13 宝爸：sidebar 200→150→225，导航字放大1.5倍后仍不溢出 */
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
.hidden { display: none !important; }

/* ---------------- 登录 ---------------- */
.login-modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  padding: 0; overflow: hidden;
  background: #090b10;
}
#login-modal > .login-card {
  position: relative; isolation: isolate;
  width: 100%; height: 100%; max-width: none; max-height: none; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(420px, 1.2fr); align-items: stretch;
  overflow: hidden; text-align: left;
  background: #080a0e;
  border: 0; border-radius: 0; box-shadow: none;
}
.login-light-field {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: none;
}
.login-showreel {
  position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; overflow: hidden;
  background: #07090c;
}
.login-showreel video {
  width: 100%; height: 100%; display: block; object-fit: cover; object-position: center;
  filter: none;
}
.login-showreel::after {
  content: ''; position: absolute; z-index: 1; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent 38%, rgba(8,10,14,.60) 58%, rgba(8,10,14,.96) 80%, #080a0e 100%);
}
.shuakan-logo {
  width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 13px;
  color: #2c220d; background: linear-gradient(145deg, #f3dc86, #bf9341);
  box-shadow: 0 12px 34px rgba(201,169,97,.25), inset 0 1px 0 rgba(255,255,255,.4);
}
.shuakan-logo svg { width: 31px; height: 31px; overflow: visible; }
.shuakan-logo-frame, .shuakan-logo-lens { fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.shuakan-logo-lens { opacity: .94; stroke-width: 2.2; }
.shuakan-logo-play { fill: currentColor; }
.login-auth-panel {
  position: relative; z-index: 4; grid-column: 2; min-width: 0; height: 100%;
  display: grid; place-items: center; overflow-y: auto; padding: 42px clamp(36px, 3vw, 76px) 42px 20px;
  scrollbar-width: thin; scrollbar-color: rgba(219,188,100,.28) transparent;
  background: none;
}
.login-auth-panel > * { width: 100%; min-width: 0; max-width: clamp(430px, 30vw, 540px); margin-left: auto; margin-right: 0; }
.login-auth-glass {
  position: relative; padding: 0; border: 0; border-radius: 0;
  background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
.login-auth-glass > * { position: relative; z-index: 1; }
.login-auth-brand { display: flex; align-items: center; justify-content: center; margin-bottom: 44px; }
.login-auth-brand img { display: block; width: min(90%, 430px); height: auto; object-fit: contain; }
.login-auth-head { margin-bottom: 42px; text-align: center; }
.login-auth-head h1 { margin: 0; color: #f6f3ec; font-size: clamp(34px, 1.9vw, 38px); font-weight: 650; line-height: 1.2; letter-spacing: 0; text-align: center; }
.login-auth-head p { margin: 0; color: #737b88; font-size: 13px; }
.brand { color: #ead079; font-size: clamp(23px, 2vw, 28px); font-weight: 800; letter-spacing: .06em; }
.login-method-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 0 0 30px; border-bottom: 1px solid rgba(255,255,255,.075); }
.invite-login-note { margin: -12px 0 20px; padding: 12px 14px; border: 1px solid rgba(208,173,85,.32); border-radius: 10px; color: #f2eee5; background: rgba(14,16,20,.68); font-size: 13px; line-height: 1.5; }
.login-method-tabs:has(button[hidden]) { grid-template-columns: 1fr; }
.login-method-tabs button {
  position: relative; min-width: 0; padding: 0 4px 13px; border: 0; color: #777f8b; background: transparent;
  font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.login-method-tabs button::after { content: ''; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 2px; border-radius: 2px; background: transparent; }
.login-method-tabs button:hover { color: #c9ced6; }
.login-method-tabs button.active { color: #f2eee5; }
.login-method-tabs button.active::after { background: #d0ad55; box-shadow: 0 0 14px rgba(208,173,85,.34); }
.login-method-panel { min-height: 218px; }
.login-method-selector { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 0 16px; }
.login-method-selector > label { width: min(100%, 300px); flex: 0 0 auto; color: #a9b0bc; font-size: 13px; font-weight: 700; }
.login-select-shell { position: relative; width: min(100%, 300px); min-width: 0; flex: 0 0 auto; }
.login-select-shell select {
  width: 100%; min-width: 0; min-height: 46px; appearance: none; -webkit-appearance: none;
  padding: 0 44px 0 16px; border: 1px solid rgba(224,194,105,.24); border-radius: 14px;
  color: #ecd174; background: linear-gradient(145deg, rgba(17,20,27,.9), rgba(8,11,16,.72));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 10px 28px rgba(0,0,0,.14);
  font: inherit; font-size: 14px; font-weight: 720; outline: none; cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.login-select-shell select:hover { border-color: rgba(224,194,105,.46); background: linear-gradient(145deg, rgba(22,25,33,.95), rgba(10,13,19,.82)); }
.login-select-shell select:focus { border-color: rgba(213,183,93,.72); box-shadow: 0 0 0 3px rgba(201,169,97,.09), 0 12px 32px rgba(0,0,0,.2); }
.login-select-shell option { color: #ece8de; background: #151820; }
.login-select-shell > span { position: absolute; top: 50%; right: 15px; color: #d8ba62; transform: translateY(-54%); pointer-events: none; font-size: 17px; }
.login-form { display: flex; flex-direction: column; gap: 20px; }
.login-form .btn { min-height: 56px; border-radius: 14px; font-size: 16px; }
.login-register-title { margin-bottom: 12px; color: #f3efe6; font-size: 24px; font-weight: 800; text-align: left; }
.login-register-contact { gap: 10px; }
.login-register-contact input { min-width: 0; flex: 1; }
.login-form > .btn-gold { width: 100%; }
.login-provider-panel { min-height: 122px; }
.login-provider-head { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px; border: 1px solid rgba(255,255,255,.075); border-radius: 14px; background: rgba(8,11,17,.42); }
.login-provider-head strong { color: #eef0f4; font-size: 15px; }
.login-provider-icon { width: 34px; height: 34px; flex: 0 0 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; }
.login-provider-icon svg { width: 21px; height: 21px; fill: currentColor; }
.login-provider-wechat .login-provider-icon { background: #07c160; box-shadow: 0 9px 24px rgba(7,193,96,.2); }
.login-provider-qq .login-provider-icon { background: #12b7f5; box-shadow: 0 9px 24px rgba(18,183,245,.2); }
.login-qr-shell { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 0 5px; }
.login-qr-shell small { color: #7f8896; font-size: 12px; }
.login-qr-placeholder {
  position: relative; width: 184px; height: 184px; display: grid; place-items: center; overflow: hidden;
  border: 9px solid #f4f5f7; border-radius: 14px; background: #f4f5f7;
  box-shadow: 0 18px 42px rgba(0,0,0,.25);
}
.login-qr-placeholder::before {
  content: ''; position: absolute; inset: 0; opacity: .88;
  background:
    linear-gradient(90deg, #171b22 12px, transparent 12px) 0 0 / 29px 29px,
    linear-gradient(#171b22 12px, transparent 12px) 0 0 / 29px 29px,
    linear-gradient(90deg, transparent 17px, #171b22 17px 24px, transparent 24px) 0 0 / 29px 29px,
    linear-gradient(transparent 17px, #171b22 17px 24px, transparent 24px) 0 0 / 29px 29px;
}
.login-qr-placeholder .login-provider-icon { position: relative; z-index: 1; width: 48px; height: 48px; border: 5px solid #fff; border-radius: 14px; }
.login-form input {
  width: 100%; min-width: 0; min-height: 56px; padding: 12px 18px;
  border: 1px solid rgba(255,255,255,.09); border-radius: 14px;
  color: #eef0f4; background: rgba(8,11,16,.58); font-size: 16px; outline: none;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.login-form input::placeholder { color: #6f7887; }
.login-form input:hover { border-color: rgba(255,255,255,.16); background: rgba(10,13,19,.72); }
.login-form input:focus { border-color: rgba(213,183,93,.68); box-shadow: 0 0 0 3px rgba(201,169,97,.09); }
.login-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.login-code-row button {
  min-width: 120px; border: 1px solid rgba(224,194,105,.24); border-radius: 14px; color: #dfc36d;
  background: rgba(207,169,72,.08); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
}
.login-code-row button:hover { background: rgba(207,169,72,.14); border-color: rgba(224,194,105,.52); }
.login-register-entry { margin-top: 30px; color: #9098a4; font-size: 14px; text-align: center; }
.login-register-entry button { padding: 2px 4px; border: 0; color: #d8ba62; background: transparent; font: inherit; cursor: pointer; }
.login-register-entry button:hover { color: #f0d57e; }
.login-wechat-panel { min-height: 214px; display: grid; align-content: center; justify-items: center; gap: 10px; text-align: center; }
.login-wechat-panel > strong { color: #f1eee6; font-size: 18px; }
.login-wechat-panel > small { color: #838b97; font-size: 12px; line-height: 1.6; }
.login-qr-status { margin: 0; color: #b6a272; font-size: 14px; }
.login-wechat-button {
  width: 100%; display: flex; align-items: center; gap: 15px; padding: 16px 18px; border: 1px solid rgba(7,193,96,.28); border-radius: 15px;
  color: #ecf4ef; background: rgba(7,193,96,.075); text-align: left; font: inherit; cursor: pointer;
}
.login-wechat-button:hover { border-color: rgba(7,193,96,.48); background: rgba(7,193,96,.12); }
.login-wechat-mark { width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #07c160; font-size: 19px; font-weight: 800; }
.login-wechat-button span:last-child { display: grid; gap: 2px; }
.login-wechat-button strong { font-size: 15px; }
.login-wechat-button small { color: #8d969f; font-size: 11px; font-weight: 500; }
.login-msg { color: var(--red); font-size: 13px; min-height: 16px; }
.password-wrap { position: relative; }
.password-wrap input { width: 100%; padding-right: 38px; }
.toggle-pass {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #77808e;
  font-size: 12px; cursor: pointer; padding: 4px;
}
.toggle-pass.active { color: var(--gold); }
.shuakan-logo-nav { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; box-shadow: inset 0 1px 0 rgba(255,255,255,.34); }
.shuakan-logo-nav svg { width: 23px; height: 23px; }
.logo:has(.shuakan-logo)::before { display: none; }

@media (prefers-reduced-motion: reduce) {
  .login-showreel video { animation: none !important; }
}

/* ---------------- 框架 ---------------- */
.app { display: flex; height: 100vh; }
.app.sidebar-hidden .sidebar { display: none; }
.app.sidebar-hidden .content { width: 100%; }
.app.sidebar-hidden .topbar { display: none; }  /* 项目四页隐藏全局顶栏，统一用 #studio-head */
.sidebar {
  width: 212px; flex: 0 0 212px;
  background: rgba(242,242,244,.96); border-right: 1px solid rgba(0,0,0,.08);
  display: flex; flex-direction: column; padding: 0;
  color: #1d1d1f;
}
.logo {
  color: #1d1d1f; font-weight: 650; font-size: 15px; letter-spacing: -.01em;
  height: 56px; display: flex; align-items: center; justify-content: flex-start; gap: 10px;
  padding: 0 18px; border-bottom: 1px solid rgba(0,0,0,.08); text-decoration: none;
  /* 2026-08-13 宝爸：logo 与顶部 topbar 标题同高居中，底部线与 topbar 底边对齐 */
}
.logo::before {
  content: '耍'; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 8px; color: #6b531d; background: #f3ead0;
  box-shadow: inset 0 0 0 1px rgba(161,126,46,.22); font-size: 13px; font-weight: 700;
}
.nav { flex: 1; display: flex; flex-direction: column; padding: 14px 10px 18px; gap: 5px; }
.nav a {
  min-height: 38px; display: flex; align-items: center; gap: 10px;
  color: #6e6e73; text-decoration: none; padding: 0 11px;
  border-radius: 10px; font-size: 13.5px; transition: background .14s, color .14s;
  text-align: left;
}
.nav a::before { content: '•'; width: 16px; height: 16px; flex: 0 0 16px; display: grid; place-items: center; font-size: 15px; line-height: 1; opacity: .78; }
.nav a[data-route="projects"]::before{content:'▦'}.nav a[data-route="generate"]::before{content:'▷'}.nav a[data-route="assets"]::before{content:'◇'}.nav a[data-route="jobs"]::before{content:'◷'}
.nav a.nav-sep { margin-top: 3px; }
.nav a:hover { background: rgba(0,0,0,.045); color: #1d1d1f; }
.nav a.active { background: rgba(201,169,97,.18); color: #604915; font-weight: 600; }
/* 2026-08-13 宝爸：导航项全部居中；"AI 群聊"加 letter-spacing 使其视觉宽度与 4 字项一致 */
.nav a[data-route="chat"] { letter-spacing: 1.5px; }
.sidebar-foot { padding: 10px; border-top: 1px solid rgba(0,0,0,.08); font-size: 12px; color: #86868b; }
.sidebar-account { position: relative; display: flex; align-items: center; gap: 8px; }
.account-entry {
  width: 100%; min-height: 52px; display: flex; align-items: center; gap: 10px;
  border: 1px solid transparent; border-radius: 12px; padding: 7px 8px;
  color: #1d1d1f; background: transparent; cursor: pointer; text-align: left;
  transition: background-color var(--motion-duration-navigation) var(--motion-ease-standard), border-color var(--motion-duration-navigation) var(--motion-ease-standard), transform var(--motion-duration-micro) var(--motion-ease-standard);
}
.account-entry:hover, .account-entry[aria-expanded="true"] { background: rgba(255,255,255,.82); border-color: rgba(0,0,0,.08); }
.account-entry:active { transform: scale(.985); }
.account-avatar {
  width: 34px; height: 34px; flex: 0 0 34px; display: block; object-fit: cover;
  border-radius: 50%; background: #262a31;
  box-shadow: 0 0 0 1px rgba(201,169,97,.26), 0 4px 12px rgba(0,0,0,.18);
}
.account-avatar-lg { width: 42px; height: 42px; flex-basis: 42px; }
.account-entry-copy, .account-popover-identity { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.account-entry-copy { flex: 1; }
.account-entry-copy strong, .account-popover-identity strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: #1d1d1f; }
.account-entry-copy span, .account-popover-identity span { color: #86868b; font-size: 11px; }
.account-entry-side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 2px; }
.account-chevron { color: #86868b; font-size: 14px; transform: translateY(2px); transition: transform var(--motion-duration-popover) var(--motion-ease-standard); }
.account-entry[aria-expanded="true"] .account-chevron { transform: rotate(180deg) translateY(-1px); }
.account-popover {
  position: absolute; z-index: 80; top: calc(100% + 8px); right: 0; bottom: auto; left: auto;
  width: min(308px, calc(100vw - 24px)); padding: 8px; border: 1px solid rgba(0,0,0,.1); border-radius: 15px;
  background: rgba(255,255,255,.97); box-shadow: 0 18px 48px rgba(30,24,12,.18);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(calc(var(--motion-distance-popover) * -1)); transform-origin: right top;
  transition: opacity var(--motion-duration-popover-exit) var(--motion-ease-exit), transform var(--motion-duration-popover-exit) var(--motion-ease-exit), visibility 0s linear var(--motion-duration-popover-exit);
}
.account-popover.show { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); transition: opacity var(--motion-duration-popover) var(--motion-ease-enter), transform var(--motion-duration-popover) var(--motion-ease-enter); }
.sidebar > .sidebar-account .account-popover { top: auto; right: 10px; bottom: calc(100% + 8px); left: 10px; width: auto; transform-origin: right bottom; }
.account-popover-head { display: flex; align-items: center; gap: 10px; padding: 7px 7px 11px; border-bottom: 1px solid rgba(0,0,0,.07); }
.account-menu-group { padding: 8px 0 2px; }
.account-menu-links { padding-top: 7px; }
.account-menu-label { display: block; padding: 2px 9px 5px; color: #9a9a9f; font-size: 10px; letter-spacing: .08em; }
.account-menu-link, .account-logout {
  width: 100%; min-height: 34px; display: flex; align-items: center; border: 0; border-radius: 9px;
  padding: 0 10px; color: #3d3d40; background: transparent; text-decoration: none;
  font: inherit; font-size: 12.5px; cursor: pointer; transition: background .14s ease, color .14s ease;
}
.account-menu-link:hover, .account-menu-link.active { color: #604915; background: rgba(201,169,97,.16); }
.account-logout { margin-top: 7px; border-top: 1px solid rgba(0,0,0,.07); border-radius: 0 0 9px 9px; color: #a44343; }
.account-logout:hover { background: rgba(196,70,70,.08); }
@media (prefers-reduced-motion: reduce) {
  .account-entry, .account-chevron, .account-popover { transition-duration: var(--motion-duration-instant); }
}

.content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 54px; flex: 0 0 54px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; border-bottom: 1px solid rgba(0,0,0,.08); background: rgba(255,255,255,.86);
  color: #1d1d1f; backdrop-filter: blur(14px);
}
.topbar h1 { font-size: 15px; font-weight: 600; margin: 0; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.workspace-account-host { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; }
.workspace-account-host .sidebar-account { padding: 0; border: 0; color: inherit; }
.workspace-account-host .account-entry { width: auto; min-height: 38px; padding: 3px 8px; }
.workspace-account-host .account-entry-copy { min-width: 88px; max-width: 150px; }
/* 顶部常驻刷新按钮（PWA 手动拉取最新内容） */
.tb-refresh {
  width: 36px; height: 36px; flex: 0 0 auto;
  border-radius: 9px; border: 1px solid rgba(0,0,0,.1);
  background: #fff; color: #6e6e73; font-size: 15px; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, transform .12s;
}
.tb-refresh:hover { background: #f2f2f4; }
.tb-refresh:active { transform: scale(0.92); }
.wallet-balance {
  font-size: 10.5px; font-weight: 650; color: #6b531d;
  background: rgba(201,169,97,.14); border: 1px solid rgba(161,126,46,.15);
  padding: 3px 6px; border-radius: 8px; white-space: nowrap; user-select: none;
}
.view { flex: 1; overflow-y: auto; padding: 28px; }
.view:has(.cover-clean), .view:has(.wk-library) { padding: 0; background: #f5f5f7; color: #1d1d1f; }
.view[data-page="generate"], .view[data-page="assets"], .view[data-page="jobs"],
.view[data-page="prompts"], .view[data-page="chat"], .view[data-page="providers"],
.view[data-page="platform"], .view[data-page="billing"] {
  background: #f5f5f7; color: #1d1d1f;
  --bg: #f5f5f7; --bg-2: #fff; --bg-3: #f2f2f4;
  --line: rgba(0,0,0,.08); --text: #1d1d1f; --text-dim: #6e6e73;
}
#studio-head:not(:has(*)) { display: none; }

/* ---------------- 按钮 ---------------- */
.btn {
  min-height: var(--ds-control-height-normal, 34px); border: none;
  border-radius: var(--ds-radius-control, 9px); padding: 0 var(--ds-control-padding-x, 12px);
  font-size: 13px; line-height: 1.2; cursor: pointer; font-weight: 600;
  transition: background-color var(--motion-duration-control) var(--motion-ease-standard), border-color var(--motion-duration-control) var(--motion-ease-standard), color var(--motion-duration-control) var(--motion-ease-standard), box-shadow var(--motion-duration-control) var(--motion-ease-standard), transform var(--motion-duration-micro) var(--motion-ease-standard);
}
.btn-gold { background: var(--gold); color: #1a1308; }
.btn-gold:hover { background: var(--gold-soft); }
.btn-gold:active { background: var(--ds-color-accent-pressed, #B58A2A); }
/* 一键多模型并行生成：电光蓝紫，醒目区分于单模型金色 */
.btn-electric { background: linear-gradient(135deg, #4f7cff, #7b5cff); color: #fff; box-shadow: 0 2px 12px rgba(91, 110, 255, .35); }
.btn-electric:hover { filter: brightness(1.1); box-shadow: 0 4px 16px rgba(91, 110, 255, .5); }
.btn-electric:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; filter: none; }
.btn-ghost { background: var(--ds-color-surface, #fff); color: var(--ds-color-text-primary, var(--text)); border: var(--ds-border-control, 1px solid var(--line)); }
.btn-ghost:hover { color: var(--ds-color-text-primary, var(--text)); border-color: var(--ds-color-border-strong, var(--gold)); background: var(--ds-color-hover-neutral, rgba(0,0,0,.04)); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { color: var(--ds-color-text-disabled, #aeaeb2); cursor: not-allowed; box-shadow: none; }
.btn[aria-busy="true"] { min-width: var(--loading-button-width, auto); cursor: wait; }
.btn:focus-visible, .btn-mini:focus-visible, .btn-xs:focus-visible,
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 0;
  box-shadow: var(--ds-focus-ring, 0 0 0 3px rgba(201,169,93,.38));
}
.btn-mini { background: transparent; color: var(--text-dim); border: 1px solid var(--line); border-radius: 6px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.btn-mini:hover { color: var(--text); }
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: 6px; white-space: nowrap; }
.save-status { font-size: 12px; color: var(--green); }

/* ---------------- 卡片/网格 ---------------- */
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; transition: .15s;
}
.card:hover { border-color: var(--gold); }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .num { font-size: 28px; font-weight: 800; color: var(--gold); }
.stat .lbl { color: var(--text-dim); font-size: 13px; }

.section-title { font-size: 17px; font-weight: 700; margin: 0 0 14px; color: var(--text); }
.muted { color: var(--text-dim); }
.empty { color: var(--text-dim); text-align: center; padding: 60px 0; }

/* ---------------- 缩略图 ---------------- */
.thumb { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 8px; background: var(--bg-3); border: 1px solid var(--line); }
.thumb-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.thumb-row img, .thumb-row video { width: 48px; height: 64px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); }
.golden-badge { color: var(--gold); font-size: 12px; }

/* ---------------- 表单 ---------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 920px; }
.field { display: flex; flex-direction: column; gap: 10px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 18px; color: var(--text-dim); font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; box-sizing: border-box;
  background: var(--bg-3); border: 1px solid var(--line); color: var(--text);
  padding: 14px 18px; border-radius: 8px; font-size: 18px; outline: none; font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); }
.field textarea { resize: vertical; min-height: 120px; }

/* 旧主页面：制作视频（UI07） */
.view[data-page="generate"] { padding: 28px 32px; }
.view[data-page="generate"] > .form-grid {
  width: min(880px, 100%); max-width: none; gap: 18px 16px;
  padding: 24px; border: 1px solid rgba(0,0,0,.07); border-radius: 18px;
  background: #fff; box-shadow: 0 8px 28px rgba(0,0,0,.05);
}
.view[data-page="generate"] .field { gap: 6px; }
.view[data-page="generate"] .field label { color: #6e6e73; font-size: 12px; font-weight: 600; }
.view[data-page="generate"] .field input,
.view[data-page="generate"] .field select,
.view[data-page="generate"] .field textarea {
  min-height: var(--ds-control-height-normal, 34px); padding: 8px 11px; border-color: var(--ds-color-border-control, rgba(0,0,0,.1));
  border-radius: var(--ds-radius-control, 9px); background: #f7f7f8; color: var(--ds-color-text-primary, #1d1d1f); font-size: 13px;
  transition: border-color var(--motion-duration-control) var(--motion-ease-standard), box-shadow var(--motion-duration-control) var(--motion-ease-standard), background-color var(--motion-duration-control) var(--motion-ease-standard);
}
.view[data-page="generate"] .field textarea { min-height: 104px; line-height: 1.55; }
.view[data-page="generate"] .field input:focus,
.view[data-page="generate"] .field select:focus,
.view[data-page="generate"] .field textarea:focus {
  border-color: rgba(161,126,46,.55); background: #fff;
  box-shadow: var(--ds-focus-ring, 0 0 0 3px rgba(201,169,93,.38));
}
.view[data-page="generate"] #f-submit { min-height: 36px; padding: 0 18px; float: right; font-size: 13px; }

/* 类型卡片选择（对标剧创比例选择器） */
.type-card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.type-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 16px 8px;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; transition: all .15s ease;
  user-select: none;
}
.type-card:hover { border-color: rgba(201,169,97,.5); background: rgba(201,169,97,.05); }
.type-card.selected {
  border-color: var(--gold); background: rgba(201,169,97,.12);
  box-shadow: 0 0 0 1px var(--gold);
}
.type-card-icon { font-size: 28px; line-height: 1; }
.type-card-label { font-size: 13px; color: var(--text); font-weight: 500; }
@media (max-width: 720px) {
  .type-card-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 剧本大纲文本框（深色统一） */
.script-outline {
  background: var(--bg-2) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
  min-height: 240px;
  line-height: 1.8;
  font-size: 14px;
  padding: 16px;
  border-radius: 10px;
  font-family: inherit;
  letter-spacing: 0.3px;
}
.script-outline::placeholder { color: var(--text-dim); }
.script-outline:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px rgba(201,169,97,.15) !important;
}

/* 剧本信息表单（一行 6 列：标题占 2 份，AI 分析占 2 份） */
.script-form-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr 2fr;
  gap: 8px;
  max-width: 1100px;
  margin-bottom: 12px;
  align-items: end;
}
@media (max-width: 900px) {
  .script-form-row { grid-template-columns: 2fr 1fr 1fr; }
  .script-form-row .ai-field { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .script-form-row { grid-template-columns: 1fr 1fr; }
  .script-form-row .ai-field { grid-column: 1 / -1; }
}

/* AI 分析紧凑状态条（放在分辨率后面） */
.ai-status-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  min-height: 38px; padding: 6px 10px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px;
}
.ai-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ai-status-text { font-weight: 600; margin-right: 4px; white-space: nowrap; }
.ai-stat-pill {
  padding: 2px 8px; border-radius: 12px;
  background: rgba(201,169,97,.10); border: 1px solid rgba(201,169,97,.25);
  color: var(--gold); font-size: 12px; white-space: nowrap;
}

/* 剧本信息下拉（对标剧创紫色高亮下拉） */
.script-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-2) !important;
  color: var(--text) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23a78bfa' d='M6 8L0 0h12z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 10px !important;
  border: 1.5px solid var(--line) !important;
  border-radius: 8px !important;
  padding: 8px 28px 8px 12px !important;
  font-size: 13px !important;
  font-family: inherit !important;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.script-select:hover { border-color: rgba(167,139,250,.4) !important; }
.script-select:focus {
  outline: none;
  border-color: #a78bfa !important;
  box-shadow: 0 0 0 3px rgba(167,139,250,.18) !important;
}
.script-select option { background: var(--bg-2); color: var(--text); }
.script-outline:focus { border-color: var(--gold) !important; }

/* AI 人物小传卡片 */
.char-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.char-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}
.char-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.char-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), rgba(201,169,97,.3));
  color: var(--bg-1);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.char-name { font-size: 15px; font-weight: 600; color: var(--text); }
.char-alias { font-size: 12px; color: var(--text-dim); font-weight: 400; margin-left: 4px; }
.char-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.char-bio { font-size: 13px; color: var(--text); line-height: 1.6; margin-bottom: 8px; }
.char-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.char-prompt { font-size: 12px; color: var(--text-dim); line-height: 1.5; padding-top: 8px; border-top: 1px solid var(--line); }

/* AI 分集剧情分页 */
.ep-pagination {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
}
.ep-page-btn {
  min-width: 32px; height: 32px; padding: 0 10px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); font-size: 13px; cursor: pointer; transition: .15s;
}
.ep-page-btn:hover { border-color: var(--gold); color: var(--gold); }
.ep-page-btn.active { background: var(--gold); color: var(--bg-1); border-color: var(--gold); }
.ep-card {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px;
}
.ep-title { font-size: 15px; font-weight: 600; color: var(--gold); margin-bottom: 8px; }
.ep-summary { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ep-section { margin-bottom: 12px; }
.ep-section-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.ep-section-body { font-size: 13px; color: var(--text-dim); line-height: 1.7; }

/* ---------------- 表格/任务 ---------------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { color: var(--text-dim); font-weight: 600; }
.pill { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.pending { background: rgba(154,163,175,.18); color: var(--text-dim); }
.pill.running { background: rgba(201,169,97,.18); color: var(--gold-soft); }
.pill.succeeded { background: rgba(76,175,125,.18); color: var(--green); }
.pill.failed { background: rgba(214,90,90,.18); color: var(--red); }
.pill.canceled { background: rgba(154,163,175,.12); color: var(--text-dim); }
.pill.fb { background: rgba(99,156,255,.18); color: #8fb6ff; border: 1px solid rgba(99,156,255,.4); }

.progress { height: 6px; background: var(--bg-3); border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--gold); transition: width .3s; }

.job-line { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.job-line .t { flex: 0 0 150px; }
.job-line .bar { flex: 1; }

/* 旧主页面：Activity List 与管理表格（UI07） */
.view[data-page="jobs"], .view[data-page="providers"],
.view[data-page="platform"], .view[data-page="billing"] { padding: 28px 32px; }
.view[data-page="jobs"] > .row:first-child {
  min-height: 40px; margin: 0 0 12px; padding: 0 4px; color: #1d1d1f;
}
.view[data-page="jobs"] > .row:first-child strong { color: #8a6a20; font-size: 13px; }
.view[data-page="jobs"] #job-list {
  overflow: hidden; border: 1px solid rgba(0,0,0,.07); border-radius: 16px;
  background: #fff; box-shadow: 0 8px 26px rgba(0,0,0,.045);
}
.view[data-page="jobs"] .job-line { min-height: 66px; padding: 11px 14px; border-color: rgba(0,0,0,.065); }
.view[data-page="jobs"] .job-line:last-child { border-bottom: 0; }
.view[data-page="jobs"] .job-line .t { flex-basis: 190px; color: #1d1d1f; font-size: 13px; font-weight: 600; }
.view[data-page="jobs"] .job-line .muted { color: #86868b; font-weight: 400; }
.view[data-page="jobs"] .progress { height: 5px; background: #ededf0; }
.view[data-page="jobs"] [data-cancel] { color: #b33a3a; border-color: rgba(179,58,58,.16); background: transparent; }

.view[data-page="providers"] > .row:first-child,
.view[data-page="platform"] > .row:first-child,
.view[data-page="billing"] > .row:first-child {
  margin: 0 auto 16px; max-width: 1460px; color: #1d1d1f;
}
.view[data-page="providers"] .section-title,
.view[data-page="billing"] h2 { color: #1d1d1f; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.view[data-page="providers"] > table,
.view[data-page="platform"] > table,
.view[data-page="billing"] > table {
  max-width: 1460px; margin: 0 auto; overflow: hidden;
  border: 1px solid rgba(0,0,0,.07); border-radius: 16px;
  border-collapse: separate; border-spacing: 0; background: #fff;
  box-shadow: 0 8px 26px rgba(0,0,0,.045); color: #1d1d1f;
}
.view[data-page="providers"] th, .view[data-page="platform"] th, .view[data-page="billing"] th {
  height: 42px; padding: 0 12px; border-color: rgba(0,0,0,.07);
  background: #f7f7f8; color: #6e6e73; font-size: 11px; font-weight: 600;
}
.view[data-page="providers"] td, .view[data-page="platform"] td, .view[data-page="billing"] td {
  min-height: 48px; padding: 10px 12px; border-color: rgba(0,0,0,.065); color: #1d1d1f; font-size: 13px;
}
.view[data-page="providers"] tbody tr:hover,
.view[data-page="platform"] tbody tr:hover,
.view[data-page="billing"] tbody tr:hover { background: #fafafa; }
.view[data-page="providers"] .btn-mini,
.view[data-page="platform"] .btn-mini { min-height: 30px; border-color: rgba(0,0,0,.1); color: #6e6e73; background: #fff; }
.view[data-page="providers"] .btn-mini.danger { color: #b33a3a; border-color: rgba(179,58,58,.18); }
.view[data-page="billing"] td:nth-child(n+5) { font-variant-numeric: tabular-nums; }

@media (max-width: 1100px) {
  .view[data-page="generate"], .view[data-page="jobs"], .view[data-page="providers"],
  .view[data-page="platform"], .view[data-page="billing"] { padding: 22px 24px; }
  .view[data-page="providers"], .view[data-page="platform"], .view[data-page="billing"] { overflow-x: auto; }
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; top: 70px; right: 20px; bottom: auto; left: auto;
  width: max-content; max-width: min(180px, calc(100vw - 40px)); min-height: 38px;
  overflow: hidden; padding: 9px 13px; white-space: nowrap; text-overflow: ellipsis;
  background: rgba(29,29,31,.94); border: 0; color: #fff;
  border-radius: 10px; z-index: 60; box-shadow: 0 10px 28px rgba(0,0,0,.18); backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(var(--motion-distance-toast));
  transition: opacity var(--motion-duration-toast-exit) var(--motion-ease-exit), transform var(--motion-duration-toast-exit) var(--motion-ease-exit);
}
.toast.is-visible { opacity: 1; transform: translateY(0); transition-duration: var(--motion-duration-toast); transition-timing-function: var(--motion-ease-enter); }

@media (prefers-reduced-motion: reduce) {
  .toast { transition-duration: var(--motion-duration-instant); }
}

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.tag { font-size: 12px; color: var(--text-dim); border: 1px solid var(--line); padding: 3px 10px; border-radius: 6px; }

/* ==================== 移动端适配 (≤768px) ==================== */
/* 桌面端默认隐藏汉堡菜单按钮（移动端媒体查询内再显示） */
.menu-toggle { display: none; }

@media (max-width: 768px) {

  /* ---- 汉堡菜单按钮 ---- */
  .menu-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; background: none; border: 1px solid var(--line);
    border-radius: 8px; color: var(--text-dim); font-size: 18px; cursor: pointer;
    transition: .15s; flex-shrink: 0;
  }
  .menu-toggle:hover { border-color: var(--gold); color: var(--gold); }

  /* ---- 侧栏：默认隐藏，点击展开为全屏覆盖 ---- */
  .app.sidebar-hidden .sidebar { display: none !important; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
    width: 300px !important;
    transform: translateX(-100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 60px rgba(0,0,0,.6); }

  /* 遮罩层（JS 动态插入） */
  .sidebar-overlay {
    position: fixed; inset: 0; z-index: 99;
    background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none; transition: opacity .28s;
  }
  .sidebar-overlay.show { opacity: 1; pointer-events: auto; }

  /* ---- 内容区：全宽 ---- */
  .content { width: 100%; }
  .topbar { padding: 0 16px; height: 52px; flex-shrink: 0; }
  .topbar h1 { font-size: 16px; }
  .view { padding: 16px 14px; }

  /* ---- 项目内页头部（#studio-head）：标题不挤压、导航可横向滚动 ---- */
  #studio-head { padding: 12px 14px 0; }
  #studio-head .wb-head-top { flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
  #studio-head .wb-back { margin-right: 0; }
  #studio-head .wb-head-title { flex-wrap: wrap; gap: 6px; min-width: 0; }
  #studio-head .wb-head-title strong { font-size: 15px; word-break: break-word; }
  #studio-head .wb-step-links { width: 100%; overflow-x: auto; gap: 0; padding-bottom: 4px; }
  #studio-head .wb-step-link { white-space: nowrap; font-size: 14px; padding: 4px 10px; }
  #studio-head .wb-step-sep { white-space: nowrap; }

  /* ---- 网格：自动缩减列数 ---- */
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .grid.cols-2 { grid-template-columns: 1fr 1fr; gap: 12px; }

  /* ---- 统计卡片：紧凑横向 ---- */
  .stat { flex-direction: row; align-items: center; gap: 10px; }
  .stat .num { font-size: 22px; }
  .stat .lbl { font-size: 11px; }

  /* ---- 表单：单列 ---- */
  .form-grid { grid-template-columns: 1fr; gap: 12px; }

  /* ---- 表格：横向滚动 ---- */
  table { font-size: 12px; display: block; overflow-x: auto; white-space: nowrap; }
  th, td { padding: 8px 10px; }

  /* ---- 任务行 ---- */
  .job-line { flex-wrap: wrap; gap: 8px; padding: 10px 0; }
  .job-line .t { flex: 0 0 auto; font-size: 12px; min-width: 70px; }

  /* ---- 登录框 ---- */
  .brand { font-size: 26px; }

  /* ---- 缩略图行 ---- */
  .thumb-row img, .thumb-row video { width: 40px; height: 54px; }

  /* ---- 按钮 ---- */
  .btn { padding: 9px 14px; font-size: 13px; }
}

@media (max-width: 820px) {
  .login-modal { align-items: stretch; padding: 0; }
  #login-modal > .login-card { width: 100%; height: 100%; max-height: none; min-height: 0; grid-template-columns: 1fr; border-radius: 0; }
  .login-showreel { position: absolute; inset: 0; height: 100%; }
  .login-showreel::after { background: rgba(8,10,14,.66); }
  .login-auth-panel { grid-column: 1; width: 100%; max-height: none; padding: 26px 24px; background: transparent; }
  .login-auth-panel > * { max-width: 460px; }
}

@media (max-width: 480px) {
  .login-modal { align-items: stretch; padding: 0; }
  #login-modal > .login-card { width: 100%; height: 100%; min-height: 100%; overflow-y: auto; border: 0; border-radius: 0; }
  .login-auth-panel { width: 100%; min-height: 100%; padding: 18px 16px; }
  .login-auth-glass { padding: 0; }
  .login-auth-brand { margin-bottom: 24px; }
  .login-auth-head { margin-bottom: 20px; }
  .login-method-tabs button { font-size: 14px; }
  .login-register-contact { flex-direction: column; }
}

/* 超小屏 (≤480px) */
@media (max-width: 480px) {
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .stat { flex-direction: column; align-items: flex-start; gap: 4px; }
  .view { padding: 14px 12px; }
}

/* ---- 剧本 Tab（全宽单板块流式排布，对标剧创） ---- */
.script-detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}
.script-detail > * { width: 100%; max-width: 1100px; }
.shot-card { transition: border-color .15s; }
.shot-card:hover { border-color: var(--gold); }
.shot-idx {
  display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;
  border-radius:50%;background:var(--bg-3);color:var(--text-dim);font-size:13px;font-weight:700;
  flex-shrink:0;
}
/* （script-detail 已改为 flex 纵向，无需断点覆盖） */

/* ==================== 首页（Vidu 风格全屏视频 Hero + 双赛道分轮） ==================== */
.cover { max-width: 100%; margin: 0; padding: 0 0 60px; }

/* ---- 全屏视频 Hero ---- */
.vidu-hero {
  position: relative; height: 72vh; min-height: 480px; max-height: 680px;
  overflow: hidden; display: flex; align-items: center; justify-content: center;
  border-radius: 0 0 20px 20px; margin-bottom: 8px;
}
.vidu-hero-bg {
  position: absolute; inset: 0;
  background:
    linear-gradient(135deg, #0a0c10 0%, #141a24 25%, #1a1520 50%, #0f1a1a 75%, #0a1018 100%);
  background-size: cover; background-position: center;
}
.vidu-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
    rgba(6,8,12,.55) 0%,
    rgba(6,8,12,.35) 45%,
    rgba(6,8,12,.65) 80%,
    rgba(6,8,12,.92) 100%
  );
}
.vidu-hero-content {
  position: relative; z-index: 2;
  text-align: center; padding: 40px 24px; max-width: 720px;
}
.vidu-brand {
  color: var(--gold); letter-spacing: 4px; font-size: 13px; font-weight: 700;
  text-transform: uppercase; opacity: .9;
}
.vidu-slogan {
  font-size: clamp(30px, 5vw, 52px); font-weight: 900;
  margin: 18px 0 14px; letter-spacing: 3px; line-height: 1.15;
  background: linear-gradient(180deg, #fff 20%, var(--gold-soft) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.vidu-sub {
  color: rgba(255,255,255,.6); font-size: 16px; max-width: 520px;
  margin: 0 auto 28px; line-height: 1.7;
}

/* 赛道 Tab 按钮（横排 pill） */
.vidu-tabs { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 28px; }
.vidu-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 26px; border-radius: 999px;
  font-size: 15px; font-weight: 600;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.6); cursor: pointer;
  transition: all .22s ease;
  backdrop-filter: blur(6px);
}
.vidu-tab:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.28);
  color: rgba(255,255,255,.85);
  transform: translateY(-1px);
}
.vidu-tab.active {
  background: linear-gradient(135deg, rgba(201,169,97,.28), rgba(201,169,97,.1));
  border-color: var(--gold); color: var(--gold-soft);
  box-shadow: 0 4px 24px rgba(201,169,97,.18), inset 0 1px 0 rgba(255,255,255,.08);
}

/* CTA + 状态 */
.vidu-ctas { margin-bottom: 16px; }
.vidu-cta-create {
  padding: 14px 40px; font-size: 17px; border-radius: 999px;
  box-shadow: 0 6px 32px rgba(201,169,97,.35), 0 2px 8px rgba(0,0,0,.3);
  transition: all .22s ease;
}
.vidu-cta-create:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 44px rgba(201,169,97,.45), 0 4px 12px rgba(0,0,0,.35);
}
.vidu-status { font-size: 13px; color: rgba(255,255,255,.38); }

/* ---- 瀑布流区域 ---- */
.showcase { max-width: 1180px; margin: 0 auto; padding: 0 16px; margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 20px; font-weight: 700; margin: 0; }
.waterfall { columns: 4; column-gap: 14px; }
.wf-card { break-inside: avoid; margin-bottom: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.wf-card:hover { transform: translateY(-3px); box-shadow: 0 10px 32px rgba(0,0,0,.35); border-color: var(--gold); }
.wf-thumb { position: relative; background-size: cover; display: flex; align-items: center; justify-content: center; }
.wf-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.45)); }
.wf-play { position: relative; z-index: 1; width: 42px; height: 42px; border-radius: 50%; background: rgba(201,169,97,.85); color: #1a1308; display: flex; align-items: center; justify-content: center; font-size: 16px; transition: transform .2s; }
.wf-card:hover .wf-play { transform: scale(1.15); }
.wf-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.wf-card:hover .wf-video { transform: scale(1.04); transition: transform .4s ease; }
.wf-meta { display: flex; align-items: center; justify-content: space-between; padding: 9px 11px; gap: 8px; }
.wf-title { font-size: 13px; font-weight: 600; }
.wf-tag { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.wf-card.g1 .wf-thumb { background: linear-gradient(135deg, #3a2f1c, #6b4f1d); }
.wf-card.g2 .wf-thumb { background: linear-gradient(135deg, #2a2113, #4a3a1d); }
.wf-card.g3 .wf-thumb { background: linear-gradient(135deg, #1d3a4a, #2f6b7a); }
.wf-card.g4 .wf-thumb { background: linear-gradient(135deg, #2f2a1a, #5c4a22); }
.wf-card.g5 .wf-thumb { background: linear-gradient(135deg, #1d2f4a, #2f4a7a); }
.wf-card.g6 .wf-thumb { background: linear-gradient(135deg, #243a2a, #3a6b4a); }
.wf-card.g7 .wf-thumb { background: linear-gradient(135deg, #3a1d2f, #6b2f4a); }
.wf-card.g8 .wf-thumb { background: linear-gradient(135deg, #1a2f3a, #2f5c6b); }
.wf-card.g9 .wf-thumb { background: linear-gradient(135deg, #2a3a1d, #4a6b2f); }
.wf-card.g10 .wf-thumb { background: linear-gradient(135deg, #3a2a1d, #6b4a2f); }
.wf-card.g11 .wf-thumb { background: linear-gradient(135deg, #1d1d3a, #3a3a6b); }
.wf-card.g12 .wf-thumb { background: linear-gradient(135deg, #1d3a3a, #2f6b6b); }

.recent-strip { max-width: 1180px; margin: 40px auto 0; padding: 0 16px; }

/* 短剧创作页：Hero 下方的剧本工作区 */
.studio-work { max-width: 1180px; margin: 36px auto 0; padding: 0 16px 48px; }
.studio-work .section-title { font-size: 18px; font-weight: 700; }
.studio-work .section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.studio-work .empty { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; }

/* 上传区域（空状态时替代按钮列表，点击直接传文档） */
.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  background: var(--bg-2);
  border: 2px dashed var(--gold-dim, rgba(201,169,97,.35));
  border-radius: 16px;
  transition: border-color .2s, background .2s;
}
.upload-zone:hover { border-color: var(--gold); background: rgba(201,169,97,.06); }
.upload-icon { font-size: 48px; margin-bottom: 12px; }
.upload-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.upload-hint { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.upload-track { font-size: 14px; color: var(--gold); }

/* 脚本列表页的赛道筛选 Tab */
.track-tabs { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.track-tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 999px; text-decoration: none; font-size: 14px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-dim); transition: .15s; }
.track-tab:hover { color: var(--text); border-color: var(--gold); }
.track-tab.active { background: linear-gradient(90deg, rgba(201,169,97,.22), rgba(201,169,97,.06)); color: var(--gold-soft); font-weight: 700; border-color: var(--gold); }
.tt-cnt { font-size: 11px; background: var(--bg-3); border-radius: 999px; padding: 1px 7px; color: var(--text-dim); }
.track-banner { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; padding: 9px 14px; background: var(--bg-3); border-radius: 8px; border: 1px solid var(--line); }
.track-banner strong { color: var(--gold-soft); }
.track-pill.engineering { background: rgba(201,169,97,.16); color: var(--gold-soft); border: 1px solid rgba(201,169,97,.4); }
.track-pill.citycard { background: rgba(143,208,232,.14); color: #8fd0e8; border: 1px solid rgba(143,208,232,.4); }

@media (max-width: 900px) {
  .vidu-hero { height: 60vh; min-height: 400px; }
  .vidu-slogan { font-size: clamp(24px, 6vw, 36px); letter-spacing: 1px; }
  .vidu-tabs { gap: 8px; }
  .vidu-tab { padding: 9px 18px; font-size: 13px; }
  .waterfall { columns: 2; }
  .showcase, .recent-strip { padding: 0 12px; }
}

/* 上传前视觉风格选择条（对标剧创：传剧本前先定风格） */
.home-style-bar {
  max-width: 1180px;
  margin: 22px auto 0;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.hsb-label { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; }
.hsb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.hsb-select {
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.hsb-select:focus { border-color: var(--gold); }
.hsb-input {
  display: none;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--bg-3);
  border: 1px solid var(--gold);
  color: var(--text);
  font-size: 13px;
  width: 280px;
  outline: none;
}
.hsb-hint { font-size: 12px; color: var(--text-dim); margin-left: auto; }

/* 首页底部：极简「我的项目」入口（不再重复展示剧本列表） */
.home-foot { margin-top: 22px; text-align: right; }
.home-link { display: inline-flex; min-height: 32px; align-items: center; font-size: 13px; color: #6e6e73; text-decoration: none; padding: 0 11px; border: 1px solid rgba(0,0,0,.09); background: rgba(255,255,255,.72); border-radius: 9px; transition: color .14s, background .14s; }
.home-link:hover { color: #1d1d1f; background: #fff; }

/* ==================== 首页（精简上传区 + 横向飞轮配置） ==================== */
.cover-clean { max-width: 1180px; margin: 0 auto; padding: 36px 28px 60px; }
.home-page-head { margin-bottom: 22px; }
.home-eyebrow { color: #8b6a22; font-size: 11px; font-weight: 650; letter-spacing: .08em; }
.home-page-head h2 { margin: 5px 0 6px; color: #1d1d1f; font-size: 26px; line-height: 1.2; font-weight: 650; letter-spacing: -.025em; }
.home-page-head p { margin: 0; color: #6e6e73; font-size: 14px; }

.flywheel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(0, 1.35fr);
  gap: 18px;
  align-items: stretch;
}
/* 横向动量金线（飞轮 C：从上传 → 配置 → 创建的动量流） */
.flywheel-rail {
  position: absolute;
  top: 50px; left: 9%; right: 9%; height: 3px;
  background: var(--line);
  border-radius: 2px;
  z-index: 0;
}
.flywheel-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, rgba(201,169,97,.5), var(--gold));
  border-radius: 2px;
  transition: width .55s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 12px rgba(201,169,97,.5);
}
.fw-step { position: relative; z-index: 1; }

/* ① 上传区 */
.home-upload {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 34px 24px;
  min-height: 310px;
  background: #fff;
  border: 1px dashed rgba(110,110,115,.34);
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.045);
  transition: border-color .14s, background .14s, transform .14s;
}
.home-upload:hover { border-color: rgba(161,126,46,.55); background: rgba(201,169,97,.055); transform: translateY(-2px); }
.home-upload.dragging { border-color: #b08a38; background: rgba(201,169,97,.09); transform: translateY(-2px); }
.home-upload.ready { border-style: solid; border-color: #b08a38; background: rgba(201,169,97,.07); }
.home-upload-icon { position: relative; width: 42px; height: 42px; margin-bottom: 15px; border-radius: 12px; background: #f2f2f4; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); }
.home-upload-icon::before { content: ''; position: absolute; left: 11px; right: 11px; bottom: 10px; height: 12px; border: 1.5px solid #6e6e73; border-top: 0; border-radius: 0 0 5px 5px; }
.home-upload-icon::after {
  content: '';
  position: absolute;
  top: 7px;
  left: 14px;
  width: 14px;
  height: 17px;
  background: #6e6e73;
  clip-path: polygon(50% 0, 100% 36%, 66% 36%, 66% 100%, 34% 100%, 34% 36%, 0 36%);
}
.home-upload-title { font-size: 15px; font-weight: 600; color: #1d1d1f; margin-bottom: 6px; }
.home-upload-hint { max-width: 300px; font-size: 12px; color: #86868b; line-height: 1.55; }

/* ② 参数配置条 */
.fw-config {
  height: 100%;
  display: flex; flex-direction: column; gap: 14px;
  padding: 22px;
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.045);
}
.fw-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.fw-g-label { font-size: 11px; font-weight: 600; color: #6e6e73; min-width: 54px; flex: 0 0 auto; }
.chips { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 32px; padding: 0 13px; border-radius: 9px;
  font-size: 13px; font-weight: 500;
  background: #f2f2f4;
  border: 1px solid rgba(0,0,0,.08);
  color: #3a3a3c;
  cursor: pointer;
  transition: background .14s, border-color .14s, color .14s;
}
.chip:hover { color: #1d1d1f; border-color: rgba(161,126,46,.4); }
.chip.on {
  background: rgba(201,169,97,.19);
  border-color: rgba(161,126,46,.35);
  color: #604915;
  box-shadow: none;
}
.fw-config .hsb-select { flex: 1; min-width: 160px; height: 32px; padding: 0 10px; border: 1px solid rgba(0,0,0,.1); border-radius: 9px; color: #1d1d1f; background: #f7f7f8; font-size: 13px; }
.fw-config .hsb-select:focus { border-color: #b08a38; box-shadow: 0 0 0 3px rgba(201,169,97,.15); }
.fw-config .hsb-input { flex: 1; min-width: 160px; }
.fw-config-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; padding-top: 15px; border-top: 1px solid rgba(0,0,0,.08); }
.fw-config-footer span { color: #86868b; font-size: 11px; }

/* ③ 创建按钮 */
.fw-step.create-step { display: flex; align-items: center; }
.btn-lg { min-height: 34px; padding: 0 16px; font-size: 13px; font-weight: 600; border-radius: 9px; white-space: nowrap; }
#home-create:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }

@media (max-width: 900px) {
  .flywheel { grid-template-columns: 1fr; }
  .flywheel-rail { display: none; }
  .fw-step.create-step { } /* 按钮在窄屏占满 */
  #home-create { width: 100%; }
}


/* 我的项目页 —— 剧创风格海报卡网格 */
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 32px;
}
.proj-card {
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.proj-card:hover { transform: translateY(-8px); box-shadow: 0 16px 48px rgba(0,0,0,.35); }
.proj-card.proj-pinned { border-color: rgba(201,169,97,.6); box-shadow: 0 0 0 1px rgba(201,169,97,.25), 0 8px 28px rgba(201,169,97,.12); }

/* 封面区（16:9 比例） */
.pc-cover {
  position: relative;
  padding-bottom: 56%;
  overflow: hidden;
}
.pc-cover-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 84px; font-weight: 700; color: #2a3040; opacity: .5;
  letter-spacing: -4px;
}
.pc-cover-tags {
  position: absolute; bottom: 16px; left: 16px;
  display: flex; gap: 8px;
}
.pc-track { font-size: 20px; padding: 4px 12px; border-radius: 8px; background:rgba(201,169,97,.18); color:var(--gold-soft); }
.pc-pinned { font-size: 20px; padding: 4px 12px; border-radius: 8px; background:rgba(201,169,97,.25); color:#e0c98f; }

/* 状态标签 */
.pc-status { font-size: 20px; padding: 4px 12px; border-radius: 8px; white-space: nowrap; }
.pc-status-done { background: rgba(76,175,80,.15); color: #4caf90; }
.pc-status-wait { background: rgba(201,169,97,.15); color: var(--gold); }
.pc-status-todo { background: rgba(100,150,255,.15); color: #6496ff; }
.pc-status-empty { background: var(--bg-3); color: var(--text-dim); opacity: .6; }

/* 信息体 */
.pc-body { padding: 20px 24px; }
.pc-title { font-size: 26px; font-weight: 600; line-height: 1.3; max-height: 2.6em; overflow: hidden; color: var(--text); }
.pc-meta { font-size: 22px; color: var(--text-dim); margin-top: 8px; }

/* 卡片底部常驻操作栏（删除剧本） */
.pc-footer { display: flex; gap: 16px; padding: 16px 24px; border-top: 1px solid var(--line); }
.pc-foot-btn { flex: 1; padding: 14px; border: 1px solid var(--line); background: transparent; color: var(--text-dim); border-radius: 12px; font-size: 24px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.pc-foot-btn:hover { color: var(--text); background: rgba(255,255,255,.04); }
.pc-foot-btn.member { color: #C9A961; border-color: rgba(201,169,97,.5); font-weight: 500; }
.pc-foot-btn.member:hover { background: rgba(201,169,97,.12); color: #e0c98f; }
.pc-foot-btn.danger { color: #ff6b6b; border-color: rgba(239,111,111,.35); }
.pc-foot-btn.danger:hover { background: rgba(239,111,111,.12); color: #ff6b6b; }
/* 回收站卡片：虚线边框 + 弱化标题，与正常项目区分 */
.proj-card.trashed { border-style: dashed; opacity: .9; }
.proj-card.trashed .pc-title { color: var(--text-dim); }

/* 项目卡片「⋯ 更多」菜单 */
.pc-more-wrap { position: absolute; top: 16px; right: 16px; z-index: 5; }
.pc-more-btn {
  width: 56px; height: 56px; border: none; border-radius: 12px;
  background: rgba(0,0,0,.35); color: var(--text); font-size: 36px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, transform .15s;
}
.pc-more-btn:hover { background: rgba(0,0,0,.55); color: var(--gold); transform: scale(1.05); }
.pc-more-menu {
  display: none; position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.4); overflow: hidden; padding: 8px 0;
}
.pc-more-menu.open { display: block; }
.pc-more-item {
  display: block; width: 100%; padding: 16px 24px; border: none; background: transparent;
  color: var(--text); font-size: 24px; text-align: left; cursor: pointer;
  transition: background .15s, color .15s;
}
.pc-more-item:hover { background: rgba(255,255,255,.06); color: var(--gold); }
.pc-more-item.danger { color: #e08e8e; }
.pc-more-item.danger:hover { background: rgba(239,111,111,.1); color: #ff6b6b; }

/* ──── 项目工作台（四步飞轮总览） ──── */
.wb-page { padding: 20px 24px; }
.wb-head {
  display: flex; align-items: center; justify-content: center; gap: 40px;
  padding-bottom: 16px; border-bottom: 0.5px solid var(--line); margin-bottom: 16px;
}

/* 持久化项目头部（#studio-head 在 index.html，切页不销毁） */
#studio-head {
  padding: 16px 20px 0;
}
#studio-head .wb-head {
  margin-bottom: 0;
  border-bottom: none;
}
.wb-head-top { display: flex; align-items: center; margin-bottom: 10px; }
.wb-back {
  display: inline-flex; align-items: center;
  font-size: 15px; color: var(--text-dim); text-decoration: none;
  padding: 4px 10px; border-radius: 6px; margin-right: 12px;
  border: 1px solid var(--line); background: var(--bg-2);
  transition: color .15s, border-color .15s, background .15s;
}
.wb-back:hover { color: var(--gold); border-color: var(--gold); background: rgba(201,169,97,.08); }
.wb-head-title { display: flex; align-items: center; }
.wb-head-meta { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* 步骤文字导航（和标题同行左对齐） */
.wb-step-links {
  display: flex; align-items: center;
  gap: 0;
}
.wb-step-link {
  font-size: 24px; color: var(--text); cursor: pointer; font-weight: 600;
  text-decoration: none; padding: 6px 18px; border-radius: 6px;
  transition: color .15s, background .15s, transform .15s;
}
.wb-step-link:hover { color: var(--gold); background: rgba(255,255,255,.06); transform: translateY(-1px); }
.wb-step-link.active { color: var(--gold); font-weight: 700; }
.wb-step-sep { color: rgba(201,169,97,.45); font-size: 20px; margin: 0 8px; user-select: none; font-weight: 600; }

/* 2×2 步骤卡网格 */
.wb-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}

/* 单张步骤卡 */
.wb-card {
  background: var(--bg-2); border: 0.5px solid var(--line);
  border-radius: 10px; padding: 16px;
  transition: border-color .2s, box-shadow .2s;
}
.wb-card:hover { border-color: #3a4556; }
.wb-card-next {
  border-color: rgba(201,169,97,.35);
  box-shadow: 0 0 12px rgba(201,169,97,.06);
}
.wb-card-head {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px; font-size: 14px; font-weight: 500;
}
.wb-card-head strong { color: var(--text); }
.wb-card-body { margin-bottom: 12px; }
.wb-card-ops { display: flex; gap: 8px; flex-wrap: wrap; }

/* 状态 pill */
.wb-pill { font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.wb-pill-done { background: rgba(76,175,80,.15); color: #4caf90; }
.wb-pill-wait { background: rgba(201,169,97,.15); color: var(--gold); }
.wb-pill-todo { background: rgba(100,150,255,.15); color: #6496ff; }
.wbpill-empty { background: var(--bg-3); color: var(--text-dim); }

/* 统计文字 */
.wb-stat { font-size: 12px; color: var(--text-dim); line-height: 1.6; }

@media (max-width: 700px) {
  .wb-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 700px) {
  .home-style-bar { margin-top: 16px; }
  .hsb-hint { margin-left: 0; width: 100%; }
  .hsb-input { width: 100%; }
  .proj-grid { grid-template-columns: 1fr !important; }
}

/* ----------------- PWA 安装引导横幅 ----------------- */
.install-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: none; align-items: center; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(15,17,21,0) 0%, rgba(15,17,21,0.97) 38%);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255,255,255,0.08);
  color: #fff; font-size: 14px;
}
.install-banner.show { display: flex; }
.ib-icon { font-size: 20px; flex: 0 0 auto; }
.ib-text { flex: 1 1 auto; line-height: 1.45; }
.ib-add {
  flex: 0 0 auto; border: none; cursor: pointer; white-space: nowrap;
  background: var(--gold, #d4af37); color: #1a1a1a; font-weight: 700;
  padding: 9px 16px; border-radius: 999px; font-size: 14px;
  transition: transform .12s, filter .15s;
}
.ib-add:hover { filter: brightness(1.08); }
.ib-add:active { transform: scale(0.95); }
.ib-later {
  flex: 0 0 auto; cursor: pointer; white-space: nowrap;
  background: transparent; color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.28);
  padding: 8px 14px; border-radius: 999px; font-size: 13px;
  transition: background .15s, color .15s, border-color .15s;
}
.ib-later:hover { color: #fff; border-color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.06); }

/* iOS 手动添加引导浮层 */
.ios-guide {
  position: fixed; inset: 0; z-index: 80; display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.6); padding: 20px;
}
.ios-guide.show { display: flex; }
.ios-guide-card {
  background: #1b1e24; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 22px; max-width: 340px; width: 100%; color: #fff;
}
.ios-guide-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; text-align: center; }
.ios-guide-steps { font-size: 14px; line-height: 1.9; margin-bottom: 18px; }
.ios-guide-steps b { color: var(--gold, #d4af37); }
.ios-share { font-size: 16px; }
.ios-guide-actions { display: flex; gap: 10px; }
.ios-guide-actions .btn { flex: 1; }

@media (max-width: 480px) {
  .install-banner { flex-wrap: wrap; }
  .ib-add { width: 100%; }
}
/* ==================== 总后台工作台 + 全局明暗模式 ==================== */
.topbar { position: relative; z-index: 20; overflow: visible; }
.theme-toggle {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 82px; height: 34px; padding: 0 12px; border: 1px solid rgba(0,0,0,.09);
  border-radius: 999px; background: rgba(255,255,255,.72); color: #5c5c62;
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 10px rgba(20,20,24,.05); transition: color .18s, background .18s, border-color .18s, transform .16s;
}
.theme-toggle:hover { color: #72571a; border-color: rgba(201,169,97,.42); background: #fff; }
.theme-toggle:active { transform: translate(-50%, -50%) scale(.96); }
.theme-toggle span:first-child { font-size: 15px; line-height: 1; }

.view[data-page="platform"] { padding: 0; overflow-x: hidden; }
.platform-dashboard { width: 100%; min-height: 100%; padding: 30px 34px 44px; }
.platform-hero {
  position: relative; overflow: hidden; min-height: 146px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding: 28px 30px; border: 1px solid rgba(97,76,31,.14); border-radius: 20px;
  background: linear-gradient(118deg, #171a20 0%, #202126 65%, #2d271c 100%); color: #f7f4ed;
  box-shadow: 0 18px 48px rgba(27,25,20,.12);
}
.platform-hero::before {
  content: ''; position: absolute; width: 330px; height: 330px; right: -100px; top: -200px; border-radius: 50%;
  border: 1px solid rgba(227,201,137,.22); box-shadow: 0 0 0 44px rgba(227,201,137,.025), 0 0 0 86px rgba(227,201,137,.018);
}
.platform-hero > * { position: relative; z-index: 1; }
.platform-eyebrow, .platform-kicker { color: #b89240; font-size: 10px; line-height: 1; font-weight: 800; letter-spacing: .16em; }
.platform-hero .platform-eyebrow { color: #e4c76f; }
.platform-hero h2 { margin: 10px 0 5px; font-size: 29px; line-height: 1.15; letter-spacing: -.035em; }
.platform-hero p { max-width: 640px; margin: 0; color: rgba(245,242,234,.62); font-size: 13px; }
.platform-hero .btn { min-height: 40px; white-space: nowrap; box-shadow: 0 9px 26px rgba(201,169,97,.18); }

.platform-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.platform-metric {
  min-width: 0; min-height: 132px; display: flex; flex-direction: column; justify-content: space-between;
  padding: 18px; border: 1px solid rgba(0,0,0,.075); border-radius: 16px; background: #fff;
  box-shadow: 0 7px 22px rgba(27,25,20,.035); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.platform-metric:hover { transform: translateY(-2px); border-color: rgba(169,132,48,.25); box-shadow: 0 12px 30px rgba(27,25,20,.07); }
.platform-metric-primary { background: linear-gradient(145deg, #fffaf0, #f6ebca); border-color: rgba(169,132,48,.2); }
.platform-metric > span { color: #74747a; font-size: 12px; font-weight: 600; }
.platform-metric > strong { margin-top: 8px; color: #19191c; font-size: 30px; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.platform-metric > small { color: #a0a0a5; font-size: 10.5px; }
.platform-metric > .platform-money { font-size: clamp(20px, 1.55vw, 28px); white-space: nowrap; }

.platform-panels { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; margin-bottom: 16px; }
.platform-panel, .platform-account-card { border: 1px solid rgba(0,0,0,.075); border-radius: 18px; background: #fff; box-shadow: 0 8px 26px rgba(27,25,20,.035); }
.platform-panel { padding: 22px; }
.platform-panel-head, .platform-account-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.platform-panel h3, .platform-account-head h3 { margin: 7px 0 0; color: #202023; font-size: 17px; letter-spacing: -.02em; }
.platform-panel-total, .platform-account-count { color: #8d8d93; font-size: 11px; white-space: nowrap; }
.platform-status-list { display: grid; gap: 14px; margin-top: 22px; }
.platform-status-row { display: grid; grid-template-columns: 92px minmax(80px, 1fr) 40px; align-items: center; gap: 12px; }
.platform-status-copy { display: flex; justify-content: space-between; color: #66666b; font-size: 12px; }
.platform-status-copy b { color: #252529; font-variant-numeric: tabular-nums; }
.platform-status-track { height: 7px; overflow: hidden; border-radius: 999px; background: #eeeeef; }
.platform-status-track i { display: block; height: 100%; border-radius: inherit; background: #55a274; transition: width .35s ease; }
.platform-status-row.is-pending .platform-status-track i { background: #d2aa4a; }
.platform-status-row.is-disabled .platform-status-track i { background: #9b9ba1; }
.platform-status-row > small { color: #99999f; font-size: 10px; text-align: right; }
.platform-quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.platform-quick-grid a {
  min-width: 0; min-height: 80px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 13px; border: 1px solid rgba(0,0,0,.07); border-radius: 13px; color: #29292d; background: #fafafa;
  text-decoration: none; transition: background .16s, border-color .16s, transform .16s;
}
.platform-quick-grid a:hover { transform: translateY(-2px); border-color: rgba(169,132,48,.25); background: #fffaf0; }
.platform-quick-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #775b18; background: #efe3c4; font-size: 16px; }
.platform-quick-grid a > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.platform-quick-grid b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.platform-quick-grid small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #96969b; font-size: 10px; }
.platform-quick-grid a > i { color: #b0a78f; font-style: normal; }

.platform-account-card { overflow: hidden; }
.platform-account-head { padding: 22px 22px 18px; border-bottom: 1px solid rgba(0,0,0,.065); }
.platform-account-head h3 { margin-bottom: 3px; }
.platform-account-head p { margin: 0; color: #919197; font-size: 11px; }
.platform-account-count { padding: 4px 9px; border-radius: 999px; background: #f2f2f3; }
.platform-table-wrap { width: 100%; overflow-x: auto; }
.platform-table { min-width: 850px; }
.platform-table th { height: 42px; padding: 0 18px; color: #929298; background: #fafafa; border-bottom: 1px solid rgba(0,0,0,.06); font-size: 10.5px; font-weight: 650; text-align: left; letter-spacing: .02em; }
.platform-table td { height: 58px; padding: 0 18px; border-bottom: 1px solid rgba(0,0,0,.055); color: #4c4c51; font-size: 12px; }
.platform-table tbody tr:last-child td { border-bottom: 0; }
.platform-table tbody tr:hover { background: #fffaf2; }
.platform-username { color: #202024; font-weight: 650; }
.platform-balance { color: #765a1b !important; font-weight: 700; font-variant-numeric: tabular-nums; }
.platform-state { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: #5c5c61; font-size: 11px; }
.platform-state i { width: 7px; height: 7px; border-radius: 50%; background: #94949a; box-shadow: 0 0 0 3px rgba(148,148,154,.1); }
.platform-state.active i { background: #4a9b70; box-shadow: 0 0 0 3px rgba(74,155,112,.12); }
.platform-state.pending i { background: #d2a844; box-shadow: 0 0 0 3px rgba(210,168,68,.12); }
.platform-actions { white-space: nowrap; }
.platform-actions .btn-mini { margin-right: 5px; }
.platform-actions .platform-approve { color: #6a5015; border-color: rgba(169,132,48,.24); background: #fff8e7; }
.platform-empty { min-height: 190px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: #96969c; }
.platform-empty > span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: #f3ead2; color: #8c6a20; font-size: 18px; }
.platform-empty b { color: #444448; font-size: 13px; }
.platform-empty small { font-size: 11px; }

html[data-theme="dark"] body { background: #0f1115; color: #e8e6e1; }
html[data-theme="dark"] .sidebar { background: rgba(18,21,27,.98); color: #e8e6e1; border-color: rgba(255,255,255,.07); }
html[data-theme="dark"] .logo { color: #f0eee8; border-color: rgba(255,255,255,.07); }
html[data-theme="dark"] .logo::before { color: #f1d77d; background: #342d1d; box-shadow: inset 0 0 0 1px rgba(227,201,137,.2); }
html[data-theme="dark"] .nav a { color: #9298a4; }
html[data-theme="dark"] .nav a:hover { color: #f1efe9; background: rgba(255,255,255,.055); }
html[data-theme="dark"] .nav a.active { color: #edd47d; background: rgba(201,169,97,.14); }
html[data-theme="dark"] .sidebar-foot { border-color: rgba(255,255,255,.07); }
html[data-theme="dark"] .account-entry { color: #e8e6e1; }
html[data-theme="dark"] .account-entry:hover, html[data-theme="dark"] .account-entry[aria-expanded="true"] { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.08); }
html[data-theme="dark"] .account-entry-copy strong, html[data-theme="dark"] .account-popover-identity strong { color: #eeece6; }
html[data-theme="dark"] .account-entry-copy span, html[data-theme="dark"] .account-popover-identity span { color: #858c97; }
html[data-theme="dark"] .account-popover { background: rgba(26,29,36,.98); border-color: rgba(255,255,255,.09); box-shadow: 0 20px 54px rgba(0,0,0,.45); }
html[data-theme="dark"] .account-popover-head, html[data-theme="dark"] .account-logout { border-color: rgba(255,255,255,.07); }
html[data-theme="dark"] .account-menu-link { color: #bcc1ca; }
html[data-theme="dark"] .account-menu-link:hover, html[data-theme="dark"] .account-menu-link.active { color: #efd57d; background: rgba(201,169,97,.13); }
html[data-theme="dark"] .topbar { color: #eceae5; background: rgba(16,18,23,.9); border-color: rgba(255,255,255,.07); }
html[data-theme="dark"] .theme-toggle { color: #bfc3cb; background: rgba(31,35,43,.88); border-color: rgba(255,255,255,.09); box-shadow: 0 2px 12px rgba(0,0,0,.2); }
html[data-theme="dark"] .theme-toggle:hover { color: #f0d67e; background: #252933; border-color: rgba(227,201,137,.35); }
html[data-theme="dark"] .tb-refresh { color: #aeb4bf; background: #1d2129; border-color: rgba(255,255,255,.09); }
html[data-theme="dark"] .tb-refresh:hover { background: #262b35; }
html[data-theme="dark"] .wallet-balance { color: #ddc26f; background: rgba(201,169,97,.1); border-color: rgba(227,201,137,.12); }
html[data-theme="dark"] .view[data-page="generate"], html[data-theme="dark"] .view[data-page="assets"], html[data-theme="dark"] .view[data-page="jobs"],
html[data-theme="dark"] .view[data-page="prompts"], html[data-theme="dark"] .view[data-page="chat"], html[data-theme="dark"] .view[data-page="providers"],
html[data-theme="dark"] .view[data-page="platform"], html[data-theme="dark"] .view[data-page="billing"] {
  background: #0f1115; color: #e8e6e1; --bg: #0f1115; --bg-2: #171a21; --bg-3: #1d222b; --line: #2a313c; --text: #e8e6e1; --text-dim: #9aa3af;
}
html[data-theme="dark"] .platform-hero { border-color: rgba(227,201,137,.13); background: linear-gradient(118deg, #171a20 0%, #1c2027 65%, #2a251b 100%); box-shadow: 0 20px 55px rgba(0,0,0,.24); }
html[data-theme="dark"] .platform-metric, html[data-theme="dark"] .platform-panel, html[data-theme="dark"] .platform-account-card { background: #171a21; border-color: rgba(255,255,255,.075); box-shadow: 0 10px 30px rgba(0,0,0,.14); }
html[data-theme="dark"] .platform-metric-primary { background: linear-gradient(145deg, #211f19, #27251d); border-color: rgba(227,201,137,.16); }
html[data-theme="dark"] .platform-metric > span, html[data-theme="dark"] .platform-panel-total, html[data-theme="dark"] .platform-account-count { color: #9097a2; }
html[data-theme="dark"] .platform-metric > strong, html[data-theme="dark"] .platform-panel h3, html[data-theme="dark"] .platform-account-head h3, html[data-theme="dark"] .platform-username { color: #f0eee8; }
html[data-theme="dark"] .platform-metric > small, html[data-theme="dark"] .platform-account-head p { color: #737b87; }
html[data-theme="dark"] .platform-status-copy { color: #a5abb4; }
html[data-theme="dark"] .platform-status-copy b { color: #eceae5; }
html[data-theme="dark"] .platform-status-track { background: #252a33; }
html[data-theme="dark"] .platform-quick-grid a { color: #e0ded9; background: #1d2129; border-color: rgba(255,255,255,.065); }
html[data-theme="dark"] .platform-quick-grid a:hover { background: #25251f; border-color: rgba(227,201,137,.2); }
html[data-theme="dark"] .platform-quick-icon { color: #e0c66d; background: #332e20; }
html[data-theme="dark"] .platform-account-head { border-color: rgba(255,255,255,.065); }
html[data-theme="dark"] .platform-account-count { background: #232730; }
html[data-theme="dark"] .platform-table th { color: #858d99; background: #14171d; border-color: rgba(255,255,255,.055); }
html[data-theme="dark"] .platform-table td { color: #b8bdc6; border-color: rgba(255,255,255,.055); }
html[data-theme="dark"] .platform-table tbody tr:hover { background: #1c2027; }
html[data-theme="dark"] .view[data-page="platform"] .btn-mini { color: #aeb4be; background: #1d2129; border-color: rgba(255,255,255,.09); }
html[data-theme="dark"] .platform-actions .platform-approve { color: #e2c96f; background: #28251d; border-color: rgba(227,201,137,.2); }
html[data-theme="dark"] .platform-empty b { color: #d5d2cc; }

@media (max-width: 1250px) {
  .platform-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .platform-dashboard { padding: 22px 20px 34px; }
  .platform-panels { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .theme-toggle { position: static; transform: none; min-width: 36px; width: 36px; padding: 0; margin-left: auto; }
  .theme-toggle:active { transform: scale(.96); }
  .theme-toggle span:last-child { display: none; }
  .workspace-account-host .account-entry-copy { display: none; }
  .workspace-account-host .account-entry { padding: 2px; }
  .wallet-balance { padding: 5px 7px; }
  .platform-dashboard { padding: 16px 14px 28px; }
  .platform-hero { min-height: 160px; align-items: flex-start; flex-direction: column; padding: 22px; }
  .platform-hero h2 { font-size: 25px; }
  .platform-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platform-quick-grid { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .platform-metrics { grid-template-columns: 1fr; }
  .platform-metric { min-height: 110px; }
}

/* Interaction Architecture V1: shared confirmation and permission feedback. */
.interaction-confirm {
  width: min(460px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .24);
  opacity: 0;
  transform: scale(var(--motion-scale-modal));
  transition: opacity var(--motion-duration-modal-exit) var(--motion-ease-exit), transform var(--motion-duration-modal-exit) var(--motion-ease-exit);
}
.interaction-confirm.is-open { opacity: 1; transform: scale(1); transition-duration: var(--motion-duration-modal); transition-timing-function: var(--motion-ease-enter); }
.interaction-confirm::backdrop { background: rgba(16, 20, 28, .38); backdrop-filter: blur(8px); opacity: 0; transition: opacity var(--motion-duration-backdrop-exit) var(--motion-ease-exit); }
.interaction-confirm.is-open::backdrop { opacity: 1; transition-duration: var(--motion-duration-backdrop-enter); transition-timing-function: var(--motion-ease-enter); }
.interaction-confirm form { padding: 24px; }
.interaction-confirm h2 { margin: 0 0 8px; font-size: 20px; }
.interaction-confirm p { margin: 0; color: var(--muted); line-height: 1.6; }
.interaction-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.interaction-confirm button { min-height: var(--ds-control-height-prominent, 38px); padding: 0 var(--ds-control-padding-prominent-x, 16px); border: var(--ds-border-control, 1px solid var(--line)); border-radius: var(--ds-radius-control, 9px); background: var(--ds-color-surface, var(--panel, #fff)); color: var(--ds-color-text-primary, var(--text)); }
.interaction-confirm button.danger { border-color: transparent; background: var(--ds-color-danger, #d70015); color: #fff; }
@media (prefers-reduced-motion: reduce) {
  .interaction-confirm, .interaction-confirm::backdrop { transition-duration: var(--motion-duration-instant); }
  html body .spinner,
  html body .wk-loading::before,
  html body .film-skeleton,
  html body .ch-skel-block,
  html body .ch-skel-line,
  html body .ch-typing-dots i,
  html body [class*="loading"]::before,
  html body [class*="loading"]::after {
    animation-duration: var(--motion-duration-instant);
    animation-iteration-count: 1;
  }
}
.permission-denied { max-width: 560px; margin: 10vh auto; padding: 40px; text-align: center; }
.permission-denied a.primary { display: inline-flex; margin-top: 18px; padding: 10px 16px; border-radius: 10px; background: var(--gold); color: #111; text-decoration: none; }

/* Desktop file drop: one global entry for scripts and loose image assets. */
.desktop-drop-overlay {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: var(--desktop-drop-backdrop, rgba(0, 0, 0, .32));
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 140ms ease, visibility 140ms ease;
}
html[data-theme="dark"] .desktop-drop-overlay { --desktop-drop-backdrop: rgba(0, 0, 0, .58); }
.desktop-drop-overlay.is-visible { opacity: 1; visibility: visible; }
.desktop-drop-card {
  width: min(520px, calc(100vw - 40px));
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 34px;
  border: 2px dashed rgba(215, 182, 91, .82);
  border-radius: 24px;
  color: var(--theme-text, #1d1d1f);
  background: var(--theme-surface, #fff);
  box-shadow: var(--theme-shadow, 0 14px 34px rgba(0, 0, 0, .12));
}
.desktop-drop-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #201a0c;
  background: linear-gradient(145deg, #f2d780, #c99e38);
  font-size: 32px;
  font-weight: 800;
}
.desktop-drop-title { margin-top: 5px; font-size: 24px; }
.desktop-drop-copy { color: var(--theme-text-soft, #6e6e73); font-size: 14px; text-align: center; }
.desktop-drop-progress { width: min(360px, 100%); margin-top: 12px; }
.desktop-drop-progress-track { height: 8px; display: block; overflow: hidden; border-radius: 999px; background: var(--theme-surface-soft, #f2f2f4); }
.desktop-drop-progress-track i { width: 4%; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #c99e38, #f1d77d); transition: width 180ms ease; }
.desktop-drop-status { display: block; margin-top: 8px; color: var(--theme-text-soft, #6e6e73); text-align: center; }

/* ===== PWA 安装横幅统一为主站小药丸样式（2026-10-19 宝爸要求全网统一；1:1 镜像主站 pwa-install-banner） ===== */
#install-banner{left:50%;right:auto;transform:translateX(-50%);bottom:18px;width:auto;max-width:94vw;flex-wrap:nowrap;gap:12px;align-items:center;padding:9px 10px;border-radius:16px;background:#101826;border:1px solid rgba(249,219,131,.30);box-shadow:0 10px 28px rgba(0,0,0,.34);color:#F8FAFC;font-size:14px;font-weight:600}
#install-banner.show{display:flex}
#install-banner .ib-icon{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;flex:0 0 36px;border-radius:10px;background:linear-gradient(135deg,#FF7A1A,#F03A17);color:#fff;font-size:20px;font-weight:800;font-style:normal;font-family:"PingFang SC","Microsoft YaHei",sans-serif;box-shadow:0 2px 8px rgba(240,58,23,.35)}
#install-banner .ib-text{display:none}
#install-banner .ib-add{order:2;width:auto;padding:6px 2px;font-size:15px;font-weight:600;letter-spacing:.2px;border-radius:0;background:none;color:#F8FAFC;white-space:nowrap}
#install-banner .ib-add:active{opacity:.85}
#install-banner .ib-later{order:3;width:30px;height:30px;flex:0 0 30px;padding:0;font-size:18px;line-height:1;display:inline-flex;align-items:center;justify-content:center;border-radius:9px;border:none;background:rgba(255,255,255,.08);color:#94A3B8}
#install-banner .ib-later:hover{color:#fff;background:rgba(255,255,255,.14)}
