:root{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color:#14223d;background:#f5f7fc;font-synthesis:none}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}
a{color:#1758da;text-decoration:none}
button,input,textarea,select{font:inherit}
button,a,label{touch-action:manipulation}
button{cursor:pointer}
button:disabled{opacity:.48;cursor:wait}

/* 按钮微交互：点击缩放反馈 */
.primary:active:not(:disabled),.secondary:active:not(:disabled),.tool-btn:active:not(:disabled){transform:scale(.97);transition:transform .1s}
.primary,.secondary,.tool-btn{transition:transform .1s,opacity .2s,background .2s}

.studio{max-width:800px;margin:auto;padding:0 20px 40px}
header{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:76px;font-size:14px}
header a{min-height:44px;display:flex;align-items:center}

/* 步骤导航：可点击按钮 */
.steps{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:8px 0 28px;font-size:12px}
.steps button{padding:12px 2px;border:0;border-bottom:3px solid #dfe5f1;text-align:center;background:none;color:#65738b;font-size:12px;cursor:pointer;border-radius:0}
.steps button.active{color:#165cf3;border-color:#165cf3;font-weight:750}
.steps button.done{color:#2a9d5c;border-color:#c8e6d4}
.steps button:hover:not(:disabled){background:#f0f4ff}
.steps button:disabled{cursor:not-allowed;opacity:.6}

.eyebrow{color:#195cdb;font-weight:700}
h1{font-size:30px;letter-spacing:-.04em;margin:12px 0}
h2{font-size:21px}
.lead{color:#65738b;line-height:1.7;margin:0 0 23px;font-size:15px}
.panel{padding:21px;background:#fff;border:1px solid #e4e9f2;border-radius:19px;margin-bottom:16px}

/* 上传区域 */
.upload{display:block;text-align:center;padding:28px 10px;border:2px dashed #bcd0fa;border-radius:14px;background:#f7faff;font-size:19px;font-weight:750;color:#1a60eb;cursor:pointer;position:relative;overflow:hidden;transition:border-color .2s,background .2s}
.upload:hover{border-color:#7ba6f5;background:#f0f6ff}
.upload-icon{display:block;font-size:36px;margin-bottom:8px}
.upload small{display:block;font-weight:400;font-size:12px;color:#63718d;margin-top:12px;line-height:1.6}
.upload-input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}

/* 照片质量提示 */
.quality-hint{margin-top:10px;padding:8px 12px;background:#fff8e6;border:1px solid #f5e0a8;border-radius:8px;color:#8a6d00;font-size:13px}

.primary,.secondary{display:block;width:100%;border-radius:13px;min-height:48px;padding:13px 12px;text-align:center;font-weight:750;border:0;margin-top:18px}
.primary{color:#fff;background:#155bf1}
.primary:hover:not(:disabled){background:#0e4cd0}
.secondary{color:#2556a1;background:#eaf0fc}
.secondary:hover:not(:disabled){background:#dce6fa}

/* 按钮行：两个按钮并排 */
.button-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.button-row .primary,.button-row .secondary{margin-top:0}

.hint{font-size:13px;line-height:1.6;color:#61718c;margin-bottom:0}
.notice{background:#fff2de;border:1px solid #f0d4a8;padding:13px;border-radius:12px;line-height:1.6;overflow-wrap:anywhere}
img,video{max-width:100%;height:auto}
video{width:100%;max-height:430px;background:#101522;border-radius:12px;margin-top:18px}
.portrait-preview{display:block;max-height:220px;margin:18px auto;object-fit:contain}
.result-image{display:block;width:100%;border-radius:12px}
.asset-summary{display:flex;gap:16px;align-items:center;margin-bottom:20px}
.asset-summary img{width:80px;height:76px;object-fit:contain;border-radius:9px;background:#f0f3f8}
.asset-summary p{font-size:13px;color:#61718c;margin-bottom:0}

label:not(.upload){display:block;margin:18px 0 8px;font-weight:650;font-size:14px}
input:not([type=file]),textarea,select{width:100%;border:1px solid #c9d4e8;border-radius:10px;padding:12px;min-height:48px;background:#fff;font-size:16px;color:#14223d;transition:border-color .2s}
input:focus,textarea:focus,select:focus{border-color:#5b8def;outline:3px solid #abc8ff;outline-offset:2px}
textarea{resize:vertical;line-height:1.6}

/* 口播工具栏 */
.dialogue-toolbar{display:flex;gap:8px;align-items:center;margin-bottom:8px;flex-wrap:wrap}
.tool-btn{display:inline-flex;align-items:center;gap:4px;padding:8px 14px;border:1px solid #c9d4e8;border-radius:20px;background:#fff;color:#2556a1;font-size:13px;font-weight:650;cursor:pointer;min-height:36px;width:auto;margin-top:0}
.tool-btn:hover{background:#f0f6ff;border-color:#7ba6f5}
.tool-btn.listening{background:#ffe5e5;border-color:#ff6b6b;color:#d32f2f;animation:pulse 1.5s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.7}}
.voice-status{font-size:12px;color:#d32f2f;font-weight:600}

/* 上传方式 tab 切换 */
.upload-tabs{display:flex;gap:8px;margin-bottom:14px}
.upload-tab{flex:1;padding:10px 8px;border:1px solid #dfe5f1;border-radius:10px;background:#fff;color:#65738b;font-size:14px;font-weight:650;cursor:pointer;transition:all .2s}
.upload-tab.active{background:#155bf1;color:#fff;border-color:#155bf1}
.upload-tab:hover:not(.active){background:#f0f4ff}

/* 链接输入框 */
.link-input-row{display:flex;gap:8px;align-items:stretch}
.link-input-row input{flex:1;min-width:0}
.link-input-row .tool-btn{margin-top:0;white-space:nowrap}

/* 快捷字段（产品/场景） */
.quick-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:14px 0}
.quick-field label{margin:0 0 6px;font-size:13px}
.quick-field input{min-height:44px;font-size:15px}

/* 口播元信息：确保明显可见 */
.dialogue-meta{display:flex;gap:16px;align-items:center;margin-top:8px;padding:8px 12px;background:#f7faff;border-radius:8px;font-size:13px;color:#526480;font-weight:600}
.length-warning{color:#e67e22;font-weight:700;margin-left:auto}

/* 扣费明细 */
.cost-breakdown{margin:14px 0;padding:14px;background:#f7faff;border:1px solid #e0e9fa;border-radius:12px}
.cost-row{display:flex;justify-content:space-between;padding:5px 0;font-size:13px;color:#526480}
.cost-row.cost-total{border-top:1px solid #d4e0f5;margin-top:6px;padding-top:10px;font-weight:750;color:#14223d;font-size:14px}

summary{min-height:44px;padding:14px 0;color:#225ba9;cursor:pointer;font-size:14px}
pre{white-space:pre-wrap;overflow-wrap:anywhere;background:#f6f8fc;padding:12px;font-family:inherit;font-size:13px;line-height:1.6;max-height:350px;overflow:auto}
progress{width:100%;height:9px;accent-color:#165cf3;margin:18px 0}
.progress-row{display:flex;align-items:center;gap:10px;margin:18px 0}
.progress-row progress{margin:0;flex:1}
.progress-text{font-size:14px;font-weight:700;color:#165cf3;min-width:40px;text-align:right}

/* 保存进度提示 */
.save-hint{margin-top:10px;color:#2a9d5c;font-weight:600;font-size:12px}

/* 登录页 */
.auth{max-width:420px;margin:6vh auto;padding:25px 20px}
.auth-brand{display:flex;align-items:center;gap:12px;font-size:30px;font-weight:800;letter-spacing:-1px;margin-bottom:30px}
.auth-brand img{width:50px}
.auth h1{font-size:27px}
.auth form{margin-top:20px}

/* 庆祝动效 */
.confetti-container{position:fixed;inset:0;pointer-events:none;z-index:9999;overflow:hidden}
.confetti-piece{position:absolute;top:-10px;width:10px;height:10px;border-radius:2px;animation:confetti-fall linear forwards}
@keyframes confetti-fall{
  0%{transform:translateY(0) rotate(0deg);opacity:1}
  100%{transform:translateY(100vh) rotate(720deg);opacity:0}
}

/* 口播模板库 */
.template-panel{margin:10px 0;padding:14px;background:#f7faff;border:1px solid #e0e9fa;border-radius:12px;animation:fadeIn .2s ease}
.template-tags{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:12px}
.template-tag{padding:6px 14px;border:1px solid #dfe5f1;border-radius:16px;background:#fff;color:#526480;font-size:13px;font-weight:600;cursor:pointer;transition:all .2s}
.template-tag.active{background:#155bf1;color:#fff;border-color:#155bf1}
.template-tag:hover:not(.active){background:#f0f4ff}
.template-list{display:grid;gap:8px}
.template-item{padding:12px;background:#fff;border:1px solid #e4e9f2;border-radius:10px;cursor:pointer;transition:all .2s}
.template-item:hover{border-color:#7ba6f5;background:#f7faff}
.template-item-title{font-weight:700;font-size:14px;color:#14223d;margin-bottom:4px}
.template-item-text{font-size:13px;color:#61718c;line-height:1.5;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}

/* 步骤切换淡入动画 */
section[data-step]{animation:fadeIn .3s ease}
@keyframes fadeIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}

/* 余额可点击 */
#balance{cursor:pointer;padding:4px 8px;border-radius:8px;transition:background .2s}
#balance:hover{background:#eef2fb}

/* 三视图放大提示 */
#three-view{cursor:zoom-in;transition:opacity .2s}
#three-view:hover{opacity:.9}

.logout{min-height:44px;padding:0 12px;border:1px solid #dfe5f1;background:#fff;border-radius:10px;color:#526480;font-size:13px;font-weight:600}

@media(min-width:768px){
  .studio{padding:0 32px 64px}
  .panel{padding:28px}
  h1{font-size:36px}
  .steps{font-size:15px}
}
@media(max-width:359px){
  .studio{padding-left:14px;padding-right:14px}
  .panel{padding:15px}
  .steps{font-size:11px}
  h1{font-size:26px}
  .button-row{grid-template-columns:1fr}
}

/* 产品/场景 分组卡片（口播区之外） */
.quick-fields-group{display:block;margin:16px 0;padding:14px;border:1px solid #e5e7eb;border-radius:12px;background:#f8fafc}
.quick-fields-group .group-title{margin:0 0 10px;font-size:14px;font-weight:600;color:#111827}
.quick-fields-group .group-optional{font-weight:400;color:#9ca3af;font-size:12px;margin-left:2px}
.quick-fields-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.quick-fields-row .quick-field{display:flex;flex-direction:column}

/* ============ 异步操作的即时反馈 ============
   用户点完按钮 2-3 秒没有任何变化，会以为系统卡死然后反复点。
   所以：按钮立刻转圈 + 换文案 + 禁用，页面顶部同时出现任务条。 */

/* 按钮里的转圈动画。用 currentColor，主按钮白字、次按钮蓝字都自适应。 */
.btn-spinner{display:inline-block;width:14px;height:14px;margin-right:8px;vertical-align:-2px;border:2px solid currentColor;border-top-color:transparent;border-radius:50%;animation:spin .7s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.primary.is-loading,.secondary.is-loading{opacity:.85;cursor:progress}
.tool-btn.is-loading{opacity:.75;cursor:progress}

/* 预估等待时间 */
.eta-hint{font-size:12.5px;line-height:1.6;color:#7c8aa5;margin:8px 0 0}

/* 全局任务条：任何步骤都能看到「谁在跑 / 排第几 / 还要等多久」 */
.task-banner{margin:14px 0;padding:14px 16px;background:#eef4ff;border:1px solid #c7dbff;border-radius:14px}
.task-banner-top{display:flex;align-items:center;gap:9px;font-size:14px;color:#14223d}
.task-banner-timer{margin-left:auto;font-size:12.5px;font-weight:700;color:#2556a1;white-space:nowrap}
.task-banner-desc{margin:8px 0 0;font-size:13px;line-height:1.65;color:#4a5b78}
.task-banner-progress{display:flex;align-items:center;gap:10px;margin:10px 0 0}
.task-banner-progress progress{margin:0;flex:1;height:8px}
.task-banner-progress[hidden]{display:none}
.task-banner-queue{margin:10px 0 0;padding:9px 11px;background:#fff;border-radius:9px;font-size:12.5px;line-height:1.65;color:#8a6d00;border:1px solid #f0dfae}

/* 不在顶部任务条里重复显示第 4 步的进度条 */
.steps{margin-bottom:20px}

/* ============ 我的项目（多草稿） ============ */
.project-bar{display:flex;gap:8px;align-items:stretch;margin:0 0 6px}
.project-chip{flex:1;display:flex;align-items:center;gap:8px;min-height:46px;padding:0 13px;border:1px solid #dfe5f1;background:#fff;border-radius:12px;text-align:left;color:#14223d;font-size:14px;min-width:0}
.project-chip:hover{border-color:#7ba6f5;background:#f7faff}
.project-chip-hint{font-size:12px;color:#8a97ad;flex:none}
.project-chip b{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}
.project-chip-caret{color:#8a97ad;font-size:11px;flex:none}
.project-new{flex:none;padding:0 15px;min-height:46px;border:1px solid #155bf1;background:#fff;color:#155bf1;border-radius:12px;font-weight:750;font-size:14px}
.project-new:hover{background:#eef4ff}

.project-panel{margin:6px 0 12px;padding:12px;background:#fff;border:1px solid #e4e9f2;border-radius:14px;animation:fadeIn .18s ease}
.project-panel-head{display:flex;align-items:baseline;gap:10px;margin-bottom:10px;font-size:13px;color:#7c8aa5}
.project-panel-head b{font-size:14px;color:#14223d}
.project-cleanup{margin-left:auto;flex:none;min-height:28px;padding:0 10px;border:1px solid #dfe5f1;background:#fff;border-radius:8px;color:#526480;font-size:12px;font-weight:600}
.project-cleanup:hover{background:#f0f4ff;border-color:#7ba6f5}
.project-list{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;max-height:min(52vh,430px);overflow-y:auto}
/* 已出片折叠区：默认收起，点标题展开 */
.project-done-toggle{margin-top:2px;padding:10px 12px;border:1px dashed #dfe5f1;border-radius:11px;color:#7c8aa5;font-size:13px;font-weight:600;cursor:pointer;user-select:none}
.project-done-toggle:hover{background:#f7faff;color:#14223d}
.project-done-toggle .caret{margin-left:4px}
.project-item.folded{opacity:.82}
.project-item{display:flex;min-width:0;gap:10px;align-items:center;padding:11px 12px;border:1px solid #e4e9f2;border-radius:11px;background:#fdfdff;cursor:pointer;transition:border-color .18s,background .18s}
.project-item:hover{border-color:#7ba6f5;background:#f7faff}
.project-item.active{border-color:#155bf1;background:#eff5ff;border-width:2px;padding:10px 11px}
.project-item-main{flex:1;min-width:0}
.project-item-name{font-size:14px;font-weight:700;color:#14223d;display:flex;align-items:center;gap:7px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.project-item-badge{flex:none;font-size:11px;font-weight:700;padding:2px 7px;border-radius:9px}
.project-item-badge.current{background:#155bf1;color:#fff}
.project-item-badge.done{background:#e4f5ea;color:#2a9d5c}
.project-item-meta{margin-top:3px;font-size:12px;color:#8a97ad;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.project-item-actions{display:flex;gap:6px;flex:none}
.project-mini{min-height:32px;padding:0 10px;border:1px solid #dfe5f1;background:#fff;border-radius:8px;color:#526480;font-size:12px;font-weight:600}
.project-mini:hover{background:#f0f4ff;border-color:#7ba6f5}
.project-mini.danger:hover{background:#fff0f0;border-color:#ffb3b3;color:#c0392b}

.project-dialog{width:min(430px,92vw);border:0;border-radius:18px;padding:22px;box-shadow:0 24px 60px rgba(20,34,61,.22);color:#14223d}
.project-dialog::backdrop{background:rgba(20,34,61,.45)}
.project-dialog h2{margin:0 0 4px;font-size:19px}
.project-dialog .hint{margin:8px 0 0}

@media(max-width:600px){
  .project-panel-head{flex-wrap:wrap}
  .project-panel-head span{min-width:0}
  .project-item{flex-direction:column;align-items:stretch}
  .project-item-actions{justify-content:flex-end;flex-wrap:wrap}
}
@media(max-width:359px){
  .project-bar{flex-direction:column}
  .quick-fields-row{grid-template-columns:1fr}
}

/* ===== 视频档位卡：低/中/高，价格直接印在卡上 ===== */
.tier-title{font-size:14px;font-weight:750;color:#111827;margin:2px 0 8px}
.tier-sub{font-size:12px;font-weight:400;color:#9ca3af;margin-left:4px}
.video-tiers{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:6px}
.tier-card{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:2px;
  padding:10px 10px 9px;border:1.5px solid #e5e7eb;border-radius:12px;background:#fff;
  cursor:pointer;text-align:left;font-family:inherit;transition:border-color .15s,background .15s}
.tier-card:hover{border-color:#7ba6f5;background:#f7faff}
.tier-card.active{border-color:#155bf1;background:#eff5ff;box-shadow:0 0 0 1px #155bf1}
.tier-tag{position:absolute;top:-8px;right:8px;font-size:10.5px;font-weight:800;color:#fff;
  background:#155bf1;border-radius:8px;padding:1px 7px}
.tier-card.active .tier-tag{background:#0f46c0}
.tier-name{font-size:13.5px;font-weight:750;color:#111827}
.tier-desc{font-size:11px;color:#8a97ad;line-height:1.3}
.tier-price{font-size:15px;font-weight:800;color:#155bf1;margin-top:4px}
.tier-spec{font-size:11px;color:#9ca3af}
@media(max-width:359px){.video-tiers{grid-template-columns:1fr}}

/* 单档（视频只有一档时）简洁价格展示 */
.tier-single{display:flex;align-items:baseline;justify-content:space-between;gap:8px;
  padding:12px 14px;border:1.5px solid #e5e7eb;border-radius:12px;background:#f7faff;margin-bottom:6px}
.tier-single-label{font-size:14px;font-weight:750;color:#111827}
.tier-single .tier-price{font-size:16px;font-weight:800;color:#155bf1}
