/* 众信财税口播视频工厂 - 品牌样式 */
:root {
  --red: #c8161d;
  --red-dark: #9e1015;
  --ink: #2b2b2b;
  --ink-2: #5a5a5a;
  --bg: #f7f4ef;
  --card: #ffffff;
  --line: #e8e2d8;
  --gold: #b8860b;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg); color: var(--ink);
  display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr auto;
  grid-template-areas: "top" "main" "footer";
  min-height: 100vh;
}

/* 顶部 */
.topbar {
  grid-area: top; display: flex; justify-content: space-between; align-items: center;
  background: var(--card); border-bottom: 2px solid var(--red); padding: 0 20px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 44px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 16px; }
.brand-sub { font-size: 12px; color: var(--ink-2); }
.topbar-right { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.collab-dot { width: 8px; height: 8px; border-radius: 50%; background: #22a34a; display: inline-block; animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .4; } }

/* 侧边抽屉导航（默认收起，汉堡按钮唤出） */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; height: 100vh; width: 240px;
  background: #ffffff; padding: 16px 10px;
  display: flex; flex-direction: column; gap: 4px;
  overflow-y: auto;
  transform: translateX(-105%);
  transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  z-index: 1001;
}
.sidebar.open { transform: translateX(0); box-shadow: 6px 0 28px rgba(0,0,0,.18); }
.drawer-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 1000;
}
.drawer-mask.show { opacity: 1; pointer-events: auto; }
.hamburger {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 9px; flex: 0 0 auto;
  border: 1px solid var(--line); background: #fff; border-radius: 9px; cursor: pointer;
  transition: border-color .15s;
}
.hamburger span { display: block; height: 2px; width: 100%; background: var(--ink); border-radius: 2px; transition: background .15s; }
.hamburger:hover { border-color: var(--red); }
.hamburger:hover span { background: var(--red); }
.nav-item {
  padding: 11px 14px; border-radius: 10px; cursor: pointer; font-size: 14.5px;
  display: flex; align-items: center; gap: 10px; transition: .15s; color: var(--ink);
}
.nav-item:hover { background: #fdf0f0; }
.nav-item.active { background: var(--red); color: #fff; font-weight: 600; }
.nav-ico { width: 22px; text-align: center; }

/* 主区 */
.main { grid-area: main; padding: 24px; max-width: 1280px; width: 100%; margin: 0 auto; }
.page { display: none; }
.page.active { display: block; animation: fadein .25s; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }
.page-title { font-size: 24px; margin-bottom: 18px; }
.page-title small { font-size: 13px; color: var(--ink-2); font-weight: 400; margin-left: 10px; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.card h2 { font-size: 16px; margin-bottom: 14px; padding-left: 10px; border-left: 4px solid var(--red); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: 1fr; } }

/* 统计 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--card); border-radius: 14px; padding: 18px; text-align: center; border: 1px solid var(--line); border-top: 3px solid var(--red); }
.stat-num { font-size: 30px; font-weight: 800; color: var(--red); }
.stat-label { font-size: 13px; color: var(--ink-2); margin-top: 4px; }

/* 七步流程 */
.flow-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
@media (max-width: 1100px) { .flow-row { grid-template-columns: repeat(4, 1fr); } }
.flow-step { background: #fdf9f3; border: 1px dashed var(--line); border-radius: 12px; padding: 12px 10px; cursor: pointer; transition: .15s; }
.flow-step:hover { border-color: var(--red); background: #fdf0f0; transform: translateY(-2px); }
.flow-step b { display: block; font-size: 14px; margin-bottom: 6px; }
.flow-step span { font-size: 12px; color: var(--ink-2); }

.tips { list-style: none; }
.tips li { padding: 8px 0; font-size: 14px; border-bottom: 1px dashed var(--line); line-height: 1.6; }
.tips li:last-child { border-bottom: none; }

/* 表单 */
.form-row { margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 13px; color: var(--ink-2); font-weight: 600; }
input, select, textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 14px;
  font-family: inherit; background: #fffdf9; outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--red); }
.check-row { display: flex; flex-wrap: wrap; gap: 14px; }
.check-row label { display: flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 400; color: var(--ink); }
.check-row input { width: auto; }

/* 按钮 */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 9px;
  padding: 9px 18px; font-size: 14px; cursor: pointer; transition: .15s; font-family: inherit;
}
.btn:hover { border-color: var(--red); color: var(--red); }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-ghost { border: none; background: #f2ede4; }
.btn-danger { color: var(--red); border: none; background: none; cursor: pointer; }

/* 脚本结果 */
.script-result { margin-top: 14px; background: #fdf9f3; border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: 14px; line-height: 1.8; white-space: pre-wrap; }
.script-result .tag { display: inline-block; background: var(--red); color: #fff; font-size: 12px; border-radius: 5px; padding: 1px 8px; margin-bottom: 4px; }
.hidden { display: none; }
.hint { font-size: 12.5px; color: var(--ink-2); margin: 8px 0; line-height: 1.7; }
code { background: #f2ede4; border-radius: 4px; padding: 1px 6px; font-size: 12.5px; }
pre { background: #2b2b2b; color: #e8e2d8; border-radius: 10px; padding: 14px 16px; font-size: 13px; overflow-x: auto; line-height: 1.7; margin: 8px 0 16px; }

/* 选题库 */
.topic-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.topic-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13.5px; transition: .15s; }
.topic-item:hover { border-color: var(--red); background: #fdf0f0; }
.topic-item b { color: var(--red); }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; padding: 9px 10px; background: #f7f2ea; border-bottom: 2px solid var(--line); }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.empty { color: #b0a99c; font-size: 13px; padding: 10px; }

/* 素材工具栏 */
.asset-toolbar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.asset-toolbar select, .asset-toolbar input { width: auto; flex: 1; min-width: 140px; }
.asset-toolbar .btn { flex: 0 0 auto; }

/* 特效 */
.fx-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1100px) { .fx-grid { grid-template-columns: repeat(2, 1fr); } }
.fx-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; transition: .15s; }
.fx-card:hover { border-color: var(--red); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(200,22,29,.08); }
.fx-preview { height: 76px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.fx-card b { font-size: 14.5px; }
.fx-card span { font-size: 12px; color: var(--ink-2); flex: 1; }
.chip-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list li { background: #fdf0f0; color: var(--red); border-radius: 20px; padding: 5px 14px; font-size: 13px; cursor: pointer; }
.chip-list li:hover { background: var(--red); color: #fff; }

/* 图表 */
.chart-card { display: flex; flex-direction: column; }
.chart-box { width: 100%; height: 480px; background: #1c1c22; border-radius: 12px; }
.chart-box.light { background: #fffdf9; }

/* 字幕预览 */
.phone { display: flex; justify-content: center; }
.phone-screen { width: 280px; height: 498px; background: #111; border-radius: 22px; border: 6px solid #2b2b2b; position: relative; overflow: hidden; }
.phone-video { width: 100%; height: 100%; background: linear-gradient(160deg, #4a4e57, #2c2f36); display: flex; align-items: center; justify-content: center; color: #8b93a3; font-size: 14px; letter-spacing: 2px; }
.st-preview { position: absolute; left: 10px; right: 10px; bottom: 46px; text-align: center; pointer-events: none; }
.st-big, .st-kw, .st-seal, .st-clean { line-height: 1.5; font-weight: 800; }
.st-big { color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.8); }
.st-big .hl { color: #ffd21e; }
.st-kw { color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.8); }
.st-kw .hl { color: #ff4d4f; background: rgba(255,255,255,.12); border-radius: 4px; padding: 0 4px; }
.st-seal { color: #fff; }
.st-seal .hl { color: #fff; background: var(--red); border-radius: 6px; padding: 2px 8px; box-shadow: 0 2px 8px rgba(200,22,29,.5); }
.st-clean { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 2px #000; font-weight: 600; }

/* 看板 */
.kanban { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 980px) { .kanban { grid-template-columns: 1fr; } }
.kb-col { background: #f7f2ea; border-radius: 12px; padding: 12px; }
.kb-col h3 { font-size: 14px; margin-bottom: 10px; padding-left: 8px; border-left: 3px solid var(--red); }
.kb-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kb-card small { color: var(--ink-2); display: block; margin-top: 3px; }
.kb-card .del { cursor: pointer; color: #c0b8a8; }
.kb-card .del:hover { color: var(--red); }

/* 脚本库 */
.lib-list { display: flex; flex-direction: column; gap: 8px; }
.lib-item { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.lib-item .meta { color: var(--ink); flex: 1; min-width: 200px; overflow: hidden; }
.lib-item .meta small { color: var(--ink-2); display: block; margin-top: 2px; }
.lib-item .lib-btns { display: flex; gap: 6px; }
.lib-full { width: 100%; white-space: pre-wrap; background: #fdf9f3; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; line-height: 1.7; }

/* 检查清单 */
.checklist { list-style: none; }
.checklist li { padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 7px; cursor: pointer; font-size: 13.5px; transition: .15s; user-select: none; }
.checklist li.ok { background: #eef7f0; border-color: #b7dcc2; text-decoration: line-through; color: #4c8a5c; }

/* 页脚 */
.footer { grid-area: footer; text-align: center; padding: 16px; font-size: 12.5px; color: #b0a99c; border-top: 1px solid var(--line); background: var(--card); }

/* 上传进度条 */
.progress-wrap { height: 12px; background: #f2ede4; border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.progress-bar { height: 100%; width: 0%; background: var(--red); border-radius: 8px; transition: width .3s; }

/* ============ 登录 / 设置浮层 ============ */
.overlay {
  position: fixed; inset: 0; background: rgba(43,43,43,.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 999;
}
.overlay.hidden { display: none; }
.login-box {
  background: var(--card); border-radius: 16px; padding: 28px 30px; width: 380px; max-width: 92vw;
  border-top: 4px solid var(--red); box-shadow: 0 12px 40px rgba(0,0,0,.25);
  display: flex; flex-direction: column; gap: 10px; text-align: center;
}
.login-box h2 { border: none; padding: 0; margin: 4px 0; }
.login-logo { height: 56px; object-fit: contain; margin: 0 auto; }
.login-box .btn { margin-top: 4px; }

/* 顶栏徽标 */
#modeBadge, #userBadge { font-size: 12.5px; color: var(--ink-2); }
#userBadge { color: var(--red); font-weight: 600; }

/* ============ 特效预览动画 ============ */
.fx-preview { transition: .2s; }
@keyframes stampIn { 0% { transform: scale(3) rotate(-18deg); opacity: 0; } 55% { transform: scale(1) rotate(0deg); opacity: 1; } 65% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes bounceY { 0%,100% { transform: translateY(0); } 30% { transform: translateY(-26px); } 50% { transform: translateY(0); } 70% { transform: translateY(-14px); } 85% { transform: translateY(0); } }
@keyframes rainFall { 0% { transform: translateY(-24px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(24px); opacity: 0; } }
@keyframes flashBlink { 0%,100% { opacity: 1; filter: none; } 25% { opacity: .25; } 50% { opacity: 1; text-shadow: 0 0 18px var(--red); } 75% { opacity: .25; } }
@keyframes slideX { 0% { transform: translateX(-34px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateX(34px); opacity: 0; } }
.anim-stamp { animation: stampIn 1.2s cubic-bezier(.2,1.4,.4,1) both; }
.anim-bounce { animation: bounceY 1.4s ease both; }
.anim-rain { animation: rainFall .9s linear 2 both; }
.anim-flash { animation: flashBlink 1.3s ease both; }
.anim-slide { animation: slideX 1.2s ease both; }

/* ============ 移动端适配（≤768px） ============ */
@media (max-width: 768px) {
  body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    grid-template-areas: "top" "nav" "main" "footer";
  }
  .topbar { padding: 8px 12px; flex-wrap: wrap; gap: 6px; height: auto; }
  .brand-logo { height: 34px; }
  .brand-sub { display: none; }
  .brand-name { font-size: 14px; }
  .topbar-right { width: 100%; justify-content: flex-start; flex-wrap: wrap; font-size: 12px; gap: 6px; }
  .topbar-right .btn { padding: 6px 10px; font-size: 12px; }
  .sidebar {
    width: 250px;
    -webkit-overflow-scrolling: touch;
  }
  .nav-item { padding: 10px 14px; font-size: 14px; }
  .main { padding: 12px; }
  .page-title { font-size: 19px; }
  .page-title small { display: block; margin: 4px 0 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-num { font-size: 22px; }
  .flow-row { grid-template-columns: repeat(2, 1fr); }
  .fx-grid { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 14px; border-radius: 12px; }
  .card h2 { font-size: 14.5px; }
  .tbl { display: block; overflow-x: auto; white-space: nowrap; }
  .asset-toolbar { flex-direction: column; }
  .asset-toolbar select, .asset-toolbar input { width: 100%; }
  .chart-box { height: 340px; }
  .phone-screen { width: 230px; height: 410px; }
  .login-box { padding: 20px; }
  pre { font-size: 12px; }
  .kanban { grid-template-columns: 1fr; }
  .lib-item { flex-direction: column; align-items: stretch; }
  .lib-item .lib-btns { justify-content: flex-start; }
  .check-row { gap: 10px; }
}
@media (max-width: 420px) {
  .brand-name { max-width: 58vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .stat-grid { gap: 8px; }
  .flow-step b { font-size: 13px; }
}
