/* 等你来看剧 · 分镜台
   设计系统取自原站 dnlkj.com（Tailwind + 7 套 data-theme）
   变量、字体、圆角、阴影尺度全部对齐 */

/* ===== 字体（下载自原站 _next/static/media）=====
   unicode-range 必须保留：这两个 woff2 只含拉丁字形，
   不加 range 浏览器会让它们认领中文 → 无字形 → 乱码。 */
@font-face {
  font-family: InterVar;
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/fonts/e4af272ccee01ff0-s.p.woff2) format("woff2");
  unicode-range: u+00??, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da, u+02dc,
    u+0304, u+0308, u+0329, u+2000-206f, u+20ac, u+2122, u+2191, u+2193,
    u+2212, u+2215, u+feff, u+fffd;
}
@font-face {
  font-family: PlayfairVar;
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(/fonts/eaead17c7dbfcd5d-s.p.woff2) format("woff2");
  unicode-range: u+00??, u+0131, u+0152-0153, u+02bb-02bc, u+02c6, u+02da, u+02dc,
    u+0304, u+0308, u+0329, u+2000-206f, u+20ac, u+2122, u+2191, u+2193,
    u+2212, u+2215, u+feff, u+fffd;
}

/* ===== 主题变量（原站 7 套，原样搬过来）===== */
:root, [data-theme="cyber"] {
  --bg-deep: #050510;
  --bg-card: rgba(16, 16, 32, .82);
  --bg-elevated: rgba(28, 28, 48, .88);
  --bg-input: rgba(22, 22, 40, .9);
  --accent-primary: #8b5cf6;
  --accent-secondary: #22d3ee;
  --accent-warm: #fb7185;
  --accent-gold: #fbbf24;
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border-color: hsla(0, 0%, 100%, .09);
  --shadow-color: rgba(0, 0, 0, .5);
  --accent-primary-glow: rgba(139, 92, 246, .35);
  --accent-secondary-glow: rgba(34, 211, 238, .35);
}
[data-theme="gold"] {
  --bg-deep: #0a0805;
  --bg-card: rgba(28, 22, 12, .85);
  --bg-elevated: rgba(40, 32, 18, .9);
  --bg-input: rgba(32, 26, 14, .92);
  --accent-primary: #f59e0b;
  --accent-secondary: #fbbf24;
  --accent-warm: #f97316;
  --accent-gold: #fde047;
  --text-primary: #fffbeb;
  --text-secondary: #e7e5e4;
  --text-muted: #a8a29e;
  --border-color: rgba(251, 191, 36, .12);
  --shadow-color: rgba(0, 0, 0, .55);
  --accent-primary-glow: rgba(245, 158, 11, .35);
  --accent-secondary-glow: rgba(251, 191, 36, .35);
}
[data-theme="glacier"] {
  --bg-deep: #020617;
  --bg-card: rgba(15, 23, 42, .85);
  --bg-elevated: rgba(30, 41, 59, .9);
  --bg-input: rgba(23, 32, 50, .92);
  --accent-primary: #38bdf8;
  --accent-secondary: #818cf8;
  --accent-warm: #f472b6;
  --accent-gold: #facc15;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: rgba(148, 163, 184, .12);
  --shadow-color: rgba(0, 0, 0, .5);
  --accent-primary-glow: rgba(56, 189, 248, .35);
  --accent-secondary-glow: rgba(129, 140, 248, .35);
}
[data-theme="crimson"] {
  --bg-deep: #0c0508;
  --bg-card: rgba(30, 12, 18, .85);
  --bg-elevated: rgba(45, 18, 28, .9);
  --bg-input: rgba(36, 14, 22, .92);
  --accent-primary: #f43f5e;
  --accent-secondary: #fb923c;
  --accent-warm: #facc15;
  --text-primary: #fff1f2;
  --text-secondary: #fecdd3;
  --text-muted: #fda4af;
  --border-color: rgba(244, 63, 94, .14);
  --shadow-color: rgba(0, 0, 0, .55);
  --accent-primary-glow: rgba(244, 63, 94, .35);
  --accent-secondary-glow: rgba(251, 146, 60, .35);
}
[data-theme="emerald"] {
  --bg-deep: #04100c;
  --bg-card: rgba(10, 28, 22, .85);
  --bg-elevated: rgba(16, 40, 32, .9);
  --bg-input: rgba(13, 34, 26, .92);
  --accent-primary: #10b981;
  --accent-secondary: #34d399;
  --accent-warm: #fbbf24;
  --accent-gold: #fbbf24;
  --text-primary: #ecfdf5;
  --text-secondary: #d1fae5;
  --text-muted: #6ee7b7;
  --border-color: rgba(16, 185, 129, .14);
  --shadow-color: rgba(0, 0, 0, .5);
  --accent-primary-glow: rgba(16, 185, 129, .35);
  --accent-secondary-glow: rgba(52, 211, 153, .35);
}
[data-theme="sakura"] {
  --bg-deep: #12050f;
  --bg-card: rgba(35, 12, 28, .85);
  --bg-elevated: rgba(48, 18, 38, .9);
  --bg-input: rgba(40, 14, 32, .92);
  --accent-primary: #ec4899;
  --accent-secondary: #a78bfa;
  --accent-warm: #f472b6;
  --accent-gold: #fbbf24;
  --text-primary: #fdf2f8;
  --text-secondary: #fbcfe8;
  --text-muted: #f9a8d4;
  --border-color: rgba(236, 72, 153, .14);
  --shadow-color: rgba(0, 0, 0, .5);
  --accent-primary-glow: rgba(236, 72, 153, .35);
  --accent-secondary-glow: rgba(167, 139, 250, .35);
}
[data-theme="light"] {
  --bg-deep: #f0f0f8;
  --bg-card: rgba(255, 255, 255, .9);
  --bg-elevated: #ffffff;
  --bg-input: #f8fafc;
  --accent-primary: #7c3aed;
  --accent-secondary: #3b82f6;
  --accent-warm: #f43f5e;
  --accent-gold: #d97706;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border-color: rgba(15, 23, 42, .1);
  --shadow-color: rgba(15, 23, 42, .12);
  --accent-primary-glow: rgba(124, 58, 237, .25);
  --accent-secondary-glow: rgba(59, 130, 246, .25);
}

/* ===== 基础 ===== */
:root {
  --font-sans: "InterVar", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-display: "PlayfairVar", "Noto Serif SC", Georgia, serif;
  --font-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-full: 9999px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--text-primary);
  font: 14px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  transition: background .3s, color .3s;
}
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
code { font-family: var(--font-mono); font-size: .92em; color: var(--text-secondary); background: var(--bg-input); padding: 1px 5px; border-radius: 4px; }
a { color: var(--accent-primary); text-decoration: none; }

/* ===== 顶栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: background .3s, border-color .3s;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--text-primary);
  display: inline-flex; align-items: center; gap: 9px;
}
.logo::before {
  content: ""; width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  box-shadow: 0 4px 16px var(--accent-primary-glow);
}
.brand .rule { width: 1px; height: 16px; background: var(--border-color); }
.sub { font-size: 12.5px; color: var(--text-muted); letter-spacing: .02em; }
.top-right { display: flex; align-items: center; gap: 10px; }

/* ===== 主题按钮 ===== */
.theme-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border-color);
  background: var(--bg-input); color: var(--text-secondary);
  display: grid; place-items: center; cursor: pointer; font-size: 15px; line-height: 1;
  transition: border-color .15s, background .15s, color .15s;
}
.theme-btn:hover { border-color: var(--accent-primary); color: var(--text-primary); }

/* ===== 按钮 ===== */
button { font: inherit; cursor: pointer; transition: all .15s ease; }
button:disabled { opacity: .45; cursor: not-allowed; }

.primary {
  border: 0; border-radius: 10px; padding: 9px 18px; font-weight: 600; font-size: 13.5px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  box-shadow: 0 4px 16px var(--accent-primary-glow);
}
.primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 6px 22px var(--accent-primary-glow); transform: translateY(-1px); }
.primary:active:not(:disabled) { transform: translateY(0); }

.ghost {
  background: var(--bg-input); color: var(--text-secondary);
  border: 1px solid var(--border-color); border-radius: 10px; padding: 8px 16px; font-size: 13.5px;
}
.ghost:hover:not(:disabled) { border-color: var(--accent-primary); color: var(--text-primary); background: var(--bg-elevated); }
.small { padding: 5px 12px; font-size: 12.5px; border-radius: 8px; }

/* ===== 输入 ===== */
input, textarea, select {
  font: inherit; font-family: var(--font-sans); color: var(--text-primary);
  background: var(--bg-input); border: 1px solid var(--border-color);
  border-radius: 10px; padding: 9px 12px; width: 100%; outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-glow);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.65; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px;
}
label { display: block; margin: 14px 0; color: var(--text-secondary); font-size: 12.5px; font-weight: 500; }
label input, label textarea, label select { margin-top: 7px; color: var(--text-primary); font-size: 14px; font-weight: 400; }

/* ===== 登录页 ===== */
.auth-wrap { display: grid; place-items: center; min-height: calc(100vh - 64px); padding: 40px 24px; }
.auth-split {
  display: grid; grid-template-columns: 1fr; max-width: 420px; width: 100%;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 20px; padding: 36px 34px 30px;
  box-shadow: 0 20px 60px var(--shadow-color);
  backdrop-filter: blur(20px);
}
.auth-plate { display: none; }
.auth-form { padding: 0; }
.kicker {
  margin: 0 0 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent-primary);
}
.auth-form h1 { margin: 0 0 6px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.lead { margin: 0 0 20px; font-size: 13px; color: var(--text-muted); }
.msg { min-height: 20px; margin-top: 12px; color: var(--accent-warm); font-size: 12.5px; }
.msg.ok { color: var(--accent-primary); }

/* ===== 工作区 ===== */
.studio { display: grid; grid-template-columns: 264px 1fr; min-height: calc(100vh - 64px); }

.sidebar {
  border-right: 1px solid var(--border-color);
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  display: flex; flex-direction: column;
}
.side-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 10px; }
.side-title { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.project-list { list-style: none; margin: 0; padding: 2px 10px 14px; overflow: auto; flex: 1; }
.project-list li {
  padding: 10px 12px; margin-bottom: 2px; cursor: pointer; border-radius: var(--r-md);
  border: 1px solid transparent; transition: background .14s, border-color .14s;
}
.project-list li:hover { background: var(--bg-elevated); }
.project-list li.active { background: var(--bg-elevated); border-color: var(--border-color); box-shadow: inset 3px 0 0 var(--accent-primary); }
.project-list .pname { display: block; font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.project-list .pmeta { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.side-foot { padding: 12px 16px; border-top: 1px solid var(--border-color); font-size: 11px; color: var(--text-muted); }

.work { padding: 26px 30px 80px; overflow: auto; }

/* ===== 空态 ===== */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 60vh; text-align: center;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 20px;
  margin: 8px auto; max-width: 820px; padding: 60px 24px;
}
.empty-num { display: none; }
.empty::before {
  content: ""; width: 54px; height: 54px; border-radius: 14px; margin-bottom: 10px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  box-shadow: 0 8px 28px var(--accent-primary-glow);
  opacity: .9;
}
.empty h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }

/* ===== 项目头 ===== */
.proj-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color);
}
.proj-head h2 { margin: 0 0 4px; font-size: 21px; font-weight: 700; letter-spacing: -.015em; }
.proj-head p { margin: 0; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); }

/* ===== 步骤条 ===== */
.steps {
  display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px;
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: var(--r-lg); padding: 6px;
}
.step-btn {
  border: 0; background: transparent; color: var(--text-muted);
  padding: 8px 14px; font-size: 13px; font-weight: 500; border-radius: 10px;
  transition: background .15s, color .15s;
}
.step-btn:hover { background: var(--bg-elevated); color: var(--text-secondary); }
.step-btn.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff; font-weight: 600;
  box-shadow: 0 4px 16px var(--accent-primary-glow);
}
.step-btn.done { color: var(--accent-primary); }

/* ===== 步骤内容 ===== */
.step-body {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 20px; padding: 26px 26px 28px; min-height: 340px; max-width: 1120px;
  box-shadow: 0 12px 40px var(--shadow-color);
  backdrop-filter: blur(20px);
}
.step-body::before, .step-body::after { display: none; }
.step-body h3 {
  margin: 0 0 18px; font-size: 16px; font-weight: 700; letter-spacing: -.01em;
  padding-bottom: 14px; border-bottom: 1px solid var(--border-color);
}
.step-body h3::before { content: none; }

.hint {
  border-left: 3px solid var(--accent-primary); background: var(--bg-input);
  padding: 11px 15px; color: var(--text-secondary); font-size: 12.5px; line-height: 1.75;
  margin-bottom: 18px; border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.step-body > * { animation: fadeUp .32s cubic-bezier(.22,.8,.3,1) both; }
.step-body > *:nth-child(1) { animation-delay: 0ms; }
.step-body > *:nth-child(2) { animation-delay: 30ms; }
.step-body > *:nth-child(3) { animation-delay: 60ms; }
.step-body > *:nth-child(4) { animation-delay: 90ms; }
.step-body > *:nth-child(5) { animation-delay: 120ms; }
.step-body > *:nth-child(n+6) { animation-delay: 150ms; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }

/* ===== 卡片 ===== */
.item {
  background: var(--bg-elevated); border: 1px solid var(--border-color);
  border-radius: var(--r-md); padding: 12px;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.item:hover { border-color: var(--accent-primary); transform: translateY(-2px); box-shadow: 0 8px 24px var(--shadow-color); }
.item .t { font-size: 13.5px; font-weight: 600; margin-bottom: 5px; color: var(--text-primary); }
.item .d { color: var(--text-muted); font-size: 11.5px; line-height: 1.7; word-break: break-word; }

/* ===== 画格 ===== */
.thumb {
  width: 100%; aspect-ratio: 9 / 16; border: 1px solid var(--border-color);
  border-radius: var(--r-md); background-color: var(--bg-input);
  background-position: center; background-size: cover; background-repeat: no-repeat;
  display: grid; place-items: center; color: var(--text-muted);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  position: relative; overflow: hidden;
}
.thumb::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.45)); }
.thumb.wide { aspect-ratio: 16 / 9; }

/* ===== 标签 ===== */
.pill {
  font-size: 11.5px; font-weight: 500; padding: 3px 10px; border-radius: var(--r-full);
  background: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-secondary);
}
.pill b { color: var(--accent-gold); font-weight: 700; }

.tag {
  display: inline-block; font-size: 10.5px; font-weight: 500; letter-spacing: .02em;
  padding: 2px 7px; margin-left: 6px; border-radius: var(--r-full);
  background: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-muted);
  vertical-align: middle;
}
.tag.ok { color: var(--accent-primary); border-color: var(--accent-primary); }
.tag.err { color: var(--accent-warm); border-color: var(--accent-warm); }
.tag.run { color: var(--accent-gold); border-color: var(--accent-gold); }

/* ===== 表格 ===== */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
th {
  text-align: left; padding: 10px 12px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1px solid var(--border-color); background: var(--bg-input);
}
th:first-child { border-radius: var(--r-sm) 0 0 0; }
th:last-child { border-radius: 0 var(--r-sm) 0 0; }
td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-color); vertical-align: top; }
tbody tr:hover { background: var(--bg-elevated); }

pre {
  background: var(--bg-input); border: 1px solid var(--border-color); border-radius: var(--r-md);
  padding: 14px; overflow: auto; max-height: 340px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.65; color: var(--text-secondary);
}

/* ===== Toast ===== */
.toast {
  position: fixed; right: 28px; bottom: 28px;
  background: var(--bg-elevated); border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-primary);
  color: var(--text-primary); padding: 11px 18px; font-size: 13px; font-weight: 500;
  border-radius: var(--r-md); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; transform: translateY(10px);
  max-width: 42vw; z-index: 80; box-shadow: 0 16px 40px var(--shadow-color);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.err { border-left-color: var(--accent-warm); }

/* ===== 滚动条 / 选区 ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 9999px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: content-box; }
::selection { background: var(--accent-primary-glow); color: var(--text-primary); }

@media (max-width: 900px) {
  .studio { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border-color); }
  .grid2 { grid-template-columns: 1fr; }
  .work { padding: 18px 16px 60px; }
}
