/* Inter 自托管（400/500/600/700） */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/fonts/inter-latin-700-normal.woff2') format('woff2'); }

/* base.css — 设计变量 + 重置 + 通用组件（复刻 ainudez.net，零第三方） */
/* 配色/字号/圆角/间距全部取自原站 Joy UI 实测 token */

:root {
  /* —— 颜色（dark scheme）—— */
  --bg: #000;
  --surface: #0b0d0e;   /* background-surface */
  --surface-2: #171a1c; /* background-level1（卡片/输入框/图标按钮） */
  --surface-3: #32383e; /* background-level2 */
  --text: #f0f4f8;      /* text-primary */
  --text-2: #cdd7e1;    /* text-secondary（body 默认） */
  --text-3: #9fa6ad;    /* text-tertiary */
  --line: rgba(99, 107, 116, .16); /* divider */
  --brand: #0b6bcb;         /* primary-500 */
  --brand-hover: #185ea5;   /* primary-600 */
  --brand-active: #12467b;  /* primary-700 */
  --danger: #c41c1c;

  /* —— 圆角（Joy 阶梯）—— */
  --r-xs: 2px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* —— 间距 —— */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* —— 字号（Joy 阶梯）—— */
  --fs-xs: .75rem;
  --fs-sm: .875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-xl2: 1.5rem;
  --fs-xl3: 1.875rem;
  --fs-xl4: 2.25rem;

  /* —— 行高 —— */
  --lh-xs: 1.33334;
  --lh-sm: 1.42858;
  --lh-md: 1.5;
  --lh-lg: 1.55556;

  /* —— 字重 —— */
  --fw-sm: 300;
  --fw-md: 500;
  --fw-lg: 600;
  --fw-xl: 700;

  /* —— 字体 —— */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

/* Hide only the viewport scrollbar; keep wheel, touch and keyboard scrolling. */
html { scrollbar-width: none; }
html::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh-md);
}

a { color: inherit; text-decoration: none; }
img, video { display: block; }
/* [hidden] 必须压过上面的 display:block，否则 JS 里 el.hidden=true 不生效
   （人脸预览空图、结果播放器会在页面上露出空白块） */
[hidden] { display: none !important; }

/* —— hero：H1 = 30px/700/-0.025em，副标题 = 0.875rem tertiary（原站 h2 / body-sm）—— */
.hero { padding: var(--sp-4) 0 var(--sp-6); }
.hero h1 {
  margin: 0 0 var(--sp-2);
  font-weight: var(--fw-xl);
  font-size: var(--fs-xl3);
  line-height: var(--lh-xs);
  letter-spacing: -.025em;
  color: var(--text);
}
.hero-sub { margin: 0 0 var(--sp-4); font-size: var(--fs-sm); color: var(--text-3); }

/* —— 按钮（solid primary）—— */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .75rem;
  min-height: 2.75rem;
  padding: .5rem 1.5rem;
  font-family: inherit; font-size: var(--fs-md); font-weight: var(--fw-lg);
  border: 0; border-radius: var(--r-sm);
  cursor: pointer;
  transition: background-color .15s;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-hover); }
.btn--primary:active { background: var(--brand-active); }
.btn:disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }

/* 卡片 hover 浮现的 pill「生成」按钮：50px 圆角 + solid 蓝 + opacity .8（原站 sizeLg） */
.btn-pill {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem;
  padding: .5rem 1.5rem;
  font-family: inherit; font-size: var(--fs-md); font-weight: var(--fw-lg);
  border: 0; border-radius: 50px;
  background: var(--brand); color: #fff;
  opacity: .8; cursor: pointer;
}

/* —— 表单控件 —— */
select, input[type=text], input[type=number], input[type=password], textarea {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
  font: inherit;
}
select:focus, input:focus, textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: -1px;
}

/* —— 通用文本 —— */
.text-3 { color: var(--text-3); }

/* —— 模态弹窗锁背景滚动 ——
   原生 dialog.showModal() 不锁滚动：由 dialog-scroll-lock.js 给 html 加 has-modal，
   另用 :has(dialog:modal) 兜住 JS 未执行/未生效的情况。 */
html.has-modal, html:has(dialog:modal) { overflow: hidden; }
html.has-modal body, html:has(dialog:modal) body { overflow: hidden; }
dialog:modal { overscroll-behavior: contain; }
/* tabindex="-1" 的元素只给 JS 程序化聚焦（标题、面板等），不显示浏览器默认焦点环 */
[tabindex="-1"]:focus { outline: none; }
