/* ============================================================
   大麦科技 · 短剧全自动工作台
   设计系统：暗色玻璃拟态（Glassmorphism）
   深蓝紫渐变底 · 大型弥散光斑 · 白玻璃卡片 · 现代无衬线字体
   ============================================================ */
:root {
  --bg-0: #0f172a;
  --bg-1: #1e1b4b;
  --bg-2: #172554;
  --ink: rgba(255, 255, 255, .93);
  --ink-2: rgba(255, 255, 255, .62);
  --ink-3: rgba(255, 255, 255, .42);
  --brand: #6366f1;
  --brand-2: #a855f7;
  --brand-grad: linear-gradient(135deg, #6366f1, #a855f7);
  --azure: #38bdf8;
  --gold: #fbbf24;
  --ok: #34d399;
  --err: #fb7185;
  --glass-bg: rgba(255, 255, 255, .08);
  --glass-bg-2: rgba(255, 255, 255, .12);
  --glass-border: rgba(255, 255, 255, .15);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .22);
  --shadow: 0 4px 24px rgba(2, 6, 23, .25);
  --shadow-lg: 0 20px 60px rgba(2, 6, 23, .5);
  --font: 'PingFang SC', 'Microsoft YaHei', '微软雅黑', 'Segoe UI', Inter, -apple-system, sans-serif;
  --radius: 16px;
  --radius-sm: 12px;
  /* 兼容别名：旧内联样式仍引用这些变量 */
  --font-kai: var(--font);
  --font-song: var(--font);
  --font-hei: var(--font);
  --cinnabar: #a78bfa;
  --cinnabar-dark: #c4b5fd;
  --cinnabar-soft: rgba(139, 92, 246, .16);
  --line: rgba(255, 255, 255, .12);
  --line-2: rgba(255, 255, 255, .18);
  --paper-2: rgba(255, 255, 255, .07);
  --paper-3: rgba(255, 255, 255, .12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg-0) 0%, var(--bg-1) 50%, var(--bg-2) 100%);
  background-attachment: fixed;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* 大型弥散光斑 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle 340px at 18% 12%, rgba(99, 102, 241, .42) 0%, transparent 70%),
    radial-gradient(circle 300px at 82% 8%, rgba(168, 85, 247, .34) 0%, transparent 70%),
    radial-gradient(circle 380px at 88% 82%, rgba(244, 114, 182, .24) 0%, transparent 70%),
    radial-gradient(circle 320px at 10% 88%, rgba(96, 165, 250, .26) 0%, transparent 70%);
  filter: blur(72px);
}

h1, h2, h3, h4 { color: var(--ink); font-weight: 600; line-height: 1.35; }
a { color: #93c5fd; text-decoration: none; transition: color .15s; }
a:hover { color: #c4b5fd; }
::selection { background: rgba(139, 92, 246, .45); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .28); }

/* ---------------- 品牌标 ---------------- */
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  background: var(--brand-grad);
  box-shadow: 0 6px 20px rgba(124, 58, 237, .45), var(--glass-hi);
  user-select: none;
  flex: none;
}
.logo-mark.sm { width: 26px; height: 26px; font-size: 13px; border-radius: 8px; }

/* 兼容旧类名 */
.seal, .seal.seal-sm { border: none; transform: none; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 24px;
  font-family: var(--font);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
  line-height: 1.6;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.btn:hover { background: var(--glass-bg-2); border-color: rgba(255, 255, 255, .28); box-shadow: 0 6px 22px rgba(2, 6, 23, .35); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary {
  color: #fff;
  background: var(--brand-grad);
  border: 1px solid rgba(196, 181, 253, .4);
  box-shadow: 0 8px 26px rgba(124, 58, 237, .42), var(--glass-hi);
}
.btn-primary:hover { filter: brightness(1.12); background: var(--brand-grad); border-color: rgba(221, 214, 254, .6); box-shadow: 0 10px 34px rgba(124, 58, 237, .55); }

.btn-ghost { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
.btn-ghost:hover { background: var(--glass-bg); border-color: var(--glass-border); box-shadow: none; }

.btn-sm { padding: 5px 14px; font-size: 13px; border-radius: 9px; }
.btn-lg { padding: 14px 44px; font-size: 16.5px; border-radius: 14px; font-weight: 600; }

.btn-danger { color: #fda4af; border-color: rgba(251, 113, 133, .4); }
.btn-danger:hover { background: rgba(251, 113, 133, .14); border-color: rgba(251, 113, 133, .7); }

/* ---------------- 表单 ---------------- */
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%;
  padding: 10px 15px;
  font-family: var(--font);
  font-size: 14.5px;
  color: var(--ink);
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, textarea:focus, select:focus {
  border-color: rgba(167, 139, 250, .75);
  background: rgba(255, 255, 255, .1);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, .22);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.8; }
label.field { display: block; }
label.field > span.lab {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  margin-bottom: 6px;
}
select { cursor: pointer; }
select option { background: #141a33; color: var(--ink); }

/* ---------------- 密码框小眼睛（core.js 自动注入，点一下显示/隐藏） ---------------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 42px; }
.pw-eye {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  font-size: 15px; line-height: 1; cursor: pointer; opacity: .5;
  user-select: none; transition: opacity .15s;
}
.pw-eye:hover, .pw-eye.on { opacity: 1; }

/* ---------------- 卡片（白玻璃） ---------------- */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-hi), var(--shadow);
  position: relative;
}
.card-pad { padding: 26px 30px; }
.card-mark::before { content: none; }

/* ---------------- 分割线 ---------------- */
.brush-divider {
  height: 1px;
  margin: 28px 0;
  border: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent);
}

/* ---------------- 徽章 ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  color: var(--ink-2);
  background: rgba(255, 255, 255, .08);
  white-space: nowrap;
}
.badge-red { color: #fda4af; border-color: rgba(251, 113, 133, .4); background: rgba(251, 113, 133, .12); }
.badge-blue { color: #7dd3fc; border-color: rgba(56, 189, 248, .4); background: rgba(56, 189, 248, .12); }
.badge-gold { color: #fcd34d; border-color: rgba(251, 191, 36, .4); background: rgba(251, 191, 36, .12); }
.badge-ok { color: #6ee7b7; border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .12); }
.badge-gray { color: var(--ink-3); }

/* ---------------- 提示条 ---------------- */
.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 18px;
  border-left: 3px solid var(--azure);
  background: rgba(56, 189, 248, .1);
  font-size: 13.5px;
  color: var(--ink-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.notice.warn { border-left-color: var(--gold); background: rgba(251, 191, 36, .1); }
.notice.err { border-left-color: var(--err); background: rgba(251, 113, 133, .12); }

/* ---------------- 模态框 ---------------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 16, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .18s ease;
}
.modal {
  background: rgba(21, 26, 48, .88);
  backdrop-filter: blur(28px) saturate(1.5);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 20px;
  box-shadow: var(--shadow-lg), var(--glass-hi);
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  animation: slideUp .22s ease;
}
.modal.wide { max-width: 760px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 26px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  font-size: 18px;
  font-weight: 600;
}
.modal-body { padding: 24px 26px; overflow-y: auto; }
.modal-foot { padding: 16px 26px; border-top: 1px solid rgba(255, 255, 255, .12); display: flex; justify-content: flex-end; gap: 10px; }
.modal-x {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--ink-3);
  cursor: pointer; border-radius: 9px;
  transition: all .15s;
}
.modal-x:hover { color: #fda4af; background: rgba(251, 113, 133, .14); }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } }

/* ---------------- Toast ---------------- */
#toast-wrap {
  position: fixed;
  top: 22px; left: 50%; transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 11px 28px;
  background: rgba(21, 26, 48, .92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .2);
  color: var(--ink);
  font-size: 14px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .2s ease;
  max-width: 80vw;
}
.toast.ok { border-color: rgba(52, 211, 153, .55); color: #a7f3d0; }
.toast.err { border-color: rgba(251, 113, 133, .55); color: #fecdd3; }

/* ---------------- 表格 ---------------- */
table.plain { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.plain th {
  font-weight: 600;
  text-align: left;
  padding: 10px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .2);
  color: var(--ink-2);
  white-space: nowrap;
}
table.plain td { padding: 10px 13px; border-bottom: 1px solid rgba(255, 255, 255, .08); vertical-align: top; }
table.plain tr:hover td { background: rgba(255, 255, 255, .04); }

/* ---------------- Markdown 渲染 ---------------- */
.md { font-size: 14.5px; color: var(--ink-2); }
.md h1, .md h2, .md h3, .md h4 { color: var(--ink); margin: 1.1em 0 .45em; font-weight: 600; }
.md h1 { font-size: 21px; border-bottom: 1px solid rgba(255, 255, 255, .18); padding-bottom: 8px; }
.md h2 { font-size: 19px; }
.md h3 { font-size: 16.5px; }
.md h4 { font-size: 15px; }
.md p { margin: .6em 0; }
.md ul, .md ol { margin: .6em 0; padding-left: 1.6em; }
.md li { margin: .25em 0; }
.md strong { color: #ddd6fe; font-weight: 700; }
.md code {
  font-family: Consolas, 'Cascadia Mono', monospace;
  font-size: 13px;
  background: rgba(255, 255, 255, .12);
  color: #c7d2fe;
  padding: 1px 6px;
  border-radius: 5px;
}
.md pre { background: #0a0e1d; color: #d3dbee; padding: 15px 18px; border-radius: 12px; overflow-x: auto; margin: .8em 0; border: 1px solid rgba(255, 255, 255, .1); }
.md pre code { background: none; color: inherit; padding: 0; }
.md blockquote { border-left: 3px solid var(--brand-2); background: rgba(168, 85, 247, .12); padding: 8px 16px; margin: .7em 0; color: var(--ink-2); border-radius: 0 8px 8px 0; }
.md hr { border: none; border-top: 1px dashed rgba(255, 255, 255, .2); margin: 1.2em 0; }
.md table { width: 100%; border-collapse: collapse; margin: .8em 0; font-size: 13.5px; }
.md th { background: rgba(255, 255, 255, .08); font-weight: 600; }
.md th, .md td { border: 1px solid rgba(255, 255, 255, .12); padding: 7px 11px; text-align: left; }
.md tr:nth-child(even) td { background: rgba(255, 255, 255, .03); }

/* ---------------- 空状态 ---------------- */
.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--ink-3);
  font-size: 15px;
}
.empty .pic { font-size: 44px; margin-bottom: 16px; opacity: .55; }

/* ---------------- 杂项 ---------------- */
.row { display: flex; gap: 12px; align-items: center; }
.grow { flex: 1; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
.mt1 { margin-top: 8px; } .mt2 { margin-top: 16px; } .mt3 { margin-top: 26px; }
.mb1 { margin-bottom: 8px; } .mb2 { margin-bottom: 16px; } .mb3 { margin-bottom: 26px; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .18);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid rgba(255, 255, 255, .16); }
.tabs .tab {
  padding: 10px 26px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
}
.tabs .tab:hover { color: var(--ink); }
.tabs .tab.on { color: #c4b5fd; border-bottom-color: #a78bfa; }

.vpoem { display: none; }

/* ============================================================
   日间主题（白天模式）：浅色玻璃拟态 —— html[data-theme="light"] 激活
   默认仍是暗色玻璃拟态；切换按钮在顶栏，偏好存 localStorage('dm-theme')
   ============================================================ */
html[data-theme="light"] {
  --bg-0: #eef1fb;
  --bg-1: #eae4f8;
  --bg-2: #e3ecfd;
  --ink: rgba(20, 25, 48, .92);
  --ink-2: rgba(35, 41, 70, .68);
  --ink-3: rgba(60, 66, 100, .5);
  --glass-bg: rgba(255, 255, 255, .58);
  --glass-bg-2: rgba(255, 255, 255, .82);
  --glass-border: rgba(99, 102, 241, .22);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .9);
  --shadow: 0 4px 24px rgba(49, 46, 129, .12);
  --shadow-lg: 0 20px 60px rgba(49, 46, 129, .22);
  --cinnabar: #7c3aed;
  --cinnabar-dark: #6d28d9;
  --cinnabar-soft: rgba(124, 58, 237, .1);
  --line: rgba(30, 41, 80, .14);
  --line-2: rgba(30, 41, 80, .22);
  --paper-2: rgba(99, 102, 241, .07);
  --paper-3: rgba(99, 102, 241, .13);
}
html[data-theme="light"] body::before { opacity: .5; }
html[data-theme="light"] a { color: #4f46e5; }
html[data-theme="light"] a:hover { color: #7c3aed; }
html[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(99, 102, 241, .32); }
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, .5); }

html[data-theme="light"] .btn:hover { border-color: rgba(99, 102, 241, .45); box-shadow: 0 6px 22px rgba(49, 46, 129, .16); }
html[data-theme="light"] .btn-danger { color: #be123c; }
html[data-theme="light"] .btn-danger:hover { background: rgba(225, 29, 72, .1); border-color: rgba(225, 29, 72, .55); }

html[data-theme="light"] input[type=text], html[data-theme="light"] input[type=password],
html[data-theme="light"] input[type=number], html[data-theme="light"] textarea, html[data-theme="light"] select {
  background: rgba(255, 255, 255, .72);
}
html[data-theme="light"] input:focus, html[data-theme="light"] textarea:focus, html[data-theme="light"] select:focus { background: #fff; }
html[data-theme="light"] select option { background: #fff; color: #1e293b; }

html[data-theme="light"] .badge { background: rgba(99, 102, 241, .08); }
html[data-theme="light"] .badge-red { color: #be123c; border-color: rgba(190, 18, 60, .35); background: rgba(190, 18, 60, .07); }
html[data-theme="light"] .badge-blue { color: #0369a1; border-color: rgba(3, 105, 161, .35); background: rgba(3, 105, 161, .07); }
html[data-theme="light"] .badge-gold { color: #92400e; border-color: rgba(146, 64, 14, .35); background: rgba(146, 64, 14, .07); }
html[data-theme="light"] .badge-ok { color: #047857; border-color: rgba(4, 120, 87, .35); background: rgba(4, 120, 87, .07); }

html[data-theme="light"] .notice { background: rgba(56, 189, 248, .1); }
html[data-theme="light"] .notice.warn { background: rgba(251, 191, 36, .14); }
html[data-theme="light"] .notice.err { background: rgba(225, 29, 72, .08); }

html[data-theme="light"] .brush-divider { background: linear-gradient(90deg, transparent, rgba(99, 102, 241, .35), transparent); }

html[data-theme="light"] .modal-mask { background: rgba(15, 23, 42, .3); }
html[data-theme="light"] .modal { background: rgba(255, 255, 255, .96); border-color: rgba(99, 102, 241, .22); }
html[data-theme="light"] .modal-head { border-bottom-color: rgba(30, 41, 80, .12); }
html[data-theme="light"] .modal-foot { border-top-color: rgba(30, 41, 80, .12); }
html[data-theme="light"] .modal-x:hover { color: #be123c; background: rgba(225, 29, 72, .1); }

html[data-theme="light"] .toast { background: rgba(255, 255, 255, .97); color: #1e293b; border-color: rgba(99, 102, 241, .35); }
html[data-theme="light"] .toast.ok { color: #047857; }
html[data-theme="light"] .toast.err { color: #be123c; }

html[data-theme="light"] table.plain th { border-bottom-color: rgba(30, 41, 80, .2); }
html[data-theme="light"] table.plain td { border-bottom-color: rgba(30, 41, 80, .1); }
html[data-theme="light"] table.plain tr:hover td { background: rgba(99, 102, 241, .05); }

html[data-theme="light"] .md strong { color: #5b21b6; }
html[data-theme="light"] .md code { background: rgba(99, 102, 241, .1); color: #4338ca; }
html[data-theme="light"] .md h1 { border-bottom-color: rgba(30, 41, 80, .15); }
html[data-theme="light"] .md hr { border-top-color: rgba(30, 41, 80, .22); }
html[data-theme="light"] .md th { background: rgba(99, 102, 241, .07); }
html[data-theme="light"] .md th, html[data-theme="light"] .md td { border-color: rgba(30, 41, 80, .13); }
html[data-theme="light"] .md tr:nth-child(even) td { background: rgba(99, 102, 241, .04); }
html[data-theme="light"] .md blockquote { background: rgba(124, 58, 237, .07); }

html[data-theme="light"] .spinner { border-color: rgba(99, 102, 241, .3); }
html[data-theme="light"] .tabs { border-bottom-color: rgba(30, 41, 80, .15); }
html[data-theme="light"] .tabs .tab.on { color: #6d28d9; border-bottom-color: #7c3aed; }
