/* ==========================================================================
   校网宣部 · 部门工作台  共享样式表
   设计基调：清爽、年轻、有校园感。主色为靛蓝紫渐变，强调色为暖橙。
   ========================================================================== */

:root {
  --brand-1: #4f46e5;
  --brand-2: #7c3aed;
  --brand-3: #06b6d4;
  --accent: #f97316;
  --accent-soft: #fff1e6;

  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e6e9f2;

  --text: #1c2033;
  --text-2: #565d78;
  --text-3: #8b93ad;

  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(24, 30, 60, .06), 0 2px 8px rgba(24, 30, 60, .05);
  --shadow: 0 6px 24px rgba(24, 30, 60, .08);
  --shadow-lg: 0 18px 44px rgba(24, 30, 60, .14);
  --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 52%, #a855f7 100%);
  --grad-soft: linear-gradient(135deg, rgba(79, 70, 229, .10), rgba(168, 85, 247, .10));

  --nav-h: 62px;
  --maxw: 1180px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI",
          system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 320px;
  background:
    radial-gradient(900px 320px at 12% -40%, rgba(79, 70, 229, .20), transparent 70%),
    radial-gradient(700px 300px at 88% -30%, rgba(6, 182, 212, .18), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; }
p { margin: 0; }

::selection { background: rgba(124, 58, 237, .22); }

/* ------------------------------ 布局骨架 ------------------------------ */

.shell { position: relative; z-index: 1; }

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px;
}

/* 顶部导航（桌面） */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(180%) blur(14px);
  background: rgba(255, 255, 255, .82);
  border-bottom: 1px solid rgba(230, 233, 242, .9);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 66px;
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.brand-logo {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 13px;
  background: var(--grad);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: .5px;
  box-shadow: 0 8px 18px rgba(79, 70, 229, .34);
}

.brand-text { min-width: 0; }
.brand-name { font-size: 15.5px; font-weight: 800; letter-spacing: .2px; white-space: nowrap; }
.brand-sub { font-size: 11.5px; color: var(--text-3); letter-spacing: .8px; white-space: nowrap; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.nav a {
  position: relative;
  padding: 9px 15px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-2);
  transition: color .18s, background .18s;
}

.nav a:hover { color: var(--brand-1); background: rgba(79, 70, 229, .07); }

.nav a.active { color: var(--brand-1); background: rgba(79, 70, 229, .10); }

.nav a.active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -1px;
  transform: translateX(-50%);
  width: 18px; height: 3px;
  border-radius: 3px;
  background: var(--grad);
}

/* 底部标签栏（移动） */
.tabbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
}

.tabbar-inner { display: flex; height: var(--nav-h); }

.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  transition: color .18s;
}

.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--brand-1); }
.tabbar a.active svg { filter: drop-shadow(0 4px 8px rgba(79, 70, 229, .32)); }

/* ------------------------------ 通用组件 ------------------------------ */

.page-head { padding: 30px 0 18px; }

.page-title { font-size: 26px; letter-spacing: -.4px; }

.page-desc { color: var(--text-2); font-size: 14px; margin-top: 6px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-pad { padding: 20px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  margin-bottom: 4px;
}

.section-title .dot {
  width: 6px; height: 18px;
  border-radius: 4px;
  background: var(--grad);
}

.section-desc { color: var(--text-3); font-size: 13px; margin-bottom: 16px; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 700;
  transition: transform .15s, box-shadow .2s, background .2s, color .2s;
  white-space: nowrap;
}

.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 22px rgba(79, 70, 229, .30);
}
.btn-primary:hover { box-shadow: 0 14px 28px rgba(79, 70, 229, .40); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover { border-color: #cfd5e8; background: var(--surface-2); }

.btn-soft {
  background: var(--accent-soft);
  color: #c2410c;
}
.btn-soft:hover { background: #ffe3cc; }

.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }

.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--line);
}
.pill-brand { background: rgba(79, 70, 229, .10); color: var(--brand-1); border-color: transparent; }
.pill-ok { background: rgba(16, 185, 129, .12); color: #047857; border-color: transparent; }
.pill-warn { background: rgba(245, 158, 11, .14); color: #b45309; border-color: transparent; }
.pill-danger { background: rgba(239, 68, 68, .12); color: #b91c1c; border-color: transparent; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-size: 26px; font-weight: 800; letter-spacing: -.6px; }
.stat-label { font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.stat-unit { font-size: 13px; font-weight: 700; color: var(--text-3); margin-left: 3px; }

.avatar {
  width: 40px; height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .5px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.avatar-sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 12px; }
.avatar-lg { width: 74px; height: 74px; flex-basis: 74px; font-size: 26px; border-radius: 24px; }

.rows { display: flex; flex-direction: column; }

.row-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
}
.row-item:last-child { border-bottom: none; }
.row-item .grow { flex: 1; min-width: 0; }
.row-title { font-weight: 700; font-size: 14.5px; }
.row-sub { font-size: 12.5px; color: var(--text-3); }

.divider { height: 1px; background: var(--line); margin: 16px 0; }

.empty {
  padding: 34px 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 13.5px;
}

.skeleton-note {
  font-size: 12.5px;
  color: var(--text-3);
  text-align: center;
  padding: 10px 0 0;
}

/* ------------------------------ 主页 Hero ------------------------------ */

.hero {
  position: relative;
  margin-top: 24px;
  border-radius: 26px;
  overflow: hidden;
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.hero::after {
  content: "";
  position: absolute;
  right: -120px; top: -140px;
  width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .34), transparent 62%);
  pointer-events: none;
}

.hero::before {
  content: "";
  position: absolute;
  left: -80px; bottom: -180px;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(6, 182, 212, .40), transparent 65%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.25fr .95fr;
  gap: 28px;
  padding: 40px 38px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .4px;
}

.hero h1 {
  font-size: 40px;
  line-height: 1.16;
  letter-spacing: -1.2px;
  margin: 16px 0 12px;
}

.hero h1 .hl {
  background: linear-gradient(180deg, transparent 62%, rgba(255, 255, 255, .38) 62%);
  padding: 0 4px;
}

.hero p.lead {
  font-size: 15px;
  color: rgba(255, 255, 255, .88);
  max-width: 44ch;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.hero .btn-primary {
  background: #fff;
  color: var(--brand-1);
  box-shadow: 0 12px 26px rgba(12, 8, 60, .26);
}

.hero .btn-outline {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .42);
  color: #fff;
}
.hero .btn-outline:hover { background: rgba(255, 255, 255, .22); }

.hero-panel {
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 20px;
  padding: 18px;
  backdrop-filter: blur(6px);
}

.hero-panel-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .6px;
  color: rgba(255, 255, 255, .92);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.hero-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.hero-stat {
  background: rgba(255, 255, 255, .14);
  border-radius: 14px;
  padding: 12px 13px;
}

.hero-stat .n { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.hero-stat .l { font-size: 11.5px; color: rgba(255, 255, 255, .82); font-weight: 600; }

/* 头像墙 */
.facewall { display: flex; align-items: center; margin-top: 14px; }
.facewall .avatar { margin-left: -10px; border: 2px solid rgba(255, 255, 255, .7); }
.facewall .avatar:first-child { margin-left: 0; }
.facewall .more {
  margin-left: -10px;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, .22);
  border: 2px solid rgba(255, 255, 255, .7);
}

/* 概览统计条 */
.overview { margin-top: 20px; }

.ov-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .18s, box-shadow .2s, border-color .2s;
}

.ov-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d8dcee; }

.ov-ico {
  width: 44px; height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 21px;
  background: var(--grad-soft);
}

/* 内容区块 */
.section { margin-top: 34px; }

.split { display: grid; grid-template-columns: 1.35fr 1fr; gap: 18px; align-items: start; }

.notice {
  display: flex;
  gap: 13px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.notice:last-child { border-bottom: none; }

.notice-date {
  flex: 0 0 54px;
  text-align: center;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 6px 0;
}
.notice-date .d { font-size: 18px; font-weight: 800; line-height: 1.1; color: var(--brand-1); }
.notice-date .m { font-size: 11px; color: var(--text-3); font-weight: 600; }

.notice-body { min-width: 0; }
.notice-title { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notice-text { font-size: 13px; color: var(--text-2); margin-top: 3px; }

.task {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
}
.task:last-child { border-bottom: none; }

.task-check {
  width: 21px; height: 21px;
  flex: 0 0 21px;
  margin-top: 2px;
  border-radius: 7px;
  border: 2px solid #cbd2e6;
  background: #fff;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  transition: background .18s, border-color .18s, transform .15s;
}
.task-check:active { transform: scale(.9); }
.task.done .task-check { background: var(--ok); border-color: var(--ok); }
.task.done .task-title { color: var(--text-3); text-decoration: line-through; }

.task-title { font-size: 14px; font-weight: 600; }
.task-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  border: 1px solid var(--line);
}
.progress > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--grad);
  transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 9px; }
.tag {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
}

/* ------------------------------ 签到页 ------------------------------ */

.signin-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 18px;
  align-items: stretch;
}

.signin-main {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 26px;
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-lg);
}

.signin-main::after {
  content: "";
  position: absolute;
  right: -70px; top: -70px;
  width: 250px; height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, .3), transparent 62%);
}

.signin-main .clock {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.signin-main .today {
  font-size: 13.5px;
  color: rgba(255, 255, 255, .86);
  font-weight: 600;
  letter-spacing: .3px;
}

.signin-main .btn {
  position: relative;
  z-index: 1;
  background: #fff;
  color: var(--brand-1);
  box-shadow: 0 12px 26px rgba(10, 6, 50, .28);
  margin-top: 20px;
}
.signin-main .btn:disabled { background: rgba(255, 255, 255, .55); color: rgba(79, 70, 229, .7); }

.signin-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  font-size: 12.5px;
  font-weight: 700;
}

.signin-side { display: flex; flex-direction: column; gap: 16px; }

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cal-month { font-size: 15.5px; font-weight: 800; }

.icon-btn {
  width: 32px; height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-2);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  transition: background .18s, color .18s, border-color .18s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--brand-1); border-color: #cfd5e8; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }

.cal-dow {
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-3);
  padding-bottom: 5px;
}
.cal-dow.weekend { color: #c084fc; }

.cal-day {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 11px;
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--text-2);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: transform .15s, background .18s;
}
.cal-day:hover { transform: translateY(-2px); }

.cal-day.blank { background: transparent; pointer-events: none; }

.cal-day.done {
  background: linear-gradient(135deg, rgba(79, 70, 229, .14), rgba(168, 85, 247, .14));
  color: var(--brand-1);
  border-color: rgba(79, 70, 229, .26);
  font-weight: 800;
}
.cal-day.done::after {
  content: "";
  position: absolute;
  bottom: 5px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--brand-1);
}

.cal-day.late {
  background: linear-gradient(135deg, rgba(245, 158, 11, .16), rgba(249, 115, 22, .16));
  color: #b45309;
  border-color: rgba(245, 158, 11, .3);
}
.cal-day.late::after { background: var(--warn); }

.cal-day.today {
  box-shadow: 0 0 0 2px var(--brand-1);
  color: var(--brand-1);
  font-weight: 800;
}

.cal-day.future { opacity: .42; }

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-3);
  font-weight: 600;
}
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }

.streak-box { display: flex; align-items: center; gap: 16px; }

.flame {
  width: 58px; height: 58px;
  flex: 0 0 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 27px;
  background: linear-gradient(135deg, #fff1e6, #ffe0cc);
  box-shadow: 0 8px 18px rgba(249, 115, 22, .18);
}

.log-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.log-item:last-child { border-bottom: none; }
.log-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: 0 0 8px; }
.log-dot.late { background: var(--warn); }
.log-time { margin-left: auto; color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ------------------------------ 排名页 ------------------------------ */

.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: end;
  padding: 8px 0 4px;
}

.podium-card {
  position: relative;
  text-align: center;
  padding: 20px 14px 18px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.podium-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.podium-card.top1 {
  background: linear-gradient(180deg, #fffaf0, #fff);
  border-color: #f5d9a8;
  box-shadow: 0 14px 34px rgba(245, 158, 11, .18);
  padding-top: 26px;
  padding-bottom: 26px;
  order: 2;
}
.podium-card.top2 { order: 1; }
.podium-card.top3 { order: 3; }

.podium-card .avatar { margin: 0 auto 10px; }

.medal {
  position: absolute;
  top: -14px; left: 50%;
  transform: translateX(-50%);
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 6px 14px rgba(20, 20, 50, .2);
}
.top1 .medal { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.top2 .medal { background: linear-gradient(135deg, #cbd5e1, #94a3b8); }
.top3 .medal { background: linear-gradient(135deg, #f9a066, #ea7c3c); }

.podium-name { font-weight: 700; font-size: 14.5px; }
.podium-dept { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.podium-score { font-size: 21px; font-weight: 800; color: var(--brand-1); margin-top: 8px; letter-spacing: -.5px; }
.podium-score small { font-size: 11.5px; font-weight: 700; color: var(--text-3); margin-left: 2px; }

.podium-bar {
  margin-top: 12px;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.podium-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--grad); }
.top1 .podium-bar > i { background: linear-gradient(90deg, #fbbf24, #f59e0b); }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.seg {
  display: inline-flex;
  padding: 4px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.seg button {
  border: 0;
  background: transparent;
  padding: 7px 15px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-3);
  transition: background .18s, color .18s, box-shadow .18s;
}
.seg button.active {
  background: #fff;
  color: var(--brand-1);
  box-shadow: var(--shadow-sm);
}

.search {
  flex: 1;
  min-width: 170px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.search input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
}
.search input::placeholder { color: var(--text-3); }

.rank-table { width: 100%; border-collapse: collapse; }

.rank-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: .4px;
  padding: 0 12px 10px;
  white-space: nowrap;
}
.rank-table th.num, .rank-table td.num { text-align: right; }

.rank-table td {
  padding: 11px 12px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.rank-table tbody tr { transition: background .16s; }
.rank-table tbody tr:hover { background: var(--surface-2); }

.rank-table tbody tr.me {
  background: rgba(79, 70, 229, .06);
  box-shadow: inset 3px 0 0 var(--brand-1);
}
.rank-table tbody tr.me:hover { background: rgba(79, 70, 229, .10); }

.rank-no {
  width: 34px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}
.rank-no.gold { color: #d97706; }
.rank-no.silver { color: #7c8798; }
.rank-no.bronze { color: #c2703a; }

.cell-user { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-user .avatar { flex-basis: 34px; width: 34px; height: 34px; font-size: 12.5px; }
.cell-name { font-weight: 700; font-size: 14px; white-space: nowrap; }
.cell-name .me-tag {
  margin-left: 6px;
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--brand-1);
  color: #fff;
  font-weight: 800;
}
.cell-sub { font-size: 11.5px; color: var(--text-3); }

.trend { font-weight: 800; font-size: 12.5px; }
.trend.up { color: var(--ok); }
.trend.down { color: var(--danger); }
.trend.flat { color: var(--text-3); }

.score-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: flex-end;
}
.score-bar .bar {
  width: 74px;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  border: 1px solid var(--line);
}
.score-bar .bar > i { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.score-bar .val { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }

/* 我的名次浮动条 */
.myrank-strip {
  position: sticky;
  bottom: calc(var(--nav-h) + 10px);
  z-index: 20;
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 16px 34px rgba(79, 70, 229, .32);
}
.myrank-strip .avatar { border: 2px solid rgba(255, 255, 255, .6); }
.myrank-strip .grow { flex: 1; min-width: 0; }
.myrank-strip .t { font-weight: 800; font-size: 14.5px; }
.myrank-strip .s { font-size: 12px; color: rgba(255, 255, 255, .85); }
.myrank-strip .n { font-size: 22px; font-weight: 800; letter-spacing: -.6px; }

/* ------------------------------ 我的页 ------------------------------ */

.profile-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 28px;
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.profile-hero::after {
  content: "";
  position: absolute;
  right: -90px; bottom: -120px;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(6, 182, 212, .38), transparent 64%);
}
.profile-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 18px; }
.profile-top .avatar { border: 3px solid rgba(255, 255, 255, .55); }

.profile-name { font-size: 24px; font-weight: 800; letter-spacing: -.5px; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.profile-meta { font-size: 13px; color: rgba(255, 255, 255, .86); margin-top: 3px; }

.profile-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 22px;
}
.profile-stats .box {
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 15px;
  padding: 13px 14px;
}
.profile-stats .n { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.profile-stats .l { font-size: 11.5px; color: rgba(255, 255, 255, .84); font-weight: 600; }

.heat-grid { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; }
.heat-cell {
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background: #eceffa;
}
.heat-cell.l1 { background: rgba(79, 70, 229, .22); }
.heat-cell.l2 { background: rgba(79, 70, 229, .42); }
.heat-cell.l3 { background: rgba(79, 70, 229, .64); }
.heat-cell.l4 { background: var(--brand-1); }
.heat-cell.today { box-shadow: 0 0 0 2px var(--accent); }

.heat-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-3);
  font-weight: 600;
}
.heat-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.badges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

.badge {
  text-align: center;
  padding: 16px 10px;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: transform .18s, box-shadow .2s;
}
.badge:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); }

.badge-ico {
  width: 46px; height: 46px;
  margin: 0 auto 8px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: var(--grad-soft);
}
.badge-name { font-size: 13px; font-weight: 700; }
.badge-desc { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.badge.locked { opacity: .48; filter: grayscale(1); }
.badge.locked .badge-ico { background: var(--surface-2); }

.form-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.form-row:last-child { border-bottom: none; }
.form-row label { font-size: 14px; font-weight: 600; flex: 0 0 92px; }
.form-row .grow { flex: 1; }

.input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  outline: 0;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input:focus {
  border-color: var(--brand-1);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
}
select.input { appearance: none; cursor: pointer; }

.switch {
  position: relative;
  width: 46px; height: 27px;
  flex: 0 0 46px;
  border-radius: 999px;
  background: #d7dcec;
  border: 0;
  padding: 0;
  transition: background .2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(20, 20, 50, .22);
  transition: transform .2s;
}
.switch[aria-checked="true"] { background: var(--brand-1); }
.switch[aria-checked="true"]::after { transform: translateX(19px); }

/* 设置项 */
.set-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}
.set-item:last-child { border-bottom: none; }
.set-ico {
  width: 36px; height: 36px;
  flex: 0 0 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  font-size: 17px;
}
.set-item .grow { flex: 1; min-width: 0; }
.set-title { font-size: 14px; font-weight: 600; }
.set-sub { font-size: 11.5px; color: var(--text-3); }
.chev { color: var(--text-3); font-size: 17px; font-weight: 700; }

/* ------------------------------ 页脚 / 提示 ------------------------------ */

.footer {
  margin: 46px 0 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 12.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.footer a:hover { color: var(--brand-1); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 26px);
  transform: translate(-50%, 18px);
  z-index: 90;
  padding: 12px 20px;
  border-radius: 14px;
  background: rgba(24, 25, 45, .94);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s, transform .24s;
  max-width: calc(100vw - 40px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.fab-top {
  position: fixed;
  right: 16px;
  bottom: calc(var(--nav-h) + 18px);
  z-index: 30;
  width: 42px; height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  color: var(--text-2);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.fab-top.show { opacity: 1; pointer-events: auto; }

.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .55s ease, transform .55s cubic-bezier(.2, .7, .3, 1); }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ------------------------------ 通用弹窗 ------------------------------ */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 18, 34, .46);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .22s;
}
.modal-mask.show { opacity: 1; }

.modal {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 22px 20px 18px;
  transform: translateY(10px) scale(.98);
  transition: transform .22s;
}
.modal-mask.show .modal { transform: none; }

.modal-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 6px;
}

.modal-sub {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 16px;
  line-height: 1.55;
}

.modal-field { margin-bottom: 13px; }
.modal-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
}
.modal-field .input { background: var(--surface-2); }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.modal-msg {
  font-size: 12.5px;
  color: var(--danger);
  min-height: 18px;
  margin-top: 6px;
}

/* 滑块机器人验证 */
.captcha-track {
  position: relative;
  height: 46px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.captcha-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(135deg, rgba(16, 185, 129, .18), rgba(79, 70, 229, .18));
  transition: width .12s;
}

.captcha-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  pointer-events: none;
}

.captcha-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  font-size: 17px;
  cursor: grab;
  z-index: 2;
}

.captcha-track.ok {
  border-color: rgba(16, 185, 129, .6);
  background: rgba(16, 185, 129, .10);
}
.captcha-track.ok .captcha-hint { color: #047857; }

.countdown-pill {
  display: inline-block;
  min-width: 28px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------ 响应式 ------------------------------ */

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; padding: 30px 24px; gap: 22px; }
  .hero h1 { font-size: 32px; }
  .split { grid-template-columns: 1fr; }
  .signin-hero { grid-template-columns: 1fr; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .badges { grid-template-columns: repeat(3, 1fr); }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 14px; }
  .topbar-inner { height: 58px; }
  .brand-sub { display: none; }
  .nav { display: none; }
  .tabbar { display: block; }
  .shell { padding-bottom: calc(var(--nav-h) + 14px); }
  .page-head { padding: 22px 0 14px; }
  .page-title { font-size: 22px; }
  .hero { margin-top: 16px; border-radius: 22px; }
  .hero h1 { font-size: 27px; letter-spacing: -.7px; }
  .hero-inner { padding: 24px 18px; }
  .signin-main { padding: 20px; }
  .signin-main .clock { font-size: 38px; }
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .g-3.keep, .overview.g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .podium { grid-template-columns: 1fr; align-items: stretch; }
  .podium-card { order: 0 !important; }
  .heat-grid { grid-template-columns: repeat(13, 1fr); gap: 3px; }
  .badges { grid-template-columns: repeat(2, 1fr); }
  .card-pad { padding: 16px; }
  .rank-table th:nth-child(4), .rank-table td:nth-child(4) { display: none; }
  .toast { bottom: calc(var(--nav-h) + 84px); }
  .fab-top { bottom: calc(var(--nav-h) + 76px); }
  .myrank-strip { bottom: calc(var(--nav-h) + 8px); }
}

@media (max-width: 420px) {
  .score-bar .bar { display: none; }
  .profile-top { gap: 13px; }
  .profile-name { font-size: 20px; }
}

@media print {
  .topbar, .tabbar, .fab-top, .myrank-strip, .toast { display: none !important; }
  body { background: #fff; }
}
