* { margin:0; padding:0; box-sizing:border-box; }
html { height: 100%; }
/* Safari「整页截图」依赖文档实际高度：body 用 min-height 让文档随内容撑开，
   不能用 height:100% 把文档锁在视口高度（否则截图只能截一屏） */
body {
  min-height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: #1a1a1a;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12px 0 30px;
}

/* 固定背景图层 */
.bg-fixed {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -1;
  /* iOS/微信 WKWebView 下 fixed 背景滚动抖动修复：强制 GPU 合成层 */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  will-change: transform;
  pointer-events: none;
}

/* 滚动改为文档流自然滚动（不再用容器内滚动）：
   容器内 overflow-y:auto 会让 Safari 整页截图偶发失灵，
   overflow-x: clip 只裁横向溢出、不创建滚动容器 */
.container {
  max-width: 420px;
  width: 100%;
  border-radius: 28px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  position: relative;
  overflow-x: clip;
  color: #fff;
  backdrop-filter: blur(2px);
}
.bg-overlay { display: none; }
.header { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 5px; position: relative; z-index: 2; }
.logo-area .logo-img { max-height: 40px; max-width: 100px; }
.default-logo { font-size: 20px; font-weight: 800; color: #ffe484; letter-spacing: 2px; }
.mascot-area .mascot-img { width: 50px; height: 50px; object-fit: contain; }

/* 小鸡 */
.chick-mascot { width: 50px; height: 60px; position: relative; }
.chick-body { width: 44px; height: 48px; background: #fff; border-radius: 50% 50% 42% 42%; position: absolute; bottom: 6px; left: 3px; box-shadow: inset 0 -4px 0 rgba(0,0,0,0.05); }
.chick-eye { width: 7px; height: 9px; background: #111; border-radius: 50%; position: absolute; top: 14px; }
.chick-eye.left { left: 16px; } .chick-eye.right { left: 26px; }
.chick-beak { width: 10px; height: 8px; background: #ff8c00; clip-path: polygon(0 0, 100% 50%, 0 100%); position: absolute; top: 20px; left: 22px; transform: rotate(90deg); }
.chick-comb { position: absolute; top: 0; left: 10px; display: flex; gap: 3px; }
.comb { width: 8px; height: 12px; background: #e60012; border-radius: 50% 50% 0 0; }
.chick-wing { width: 12px; height: 14px; background: #f0f0f0; border-radius: 50%; position: absolute; top: 23px; left: -2px; transform: rotate(15deg); }
.soccer-ball { font-size: 26px; position: absolute; right: 0; bottom: 6px; animation: bounce 1s infinite alternate; }
@keyframes bounce { 0% { transform: translateY(0) rotate(0deg); } 100% { transform: translateY(-4px) rotate(20deg); } }

.title-area { text-align: center; margin: 5px 10px 10px; position: relative; z-index: 2; }
.main-title { font-size: 30px; font-weight: 900; letter-spacing: 2px; background: linear-gradient(180deg, #ffe484 0%, #ffb800 80%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.sub-title { font-size: 14px; letter-spacing: 3px; background: rgba(255,255,255,0.25); padding: 4px 16px; border-radius: 20px; display: inline-block; margin-top: 4px; color: #ffe8b0; }

/* ========== 倒计时（科技感） ========== */
.countdown-card {
  background: linear-gradient(135deg, rgba(10,12,20,0.55), rgba(30,12,16,0.45));
  backdrop-filter: blur(12px);
  margin: 0 16px 14px; border-radius: 18px; padding: 18px 14px 16px;
  text-align: center; border: 1px solid rgba(255,179,0,0.35);
  min-height: 80px; position: relative; z-index: 2; overflow: hidden;
  box-shadow: 0 0 26px rgba(255,179,0,0.12), inset 0 0 30px rgba(217,0,26,0.08);
}
.countdown-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,179,0,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,179,0,0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}
.cd-corner { position: absolute; width: 14px; height: 14px; border: 2px solid rgba(255,179,0,0.7); }
.cd-corner.tl { top: 7px; left: 7px; border-right: none; border-bottom: none; }
.cd-corner.tr { top: 7px; right: 7px; border-left: none; border-bottom: none; }
.cd-corner.bl { bottom: 7px; left: 7px; border-right: none; border-top: none; }
.cd-corner.br { bottom: 7px; right: 7px; border-left: none; border-top: none; }
.countdown-label { font-size: 12px; font-weight: 700; letter-spacing: 3px; color: #ffe8b0; position: relative; z-index: 1; }
.countdown-label::before { content: '◢ '; color: #ffd36b; }
.countdown-timer { position: relative; z-index: 1; margin: 12px 0 6px; }
.cd-segments { display: flex; align-items: flex-end; justify-content: center; gap: 6px; }
.cd-seg { display: flex; flex-direction: column; align-items: center; }
.cd-num {
  font-family: 'Bahnschrift','DIN Alternate','Consolas',monospace;
  font-size: 30px; font-weight: 800; color: #fff; letter-spacing: 1px;
  background: linear-gradient(180deg, rgba(255,179,0,0.18), rgba(217,0,26,0.18));
  border: 1px solid rgba(255,179,0,0.4); border-radius: 10px;
  padding: 4px 8px; min-width: 48px; text-align: center;
  text-shadow: 0 0 10px rgba(255,179,0,0.6);
  box-shadow: inset 0 0 12px rgba(255,179,0,0.15);
}
.cd-unit { font-size: 11px; color: #ffe8b0; margin-top: 5px; letter-spacing: 1px; }
.cd-sep { font-size: 24px; color: #ffd36b; font-weight: 800; padding-bottom: 20px; animation: cdPulse 1.4s ease-in-out infinite; }
@keyframes cdPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.cd-status { font-size: 22px; font-weight: 800; letter-spacing: 2px; }
.cd-status.during { color: #ff8a3d; text-shadow: 0 0 14px rgba(255,138,61,0.7); animation: cdBeat 1.4s ease-in-out infinite; }
@keyframes cdBeat { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.cd-status.after { color: #9fffd0; text-shadow: 0 0 12px rgba(159,255,208,0.5); }
.cd-status.waiting { color: #ffd36b; text-shadow: 0 0 12px rgba(255,211,107,0.5); font-size: 16px; }
.rule-btn { display: inline-block; background: rgba(255,179,0,0.12); padding: 8px 22px; border-radius: 20px; margin-top: 10px; font-size: 14px; cursor: pointer; border: 1px solid rgba(255,179,0,0.45); color: #fff8e0; position: relative; z-index: 1; transition: .2s; }
.rule-btn:active { transform: scale(0.96); }

/* ========== 赛程进度（可点击切换期数 · 科技感） ========== */
.timeline-card {
  background: linear-gradient(135deg, rgba(10,14,24,0.45), rgba(30,12,16,0.4));
  backdrop-filter: blur(12px);
  margin: 0 16px 12px;
  border-radius: 16px;
  padding: 14px 10px 12px;
  border: 1px solid rgba(255,179,0,0.22);
  position: relative;
  z-index: 2;
  box-shadow: 0 0 22px rgba(255,179,0,0.08);
}
.timeline-title {
  font-size: 13px;
  font-weight: 700;
  color: #ffe8b0;
  letter-spacing: 2px;
}
.timeline-title::before { content: '◢ '; color: #ffd36b; }
.timeline-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.timeline-track::-webkit-scrollbar { display: none; }
.timeline-node {
  flex: 0 0 auto;
  scroll-snap-align: center;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,179,0,0.25);
  border-radius: 14px;
  padding: 9px 11px;
  min-width: 70px;
  max-width: 92px;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease, border-color .25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.timeline-node:active { transform: scale(0.95); }
.timeline-node.active {
  background: linear-gradient(135deg, rgba(217,0,26,0.9), rgba(179,0,21,0.9));
  border-color: #ff6a86;
  box-shadow: 0 0 18px rgba(255,106,134,0.55);
}
.timeline-node.active .timeline-label,
.timeline-node.active .timeline-date,
.timeline-node.active .timeline-status { color: #fff; }
.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: 2px solid rgba(255,255,255,0.5);
  margin-bottom: 5px;
  transition: .3s;
  position: relative;
  z-index: 1;
}
.timeline-dot.done { background: #ffd36b; border-color: #ffd36b; box-shadow: 0 0 8px rgba(255,179,0,0.7); }
.timeline-dot.active { background: #ff8a3d; border-color: #ffb066; box-shadow: 0 0 10px rgba(255,138,61,0.9); animation: firePulse 1.2s infinite alternate; }
@keyframes firePulse {
  from { box-shadow: 0 0 6px rgba(255,138,61,0.6); transform: scale(1); }
  to { box-shadow: 0 0 14px rgba(255,138,61,1); transform: scale(1.25); }
}
.timeline-label { font-size: 11px; color: #fff; font-weight: 700; text-align: center; white-space: nowrap; line-height: 1.2; }
.timeline-date { font-size: 9px; color: rgba(255,255,255,0.6); margin-top: 2px; text-align: center; white-space: nowrap; }
.timeline-status { font-size: 9px; margin-top: 3px; font-weight: 700; white-space: nowrap; padding: 1px 6px; border-radius: 10px; }
.timeline-status.done { color: #06121a; background: #ffd36b; }
.timeline-status.active { color: #1a0d00; background: #ffb066; }
.timeline-status.future { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.12); }

.update-bar {
  background: rgba(255,255,255,0.15); backdrop-filter: blur(4px);
  margin: 0 16px 10px; border-radius: 12px; padding: 8px 16px;
  text-align: center; font-size: 14px; font-weight: 600;
  color: #ffea9e; border: 1px solid rgba(255,255,255,0.3);
  position: relative; z-index: 2;
}

/* 视图切换按钮 */
.view-switch { display: flex; gap: 8px; margin: 0 16px 10px; position: relative; z-index: 2; }
.view-btn {
  flex: 1; padding: 10px 6px; border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.4); background: rgba(255,255,255,0.15);
  color: #fff; font-size: 13px; cursor: pointer; font-weight: 600; transition: 0.2s;
}
.view-btn.active { background: rgba(255,255,255,0.95); color: #d9001a; border-color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }

.rank-section {
  background: rgba(255,255,255,0.92); backdrop-filter: blur(4px);
  margin: 0 16px 14px; border-radius: 20px; padding: 14px 12px;
  color: #333; box-shadow: 0 8px 16px rgba(0,0,0,0.1);
  position: relative; z-index: 2;
}

/* 让期数按钮区域可以横向滚动 */
.period-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 5px;
  margin-bottom: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.period-item {
  background: #f0f0f0; border-radius: 16px; padding: 5px 10px;
  font-size: 13px; font-weight: 600; cursor: pointer; color: #555;
  flex-shrink: 0;
  white-space: nowrap;
}
.period-item.active { background: #d9001a; color: #fff; }
.group-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.group-tab { background: #f0f0f0; border: none; border-radius: 14px; padding: 5px 12px; font-size: 13px; cursor: pointer; color: #444; }
.group-tab.active { background: #b30015; color: #fff; }
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item { display: flex; align-items: center; background: #fafafa; border-radius: 14px; padding: 10px; border: 1px solid #eee; }
.medal { font-size: 22px; margin-right: 8px; min-width: 28px; text-align: center; }
.rank-info { flex: 1; }
.store-name { font-weight: 700; font-size: 15px; }
.achieve { font-size: 12px; color: #888; }
.rate { font-weight: 800; color: #d9001a; font-size: 15px; }
.empty-msg { text-align: center; padding: 30px 0; color: #999; font-size: 15px; }
.hidden { display: none !important; }

/* 沙特奖 */
.saudi-divider { text-align: center; font-size: 14px; font-weight: 600; color: #888; margin: 20px 0 10px; padding-top: 15px; border-top: 1px dashed #ddd; }
.saudi-item { background: #f5f5f5 !important; border-color: #ddd !important; }
.saudi-item .rate { color: #888 !important; }

/* 门店名单 */
.store-list-container { margin-top: 10px; }
.store-list-title { text-align: center; font-size: 15px; font-weight: 600; color: #555; margin-bottom: 8px; }
.store-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.store-list-item { background: #f8f8f8; border-radius: 20px; padding: 6px 14px; font-size: 14px; color: #333; border: 1px solid #eee; }

/* 经理头像 */
.avatar-area-clean { width: 48px; height: 48px; margin-right: 12px; flex-shrink: 0; position: relative; }
.avatar-area-clean .avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid #eee; }
.avatar-area-clean .avatar-placeholder { font-size: 32px; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; background: #f0f0f0; border-radius: 50%; }
.rank-extra { font-size: 18px; margin-left: 4px; vertical-align: middle; }
.rank-motto { font-size: 11px; color: #888; margin-top: 2px; line-height: 1.3; font-style: italic; }
.manager-item { align-items: center !important; padding: 12px 10px !important; }

/* 风采 */
.gallery { margin: 0 16px 14px; display: flex; gap: 10px; position: relative; z-index: 2; }
.gallery-item { flex: 1; background: rgba(255,255,255,0.2); backdrop-filter: blur(5px); border-radius: 14px; padding: 10px; text-align: center; cursor: pointer; border: 1px solid rgba(255,255,255,0.3); }
.gallery-item img { max-width: 100%; height: 60px; object-fit: cover; border-radius: 10px; }
.gallery-placeholder { font-size: 28px; }
.gallery-title { font-size: 13px; font-weight: 700; margin-top: 6px; color: #ffe484; }
.gallery-desc { font-size: 11px; color: #ffe8b0; margin-top: 2px; }

/* 底部 */
.footer { text-align: center; font-size: 12px; padding: 10px 16px 20px; opacity: 0.85; position: relative; z-index: 2; line-height: 1.6; }
.footer a { color: #ffe484; text-decoration: none; }

/* 赛程头部：标题 + 仪表盘按钮 */
.timeline-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.dashboard-btn { background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.35); color: #fff; border-radius: 16px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; backdrop-filter: blur(4px); transition: 0.2s; }
.dashboard-btn:hover { background: rgba(255,255,255,0.28); transform: translateY(-1px); }

/* 仪表盘弹窗 */
.dashboard-box { max-width: 92vw; width: 560px; max-height: 86vh; background: linear-gradient(180deg, #fff 0%, #fffaf5 100%); border: 1px solid rgba(255,179,0,0.25); }
.dashboard-title { text-align: center; font-size: 18px; font-weight: 800; color: #b30015; margin-bottom: 4px; }
.dashboard-subtitle { text-align: center; font-size: 12px; color: #888; margin-bottom: 14px; }
.dashboard-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.dashboard-tab { flex: 1; background: #f5f5f5; border: none; border-radius: 14px; padding: 8px 0; font-size: 13px; font-weight: 600; color: #555; cursor: pointer; }
.dashboard-tab.active { background: #b30015; color: #fff; }
.dashboard-chart { background: #fff; border-radius: 16px; border: 1px solid #eee; padding: 12px; margin-bottom: 14px; min-height: 180px; }
.chart-empty { text-align: center; color: #999; padding: 60px 0; font-size: 14px; }
.chart-wrap { display: flex; flex-direction: column; gap: 10px; }
.chart-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.chart-label { width: 84px; text-align: right; color: #444; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-bar { flex: 1; height: 24px; display: flex; border-radius: 12px; overflow: hidden; background: #f0f0f0; }
.chart-seg { height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 700; min-width: 0; transition: width 0.4s ease; }
.chart-seg.champion { background: linear-gradient(90deg, #ffd700, #ffb800); color: #5a3d00; }
.chart-seg.runner { background: linear-gradient(90deg, #c0c0c0, #a0a0a0); color: #333; }
.chart-seg.third { background: linear-gradient(90deg, #cd7f32, #a0522d); color: #fff; }
.chart-seg.others { background: linear-gradient(90deg, #e8e2d4, #cfc8b6); color: #6b6455; }
.chart-count { width: 36px; text-align: left; color: #666; font-weight: 700; }
.chart-legend { display: flex; justify-content: center; gap: 16px; margin-top: 10px; font-size: 12px; color: #555; }
.chart-legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.legend-dot.champion { background: #ffb800; }
.legend-dot.runner { background: #a0a0a0; }
.legend-dot.third { background: #a0522d; }
.legend-dot.others { background: #cfc8b6; }
.dashboard-table-wrap { max-height: 38vh; overflow-y: auto; border-radius: 14px; border: 1px solid #eee; }
.dashboard-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dashboard-table th { background: #fff5f5; color: #b30015; padding: 10px 8px; text-align: center; font-weight: 700; position: sticky; top: 0; }
.dashboard-table td { padding: 9px 8px; text-align: center; border-bottom: 1px solid #f2f2f2; color: #333; }
.dashboard-table td:first-child { text-align: left; font-weight: 600; }
.dashboard-table tr:last-child td { border-bottom: none; }
.dashboard-actions { display: flex; justify-content: center; margin-top: 14px; }
.dashboard-download { display: inline-block; background: #b30015; color: #fff; text-decoration: none; border-radius: 18px; padding: 10px 22px; font-size: 14px; font-weight: 700; }
.dashboard-download:hover { background: #900; }

/* 弹窗 */
.modal-overlay { position: fixed; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-box { background: #fff; border-radius: 20px; padding: 20px; width: 85%; max-width: 360px; color: #222; max-height: 70vh; overflow-y: auto; }
.modal-close { float: right; font-size: 24px; cursor: pointer; }