/* ============================================================
   影造AI · 全局设计系统
   紫白主题 / 低饱和紫调 / 玫金点缀
   ============================================================ */

:root {

  /* ---- 语义别名（2026-10-17 阶段1收口：新代码统一用语义名） ---- */
  --brand-pink: var(--gold);      /* 品牌玫红（即 --gold，浅底正文可读版） */
  --brand-purple: var(--purple);  /* 品牌紫 */

  /* ---- 移动端安全区 & 触控（全站统一） ---- */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --tap: 44px;    /* 最小触控目标 */
  --row: 48px;    /* 最小列表行高 */

  /* ---- 金额/Y币语义色（数字强调专用，配套 .t-num 等宽使用） ---- */
  --price: #C2255C;   /* 价格/金额强调 */
  --ycoin: #8A5A14;   /* Y币深金（浅底可读） */

  /* ---- z-index 层级（全站唯一来源，禁止散落魔法值） ---- */
  --z-sticky: 100;    /* 吸底操作栏 */
  --z-tabbar: 200;    /* 底部Tab */
  --z-dropdown: 300;  /* 下拉/抽屉 */
  --z-mask: 400;      /* 遮罩 */
  --z-modal: 500;     /* Modal / ActionSheet */
  --z-toast: 600;     /* toast */
  --z-guide: 700;     /* 新手引导蒙层 */

  /* 媒体查询断点约定（@media 不支持 var，全站统一写数值）：
     ≤768px 手机 | 769–860px 过渡 | ≥861px 桌面 */

  /* ---- 色彩：背景层级（2026-10-14 提亮：纯黑改浅炭灰，视频不再扎眼，小白创业人群更友好） ---- */
  --bg-0: #E0D7F1;          /* 页面最底层（A案紫灰底加深C档，老板拍板2026-10-17） */
  --bg-1: #EDE7F7;          /* 主背景（紫灰，比底色浅一档） */
  --bg-2: #F9F7FE;          /* 卡片/面板（明显亮，一眼看出是卡片） */
  --bg-3: #FFFFFF;          /* 悬浮/悬停面（最亮） */
  --bg-4: #F3EFFB;          /* 输入框/控件底（比卡片略深，内凹感） */
  --bg-glass: rgba(249, 247, 254, 0.85);  /* 毛玻璃 */

  /* ---- 色彩：文字（底色提亮后仍保持高对比） ---- */
  --text-1: #1a1525;        /* 主文字 */
  --text-2: #5D566E;        /* 次要文字（微紫调） */
  --text-3: #6E6880;        /* 辅助/占位（微紫调） */
  --text-4: #d1d5db;        /* 禁用 */

  /* ---- 色彩：品牌点缀（唯一彩色） ---- */
  --gold: #C2255C;
  --gold-hi: #E85D8A;
  --purple: #c084fc;
  --grad-brand: linear-gradient(135deg, #ff6b9d, #c084fc);
  --grad-orange: linear-gradient(135deg, #ff8a5c, #ff508e);
  --gold-dim: rgba(255, 107, 157, 0.12);
  --gold-line: rgba(194, 37, 92, 0.32);

  /* ---- 色彩：功能色（浅底略提亮） ---- */
  --ok: #218838;
  --ok-dim: rgba(91, 209, 146, 0.16);
  --warn: #E0B25E;
  --err: #E03131;
  --err-dim: rgba(240, 122, 122, 0.16);
  --info: #4C6A92;
  --info-dim: rgba(147, 167, 196, 0.18);

  /* ---- 边线（浅炭底用更清晰的白透明度） ---- */
  --line-1: #E3DBEF;          /* 最浅分隔线 */
  --line-2: #CFC3E3;          /* 卡片边线（加深，边界清晰） */
  --line-3: #d9dbe0;

  /* ---- 圆角 ---- */
  --r-xs: 4px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-full: 999px;

  /* ---- 阴影（浅炭底：降低黑度、加柔光） ---- */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-2: 0 6px 18px rgba(0, 0, 0, 0.08);
  --shadow-3: 0 14px 44px rgba(0, 0, 0, 0.12);
  --shadow-gold: 0 4px 24px rgba(255, 107, 157, 0.22);

  /* ---- 间距（4的倍数） ---- */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --sp-12: 48px; --sp-16: 64px; --sp-20: 80px;

  /* ---- 字体 ---- */
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", -apple-system, "Segoe UI", sans-serif;
  --font-num: "DIN Alternate", "Helvetica Neue", var(--font);
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-lg: 16px;
  --fs-xl: 20px; --fs-2xl: 24px; --fs-3xl: 32px; --fs-4xl: 44px; --fs-5xl: 60px;

  /* ---- 动效（Apple 标准） ---- */
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-1: 150ms;
  --dur-2: 200ms;
  --dur-3: 250ms;

  /* ---- 布局 ---- */
  --sidebar-w: 232px;
  --sidebar-w-fold: 64px;
  --topbar-h: 60px;
  --max-w: 1440px;

  /* ---- 兼容别名（2026-10-20 W4：补历史幽灵变量；值全部指向既有 token） ---- */
  --btn-radius: var(--r-md);   /* components.css .btn 在用，缺失曾致全站按钮直角 */
  --r-btn: var(--r-md);
  --sp-7: 28px;                /* 补 6→8 档位（landing-dy 等页在用） */
  --sp-9: 36px;                /* 补 8→10 档位（content-library 等页在用） */
  --danger: var(--err);
  --error: var(--err);
  --success: var(--ok);
  --success-dim: var(--ok-dim);
  --tx-1: var(--text-1);
  --tx-2: var(--text-2);
  --tx-3: var(--text-3);
  --line: var(--line-2);
  --bg-card: var(--bg-2);
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.6;
  color: var(--text-1);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
ul, ol { list-style: none; }
::selection { background: var(--gold-dim); color: var(--gold-hi); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ============ 背景氛围层（电影颗粒+暗角） ============ */
.cinema-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 107, 157, 0.06), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(192, 132, 252, 0.07), transparent 60%),
    var(--bg-0);
}
.cinema-bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.028'/%3E%3C/svg%3E");
}

/* ============ 排版工具 ============ */
.h-display { font-size: var(--fs-5xl); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.h-1 { font-size: var(--fs-4xl); font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; }
.h-2 { font-size: var(--fs-3xl); font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.h-3 { font-size: var(--fs-2xl); font-weight: 600; line-height: 1.3; }
.h-4 { font-size: var(--fs-xl); font-weight: 600; line-height: 1.4; }
.h-5 { font-size: var(--fs-lg); font-weight: 600; }
.t-sec { color: var(--text-2); }
.t-mut { color: var(--text-3); }
.t-gold { color: var(--gold); }
.t-num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ============ 布局工具 ============ */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 var(--sp-8); }
.flex { display: flex; } .flex-col { flex-direction: column; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.justify-center { justify-content: center; } .flex-1 { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.grid { display: grid; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); } .gap-5 { gap: var(--sp-5); } .gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }
.mt-2 { margin-top: var(--sp-2); } .mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); } .mt-8 { margin-top: var(--sp-8); }
.mt-12 { margin-top: var(--sp-12); } .mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); } .mb-8 { margin-bottom: var(--sp-8); }
.w-full { width: 100%; } .text-center { text-align: center; }
.hidden { display: none !important; }

/* ============ 通用动画 ============ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.anim-up { animation: fadeUp var(--dur-3) var(--ease-out) both; }
.anim-up-d1 { animation: fadeUp var(--dur-3) var(--ease-out) 60ms both; }
.anim-up-d2 { animation: fadeUp var(--dur-3) var(--ease-out) 120ms both; }
.anim-up-d3 { animation: fadeUp var(--dur-3) var(--ease-out) 180ms both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============ 全站浅色兜底（A案浅紫灰底 2026-10-17） ============ */
html, body { background: #E0D7F1 !important; color: #1a1525 !important; }



/* ============ 2026-10-20 W4：通用状态占位 & 媒体失败兜底（不引框架，页面直接可用） ============ */
.yz-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2); padding: var(--sp-12) var(--sp-4); text-align: center; color: var(--text-3); border-radius: var(--r-md); }
.yz-state .yz-state-ico { font-size: 40px; line-height: 1; opacity: .85; }
.yz-state .yz-state-t { font-size: var(--fs-lg); font-weight: 600; color: var(--text-2); }
.yz-state .yz-state-d { font-size: var(--fs-sm); max-width: 32em; }
.yz-state .yz-state-act { margin-top: var(--sp-2); display: flex; gap: var(--sp-2); }
.yz-img-ph { display: flex; align-items: center; justify-content: center; min-height: 96px; padding: var(--sp-4); background: linear-gradient(135deg, var(--bg-4), var(--bg-1)); border: 1px dashed var(--line-2); border-radius: var(--r-sm); color: var(--text-3); font-size: var(--fs-sm); text-align: center; }
.toast .t-action { margin-left: 10px; color: #fff; font-weight: 700; text-decoration: underline; white-space: nowrap; align-self: center; }


/* ===== 2026-10-21a 手机端触控热区增强（40px 起步，防手粗点不中） ===== */
@media (max-width:860px){
  .tag,.vdn-dl,.tf-chip,.st-q,.ms-cat,.mh-chip,.dh-eg,.xy-tool,.vdn-tab,.pd-plat,
  .dh2-chip,.qw-chip,.login-mode,.menu-item,.av3-sc-copy,
  .os-chips>button,.pr-tabs>button,.gv-seg>button,.pd-tabs>button,.tabs-pill>.tab,
  #cs-q>button,#cs-r>button,#cs-d>button,#ds-genres>button,#ds-ex>button{
    min-height:40px !important; min-width:40px !important;
  }
  .xy-th-del,.xy-th-toggle{min-width:36px !important;min-height:36px !important;}
}
