/* ============================================================
   课堂签到汇总统计报告系统 · 深海蓝校园主题
   手机优先 / 时段天空渐变 / 昼夜两套液态玻璃 / 天气物理场景
   ============================================================ */

:root {
  --paper: #e9f1f8;
  --card: #fbfdff;
  --ink: #1e3a52;
  --ink-2: #5b748c;
  --ink-3: #9db3c6;
  --ginkgo: #f4a83d;      /* 暖阳金（点缀） */
  --ginkgo-deep: #d98a1f;
  --leaf: #2a9d8f;         /* 海浪青 */
  --leaf-deep: #1f7a6e;
  --sky: #5aa9e6;          /* 晴空蓝 */
  --vermilion: #e76f51;    /* 珊瑚红（预警） */
  --radius: 18px;
  --shadow: 0 2px 10px rgba(23, 68, 110, 0.08), 0 12px 32px rgba(23, 68, 110, 0.08);
  --font: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

/* 天气天空层：四套 CSS 渐变交叉淡入（不是图片，四层叠加只切换透明度） */
#bgScenes {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.bg-scene {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.bg-scene.on { opacity: 1; }
/* 晴天：万里无云的通透蓝 */
.bg-scene[data-wx="sunny"] {
  background: linear-gradient(180deg, #1667c2 0%, #4fa3e3 55%, #bfe3f7 100%);
}
/* 阴天：灰蓝压下来 */
.bg-scene[data-wx="cloudy"] {
  background: linear-gradient(180deg, #62768a 0%, #8fa2b3 60%, #bcc8d3 100%);
}
/* 雨天：钢蓝更低沉 */
.bg-scene[data-wx="rain"] {
  background: linear-gradient(180deg, #4d5f71 0%, #74899c 60%, #9fb0bf 100%);
}
/* 雪天：白亮反光的雪空 */
.bg-scene[data-wx="snow"] {
  background: linear-gradient(180deg, #a9bdcf 0%, #d5e2ee 60%, #f2f6fb 100%);
}
body.night #bgScenes { filter: brightness(0.52) saturate(0.85); }

/* 固定楼图：横跨底部全宽，height:auto 保持原始比例，永不拉伸变形 */
#buildingImg {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  z-index: 1;
  pointer-events: none;
}
body.night #buildingImg { filter: brightness(0.58) saturate(0.9); }

/* 夜间液态玻璃：深色底 + 奶油白文字 */
body.night .card,
body.night .today-card,
body.night .kpi {
  --ink: #f2efe9;
  --ink-2: rgba(242, 239, 233, 0.62);
  --ink-3: rgba(242, 239, 233, 0.45);
  --paper: rgba(255, 255, 255, 0.07);
  --card: rgba(255, 255, 255, 0.16);
  --leaf-deep: #8fd0b3;
  --ginkgo-deep: #e8b477;
  --sky: #9fd8f2;
  --vermilion: #e8907a;
  --chart-grid: rgba(236, 246, 255, 0.07);
  --chart-tick: rgba(242, 239, 233, 0.45);
  background: linear-gradient(160deg, rgba(8, 13, 22, 0.62), rgba(4, 7, 13, 0.62));
  border-color: rgba(236, 246, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

/* 天气特效画布（覆盖层，不拦截交互） */
#weatherFx {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

/* 天气切换 */
.wx-switch {
  display: flex;
  flex-wrap: wrap;   /* 320px 小屏 + "自动·晴" 文案变长时允许换行，避免横向溢出 */
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  position: relative;
  z-index: 5;
}
.wx-label {
  font-size: 11px;
  font-weight: 700;
  color: rgba(30, 58, 82, 0.65);
  margin-right: 2px;
}
body.night .wx-label { color: rgba(253, 246, 233, 0.7); }
.wx-switch button {
  border: 1.5px solid rgba(30, 58, 82, 0.25);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(3px);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.wx-switch button:hover { transform: translateY(-1px); }
.wx-switch button.active {
  background: #1f6fb2;
  border-color: #1f6fb2;
  color: #fff;
  box-shadow: 0 3px 10px rgba(31, 111, 178, 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scrollbar-width: thin; scrollbar-color: #b8cbdc var(--paper); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #b8cbdc; border-radius: 3px; }

body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; }

/* ================= 顶部天空区 ================= */
.hero {
  position: relative;
  overflow: hidden;
  padding: 34px 20px 96px;
  background: transparent; /* 让天气实景背景透上来 */
  border-radius: 0 0 30px 30px;
}

/* 太阳 / 月亮 */
.sky-orb {
  position: absolute;
  top: 26px;
  right: 30px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8e0, #ffd76a 55%, #ffb63d);
  box-shadow: 0 0 44px 14px rgba(255, 199, 84, 0.55);
  animation: orb-float 9s ease-in-out infinite;
  transition: background 2s ease, box-shadow 2s ease;
}
body.night .sky-orb {
  background: radial-gradient(circle at 38% 38%, #fff, #e8ecf5 55%, #c9d2e6);
  box-shadow: 0 0 30px 8px rgba(220, 228, 250, 0.5);
}
@keyframes orb-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* 云朵 */
.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  filter: blur(1px);
  animation: cloud-drift linear infinite;
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: inherit;
  border-radius: 50%;
}
.cloud.c1 { width: 92px; height: 26px; top: 52px; left: -100px; animation-duration: 68s; }
.cloud.c1::before { width: 40px; height: 40px; top: -20px; left: 14px; }
.cloud.c1::after { width: 28px; height: 28px; top: -12px; right: 16px; }
.cloud.c2 { width: 66px; height: 20px; top: 118px; left: -80px; animation-duration: 92s; animation-delay: -30s; opacity: 0.75; }
.cloud.c2::before { width: 30px; height: 30px; top: -15px; left: 10px; }
.cloud.c2::after { width: 22px; height: 22px; top: -9px; right: 12px; }
.cloud.c3 { width: 54px; height: 16px; top: 24px; left: -60px; animation-duration: 110s; animation-delay: -70s; opacity: 0.6; }
.cloud.c3::before { width: 24px; height: 24px; top: -12px; left: 8px; }
.cloud.c3::after { width: 18px; height: 18px; top: -7px; right: 10px; }
body.night .cloud { opacity: 0.18; }
@keyframes cloud-drift {
  from { transform: translateX(0); }
  to { transform: translateX(calc(100vw + 200px)); }
}

/* 星星（夜间显示，JS 生成） */
.star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  opacity: 0;
  animation: star-twinkle 3s ease-in-out infinite;
}
body.night .star { opacity: 0.9; }
@keyframes star-twinkle {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(0.5); opacity: 0.4; }
}

/* 飘落的银杏叶 */
.leaf-fall {
  position: absolute;
  top: -30px;
  font-size: 0;
  width: 16px;
  height: 16px;
  background: var(--ginkgo);
  border-radius: 80% 0 80% 0;
  opacity: 0.85;
  animation: leaf-drop linear infinite;
}
@keyframes leaf-drop {
  0% { transform: translate(0, -30px) rotate(0deg); opacity: 0; }
  8% { opacity: 0.9; }
  100% { transform: translate(60px, 480px) rotate(340deg); opacity: 0; }
}

.hero-inner { position: relative; max-width: 720px; margin: 0 auto; z-index: 2; }

body.night .greeting { color: #fdf6e9; text-shadow: 0 2px 14px rgba(20, 26, 48, 0.5); }
body.night .greeting small { color: rgba(253, 246, 233, 0.78); }

.greeting {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
.greeting small {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: rgba(58, 53, 44, 0.72);
  margin-top: 4px;
  letter-spacing: 0.06em;
}

/* 拍立得照片卡 */
.polaroids {
  position: relative;
  margin-top: 22px;
  height: 132px;
}
.polaroid {
  position: absolute;
  width: 108px;
  background: #fff;
  padding: 6px 6px 22px;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(90, 75, 45, 0.22);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.polaroid img { width: 100%; height: 96px; object-fit: cover; border-radius: 3px; display: block; }
.polaroid::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 44px;
  height: 16px;
  margin-left: -22px;
  background: rgba(244, 168, 61, 0.5);
  border-radius: 2px;
  transform: rotate(-2deg);
}
.polaroid.p1 { left: 0; top: 6px; transform: rotate(-5deg); }
.polaroid.p2 { left: 76px; top: 0; transform: rotate(4deg); }
.polaroid:hover { transform: rotate(0deg) scale(1.08); z-index: 3; }
.polaroid span {
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 10px;
  color: var(--ink-2);
}

/* ================= 主体 ================= */
main {
  max-width: 720px;
  margin: -64px auto 0;
  padding: 0 16px 56px;
  position: relative;
  z-index: 2;
}

/* 入场动画 */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: reveal-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--d, 0s);
}
@keyframes reveal-up {
  to { opacity: 1; transform: translateY(0); }
}

/* 奶油琥珀 · 浅色液态玻璃（参考 zaixuexidexiaoq.cn 配色的亮色版：奶油白底 + 深墨蓝文字 + 琥珀金点缀） */
.today-card,
.card,
.kpi {
  --ink: #101c2e;          /* 深墨蓝 */
  --ink-2: rgba(16, 28, 46, 0.6);
  --ink-3: rgba(16, 28, 46, 0.42);
  --paper: rgba(255, 255, 255, 0.5);
  --card: #ffffff;
  --leaf-deep: #2f7a5c;
  --ginkgo-deep: #c07a1f;  /* 浅底上的深琥珀 */
  --sky: #4a8fb5;
  --vermilion: #d9553a;
  --chart-grid: rgba(16, 28, 46, 0.08);
  --chart-tick: rgba(16, 28, 46, 0.42);
  color: var(--ink);
}

/* 最新场次大卡 · 液态玻璃 */
.today-card {
  background: linear-gradient(160deg, rgba(251, 247, 238, 0.6), rgba(243, 236, 221, 0.48));
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  border: 1px solid rgba(232, 180, 119, 0.38);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(26, 18, 6, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}
.today-card::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -36px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 180, 119, 0.22), transparent 70%);
}
.today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.today-head h2 { font-size: 17px; font-weight: 800; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(47, 122, 92, 0.12);
  color: var(--leaf-deep);
}
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--leaf); animation: chip-pulse 1.8s ease-in-out infinite; }
@keyframes chip-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.5); opacity: 0.6; } }

.today-rate {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 10px;
}
.today-rate .num {
  font-size: 46px;
  font-weight: 800;
  color: var(--leaf-deep);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.today-rate .of { font-size: 13px; color: var(--ink-2); }

.today-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.mini-stat {
  flex: 1 1 90px;
  background: var(--paper);
  border-radius: 12px;
  padding: 9px 12px;
}
.mini-stat b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.mini-stat span { font-size: 11px; color: var(--ink-2); }
.mini-stat.ok b { color: var(--leaf-deep); }
.mini-stat.leave b { color: var(--sky); }
.mini-stat.late b { color: var(--ginkgo-deep); }

.today-note { margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.today-note b { color: var(--ink); }

/* 视图切换 */
.view-toggle {
  display: flex;
  background: rgba(243, 236, 221, 0.55);
  backdrop-filter: blur(14px) saturate(145%);
  -webkit-backdrop-filter: blur(14px) saturate(145%);
  border: 1px solid rgba(232, 180, 119, 0.32);
  border-radius: 999px;
  padding: 4px;
  margin: 22px auto 0;
  width: max-content;
  position: sticky;
  top: 10px;
  z-index: 20;
  box-shadow: 0 4px 14px rgba(26, 18, 6, 0.12);
}
.view-toggle button {
  border: none;
  background: transparent;
  padding: 8px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: rgba(16, 28, 46, 0.6);
  cursor: pointer;
  transition: all 0.25s ease;
}
.view-toggle button.active {
  background: #ffffff;
  color: #101c2e;
  box-shadow: 0 2px 8px rgba(26, 18, 6, 0.15);
}

/* 通用卡片 · 液态玻璃 */
.card {
  background: linear-gradient(160deg, rgba(251, 247, 238, 0.6), rgba(243, 236, 221, 0.48));
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
  border: 1px solid rgba(232, 180, 119, 0.38);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(26, 18, 6, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  padding: 20px;
  margin-top: 18px;
}
.card h3 {
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.card h3 .deco {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex: none;
  transform: rotate(45deg);
}
.deco.gold { background: var(--ginkgo); }
.deco.green { background: var(--leaf); }
.deco.blue { background: var(--sky); }
.deco.red { background: var(--vermilion); }
.card h3 small { margin-left: auto; font-weight: 500; font-size: 11px; color: var(--ink-3); }

/* 简要模式下隐藏详细内容 */
body.compact .detail-only { display: none !important; }

/* KPI 网格 */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 18px;
}
.kpi {
  background: linear-gradient(160deg, rgba(251, 247, 238, 0.55), rgba(243, 236, 221, 0.44));
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
  border: 1px solid rgba(232, 180, 119, 0.34);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(26, 18, 6, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.kpi:hover { transform: translateY(-4px) rotate(-0.6deg); }
.kpi .k-ic {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 9px;
}
.kpi .k-value {
  font-size: 27px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kpi .k-label { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.kpi .k-spark { position: absolute; right: 12px; bottom: 12px; }
.ic-green { background: rgba(122, 155, 87, 0.16); }
.ic-gold { background: rgba(240, 180, 41, 0.2); }
.ic-blue { background: rgba(111, 177, 214, 0.2); }
.ic-red { background: rgba(217, 85, 58, 0.14); }
.v-green { color: var(--leaf-deep); }
.v-gold { color: var(--ginkgo-deep); }
.v-blue { color: var(--sky); }
.v-red { color: var(--vermilion); }

/* 图表 */
.chart-wrap canvas.chart { width: 100%; height: 240px; display: block; }
.chart-wrap canvas.chart-sm { width: 100%; height: 200px; display: block; }

.chart-grid { display: grid; gap: 18px; }

.chart-tip {
  position: absolute;
  pointer-events: none;
  background: rgba(255, 253, 247, 0.97);
  border: 1px solid #d5e4f0;
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 12px;
  box-shadow: var(--shadow);
  z-index: 5;
  display: none;
  min-width: 128px;
}
.chart-tip .t-date { font-weight: 800; margin-bottom: 4px; color: var(--leaf-deep); }
.chart-tip .t-row { display: flex; justify-content: space-between; gap: 14px; color: var(--ink-2); }
.chart-tip .t-row b { color: var(--ink); }
/* 夜间：tooltip 必须跟深色玻璃一致，否则浅底浅字看不见 */
body.night .chart-tip {
  background: rgba(8, 13, 22, 0.96);
  border-color: rgba(236, 246, 255, 0.18);
}
body.night .chart-tip .t-date { color: #8fd0b3; }
.card.chart-wrap { position: relative; }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; justify-content: center; }
.legend .lg { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.legend .lg i { width: 10px; height: 10px; border-radius: 4px; }
.legend .lg b { color: var(--ink); }

/* 热力图 */
.hm-grid {
  display: grid;
  grid-template-columns: 44px repeat(5, 1fr);
  gap: 5px;
}
.hm-head, .hm-week {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-3);
  min-height: 30px;
}
.hm-week { background: var(--paper); border-radius: 9px; }
.hm-cell {
  min-height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  cursor: default;
  transition: transform 0.15s ease;
}
.hm-cell:hover { transform: scale(1.1); }
.hm-cell.blank { background: transparent; border: 1.5px dashed #e3d9c2; }
.hm-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; color: var(--ink-3); justify-content: flex-end; }
.hm-foot .scale {
  width: 90px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--vermilion), var(--ginkgo), var(--leaf));
}

/* 座位图 */
.seat-podium {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4em;
  color: var(--ink-2);
  background: var(--paper);
  border-radius: 10px;
  padding: 7px 0;
  margin-bottom: 10px;
}
.seat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.seat-col-label {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-3);
  padding-bottom: 1px;
}
.seat-cell {
  background: rgba(122, 155, 87, 0.13);
  border: 1.5px solid rgba(122, 155, 87, 0.45);
  border-radius: 11px;
  min-height: 48px;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.seat-cell:hover { transform: scale(1.06) rotate(-1deg); }
.seat-cell .nm { font-size: 11px; font-weight: 700; line-height: 1.4; }
.seat-cell.empty { background: transparent; border: 1.5px dashed #c8d8e6; }
.seat-door { display: flex; justify-content: flex-end; margin-top: 9px; }
.seat-door span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--ginkgo-deep);
  border: 1.5px solid rgba(240, 180, 41, 0.7);
  background: rgba(240, 180, 41, 0.12);
  border-radius: 999px;
  padding: 3px 14px;
}
.seat-foot { margin-top: 12px; }
.seat-legend { display: flex; gap: 14px; font-size: 11px; color: var(--ink-2); flex-wrap: wrap; }
.seat-legend .sq { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-right: 5px; }
.seat-legend .sq.present { background: rgba(122, 155, 87, 0.3); border: 1.5px solid var(--leaf); }
.seat-legend .sq.leave { background: rgba(111, 177, 214, 0.25); border: 1.5px solid var(--sky); }
.seat-legend .sq.none { background: transparent; border: 1.5px dashed #b8cbdc; }
.seat-leave { margin-top: 9px; font-size: 12px; color: var(--ink-2); }
.seat-leave b {
  color: #4a8fb5;
  font-size: 10px;
  border: 1.5px solid rgba(111, 177, 214, 0.6);
  background: rgba(111, 177, 214, 0.12);
  border-radius: 999px;
  padding: 2px 9px;
  margin-right: 7px;
}
.seat-note { margin-top: 8px; font-size: 10px; color: var(--ink-3); }

/* 排行表 */
.table-scroll { max-height: 460px; overflow: auto; border-radius: 12px; }
.rank-table { width: 100%; border-collapse: collapse; }
.rank-table th {
  position: sticky;
  top: 0;
  background: var(--card);
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-3);
  text-align: left;
  padding: 9px 8px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  z-index: 2;
}
.rank-table th.sorted { color: var(--leaf-deep); }
.rank-table td {
  padding: 10px 8px;
  border-bottom: 1.5px solid #e3edf5;
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.rank-table td.name { color: var(--ink); font-weight: 700; white-space: nowrap; }
.rank-table tr:hover td { background: rgba(240, 180, 41, 0.06); }
.rank-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-3);
  background: var(--paper);
}
.rank-no.top { background: var(--ginkgo); color: #fff; box-shadow: 0 2px 6px rgba(240, 180, 41, 0.5); }
.st { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.st.ok { background: rgba(122, 155, 87, 0.14); color: var(--leaf-deep); }
.st.warn { background: rgba(240, 180, 41, 0.16); color: var(--ginkgo-deep); }
.st.bad { background: rgba(217, 85, 58, 0.12); color: var(--vermilion); }
.leave-tag {
  font-size: 9px;
  font-weight: 700;
  color: #4a8fb5;
  border: 1px solid rgba(111, 177, 214, 0.6);
  border-radius: 999px;
  padding: 1px 6px;
  margin-left: 5px;
  vertical-align: 1px;
}

/* 预警卡（友好配色） */
.alert-card {
  border-radius: 14px;
  padding: 13px 15px;
  margin-bottom: 10px;
  background: var(--paper);
  border-left: 5px solid var(--vermilion);
}
.alert-card.warn { border-left-color: var(--ginkgo); }
.alert-card.info { border-left-color: var(--sky); }
.alert-card .a-title { font-size: 14px; font-weight: 800; }
.alert-card .a-body { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.alert-card .a-body b { color: var(--ink); }

/* 数据导入导出 */
.io {
  margin-top: 22px;
  border: 2px dashed #c3d4e2;
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.io .io-label { width: 100%; font-size: 11px; font-weight: 800; color: var(--ink-3); letter-spacing: 0.08em; }
.btn {
  border: none;
  background: var(--leaf);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(122, 155, 87, 0.4);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  display: inline-block;
}
.btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 8px 18px rgba(122, 155, 87, 0.45); }
.btn.ghost {
  background: var(--card);
  color: var(--leaf-deep);
  border: 2px solid rgba(122, 155, 87, 0.5);
  box-shadow: none;
}
.btn.gold { background: var(--ginkgo); box-shadow: 0 4px 12px rgba(244, 168, 61, 0.5); }
.btn.gold:hover { box-shadow: 0 8px 18px rgba(240, 180, 41, 0.5); }
.file-btn input { display: none; }
.io-msg { width: 100%; font-size: 12px; font-weight: 700; color: var(--leaf-deep); }
.io-msg.err { color: var(--vermilion); }

footer {
  margin-top: 30px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
  line-height: 1.8;
}

/* ================= 桌面端增强 ================= */
@media (min-width: 720px) {
  .hero { padding: 48px 24px 120px; border-radius: 0 0 44px 44px; }
  .hero-inner, main { max-width: 1020px; }
  .greeting { font-size: 34px; }
  .polaroids { height: 168px; }
  .polaroid { width: 140px; }
  .polaroid img { height: 128px; }
  .polaroid.p2 { left: 104px; }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .chart-grid { grid-template-columns: repeat(2, 1fr); }
  .duo-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; }
  .duo-grid .card { margin-top: 0; }
  .duo-wrap { margin-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .cloud, .sky-orb, .leaf-fall, .star { animation: none !important; display: none; }
  .reveal { animation: none; opacity: 1; transform: none; }
  * { transition-duration: 0.01ms !important; }
}
