/* ============================================================
   DAAS GIFT · 礼品发放公示平台
   视觉语言：HarmonyOS 浅色光感 / 单一品牌蓝 #0060FF
             磨砂白卡片 · 悬浮浮岛导航 · 胶囊 HUD 标签
   ============================================================ */

:root {
  /* 表面 */
  --bg: #f4f7fc;
  --bg-soft: #fbfcfe;
  --surface: #ffffff;
  --surface-2: #f7f9fd;
  --glass: rgba(255, 255, 255, 0.9);
  --glass-solid: #f2fbfffd;

  /* 描边 */
  --line: rgba(16, 42, 84, 0.075);
  --line-strong: rgba(16, 42, 84, 0.14);

  /* 文字 */
  --text: #0f1b2d;
  --text-2: #465568;
  --muted: #98a5b8;

  /* 品牌 */
  --brand: #0060ff;
  --brand-press: #0052db;
  --brand-tint: #edf4ff;
  --brand-tint-2: #dce9ff;
  --brand-ring: rgba(0, 96, 255, 0.16);

  /* 语义 */
  --ok: #0e9f6e;
  --ok-tint: #e9f9f1;
  --warn: #b54708;
  --warn-tint: #fff6e5;
  --danger: #e0453b;
  --danger-tint: #fdecea;
  --violet: #6b57d9;
  --violet-tint: #f1eeff;
  --pink: #d6409f;
  --pink-tint: #fdf0f7;

  --grad: #0060ff;
  --grad-soft: linear-gradient(140deg, #edf4ff, #f7fbff);

  --radius: 22px;
  --shadow-sm: 0 2px 6px rgba(21, 52, 110, 0.04), 0 1px 2px rgba(21, 52, 110, 0.03);
  --shadow: 0 14px 34px -20px rgba(21, 52, 110, 0.26), 0 2px 6px rgba(21, 52, 110, 0.04);
  --shadow-lg: 0 30px 64px -30px rgba(21, 52, 110, 0.34), 0 6px 16px rgba(21, 52, 110, 0.05);
  --shadow-brand: 0 12px 26px -12px rgba(0, 96, 255, 0.5);

  --font: "HarmonyOS Sans SC", "HarmonyOS Sans", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei",
    "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html { color-scheme: light; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 光场：顶部淡蓝光晕，整体浅色光感 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1000px 620px at 10% -12%, #e3edff, transparent 62%),
    radial-gradient(860px 560px at 90% -6%, #e8f6ff, transparent 60%),
    radial-gradient(700px 700px at 50% 108%, #eef3ff, transparent 68%),
    linear-gradient(180deg, #f8fbff 0%, #f2f5fa 100%);
}

/* 极淡网格：保留一点 HUD「数据面板」味，不喧宾夺主 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(16, 42, 84, 0.032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 42, 84, 0.032) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 92% 62% at 50% 0%, #000 18%, transparent 84%);
  -webkit-mask-image: radial-gradient(ellipse 92% 62% at 50% 0%, #000 18%, transparent 84%);
}

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

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(16, 42, 84, 0.16);
  border-radius: 999px;
  border: 3px solid #f4f7fc;
}
::-webkit-scrollbar-thumb:hover { background: rgba(16, 42, 84, 0.26); }

/* --------------------------------------------------------- 排版工具 */

.grad-text { color: var(--brand); }

.mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* --------------------------------------------------------- 悬浮浮岛导航 */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 12px 18px;
}

/* 顶部渐隐遮罩，避免内容从浮岛上方缝隙穿过 */
.nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(180deg, #f7fafe 42%, rgba(247, 250, 254, 0));
}

.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 22px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 30px -20px rgba(21, 52, 110, 0.32), 0 1px 2px rgba(21, 52, 110, 0.04);
}

.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: -0.01em; }

.brand-mark {
  width: 34px; height: 34px;
  border-radius: 11px;
  background: linear-gradient(150deg, #2b82ff, var(--brand) 62%, #0050d6);
  display: grid; place-items: center;
  font-size: 15px; font-weight: 800; color: #fff;
  box-shadow: 0 8px 18px -9px rgba(0, 96, 255, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.34);
  position: relative;
  overflow: hidden;
  flex: none;
}
.brand-mark::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 58%);
  opacity: .8;
}
.brand-mark span { position: relative; z-index: 1; }

.brand-name { font-size: 15px; line-height: 1.2; }
.brand-name small {
  display: block;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.nav-links { display: flex; gap: 2px; margin-left: auto; }
.nav-links a {
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text-2);
  transition: background .18s ease, color .18s ease;
}
.nav-links a:hover { color: var(--brand); background: var(--brand-tint); }

/* 浮岛内的次要入口：白底细描边，不与主色争 */
.nav-inner .btn-ghost {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line-strong);
  color: var(--text-2);
  box-shadow: none;
}
.nav-inner .btn-ghost:hover {
  color: var(--brand);
  border-color: rgba(0, 96, 255, 0.3);
  background: #fff;
}

/* --------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.btn:hover { border-color: rgba(0, 96, 255, 0.3); color: var(--brand); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; color: var(--muted); }

/* 全站唯一饱和蓝 = 主操作 */
.btn-primary {
  background: var(--brand);
  border: none;
  color: #fff;
  font-weight: 650;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover { background: var(--brand-press); color: #fff; filter: none; }

.btn-ghost {
  background: var(--brand-tint);
  border-color: transparent;
  color: var(--brand);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--brand-tint-2); border-color: transparent; color: var(--brand); }

.btn-danger { color: var(--danger); border-color: rgba(224, 69, 59, 0.22); background: var(--danger-tint); }
.btn-danger:hover { background: #fbdcd9; border-color: rgba(224, 69, 59, 0.4); color: var(--danger); }

.btn-sm { height: 33px; padding: 0 14px; font-size: 12.5px; }
.btn-icon { width: 33px; height: 33px; padding: 0; }

/* --------------------------------------------------------- 通用卡片 */

.hud {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
/* 顶部 1px 高光，模拟磨砂玻璃边缘 */
.hud::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 1), transparent);
  pointer-events: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--surface-2);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: .02em;
  white-space: nowrap;
}
.pill-purple { color: var(--violet); background: var(--violet-tint); }
.pill-blue   { color: var(--brand);  background: var(--brand-tint); }
.pill-pink   { color: var(--pink);   background: var(--pink-tint); }
.pill-ok     { color: var(--ok);     background: var(--ok-tint); }
.pill-warn   { color: var(--warn);   background: var(--warn-tint); }
.pill-dot::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* --------------------------------------------------------- 首页 HUD 面板 */

.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 60px 24px 20px;
}

.hero-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(14, 159, 110, 0.16);
  background: var(--ok-tint);
  color: var(--ok);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .1em;
}
.hero-live i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(14, 159, 110, 0.14);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.8); }
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: 48px;
  align-items: center;
}

/* 首屏右侧：最新一期悬浮卡（轻透视保留 HUD 悬浮感） */
.hero-panel {
  padding: 22px 22px 18px;
  transform: perspective(1500px) rotateY(-6deg) rotateX(3deg) translateZ(0);
  transform-origin: 100% 50%;
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), box-shadow .5s ease;
  box-shadow: var(--shadow-lg);
}
.hero-panel:hover {
  transform: perspective(1500px) rotateY(-2deg) rotateX(1deg);
  box-shadow: 0 40px 80px -34px rgba(21, 52, 110, 0.4), 0 8px 20px rgba(21, 52, 110, 0.06);
}

.hp-head { display: flex; align-items: center; gap: 10px; }
.hp-period {
  font-size: 15px;
  color: var(--text-2);
  margin: 14px 0 4px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.hp-period b {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.hp-list { margin: 6px 0 0; }
.hp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}
.hp-row:last-child { border-bottom: 0; }
.hp-row .hp-name {
  color: var(--text);
  font-weight: 550;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hp-row .hp-qty {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--brand);
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--brand-tint);
  flex: none;
}
.hp-foot {
  display: flex;
  align-items: center;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.hp-foot a { margin-left: auto; color: var(--brand); font-weight: 600; }
.hp-foot a:hover { color: var(--brand-press); }

@media (max-width: 900px) {
  .hero-top { grid-template-columns: 1fr; gap: 30px; }
  .hero-panel { transform: none; }
}

.hero h1 {
  margin: 22px 0 0;
  font-size: clamp(36px, 5.6vw, 62px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  font-weight: 800;
  color: var(--text);
}
.hero h1 em { font-style: normal; }

.hero-sub {
  margin: 18px 0 0;
  max-width: 560px;
  color: var(--text-2);
  font-size: 15.5px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 42px;
}

.stat {
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: "";
  position: absolute;
  right: -34px; top: -34px;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 96, 255, 0.1), transparent 70%);
}
.stat-k { font-size: 11px; letter-spacing: .14em; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.stat-v {
  font-size: 30px;
  font-weight: 780;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.stat-v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }

/* --------------------------------------------------------- 区块 */

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 58px 24px;
}
.section + .section { padding-top: 20px; }

.section-head {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.section-head h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.02em;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-head h2::before {
  content: "";
  width: 4px; height: 22px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}
.section-head p { margin: 0; color: var(--muted); font-size: 13.5px; }
.section-head .spacer { margin-left: auto; }

/* --------------------------------------------------------- 公告 */

.ann-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.ann {
  padding: 22px 22px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: transform .22s cubic-bezier(.22,1,.36,1), border-color .22s, box-shadow .22s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ann:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 96, 255, 0.22);
  box-shadow: 0 26px 56px -30px rgba(21, 52, 110, 0.34);
}
.ann-top { display: flex; align-items: center; gap: 8px; }
.ann-date { margin-left: auto; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ann h3 {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.42;
  letter-spacing: -0.01em;
  font-weight: 650;
}
.ann p {
  margin: 0;
  color: var(--text-2);
  font-size: 13.5px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-line;
}
.ann-more {
  margin-top: auto;
  padding-top: 4px;
  font-size: 12.5px;
  color: var(--brand);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.ann:hover .ann-more { color: var(--brand-press); }
.ann.pinned { border-color: rgba(0, 96, 255, 0.2); }
.ann.pinned::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(0, 96, 255, 0.05), transparent 52%);
  pointer-events: none;
}

/* --------------------------------------------------------- 筛选栏 */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

/* 选中态＝浅蓝底衬 + 蓝字（不抢主 CTA 的饱和蓝） */
.chip {
  height: 33px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: all .16s ease;
  font-variant-numeric: tabular-nums;
}
.chip:hover { color: var(--brand); border-color: rgba(0, 96, 255, 0.2); background: var(--brand-tint); }
.chip.on {
  color: var(--brand);
  background: linear-gradient(180deg, var(--brand-tint), var(--brand-tint-2));
  border-color: rgba(0, 96, 255, 0.22);
  font-weight: 700;
  box-shadow: inset 0 1px 0 #fff;
}

.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  min-width: 220px;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.search:focus-within {
  border-color: rgba(0, 96, 255, 0.34);
  background: #fff;
  box-shadow: 0 0 0 4px var(--brand-ring);
}
.search input {
  border: 0; outline: 0; background: transparent;
  color: var(--text); font-family: inherit; font-size: 13.5px;
  width: 100%;
}
.search input::placeholder { color: var(--muted); }
.search svg { flex: none; opacity: .55; }

/* --------------------------------------------------------- 中奖公示板 */

.period-board {
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 18px;
}

.period-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: linear-gradient(100deg, var(--brand-tint), #f8fbff 58%, #fff);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.period-no {
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text);
}
.period-no b {
  font-size: 26px;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
}
.period-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; align-items: center; }

.w-row {
  display: grid;
  grid-template-columns: 1.5fr 0.62fr 1.25fr 1.15fr;
  gap: 14px;
  align-items: center;
  padding: 15px 22px;
  border-bottom: 1px solid var(--line);
  transition: background .16s ease;
}
.w-row:last-child { border-bottom: 0; }
.w-row:hover { background: #fafcff; }

.w-th {
  padding: 10px 22px !important;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.w-th span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.w-prize {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.005em;
}
.w-prize .ico {
  width: 34px; height: 34px; flex: none;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--brand-tint);
  border: 1px solid rgba(0, 96, 255, 0.1);
  font-size: 15px;
}
.w-qty {
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}
.w-qty small { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 3px; }
.w-winner { color: var(--text); font-weight: 550; font-size: 14px; word-break: break-all; }
.w-time { color: var(--text-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.w-note { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* --------------------------------------------------------- 空状态 / 加载 */

.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.6);
}
.empty strong { display: block; color: var(--text-2); font-size: 15px; margin-bottom: 6px; font-weight: 600; }

.skeleton {
  height: 74px;
  border-radius: 16px;
  background: linear-gradient(90deg, #eef2f8, #f7fafd, #eef2f8);
  background-size: 240% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  margin-bottom: 10px;
}
@keyframes shimmer { 0% { background-position: 140% 0; } 100% { background-position: -40% 0; } }

.center-more { display: flex; justify-content: center; padding: 26px 0 0; }

/* --------------------------------------------------------- 页脚 */

.footer {
  max-width: 1180px;
  margin: 40px auto 0;
  padding: 30px 24px 46px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 12.5px;
}
.footer .spacer { margin-left: auto; }
.footer a:hover { color: var(--brand); }

/* --------------------------------------------------------- 抽屉 / 弹窗 */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(12, 24, 42, 0.38);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.overlay.on { opacity: 1; pointer-events: auto; }

.modal {
  width: 100%;
  max-width: 620px;
  max-height: 84vh;
  overflow: auto;
  border-radius: 26px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 40px 100px -34px rgba(15, 27, 45, 0.34);
  transform: translateY(14px) scale(.985);
  transition: transform .22s cubic-bezier(.22,1,.36,1);
}
.overlay.on .modal { transform: none; }
.modal-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-size: 20px; line-height: 1.4; letter-spacing: -0.015em; }
.modal-close {
  margin-left: auto;
  width: 34px; height: 34px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: grid; place-items: center;
  transition: all .16s;
}
.modal-close:hover { color: var(--text); background: #eef2f8; }
.modal-body { color: var(--text-2); font-size: 14.5px; white-space: pre-wrap; line-height: 1.8; }
.modal-foot { margin-top: 22px; display: flex; gap: 10px; align-items: center; }

/* --------------------------------------------------------- 表单 */

.field { margin-bottom: 15px; }
.field > label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text-2);
  margin-bottom: 7px;
}
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

.input, .textarea, .select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: rgba(0, 96, 255, 0.38);
  background: #fff;
  box-shadow: 0 0 0 4px var(--brand-ring);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.textarea { min-height: 130px; resize: vertical; line-height: 1.7; }
.select { appearance: none; background-image: none; cursor: pointer; }
.select option { background: #fff; color: var(--text); }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-2);
  user-select: none;
}
.switch input { display: none; }
.switch i {
  width: 42px; height: 24px;
  border-radius: 999px;
  background: #dde4ee;
  position: relative;
  transition: all .2s ease;
  flex: none;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15, 27, 45, 0.22);
  transition: all .2s cubic-bezier(.22,1,.36,1);
}
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(18px); }

/* --------------------------------------------------------- Toast */

.toast-wrap {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: center;
  pointer-events: none;
}
.toast {
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: var(--text);
  box-shadow: 0 18px 40px -16px rgba(15, 27, 45, 0.3);
  animation: toastIn .22s cubic-bezier(.22,1,.36,1);
  max-width: 82vw;
}
.toast.err { color: var(--danger); border-color: rgba(224, 69, 59, 0.16); background: var(--danger-tint); }
.toast.ok { color: var(--ok); border-color: rgba(14, 159, 110, 0.16); background: var(--ok-tint); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* --------------------------------------------------------- 后台外壳 */

.admin-shell { display: flex; min-height: 100vh; }

.side {
  width: 236px;
  flex: none;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side .brand { padding: 4px 8px 20px; }
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 13px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text-2);
  cursor: pointer;
  transition: all .16s ease;
  border: 1px solid transparent;
}
.side-link:hover { background: var(--brand-tint); color: var(--brand); }
.side-link.on {
  background: linear-gradient(180deg, var(--brand-tint), var(--brand-tint-2));
  border-color: rgba(0, 96, 255, 0.16);
  color: var(--brand);
  font-weight: 700;
  box-shadow: inset 0 1px 0 #fff;
}
.side-link svg { flex: none; opacity: .9; }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; }

.page-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-head h1 { margin: 0; font-size: 22px; letter-spacing: -0.02em; font-weight: 750; }
.page-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.page-head .spacer { margin-left: auto; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

/* 让并排面板各自贴合内容高度，避免出现大片空白 */
#overviewGrid, #settingsGrid { align-items: start; }

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  opacity: .55;
  cursor: pointer;
}


.panel { border-radius: 20px; padding: 20px; }
.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 { margin: 0; font-size: 14.5px; font-weight: 700; letter-spacing: -0.005em; }
.panel-head .spacer { margin-left: auto; }

/* 表格 */
.table-wrap { overflow-x: auto; border-radius: 16px; border: 1px solid var(--line); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
table.tbl th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  vertical-align: middle;
}
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover td { background: #fafcff; }
table.tbl td.strong { color: var(--text); font-weight: 600; }
table.tbl td.num { font-variant-numeric: tabular-nums; }
.td-actions { display: flex; gap: 6px; justify-content: flex-end; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search { margin-left: 0; flex: 1; min-width: 200px; max-width: 340px; }

/* 登录 */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: 100%;
  max-width: 388px;
  padding: 34px 30px 28px;
  border-radius: 26px;
  box-shadow: var(--shadow-lg);
}
.login-card h1 { margin: 18px 0 6px; font-size: 23px; letter-spacing: -0.025em; font-weight: 780; }
.login-card > p { margin: 0 0 24px; color: var(--muted); font-size: 13px; }

/* 分页 */
.pager { display: flex; align-items: center; gap: 8px; justify-content: flex-end; padding-top: 16px; }
.pager .info { font-size: 12.5px; color: var(--muted); margin-right: auto; font-variant-numeric: tabular-nums; }

/* 响应式 */
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .side { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .24s ease; box-shadow: none; }
  .side.open { transform: none; box-shadow: 40px 0 80px -40px rgba(15, 27, 45, 0.3); }
  .main { padding: 20px 16px 60px; }
  .nav-links { display: none; }
  .w-row { grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 14px 16px; }
  .w-th { display: none; }
  .w-time { grid-column: 1 / -1; font-size: 12px; }
  .section, .hero { padding-left: 16px; padding-right: 16px; }
  .modal { padding: 22px; }
  .row-3 { grid-template-columns: 1fr 1fr; }
  .search { margin-left: 0; width: 100%; }
  .nav { padding: 10px 12px; }
  .nav-inner { padding: 8px 10px 8px 14px; gap: 12px; }
  .brand-name small { display: none; }
}

@media (max-width: 560px) {
  .hero { padding-top: 34px; }
  .hero h1 { font-size: 34px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat-v { font-size: 24px; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .period-head { padding: 15px 16px; }
  .period-meta { margin-left: 0; width: 100%; }
  .hp-period b { font-size: 32px; }
}

/* --------------------------------------------------------- 移动端底部浮岛 */

.tabbar { display: none; }

@media (max-width: 900px) {
  /* 只有带浮岛的前台页面才需要给底部让位 */
  body:has(.tabbar) { padding-bottom: 92px; }

  .tabbar {
    display: flex;
    position: fixed;
    left: 16px; right: 16px;
    bottom: 14px;
    z-index: 90;
    height: 64px;
    padding: 0 8px;
    align-items: center;
    justify-content: space-between;
    border-radius: 999px;
    /* 确定性磨砂白：太透会让下方文字「渗」上来 */
    background: rgba(255, 255, 255, 0.99);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.94);
    box-shadow:
      inset 0 1px 0 #fff,
      0 16px 34px -14px rgba(21, 52, 110, 0.34),
      0 4px 10px rgba(21, 52, 110, 0.06);
  }

  .tab {
    flex: 1;
    height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border-radius: 999px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .01em;
    transition: color .18s ease, background .18s ease;
  }
  .tab svg { width: 21px; height: 21px; }
  .tab.on {
    color: var(--brand);
    background: linear-gradient(180deg, var(--brand-tint), var(--brand-tint-2));
  }
  .tab:active { transform: scale(.97); }

  .toast-wrap { bottom: 94px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
