/* 紫瞳 AI · 视频创作工作台 — 自研 UI，不依赖任何第三方框架 */

* { box-sizing: border-box; }
:root {
  --bg: #0f1119;
  --panel: #181b29;
  --panel-2: #1e2133;
  --line: #2a2e44;
  --text: #e6e8f1;
  --muted: #8a8fb3;
  --accent: #8b5cf6;
  --accent-2: #6d28d9;
  --good: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
}
html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Microsoft YaHei", Segoe UI, Arial, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.5;
}
button { font: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px;
  width: 100%;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); }

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: linear-gradient(180deg, #181b29 0%, #14161f 100%);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { color: var(--accent); font-size: 22px; }
.brand-text { font-weight: 600; font-size: 15px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.balance { color: var(--muted); }
.balance b { color: var(--good); }
.user { color: var(--muted); }

/* layout */
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 56px); }
.sidenav {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 18px 12px;
}
.nav-item {
  display: block; padding: 10px 14px; border-radius: 8px;
  color: var(--muted); text-decoration: none; cursor: pointer;
  margin-bottom: 4px;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--accent); color: #fff; }
.main { padding: 24px 28px; max-width: 1080px; }
.view { display: none; }
.view.active { display: block; }
.view-head h2 { margin: 0 0 6px; font-size: 22px; }
.view-head p { margin: 0 0 22px; color: var(--muted); }

/* mode tabs */
.mode-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.mode-tab {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--muted);
}
.mode-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* form */
.form { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12px; color: var(--muted); }
.hint { color: var(--muted); font-size: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.row-2 { display: flex; align-items: center; justify-content: space-between; }
.cost { color: var(--muted); }
.cost b { color: var(--good); }

/* buttons */
.btn-primary {
  background: var(--accent); color: #fff; border: 0;
  border-radius: 8px; padding: 11px 22px; font-weight: 500;
}
.btn-primary:hover { background: var(--accent-2); }
.btn-primary:disabled { background: #3a3f5a; cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 14px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }

/* post */
.postpresets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.preset {
  padding: 10px 14px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text);
}
.preset:hover { border-color: var(--accent); }
.postform { background: var(--panel); border: 1px solid var(--line);
            border-radius: 10px; padding: 18px; min-height: 220px; }

/* history */
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-item {
  display: grid; grid-template-columns: 100px 90px 100px 1fr 100px;
  gap: 14px; padding: 12px 14px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; align-items: center;
}
.task-item .kind { color: var(--accent); font-weight: 500; }
.task-item .status-queued { color: var(--warn); }
.task-item .status-running { color: var(--accent); }
.task-item .status-done { color: var(--good); }
.task-item .status-failed { color: var(--bad); }
.task-item .id { color: var(--muted); font-family: ui-monospace, SFMono-Regular, monospace; font-size: 12px; }
.task-item .files a { color: var(--accent); margin-right: 10px; }

/* account */
.balance-card {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 12px; padding: 24px; color: #fff; max-width: 320px;
}
.big-num { font-size: 38px; font-weight: 700; }
.tx-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.tx-table th, .tx-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.tx-table th { color: var(--muted); font-weight: 500; }

/* login */
.login-layer {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.login-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 28px; width: 360px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.5);
}
.login-brand { font-size: 16px; font-weight: 600; margin-bottom: 18px; display: flex; gap: 8px; align-items: center; }
.login-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.lt {
  flex: 1; padding: 8px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--muted); border-radius: 8px;
}
.lt.active { color: var(--text); border-color: var(--accent); }
.login-card .field { margin-bottom: 14px; }
.login-card .btn-primary { width: 100%; margin-top: 8px; }

/* modal */
.modal {
  position: fixed; inset: 0; background: rgba(8,10,16,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 200;
}
.modal-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 24px; width: 460px; max-width: 92vw;
}
.modal-bar { background: var(--panel-2); border-radius: 99px; height: 6px; margin: 14px 0; overflow: hidden; }
.modal-bar-inner { background: var(--accent); height: 100%; width: 0%;
                  transition: width 0.4s ease; }
.modal-files a { color: var(--accent); display: block; margin: 6px 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* helper */
.empty { color: var(--muted); padding: 24px; text-align: center; }
.kbd { font-family: ui-monospace, SFMono-Regular, monospace;
       background: var(--panel-2); padding: 1px 6px; border-radius: 4px;
       font-size: 12px; }

/* ---------- 行业模板（企业客户主入口） ---------- */
.tpl-grid { display: grid; gap: 14px; margin-top: 16px;
            grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tpl-card { background: var(--panel); border: 1px solid var(--line);
            border-radius: 12px; padding: 16px; cursor: pointer;
            transition: border-color .15s, transform .15s; position: relative; }
.tpl-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tpl-card.disabled { opacity: .5; cursor: not-allowed; }
.tpl-card.disabled:hover { border-color: var(--line); transform: none; }
.tpl-industry { display: inline-block; font-size: 11px; color: var(--accent);
                background: rgba(47,111,237,.09); padding: 2px 8px;
                border-radius: 5px; margin-bottom: 8px; }
.tpl-name { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.tpl-desc { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }
.tpl-slots-hint { margin-top: 10px; font-size: 12px; color: var(--muted); }
.tpl-badge { position: absolute; top: 12px; right: 12px; font-size: 11px;
             color: var(--muted); }
.slot { margin-bottom: 14px; }
.slot .label { display: block; font-size: 13px; margin-bottom: 5px; }
.slot .req { color: #dc2626; margin-left: 2px; }
.slot .hint { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.slot input[type=file] { font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px;
         margin: 6px 0; }
.check input { width: auto; }
.actions { display: flex; gap: 10px; margin-top: 16px; }

/* ---- 任务进度条 ---- */
.task-progress {
  grid-column: 1 / -1;
  height: 4px;
  border-radius: 2px;
  background: rgba(0,0,0,.08);
  overflow: hidden;
}
.task-progress > div {
  height: 100%;
  background: linear-gradient(90deg, #6c5ce7, #00b894);
  transition: width .6s ease;
}
