/* ============ 简兮 · 共享 UI 基线（全站统一，Google Material 风）============
   所有页面必须先引入本文件，再引入各自页面样式。 */
:root {
  /* 奈飞风格：深黑底 #141414 + 红色 #E50914 强调 */
  --blue: #e50914;
  --blue-hover: #ff2a31;
  --red: #e50914; /* 品牌红 */
  --red-hover: #ff2a31;
  --yellow: #f5a623;
  --green: #2bd576; /* 成功（暗色下可读） */
  --green-hover: #4be08c;

  /* 交互强调 = 奈飞红（全局） */
  --accent: #e50914;
  --accent-dark: #b20710;
  --accent-soft: rgba(229, 9, 20, 0.12);
  --accent-hi: #ff2a31;

  /* 深色底（奈飞风：纯黑页面 + 深炭卡片/输入） */
  --bg: #141414; /* 页面底 */
  --bg-soft: #1f1f1f; /* 次级填充/输入 */
  --card: #1f1f1f; /* 卡片 */
  --card-hover: #2a2a2a;
  --line: #333333; /* 边框/分割线 */
  --line-hi: #4a4a4a; /* 强边框 */

  --txt: #ffffff; /* 主文字 */
  --txt-dim: #a3a3a3; /* 次要/辅助 */
  --txt-faint: #6e6e73; /* 三级 */

  /* 圆角 */
  --radius: 12px;
  --radius-s: 8px;
  --radius-l: 16px;
  --pill: 999px;

  /* 奈飞风投影（更深、更重） */
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-lift: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.6), 0 8px 20px rgba(0, 0, 0, 0.4);

  /* 全局无衬线字体（黑体）：正文与标题统一，唯一例外是 Logo 使用宋体 */
  --font-sans:
    "PingFang SC", "PingFangSC-Light", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --font-body: var(--font-sans);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: 400; /* Regular，正文用常规字重 */
  color: var(--txt);
  /* 页面底：奈飞深黑 #141414 + 顶部一抹极淡红光让背景"透气" */
  background: radial-gradient(1300px 460px at 50% -140px, rgba(229, 9, 20, 0.07), transparent 74%), var(--bg);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: clip; /* 全宽分隔线等横贯元素不外溢、不产生横向滚动条 */
  /* 顶部一条 4px 红色细条：全站品牌标识 */
  border-top: 4px solid var(--accent);
}

/* 标题：细黑体（Light 字重）+ 字距稍微拉开，更精致 */
h1,
h2,
h3 {
  font-weight: 300;
  letter-spacing: 0.5px;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

.hidden {
  display: none !important;
}

/* ============ 按钮 ============ */
.btn {
  border-radius: var(--radius-s);
  font-size: 14px;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

/* 主按钮：深炭黑底 + 白字（生成视频主按钮，黑灰配色） */
.btn-primary {
  background: #333;
  border: none;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 20px;
  letter-spacing: 1px;
  border-radius: var(--radius-s);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.btn-primary:hover {
  background: #444;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
  background: #2a2a2a;
}

.btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  background: #333;
  box-shadow: none;
}
.btn-primary:disabled:hover {
  transform: none;
  box-shadow: none;
}

/* 描边按钮：深炭 #222 底 + 白字 + 亮白边（次级动作，暗色背景下清晰可辨） */
.btn-outline {
  background: #222;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--pill);
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
}

.btn-outline:hover {
  background: #2a2a2a;
  border-color: #ff2a31;
  color: #fff;
  box-shadow: 0 4px 14px rgba(229, 9, 20, 0.3);
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
}

.btn-block.btn-primary {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============ 表单字段 ============ */
.field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 关键：.field 的 flex 会覆盖浏览器默认 [hidden]{display:none}，导致「保留原声」时配音文案框仍显示。
   这里强制让带 hidden 字段彻底收起（同时作用于隐藏的背景音乐选择区）。 */
.field[hidden] {
  display: none !important;
}

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--txt);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.hint {
  font-size: 11px;
  color: var(--txt-faint);
}

.text-input {
  width: 100%;
  background: #1f1f1f;
  border: 1px solid #333;
  border-radius: var(--radius-s);
  color: var(--txt);
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.text-input::placeholder {
  color: var(--txt-faint);
}

.text-input:hover {
  background: #1f1f1f;
  border-color: var(--line-hi);
}

.text-input:focus {
  outline: none;
  background: #1f1f1f;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.2);
}

.text-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-modal);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-title {
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.5px;
}

.modal-sub {
  font-size: 13px;
  color: var(--txt-dim);
}

/* ============ 空态 / Toast ============ */
.empty {
  text-align: center;
  font-size: 13px;
  color: var(--txt-faint);
  padding: 20px 0;
}

.toast {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(32, 33, 36, 0.92);
  color: #fff;
  font-size: 14px;
  line-height: 1.5;
  padding: 14px 24px;
  border-radius: 12px;
  z-index: 10000; /* 高于播放器(.viewer-modal z9998)等所有浮层，确保提示不被遮住 */
  max-width: 82%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: opacity 0.3s ease;
}

/* 错误弹窗：红色强调（业务限制 / 内部出错统一弹窗提示） */
.toast.toast-error {
  background: rgba(120, 8, 12, 0.95);
  border: 1px solid rgba(229, 9, 20, 0.7);
  color: #fff;
}

/* 本地/分镜视频缩略预览：不显示原生控件，点击统一走 viewer-modal。
   全局视频播放只用共享播放器，杜绝原生 <video controls> 三点菜单/无限下载。 */
.vid-preview-nocontrols {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  background: #000;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
