/* ============================================================
   AIGX · 设计令牌与基础组件
   令牌取自旧站（design-snapshot/design-tokens.json），一字未改：
   底色 #f5f5f7 / 卡片 #fff / 墨色 #1d1d1f / 次要 #48484d
   主色 #a83a67 / 浅粉 #f7e9ef / 圆角 28·22·14·999 / 容器 1180
   ============================================================ */

@import url("fonts/fonts.css");

:root {
  --bg: #f5f5f7;
  --fill-1: #ffffff;
  --fill-2: #e8e8ed;
  --fill-3: #dcdce1;
  --tint: #f7e9ef;
  --ink: #1d1d1f;
  --muted: #48484d;
  --line: rgba(0, 0, 0, .10);
  --accent: #a83a67;
  --accent-ink: #ffffff;
  --accent-deep: #8c3160;
  --field: #ffffff;

  --s-small: 16px;
  --s-body: 17px;
  --s-lead: 21px;
  --s-h3: 25px;
  --s-h2: clamp(30px, 3.5vw, 50px);
  --s-h1: clamp(38px, 6.2vw, 82px);

  --r-lg: 28px;
  --r-md: 22px;
  --r-sm: 14px;
  --pill: 999px;
  --pad: 24px;
  --maxw: 1180px;

  --ease: cubic-bezier(.16, 1, .3, 1);
  --nav-h: 52px;

  --font: "Schibsted Grotesk", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-brush: "Long Cang", "Schibsted Grotesk", "PingFang SC", serif;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .05), 0 20px 50px rgba(0, 0, 0, .09);
}

* { box-sizing: border-box; }

/* hidden 必须真的隐藏：img{display:block} 会盖掉 UA 的 [hidden] */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--s-body);
  line-height: 1.5;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

button, input, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; border: 0; background: none; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; }

p { margin: 0; color: var(--muted); }

::selection { background: var(--tint); color: var(--ink); }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── 按钮 ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: var(--pill);
  background: var(--fill-2);
  color: var(--ink);
  font-size: 15px; font-weight: 500;
  white-space: nowrap;
  transition: background .22s var(--ease), transform .22s var(--ease), color .22s var(--ease);
}
.btn:hover { background: var(--fill-3); }
.btn:active { transform: scale(.98); }

.btn--fill { background: var(--accent); color: var(--accent-ink); }
.btn--fill:hover { background: var(--accent-deep); }

.btn--line { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.btn--line:hover { background: var(--fill-2); }

.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--fill-2); }

.btn--wide { width: 100%; }

.btn--sm { height: 34px; padding: 0 14px; font-size: 14px; }

.btn:disabled { opacity: .45; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--pill);
  color: var(--muted);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.icon-btn:hover { background: var(--fill-2); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

/* ── 标签 / 徽标 ─────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: var(--pill);
  background: var(--fill-2);
  color: var(--muted);
  font-size: 13px; font-weight: 500;
}
.chip--accent { background: var(--tint); color: var(--accent-deep); }

.tag {
  display: inline-flex; align-items: center;
  height: 24px; padding: 0 10px;
  border-radius: var(--pill);
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  font-size: 12px; font-weight: 500;
  backdrop-filter: blur(10px);
}

/* ── 输入 ───────────────────────────────────────────── */
.field {
  width: 100%; height: 44px;
  padding: 0 14px;
  border: 0; border-radius: var(--r-sm);
  background: var(--field);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 15px;
  transition: box-shadow .2s var(--ease);
}
.field:focus { outline: 0; box-shadow: inset 0 0 0 1.5px var(--accent); }

.field::placeholder { color: #9a9aa0; }

/* ── 下拉（原生 select 套壳） ─────────────────────────── */
.select {
  position: relative;
  display: inline-flex; align-items: center;
}
.select select {
  appearance: none;
  height: 34px;
  padding: 0 30px 0 12px;
  border: 0; border-radius: var(--pill);
  background: transparent;
  color: var(--muted);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.select select:hover { background: var(--fill-2); color: var(--ink); }
.select select:focus { outline: 0; box-shadow: inset 0 0 0 1.5px var(--accent); }
.select::after {
  content: "";
  position: absolute; right: 12px; top: 50%;
  width: 6px; height: 6px; margin-top: -4px;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg);
  color: var(--muted);
  pointer-events: none;
}

/* ── 空状态 ─────────────────────────────────────────── */
.empty {
  display: grid; place-items: center; gap: 6px;
  padding: 60px 20px;
  text-align: center;
}
.empty__icon { color: #b9b9c0; margin-bottom: 6px; }
.empty__icon svg { width: 56px; height: 56px; }
.empty__t { font-size: 17px; font-weight: 600; color: var(--ink); }
.empty__s { font-size: 14px; color: var(--muted); }

/* ── 骨架与进度 ─────────────────────────────────────── */
.sk {
  position: relative; overflow: hidden;
  background: var(--fill-2);
}
.sk::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
  transform: translateX(-100%);
  animation: sk 1.4s infinite;
}
@keyframes sk { to { transform: translateX(100%); } }

.bar-progress {
  height: 3px; border-radius: 999px; background: var(--fill-2); overflow: hidden;
}
.bar-progress > i {
  display: block; height: 100%; width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width .4s linear;
}

/* ── 滚动条 ─────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: #c9c9cf transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: #c9c9cf; border-radius: 999px; border: 3px solid var(--bg);
}
*::-webkit-scrollbar-track { background: transparent; }

/* ══════════════════════════════════════════════════════════
   深色模式：只覆盖变量 + 少量写死的浅色面
   ══════════════════════════════════════════════════════════ */
[data-theme="dark"] {
  --bg: #0e0e12;
  --fill-1: #17171c;
  --fill-2: #212127;
  --fill-3: #2c2c34;
  --tint: #2a1a22;
  --ink: #f2f2f5;
  --muted: #a6a6b0;
  --line: rgba(255, 255, 255, .13);
  --accent: #d4578c;
  --accent-ink: #ffffff;
  --accent-deep: #e283aa;
  --field: #17171c;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .45);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .55), 0 20px 50px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
[data-theme="dark"] ::selection { background: rgba(212, 87, 140, .35); }
