:root {
  --primary: #ff5a1f;
  --primary-dark: #e64a10;
  --grad: linear-gradient(135deg, #ff7a18, #ff2e00);
  --bg: #fff7f2;
  --card: #ffffff;
  --text: #2b2b2b;
  --muted: #8a8a8a;
  --border: #ffe3d3;
  --shadow: 0 10px 30px rgba(255, 90, 31, 0.12);
  --radius: 16px;
}

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

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.page { max-width: 1100px; margin: 0 auto; padding: 20px 14px 60px; }

/* ===== 顶栏会员 ===== */
.member-bar { position: fixed; top: 14px; right: 14px; z-index: 900; display: flex; align-items: center; gap: 8px; }
.member-status { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.08); display: none; }
.member-status.paid, .member-status.nopay { display: inline-block; }
.member-status.paid { color: #059669; border: 1px solid #d1fae5; }
.member-status.nopay { color: #ff5a1f; border: 1px solid #ffe3d3; }
.btn-member {
  font-size: 13px; font-weight: 600; padding: 7px 14px; border: none; border-radius: 999px;
  cursor: pointer; color: #fff; background: linear-gradient(135deg, #ff7a18, #ff2e00);
  box-shadow: 0 4px 12px rgba(255,90,31,.3);
}
.btn-member:hover { transform: translateY(-1px); }

/* ===== 头部 ===== */
.hero { text-align: center; padding: 26px 0 14px; }
.hero h1 {
  font-size: 32px;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}
.hero .sub { color: var(--muted); margin-top: 8px; font-size: 14.5px; }
.steps { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.steps span {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 13px; font-size: 12.5px; color: #c2410c;
  box-shadow: 0 2px 8px rgba(255, 90, 31, 0.08);
}

/* ===== 布局 ===== */
.layout { display: grid; grid-template-columns: 370px 1fr; gap: 16px; margin-top: 16px; align-items: start; }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr; } }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
  border: 1px solid var(--border);
}
.card h2 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.card-head h2 { margin-bottom: 0; }
.template-count { font-size: 13px; color: var(--muted); }

/* ===== 左表单 ===== */
label.field-label { display: block; font-size: 12.5px; font-weight: 700; margin-top: 10px; color: #555; }
label em { color: #ff2e00; font-style: normal; font-weight: 400; font-size: 11px; }
input, select, textarea {
  width: 100%; margin-top: 5px; padding: 9px 11px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: #fff;
  color: var(--text); transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.12);
}
.samples { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.s-chip {
  background: #fff4ec; border: 1px solid #ffd9c2; color: #d84a00;
  border-radius: 999px; padding: 4px 11px; font-size: 12px; cursor: pointer;
}
.s-chip:hover { background: #ffe6d3; }
.auto-note {
  margin-top: 10px; background: #f0f9f4; border: 1px solid #b8e6c8; color: #0a7a3d;
  border-radius: 10px; padding: 7px 10px; font-size: 11.5px; line-height: 1.6; display: none;
}
.auto-note.show { display: block; }
.form-tip {
  font-size: 11.5px; color: var(--muted); line-height: 1.7; margin-top: 10px;
  background: #fff7ed; border: 1px dashed var(--border); border-radius: 10px; padding: 8px 10px;
}
.form-tip u { text-decoration: none; border-bottom: 1px dashed #d84a00; color: #d84a00; }

/* ===== 档位筛选 ===== */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.f-tag {
  background: #fff; border: 1.5px solid var(--border); border-radius: 999px;
  padding: 4px 12px; font-size: 12px; cursor: pointer; color: #555;
}
.f-tag:hover { border-color: var(--primary); color: var(--primary); }
.f-tag.on { background: var(--grad); color: #fff; border-color: transparent; }

/* ===== 模板列表 ===== */
.tlist { display: flex; flex-direction: column; gap: 8px; max-height: 620px; overflow-y: auto; }
.titem {
  border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px;
  cursor: pointer; background: #fffaf5; transition: all .12s;
}
.titem:hover { border-color: var(--primary); box-shadow: 0 3px 10px rgba(255,90,31,.12); }
.titem-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.titem-name { font-size: 13.5px; font-weight: 600; line-height: 1.5; }
.badge { font-size: 10px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; font-weight: 700; flex: 0 0 auto; }
.b-full  { background: #ff2e00; color: #fff; }
.b-major { background: #ff7a18; color: #fff; }
.b-half  { background: #f59e0b; color: #fff; }
.b-minor { background: #9ca3af; color: #fff; }

/* ===== 说明卡 ===== */
.legend-card { margin-top: 16px; }
.legend-card h2 { font-size: 15px; }
.legend-desc { font-size: 13px; line-height: 1.8; color: #555; }
.legend-desc b { color: #c2410c; }
.legend { display: flex; gap: 14px; font-size: 11px; color: #666; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.legend .r { background: var(--grad); }
.legend .s { background: #d1d5db; }
.legend .b1 { background: #ff2e00; }
.legend .b2 { background: #ff7a18; }
.legend .b3 { background: #f59e0b; }
.legend .b4 { background: #9ca3af; }

/* ===== 历史 ===== */
.history-card { margin-top: 16px; }
.history-list { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto; }
.history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: #fffaf5; border-radius: 10px;
  border: 1px solid var(--border); font-size: 13px;
}
.history-item-info { flex: 1; }
.history-item-title { font-weight: 600; }
.history-item-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.history-item-btn {
  background: #fff; border: 1px solid var(--border); color: var(--primary);
  border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; font-weight: 600;
}
.history-item-btn:hover { background: var(--primary); color: #fff; }
.empty-tip { color: var(--muted); font-size: 13px; text-align: center; padding: 20px; }
.btn-mini {
  background: #fff; border: 1.5px solid var(--primary); color: var(--primary);
  border-radius: 999px; padding: 3px 11px; font-size: 12px; cursor: pointer; font-weight: 600;
}
.btn-mini:hover { background: var(--primary); color: #fff; }

footer { text-align: center; color: #c9b8ae; font-size: 12px; margin-top: 28px; }

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 14px;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 20px; max-width: 760px; width: 100%;
  max-height: 92vh; overflow-y: auto; padding: 0;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: #fff; border-radius: 20px 20px 0 0; z-index: 5;
}
.modal-head h3 { font-size: 16px; line-height: 1.5; padding-right: 10px; }
.modal-close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: #999; padding: 0 4px; flex: 0 0 auto;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 18px 20px 22px; }

/* 出镜时长可视化条 */
.vis-label { font-size: 12px; color: #666; margin: 10px 0 6px; }
.vis { display: flex; height: 34px; border-radius: 9px; overflow: hidden; border: 1px solid #e5e0d8; }
.vis .seg {
  display: flex; align-items: center; justify-content: center;
  font-size: 9.5px; color: #fff; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vis .real { background: var(--grad); }
.vis .scn { background: #d1d5db; color: #555; }

/* 输出块 */
.blk { border: 1px solid var(--border); border-radius: 12px; margin-top: 12px; overflow: hidden; }
.blk-h {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; background: #fff2e8; font-size: 13px; font-weight: 700;
}
.blk-h .new {
  background: var(--grad); color: #fff; font-size: 9.5px; border-radius: 4px;
  padding: 1px 6px; margin-left: 6px; vertical-align: 1px; font-weight: 400;
}
.copy {
  border: 1px solid #ffb199; background: #fff; color: #d84a00; border-radius: 7px;
  padding: 2px 9px; font-size: 11px; cursor: pointer;
}
.copy:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.copy.done { background: #0a7a3d; color: #fff; border-color: #0a7a3d; }
.blk-b {
  padding: 11px 13px; font-size: 13px; line-height: 1.8;
  white-space: pre-wrap; word-break: break-all; background: #fff;
}
.blk-b.dark {
  background: #1d1f27; color: #e8e6e0; font-size: 12.5px;
  font-family: Consolas, Menlo, monospace; line-height: 1.75;
}
.len { font-size: 11.5px; margin-top: 6px; }
.len.ok { color: #0a7a3d; }
.len.warn { color: #d84a00; font-weight: 600; }

/* 字数提示条 */
.len-tip { font-size: 12px; margin-top: 6px; padding: 4px 10px; border-radius: 8px; line-height: 1.6; }
.len-tip.ok { color: #059669; background: #ecfdf5; }
.len-tip.warn { color: #b45309; background: #fffbeb; border: 1px solid #fde68a; }

/* AI按钮 */
.ai-btn {
  background: var(--grad); color: #fff; border: none; border-radius: 999px;
  padding: 4px 12px; font-size: 11.5px; cursor: pointer; font-weight: 600;
}
.ai-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255, 60, 0, .3); }
.ai-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.ai-loading { padding: 10px; font-size: 13px; color: #ea580c; }
.ai-result { margin-top: 10px; padding: 12px; background: #f0fdf4; border-radius: 10px; border: 1px solid #bbf7d0; }
.ai-result-label { font-size: 12px; font-weight: 600; margin-bottom: 6px; }

/* 字幕亮点词 chip */
.sub-chip {
  display: inline-block; background: #fff4ec; border: 1px solid #ffd9c2; color: #d84a00;
  border-radius: 999px; padding: 3px 10px; font-size: 12.5px; font-weight: 600;
  margin: 0 6px 6px 0;
}

.note-demo {
  background: #fff8e6; border: 1px dashed #eab308; border-radius: 10px;
  padding: 8px 11px; font-size: 11.5px; color: #854d0e; line-height: 1.7; margin-top: 14px;
}

/* ===== 会员弹窗 ===== */
.modal-mask { display:none; position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:9999; align-items:center; justify-content:center; padding:20px; }
.modal-mask.show { display:flex; }
.modal-box { background:#fff; border-radius:20px; padding:32px 24px 24px; max-width:400px; width:100%; text-align:center;
  box-shadow:0 20px 60px rgba(0,0,0,.25); animation:modalIn .25s ease; }
@keyframes modalIn { from { transform:scale(.9); opacity:0; } to { transform:scale(1); opacity:1; } }
.modal-ico { font-size:48px; margin-bottom:12px; }
.modal-title { font-size:20px; font-weight:800; color:#1F2329; margin-bottom:6px; }
.modal-sub { font-size:14px; color:#6B7280; line-height:1.7; margin-bottom:20px; }
.modal-input { width:100%; padding:12px 14px; border:1.5px solid #ffe3d3; border-radius:12px;
  font-size:14px; margin-bottom:14px; text-align:center; letter-spacing:1px; }
.modal-input:focus { outline:none; border-color:#ff5a1f; box-shadow:0 0 0 3px rgba(255,90,31,.12); }
.btn-primary { width:100%; padding:13px; background:linear-gradient(135deg,#ff7a18,#ff2e00); color:#fff;
  border:none; border-radius:12px; font-size:15px; font-weight:700; cursor:pointer;
  box-shadow:0 8px 20px rgba(255,60,0,.3); transition:transform .1s; }
.btn-primary:hover { transform:translateY(-2px); }
.btn-primary:disabled { background:#C9CDD3; box-shadow:none; cursor:not-allowed; transform:none; }
.btn-secondary { width:100%; padding:11px; background:#fff; color:#ff5a1f;
  border:1.5px solid #ff5a1f; border-radius:12px; font-size:14px; font-weight:600;
  cursor:pointer; margin-top:10px; transition:all .15s; }
.btn-secondary:hover { background:#fff5ee; }
.modal-msg { font-size:13px; margin-top:10px; min-height:18px; text-align:center; }
.modal-msg.ok { color:#059669; }
.modal-msg.err { color:#b91c1c; }
.code-row { display:flex; gap:8px; margin-bottom:4px; }
.code-row .modal-input { flex:1; margin-bottom:0; }
.btn-code { flex:0 0 auto; padding:0 14px; border:1.5px solid #ff5a1f; background:#fff; color:#ff5a1f;
  border-radius:12px; font-size:14px; font-weight:600; cursor:pointer; white-space:nowrap; }
.btn-code:disabled { opacity:.5; cursor:not-allowed; }
.modal-tip { font-size:12px; color:#9ca3af; margin-top:12px; }

/* ===== 手机端 ===== */
@media (max-width: 600px) {
  .page { padding: 12px 10px 28px; }
  .hero { padding: 14px 0 10px; }
  .hero h1 { font-size: 22px; }
  .hero .sub { font-size: 12.5px; }
  .steps { gap: 6px; }
  .steps span { padding: 4px 9px; font-size: 11px; }
  .card { padding: 14px 12px; }
  .filters { gap: 5px; }
  .f-tag { padding: 4px 9px; font-size: 11px; }
  .titem-name { font-size: 12.5px; }
  .member-bar { top: 8px; right: 8px; }
  .modal { width: 100%; height: 100%; border-radius: 0; max-height: 100vh; }
  .modal-overlay { padding: 0; }
  .modal-head { border-radius: 0; padding: 14px 16px; }
  .modal-body { padding: 14px; }
  .blk-b { font-size: 12.5px; }
  .blk-b.dark { font-size: 11.5px; }
}
