/* ============================================================
   ZEISS COM China 100 · 会议小程序原型
   设计系统：深空蓝 + 极光渐变 + 玻璃拟态
   Modern CSS: nesting / :has() / color-mix() / dvh / @view-transition
   ============================================================ */

/* 跨文档视图过渡（Chrome 126+ 渐进增强） */
@view-transition {
  navigation: auto;
}

:root {
  /* 色彩 tokens */
  --bg: #04070f;
  --bg-deep: #070c1a;
  --ink: #eaf1ff;
  --muted: #93a7cc;
  --brand: #2f7bff;
  --brand-bright: #5aa8ff;
  --cyan: #3ee6cf;
  --violet: #8f7bff;
  --gold: #ffd166;
  --danger: #ff6b81;
  --ok: #3ddc97;

  /* 玻璃 tokens */
  --glass: rgb(255 255 255 / 6%);
  --glass-strong: rgb(255 255 255 / 11%);
  --stroke: rgb(255 255 255 / 13%);
  --stroke-soft: rgb(255 255 255 / 8%);

  /* 形状与动效 */
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease-out: cubic-bezier(.22, 1, .36, 1);

  /* 排版 */
  --font: "SF Pro Display", system-ui, -apple-system, "HarmonyOS Sans SC",
    "MiSans", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;

  --shadow-card: 0 18px 40px -18px rgb(0 0 0 / 55%);
  --shadow-float: 0 24px 60px -12px rgb(0 0 0 / 65%);
  --tabbar-h: 64px;
}

/* ---------- 图标基类（配合 SVG <use>） ---------- */
.ic {
  width: 22px; height: 22px; flex: 0 0 auto;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.ic.sm { width: 17px; height: 17px; }
.ic.xs { width: 14px; height: 14px; stroke-width: 2; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100dvh;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--brand) 45%, transparent); }

/* 隐藏滚动条但保留滚动 */
.screen ::-webkit-scrollbar { width: 0; height: 0; }
.screen { scrollbar-width: none; }

/* ============================================================
   极光氛围背景（全站）
   ============================================================ */
.aurora {
  position: fixed; inset: -20%;
  z-index: 0; pointer-events: none;
  background:
    radial-gradient(42% 35% at 18% 22%, color-mix(in srgb, var(--brand) 34%, transparent), transparent 70%),
    radial-gradient(38% 40% at 82% 18%, color-mix(in srgb, var(--violet) 26%, transparent), transparent 70%),
    radial-gradient(45% 42% at 70% 85%, color-mix(in srgb, var(--cyan) 16%, transparent), transparent 72%),
    radial-gradient(40% 38% at 22% 82%, color-mix(in srgb, var(--brand) 22%, transparent), transparent 70%);
  filter: blur(30px);
  animation: aurora-drift 22s var(--ease-out) infinite alternate;
}
.aurora::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(30% 24% at 55% 42%, rgb(255 255 255 / 5%), transparent 70%);
  animation: aurora-pulse 9s ease-in-out infinite alternate;
}
@keyframes aurora-drift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1) rotate(0deg); }
  50%  { transform: translate3d(1.5%, 2%, 0) scale(1.06) rotate(1.2deg); }
  100% { transform: translate3d(2.5%, -1.5%, 0) scale(1.02) rotate(-1deg); }
}
@keyframes aurora-pulse {
  from { opacity: .5; } to { opacity: 1; }
}

/* 细颗粒噪点，增强质感 */
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .05;
  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='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

/* ============================================================
   舞台布局：移动全屏 / 桌面手机壳
   ============================================================ */
.stage {
  position: relative; z-index: 2;
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 0;
}

.phone {
  position: relative;
  width: 100%; height: 100dvh;
  background: var(--bg-deep);
  overflow: hidden;
}

/* 桌面预览：套手机壳 + 旁边页面导航 */
@media (min-width: 900px) {
  .stage {
    display: flex; align-items: center; justify-content: center;
    gap: clamp(24px, 4vw, 64px);
    padding: 40px 24px;
  }
  .phone {
    width: min(412px, 42vw);
    height: min(880px, 92dvh);
    border-radius: 52px;
    border: 1px solid rgb(255 255 255 / 14%);
    padding: 10px;
    background: linear-gradient(160deg, #232b3f, #0a0f1e 40%, #1b2334);
    box-shadow:
      0 0 0 1px rgb(0 0 0 / 60%),
      0 40px 90px -30px rgb(47 123 255 / 28%),
      0 30px 80px -20px rgb(0 0 0 / 80%);
  }
  .phone::before { /* 刘海 динамика 灵动岛 */
    content: "";
    position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
    width: 108px; height: 30px; border-radius: 20px;
    background: #05080f; z-index: 60;
  }
}

.screen {
  position: relative;
  height: 100%;
  border-radius: 42px;
  overflow: hidden;
  background:
    radial-gradient(120% 60% at 50% 0%, rgb(47 123 255 / 16%), transparent 60%),
    linear-gradient(180deg, #0a1122 0%, #060a16 40%, #04070f 100%);
  display: flex; flex-direction: column;
  isolation: isolate;
}
@media (max-width: 899px) { .screen { border-radius: 0; } }

/* 屏内独立极光（更贴近小程序氛围） */
.screen .aurora { position: absolute; inset: -30%; filter: blur(36px); opacity: .8; }

/* ============================================================
   状态栏 / 导航栏 / TabBar
   ============================================================ */
.statusbar {
  position: relative; z-index: 50;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px 4px;
  font-size: 13px; font-weight: 600;
  color: var(--ink);
}
.statusbar .icons { display: flex; gap: 6px; align-items: center; }
.statusbar svg { display: block; }

.appbar {
  position: relative; z-index: 40;
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px 12px;
}
.appbar .title {
  font-size: 20px; font-weight: 700; letter-spacing: .02em;
}
.appbar .subtitle { font-size: 12px; color: var(--muted); margin-top: 1px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--glass);
  border: 1px solid var(--stroke-soft);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  transition: transform .35s var(--spring), background .3s;
  &:active { transform: scale(.88); background: var(--glass-strong); }
}

/* 主内容滚动区 */
.page {
  position: relative; z-index: 10;
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 6px 18px calc(var(--tabbar-h) + 30px);
  display: flex; flex-direction: column; gap: 18px;
}
.page.no-tab { padding-bottom: 40px; }

/* 底部 TabBar */
.tabbar {
  position: absolute; left: 14px; right: 14px; bottom: 14px;
  z-index: 45;
  height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-radius: 24px;
  background: rgb(10 16 30 / 62%);
  border: 1px solid var(--stroke-soft);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow-float);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 10.5px; color: var(--muted);
  border-radius: 20px; margin: 6px 4px;
  transition: color .3s;
}
.tabbar a svg { transition: transform .4s var(--spring); }
.tabbar a:active svg { transform: scale(.82); }
.tabbar a[aria-current="page"] {
  color: var(--ink);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 55%, transparent), color-mix(in srgb, var(--violet) 45%, transparent));
  box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--brand) 70%, transparent);
}
.tabbar a[aria-current="page"] svg { transform: translateY(-1px) scale(1.06); }

/* ============================================================
   玻璃卡片体系
   ============================================================ */
.card {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, rgb(255 255 255 / 9%), rgb(255 255 255 / 3.5%));
  border: 1px solid var(--stroke-soft);
  backdrop-filter: blur(20px) saturate(170%);
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  box-shadow: var(--shadow-card);
  padding: 18px;
  overflow: hidden;
}
/* 卡片顶部高光描边 */
.card::before {
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 35%), transparent);
}
.card-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; margin-bottom: 12px;
}
.card-title .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--brand));
  box-shadow: 0 0 10px var(--cyan);
}

/* 九宫格功能入口 */
.grid-entries {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.entry {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 4px 12px;
  border-radius: var(--radius-md);
  background: var(--glass);
  border: 1px solid var(--stroke-soft);
  font-size: 11.5px; color: var(--ink);
  transition: transform .35s var(--spring), background .3s;
}
.entry:active { transform: scale(.9); background: var(--glass-strong); }
.entry .ico {
  width: 42px; height: 42px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, color-mix(in srgb, var(--brand) 34%, transparent), color-mix(in srgb, var(--violet) 26%, transparent));
  border: 1px solid var(--stroke-soft);
}

/* 列表行 */
.row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--stroke-soft);
  &:last-child { border-bottom: 0; }
}
.row .ico-sm {
  flex: 0 0 auto;
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  border: 1px solid var(--stroke-soft);
}
.row .grow { flex: 1; min-width: 0; }
.row .lbl { font-size: 14px; font-weight: 600; }
.row .sub { font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 2px; }

/* 徽章 / 标签 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand-bright) 40%, transparent);
  color: var(--brand-bright);
}
.badge.gold { background: color-mix(in srgb, var(--gold) 15%, transparent); border-color: color-mix(in srgb, var(--gold) 45%, transparent); color: var(--gold); }
.badge.ok   { background: color-mix(in srgb, var(--ok) 15%, transparent);   border-color: color-mix(in srgb, var(--ok) 45%, transparent);   color: var(--ok); }

/* 主按钮 */
.btn-primary {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px 22px;
  border-radius: var(--radius-md);
  font-size: 16px; font-weight: 700; letter-spacing: .04em;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, color-mix(in srgb, var(--violet) 70%, var(--brand)) 100%);
  box-shadow: 0 14px 34px -10px color-mix(in srgb, var(--brand) 80%, transparent);
  transition: transform .35s var(--spring), box-shadow .3s, filter .3s;
  overflow: hidden;
}
.btn-primary::after { /* 光泽扫过 */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgb(255 255 255 / 25%) 50%, transparent 60%);
  transform: translateX(-120%);
  transition: transform .8s var(--ease-out);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn-primary:active { transform: scale(.96); }
.btn-primary[disabled] { filter: grayscale(.4) brightness(.7); pointer-events: none; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: var(--radius-md);
  background: var(--glass);
  border: 1px solid var(--stroke);
  font-size: 14px; font-weight: 600;
  backdrop-filter: blur(12px);
  transition: transform .35s var(--spring), background .3s;
  &:active { transform: scale(.95); background: var(--glass-strong); }
}

/* ============================================================
   滚动显现（IntersectionObserver 驱动）
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(26px) scale(.98);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   桌面预览 Dock（页面导航）
   ============================================================ */
.dock {
  display: none;
}
@media (min-width: 900px) {
  .dock {
    display: flex; flex-direction: column; gap: 6px;
    width: 218px; padding: 16px;
    border-radius: 24px;
    background: rgb(12 18 34 / 55%);
    border: 1px solid var(--stroke-soft);
    backdrop-filter: blur(22px) saturate(170%);
    box-shadow: var(--shadow-float);
  }
  .dock .dock-title {
    font-size: 11px; font-weight: 700; letter-spacing: .18em;
    color: var(--muted); text-transform: uppercase;
    padding: 2px 8px 10px;
  }
  .dock a {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 14px;
    font-size: 13.5px; font-weight: 600; color: var(--muted);
    transition: background .25s, color .25s, transform .35s var(--spring);
  }
  .dock a:hover { color: var(--ink); background: var(--glass); transform: translateX(3px); }
  .dock a[aria-current="page"] {
    color: #fff;
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 60%, transparent), color-mix(in srgb, var(--violet) 45%, transparent));
    box-shadow: 0 10px 26px -10px color-mix(in srgb, var(--brand) 80%, transparent);
  }
  .dock .num {
    font-size: 10px; font-weight: 800; opacity: .65;
    width: 20px; height: 20px; display: grid; place-items: center;
    border-radius: 7px; background: rgb(255 255 255 / 8%);
  }
  .dock .hint {
    margin-top: 10px; padding: 10px 12px;
    border-radius: 12px;
    background: rgb(255 255 255 / 4%);
    font-size: 11px; line-height: 1.55; color: var(--muted);
  }
}

/* ============================================================
   工具类
   ============================================================ */
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.mt-auto { margin-top: auto; }
.flex { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* 无障碍：减少动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
