:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #667085;
  --border: #e5e7eb;
  --accent: #2454ff;
  --accent-soft: #eef3ff;
  --danger: #d92d20;
  --ok: #079455;
  --warning: #f79009;
  --shadow: 0 12px 32px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }

.container {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
}

.page-shell {
  min-height: 100vh;
  padding: 24px 0 48px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}
.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #7c8cff);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.nav-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: .16s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.danger { background: #fff4f2; color: var(--danger); border-color: #ffd7d2; }
.btn.small { padding: 7px 10px; border-radius: 10px; font-size: 13px; }
.btn:disabled, .btn.disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.hero {
  background: radial-gradient(circle at 20% 0%, rgba(36,84,255,.18), transparent 34%), var(--card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 30px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.hero h1 { margin: 0 0 8px; font-size: clamp(26px, 4vw, 44px); line-height: 1.05; }
.hero p { margin: 0; color: var(--muted); line-height: 1.7; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.04);
}
.card h2, .card h3 { margin: 0 0 12px; }
.muted { color: var(--muted); }
.kpi-value { font-size: clamp(24px, 4vw, 38px); font-weight: 900; line-height: 1; margin: 10px 0 6px; }
.kpi-label { color: var(--muted); font-size: 14px; }
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 10px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 700; }
.badge.warn { background: #fff7ed; color: var(--warning); }
.badge.ok { background: #ecfdf3; color: var(--ok); }
.badge.danger { background: #fff4f2; color: var(--danger); }

.form-row { display: grid; gap: 8px; margin-bottom: 14px; }
.form-row label { font-size: 14px; color: var(--muted); }
.input, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
}
.check-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check-item { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: 12px; }

.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 16px; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { background: #fafafa; color: var(--muted); font-size: 13px; font-weight: 800; }
tr:last-child td { border-bottom: 0; }

.section-title { display:flex; align-items:center; justify-content:space-between; gap:12px; margin: 24px 0 12px; }
.section-title h2 { margin: 0; }
.stack { display: grid; gap: 14px; }
.result-box { white-space: pre-wrap; background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 14px; overflow: auto; max-height: 360px; }

.champion-card { display:grid; grid-template-columns: 1fr auto; align-items:center; gap: 18px; }
.champion-meta { min-width: 0; }
.champion-badge { white-space: nowrap; }
.champion-name { font-size: 24px; font-weight: 900; margin-top: 8px; line-height: 1.15; }
.champion-team { color: var(--muted); margin-top: 4px; line-height: 1.45; word-break: break-all; }
.champion-value-wrap { min-width: 120px; text-align: right; }
.champion-value { font-size: 30px; font-weight: 900; line-height: 1.05; }
.champion-sub { color: var(--muted); margin-top: 6px; font-size: 13px; line-height: 1.35; word-break: break-all; }
.rank-row { display:grid; grid-template-columns: 46px 1fr auto; align-items:center; gap: 10px; padding: 10px 0; border-bottom:1px solid var(--border); }
.rank-row:last-child { border-bottom: 0; }
.rank-no { width:32px; height:32px; border-radius: 10px; display:grid; place-items:center; background: var(--accent-soft); color: var(--accent); font-weight: 900; }
.progress { height: 10px; background: #eef0f4; border-radius: 999px; overflow:hidden; margin-top: 6px; }
.progress span { display:block; height:100%; width:0%; background: var(--accent); border-radius: inherit; }

.notice { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 12px 14px; border-radius: 12px; color: var(--text); }
.footer { color: var(--muted); text-align:center; padding: 28px 0 0; font-size: 13px; line-height: 1.7; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent); text-decoration: underline; }
.footer-sep { margin: 0 8px; color: #c0c6d4; }

@media (max-width: 820px) {
  .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .hero { padding: 22px; border-radius: 22px; }
  .check-grid { grid-template-columns: 1fr; }
  th, td { padding: 10px; }
}

.entry-panel { margin: 18px 0 22px; }
.entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.entry-card {
  min-height: 118px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent-soft), var(--card));
  border-radius: 24px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  box-shadow: 0 12px 26px rgba(16, 24, 40, 0.06);
  transition: .16s ease;
}
.entry-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.entry-card strong { font-size: clamp(20px, 3vw, 28px); display: block; margin-bottom: 6px; }
.entry-card p { margin: 0; color: var(--muted); }
.entry-card span { color: var(--accent); font-weight: 900; white-space: nowrap; }
.entry-card.disabled { opacity: .6; cursor: not-allowed; }
.template-links .btn { flex: 1 1 140px; }
.leaderboard-editor { border: 1px solid var(--border); border-radius: 18px; padding: 14px; background: #fbfcff; }
.editor-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 12px; }
.check-item.compact { padding: 8px 10px; background: #fff; }
@media (max-width: 820px) {
  .entry-grid { grid-template-columns: 1fr; }
  .entry-card { align-items: flex-start; flex-direction: column; }
  .editor-head { grid-template-columns: 1fr; }
}

/* V2.3 mobile-first dashboard refinements */
.mobile-hour-list { display: none; }
@media (max-width: 640px) {
  .container { width: min(100% - 18px, 1180px); }
  .page-shell { padding: 12px 0 28px; }
  .topbar { margin-bottom: 10px; }
  .logo { font-size: 15px; }
  .logo-mark { width: 30px; height: 30px; border-radius: 10px; }
  .hero { padding: 16px; border-radius: 18px; margin-bottom: 12px; }
  .hero h1 { font-size: 24px; line-height: 1.18; margin-top: 8px !important; }
  .hero p { font-size: 13px; line-height: 1.5; }
  .badge { font-size: 12px; padding: 4px 9px; }
  .section-title { margin: 18px 0 10px; align-items: flex-start; }
  .section-title h2 { font-size: 18px; line-height: 1.25; }
  .entry-panel { margin: 12px 0 16px; }
  .entry-grid { gap: 12px; }
  .entry-card { min-height: 104px; border-radius: 20px; padding: 18px; gap: 10px; }
  .entry-card strong { font-size: 22px; }
  .entry-card p { font-size: 13px; line-height: 1.45; }
  .entry-card span { width: 100%; border-radius: 14px; background: var(--accent); color: #fff; text-align: center; padding: 10px 12px; }
  .card { border-radius: 18px; padding: 15px; }
  .champion-card { align-items: flex-start; flex-direction: column; }
  .champion-name { font-size: 24px; }
  .kpi-value { font-size: 28px !important; }
  .rank-row { grid-template-columns: 38px 1fr; align-items: start; }
  .rank-row > strong:last-child { grid-column: 2; font-size: 18px; margin-top: 2px; }
  .rank-no { width: 30px; height: 30px; border-radius: 9px; }
  .desktop-table { display: none; }
  .mobile-hour-list { display: grid; gap: 10px; }
  .hour-card { border: 1px solid var(--border); border-radius: 16px; padding: 12px; background: #fbfcff; }
  .hour-title { font-weight: 900; margin-bottom: 8px; color: var(--accent); }
  .hour-metric { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--border); }
  .hour-metric:first-of-type { border-top: 0; }
  .hour-metric span { color: var(--muted); font-size: 13px; }
  .hour-metric strong { text-align: right; }
  .hour-metric em { grid-column: 1 / -1; font-style: normal; color: var(--text); font-weight: 800; }
  .table-wrap { border-radius: 14px; }
  th, td { padding: 9px 10px; font-size: 13px; }
  .footer { padding-top: 18px; font-size: 12px; }
}


/* V2.3.5：荣誉榜卡片统一优化，彬璇/越色+外围共用同一套样式 */
@media (max-width: 640px) {
  .champion-card {
    display: grid !important;
    grid-template-columns: 1fr !important;
    justify-items: center !important;
    text-align: center !important;
    gap: 16px !important;
    padding: 22px 18px !important;
    min-height: 190px !important;
  }
  .champion-meta {
    width: 100% !important;
    display: grid !important;
    justify-items: center !important;
  }
  .champion-badge { font-size: 13px !important; padding: 6px 12px !important; }
  .champion-name { font-size: 32px !important; margin-top: 14px !important; line-height: 1.12 !important; }
  .champion-team { font-size: 17px !important; max-width: 100% !important; margin-top: 8px !important; text-align: center !important; }
  .champion-value-wrap {
    width: 100% !important;
    min-width: 0 !important;
    text-align: center !important;
    padding: 14px 12px 4px !important;
    border-top: 1px solid var(--border) !important;
  }
  .champion-value { font-size: 42px !important; font-weight: 900 !important; }
  .champion-sub { font-size: 14px !important; max-width: 100% !important; text-align: center !important; }
}
