/* ============================================================
   SunnyVote · 乐之童成长中心 最受欢迎教师评选投票
   全新投票程序 —— 设计语言：暖阳奶油 × 中国红 × 琥珀金
   ============================================================ */

:root {
  --brand: #e53935;          /* 主色 取自图片背景红 */
  --brand-deep: #b71c1c;
  --brand-soft: #ffebee;
  --accent: #f59e0b;         /* 强调 琥珀金 */
  --accent-deep: #d97706;
  --accent-soft: #fef3c7;
  --coral: #fb7185;
  --ink: #1e2340;            /* 正文深色 */
  --ink-2: #5a6080;          /* 次级文字 */
  --ink-3: #9aa1bf;          /* 弱化文字 */
  --bg: #f7f6f1;             /* 页面底色（暖奶油） */
  --bg-soft: #ffffff;
  --line: #eceef6;
  --radius: 18px;
  --radius-lg: 24px;
  --shadow-sm: 0 4px 14px rgba(183, 28, 28, .06);
  --shadow-md: 0 10px 30px rgba(183, 28, 28, .10);
  --shadow-lg: 0 22px 50px rgba(183, 28, 28, .16);
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 1180px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 340px at 85% -60px, rgba(229, 57, 53, .07), transparent 60%),
    var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
button, a, input, textarea, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
b, strong { font-weight: 700; }

.container { width: min(var(--maxw), 100% - 40px); margin-inline: auto; }
@media (max-width: 560px) { .container { width: calc(100% - 28px); } }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 600; border-radius: 999px; transition: .22s ease;
  padding: 10px 22px; font-size: 15px; white-space: nowrap;
  border: 1px solid transparent;
}
.btn--accent {
  background: linear-gradient(135deg, #fbbf24, var(--accent) 45%, var(--accent-deep));
  color: #3a2600; box-shadow: 0 8px 20px rgba(245, 158, 11, .35);
}
.btn--accent:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(245, 158, 11, .45); }
.btn--primary { background: linear-gradient(135deg, var(--brand), #ff7043); color: #fff; box-shadow: 0 8px 20px rgba(229, 57, 53, .30); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(229, 57, 53, .40); }
.btn--light { background: #fff; color: var(--brand-deep); box-shadow: var(--shadow-sm); }
.btn--light:hover { transform: translateY(-2px); }
.btn--ghost { border-color: var(--line); background: #fff; color: var(--ink-2); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn--ghost-on-dark { border-color: rgba(255,255,255,.35); color: #fff; }
.btn--ghost-on-dark:hover { background: rgba(255,255,255,.12); }
.btn--sm { padding: 7px 16px; font-size: 13px; }
.btn--lg { padding: 14px 34px; font-size: 17px; }
.btn--block { width: 100%; margin-top: 8px; }
.btn:active { transform: scale(.97); }

/* ---------------- 顶部导航 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(236,238,246,.9);
}
.topbar__inner { display: flex; align-items: center; height: 72px; gap: 26px; }
.brand { display: flex; align-items: center; gap: 11px; margin-right: auto; }
.brand__logo {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(229,57,53,.35);
}
.brand__logo img { width: 100%; height: 100%; object-fit: cover; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__text strong { font-size: 17px; letter-spacing: .3px; }
.brand__text small { font-size: 10.5px; color: var(--ink-3); letter-spacing: .6px; text-transform: uppercase; }
.topnav { display: flex; gap: 6px; }
.topnav a {
  padding: 8px 16px; border-radius: 999px; font-size: 15px; color: var(--ink-2);
  font-weight: 500; transition: .2s;
}
.topnav a:hover { color: var(--brand); background: var(--brand-soft); }
.topnav a.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.nav-burger { display: none; width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.nav-burger span { width: 17px; height: 2px; border-radius: 2px; background: var(--brand); transition: .25s; }
@media (max-width: 1080px) {
  .topnav { gap: 2px; }
  .topnav a { padding: 8px 12px; font-size: 14px; }
}
@media (max-width: 860px) {
  .topnav {
    position: fixed; inset: 72px 0 auto 0; z-index: 40; flex-direction: column;
    background: #fff; border-bottom: 1px solid var(--line); padding: 10px 20px 16px;
    box-shadow: var(--shadow-md); gap: 2px; display: none;
  }
  .topnav.open { display: flex; }
  .topnav a { padding: 11px 14px; border-radius: 12px; }
  .nav-burger { display: flex; }
}

/* ---------------- 欢迎横幅 ---------------- */
.welcome-banner { background: linear-gradient(90deg, #fef3c7, #ffe9c2); border-bottom: 1px solid #fde9b2; }
.welcome-banner__inner { display: flex; align-items: center; gap: 12px; padding-block: 10px; min-height: 52px; flex-wrap: wrap; }
.welcome-banner p { flex: 1; min-width: 200px; font-size: 14.5px; color: #7a5410; }
.welcome-banner p b { color: var(--accent-deep); }
.welcome-banner__emoji { font-size: 19px; }
.welcome-banner__close { width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.7); color: #9a7a1a; font-size: 12px; }
.welcome-banner__close:hover { background: #fff; }

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  color: #fff; background:
    radial-gradient(1100px 480px at 88% -40px, rgba(255,255,255,.14), transparent 55%),
    linear-gradient(135deg, #c62828 0%, #e53935 42%, #ff7043 100%);
}
.hero__bg {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none;
}
.hero__bg * { position: absolute; pointer-events: none; }
.hero__circle { border-radius: 50%; border: 1.5px solid rgba(255,255,255,.16); }
.hero__circle--1 { width: 330px; height: 330px; right: -90px; top: -110px; }
.hero__circle--2 { width: 210px; height: 210px; right: 190px; top: -70px; background: rgba(255,255,255,.05); border: 0; }
.hero__circle--3 { width: 150px; height: 150px; left: -60px; bottom: -60px; border-color: rgba(255,255,255,.14); }
.hero__star { font-size: 22px; color: rgba(253,230,138,.8); animation: floaty 4s ease-in-out infinite; }
.hero__star--1 { right: 34%; top: 20%; }
.hero__star--2 { right: 12%; bottom: 26%; animation-delay: 1.4s; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

.hero__grid { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 34px; align-items: center; padding-block: 66px 30px; }
.hero__status {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  letter-spacing: .8px; padding: 7px 16px; border-radius: 999px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
  backdrop-filter: blur(4px);
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { to { box-shadow: 0 0 0 9px rgba(52,211,153,0); } }
.hero__org { margin-top: 20px; font-size: 14px; opacity: .88; letter-spacing: .4px; }
.hero__title { margin-top: 8px; font-size: clamp(34px, 4.6vw, 52px); line-height: 1.18; font-weight: 800; letter-spacing: 1px; }
.hero__title em { font-style: normal; color: #fde68a; position: relative; }
.footer__title a { color: inherit; text-decoration: none; }
.footer__title a:hover { text-decoration: underline; text-underline-offset: 3px; opacity: .95; }
.hero__title em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 8px;
  background: linear-gradient(90deg, transparent, rgba(253,230,138,.5), transparent); border-radius: 4px;
}
.hero__desc { margin-top: 18px; max-width: 560px; color: rgba(255,255,255,.85); font-size: 15.5px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; font-size: 13.5px; color: rgba(255,255,255,.82); }
.hero__meta span { display: inline-flex; gap: 6px; align-items: center; }
.hero__cta { margin-top: 24px; }
.hero__media { position: relative; justify-self: center; width: min(100%, 430px); }
.hero__media img {
  width: 100%; border-radius: 28px; transform: rotate(2.4deg);
  box-shadow: 0 26px 60px rgba(70, 12, 12, .4); border: 5px solid rgba(255,255,255,.25);
}
.hero__media-badge {
  position: absolute; left: -14px; bottom: 22px; padding: 9px 18px; border-radius: 999px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #3a2600; font-weight: 700; font-size: 14px;
  box-shadow: 0 10px 22px rgba(245,158,11,.45); transform: rotate(-5deg);
}

/* 统计条 */
.stats {
  position: relative; display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(6px); border-radius: var(--radius-lg);
  padding: 10px 12px; margin-bottom: -22px; z-index: 2;
  box-shadow: var(--shadow-lg);
  width: 50%; max-width: 420px; min-width: 260px; margin-inline: auto;
}
.stats__item { text-align: center; }
.stats__item + .stats__item { border-left: 1px solid rgba(255,255,255,.22); }
.stats__item dt { font-size: 11px; color: rgba(255,255,255,.78); letter-spacing: .5px; }
.stats__item dd {
  font-size: clamp(18px, 3vw, 26px); font-weight: 800; color: #fde68a;
  font-variant-numeric: tabular-nums; line-height: 1.25; margin-top: 1px;
}
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; padding-block: 44px 40px; text-align: center; }
  .hero__copy { display: flex; flex-direction: column; align-items: center; }
  .hero__desc { max-width: 100%; }
  .hero__meta { justify-content: center; }
  .hero__media { width: min(78%, 330px); margin-top: 6px; }
  .stats { margin-bottom: -17px; }
}

/* ---------------- 区块通用 ---------------- */
.section { padding: 92px 0 84px; scroll-margin-top: 60px; }
.section--tint { background: #fff; }
.section__head { text-align: center; max-width: 620px; margin: 0 auto 40px; }
.section__eyebrow {
  display: inline-block; font-size: 12px; letter-spacing: 2.5px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); border: 1px solid #ffcdd2; border-radius: 999px; padding: 5px 14px; margin-bottom: 14px;
}
.section__head h2 { font-size: clamp(26px, 3.6vw, 36px); font-weight: 800; letter-spacing: .5px; }
.section__head p { margin-top: 8px; color: var(--ink-2); font-size: 15px; }
@media (max-width: 720px) { .section { padding: 64px 0 60px; } }

/* ---------------- 候选教师 ---------------- */
.candidate-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.search {
  position: relative; flex: 1; max-width: 480px; display: flex; align-items: center;
}
.search svg { position: absolute; left: 16px; width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.search input {
  width: 100%; padding: 12px 46px 12px 44px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fff; font-size: 14.5px; color: var(--ink); outline: none; transition: .2s; font-family: inherit;
}
.search input::placeholder { color: var(--ink-3); }
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(229,57,53,.1); }
.search__clear { position: absolute; right: 12px; width: 26px; height: 26px; border-radius: 50%; color: var(--ink-3); font-size: 12px; background: var(--bg); }
.search__clear:hover { color: #fff; background: var(--ink-3); }
.candidate-toolbar__count { font-size: 13px; color: var(--ink-3); }

.candidate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 1000px) { .candidate-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .candidate-grid { grid-template-columns: 1fr; } }

.card {
  position: relative; background: #fff; border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  padding: 26px 24px 22px; display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.card.highlight {
  border-color: var(--accent); box-shadow: 0 0 0 4px rgba(245,158,11,.18), var(--shadow-md);
  animation: pop 1.6s ease;
}
@keyframes pop { 0% { box-shadow: 0 0 0 0 rgba(245,158,11,.6), var(--shadow-md);} 100% { box-shadow: 0 0 0 10px rgba(245,158,11,0), var(--shadow-md);} }
.voted-ribbon {
  position: absolute; top: 14px; right: -8px; z-index: 2;
  background: linear-gradient(135deg, #10b981, #059669); color: #fff; font-size: 12px; font-weight: 600;
  padding: 5px 14px 5px 16px; border-radius: 999px 0 0 999px; box-shadow: 0 5px 12px rgba(16,185,129,.4);
}
.voted-ribbon::after { content:""; position:absolute; right: 0; top: 100%; border: 5px solid transparent; border-right-color: #047857; border-top-width: 0; }

.card__head {
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.card__head h3 {
  font-size: 19px; font-weight: 800; display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
}
.avatar {
  position: relative; flex: none; width: 96px; height: 96px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; font-size: 38px; font-weight: 800; color: #fff; margin-bottom: 13px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.35), 0 10px 20px rgba(0,0,0,.14);
  text-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.avatar i { font-style: normal; }
.avatar img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}

.card__intro { margin-top: 14px; font-size: 14px; color: var(--ink-2); text-align: center; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__motto {
  margin-top: 12px; padding: 10px 16px; border: 1px dashed rgba(245, 158, 11, .5);
  background: var(--accent-soft); border-radius: 12px; color: #8a5a06;
  font-size: 13px; font-style: italic; text-align: center;
}
.card__motto::before { content: "“"; }
.card__motto::after { content: "”"; }
.card__foot { margin-top: 18px; display: flex; gap: 10px; align-items: stretch; }
.vote-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 10px 10px 8px; border-radius: 14px; font-weight: 700; font-size: 15px; color: #fff;
  background: linear-gradient(135deg, var(--brand), #ff7043); box-shadow: 0 6px 16px rgba(229,57,53,.32);
  transition: .22s; line-height: 1.3;
}
.vote-btn small { font-size: 11px; font-weight: 500; opacity: .85; font-variant-numeric: tabular-nums; }
.vote-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(229,57,53,.42); }
.vote-btn:disabled { cursor: not-allowed; }
.vote-btn.mine {
  background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 6px 16px rgba(16,185,129,.35);
}
.vote-btn.mine:hover { box-shadow: 0 10px 22px rgba(16,185,129,.45); }
.card.voted .vote-btn:not(.mine) { background: #e7e9f4; color: #a7abc4; box-shadow: none; }
.vote-btn:disabled:not(.mine) { transform: none; }
.share-btn {
  flex: none; width: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 1.5px solid var(--line); border-radius: 14px; color: var(--ink-2); font-size: 12px; font-weight: 600; transition: .2s;
}
.share-btn svg { width: 17px; height: 17px; }
.share-btn:hover { border-color: var(--accent); color: var(--accent-deep); background: #fffbeb; }

.empty-state { text-align: center; padding: 44px 16px; }
.empty-state__icon { font-size: 40px; }
.empty-state p { margin-top: 10px; font-size: 16px; font-weight: 600; }
.empty-state p b { color: var(--accent-deep); }
.empty-state small { display: block; margin-top: 4px; color: var(--ink-3); }
.empty-state .btn { margin-top: 18px; }

/* ---------------- 核心课程 ---------------- */
.program-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .program-grid { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; } }
.program-card {
  position: relative; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 30px 26px 26px; overflow: hidden;
  box-shadow: var(--shadow-sm); transition: .25s;
}
.program-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.program-card__tag {
  position: absolute; right: 20px; top: 20px; font-size: 12px; font-weight: 700; letter-spacing: 1px;
  padding: 4px 12px; border-radius: 999px;
}
.program-card--baby .program-card__tag { color: #db2777; background: #fdf2f8; }
.program-card--english .program-card__tag { color: #0284c7; background: #e0f2fe; }
.program-card--think .program-card__tag { color: #b45309; background: #fef3c7; }
.program-card--baby {
  background: #fff;
  border-top: 3px solid #ec4899;
  box-shadow: 0 14px 30px rgba(236,72,153,.12), var(--shadow-sm);
  transform: scale(1.02);
}
.program-card--baby:hover { transform: scale(1.02) translateY(-5px); box-shadow: 0 20px 40px rgba(236,72,153,.16), var(--shadow-md); }
.program-card__icon {
  width: 62px; height: 62px; border-radius: 18px; display: grid; place-items: center; color: #fff;
  box-shadow: 0 10px 20px rgba(0,0,0,.12);
}
.program-card__icon svg { width: 30px; height: 30px; }
.program-card--baby .program-card__icon { background: linear-gradient(135deg, #ec4899, #db2777); }
.program-card--english .program-card__icon { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.program-card--think .program-card__icon { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.program-card__icon.program-card__icon--brand {
  width: auto; height: auto; background: #fff; color: inherit; border-radius: 14px;
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  box-shadow: 0 6px 14px rgba(0,0,0,.06); border: 1px solid rgba(0,0,0,.06);
}
.program-logo {
  font-size: 18px; font-weight: 800; letter-spacing: .5px; white-space: nowrap;
}
.program-logo--english { color: #1e40af; }
.program-card__icon--image img {
  display: block; max-height: 44px; width: auto; max-width: 100%; object-fit: contain;
}
.brand-mark {
  position: relative; width: 32px; height: 32px; flex: none;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px;
}
.brand-mark__shape { display: block; border-radius: 4px; }
.brand-mark--purple { grid-column: 1 / -1; background: #7c3aed; }
.brand-mark--green  { background: #10b981; }
.brand-mark--orange { background: #f59e0b; border-bottom-right-radius: 12px; }
.brand-mark__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-mark__text b { font-size: 15px; font-weight: 800; color: #4c1d95; letter-spacing: .3px; }
.brand-mark__text small { font-size: 7.5px; color: #6b7280; white-space: nowrap; }
.brand-mark--english { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.brand-mark--english .brand-mark__en { font-size: 11px; font-weight: 900; color: #1e40af; letter-spacing: .4px; }
.brand-mark--english .brand-mark__sub { font-size: 6.5px; font-weight: 800; color: #ef4444; letter-spacing: .6px; }
.program-card h3 { margin-top: 18px; font-size: 20px; font-weight: 800; }
.program-card p { margin-top: 8px; color: var(--ink-2); font-size: 14px; }

/* ---------------- 实时排名 ---------------- */
.ranking-list { display: grid; gap: 5px; }
.rank-row {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px 18px 6px 12px;
  box-shadow: var(--shadow-sm); transition: .2s;
}
.rank-row:hover { box-shadow: var(--shadow-md); transform: translateX(4px); }
.rank-row.is-top { background: linear-gradient(90deg, #fffbeb, #fff); border-color: #fde9a8; }
.rank-no {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; background: var(--bg); color: var(--ink-2);
}
.rank-row:nth-child(1) .rank-no { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; box-shadow: 0 6px 14px rgba(245,158,11,.4); }
.rank-row:nth-child(2) .rank-no { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; box-shadow: 0 6px 14px rgba(148,163,184,.4); }
.rank-row:nth-child(3) .rank-no { background: linear-gradient(135deg, #f0a878, #c9744a); color: #fff; box-shadow: 0 6px 14px rgba(201,116,74,.35); }
.rank-name { flex: 1; min-width: 0; margin: 0; display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15.5px; line-height: 1.4; }
.rank-campus { flex: none; font-size: 10.5px; font-weight: 600; color: var(--ink-3); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.rank-votes { flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.rank-votes b { font-size: 18px; color: var(--brand); }
.rank-votes small { font-size: 11px; color: var(--ink-3); display: block; margin-top: -2px; }
@media (max-width: 640px) { .rank-row { gap: 10px; padding: 6px 12px; } .rank-no { width: 34px; height: 34px; font-size: 13px; } }
.ranking-empty { text-align: center; color: var(--ink-3); padding: 30px 0; }
.ranking-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.ranking-foot__time { font-size: 12.5px; color: var(--ink-3); display: inline-flex; align-items: center; gap: 7px; }
.ranking-foot__time::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #34d399; }
.rank-row.flash { animation: flashRow 1.2s ease; }
@keyframes flashRow { 0%,100% { background: #fff; } 40% { background: var(--brand-soft); } }

/* ---------------- 投票规则 ---------------- */
.rule-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 1000px) { .rule-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .rule-grid { grid-template-columns: 1fr; } }
.rule-card {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 30px 22px 24px; box-shadow: var(--shadow-sm); transition: .22s; overflow: hidden;
}
.rule-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--rule-grad, linear-gradient(135deg, #10b981, #0d9488));
}
.rule-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.rule-card:nth-child(1) { --rule-grad: linear-gradient(135deg, #10b981, #0d9488); }
.rule-card:nth-child(2) { --rule-grad: linear-gradient(135deg, #8b5cf6, #6366f1); }
.rule-card:nth-child(3) { --rule-grad: linear-gradient(135deg, #f59e0b, #ef4444); }
.rule-card:nth-child(4) { --rule-grad: linear-gradient(135deg, #0ea5e9, #2563eb); }
.rule-card__no { position: absolute; top: 18px; right: 18px; font-size: 11px; font-weight: 700; letter-spacing: 1.6px; color: #c7cbe0; }
.rule-card h3 { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 800; }
.rule-card h3::before {
  content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%;
  background: var(--rule-grad, linear-gradient(135deg, #10b981, #0d9488));
}
.rule-card p { margin-top: 10px; color: var(--ink-2); font-size: 13.5px; }

/* ---------------- 联系我们 ---------------- */
.section--contact { background: linear-gradient(180deg, #ffffff, #fbf3f1); }
.contact-grid {
  list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
  max-width: 900px; margin: 0 auto;
}
.contact-card {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); text-decoration: none; color: var(--ink); transition: .22s; overflow: hidden;
}
.contact-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, #e53935, #ff7043); opacity: 0; transition: opacity .22s;
}
.contact-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #f5c9c6; }
.contact-card:hover::before { opacity: 1; }
.contact-card__body {
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0;
}
.contact-card__name {
  font-size: 15.5px; font-weight: 800; line-height: 1.35; color: var(--ink); text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1px; background-repeat: no-repeat; background-position: 0 95%;
  transition: color .18s, background-size .18s;
}
.contact-card__name:hover { color: var(--brand); background-size: 100% 1px; }
.contact-card__tel {
  font-size: 13.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; letter-spacing: .3px;
  text-decoration: none; transition: color .18s;
}
.contact-card__tel:hover { color: var(--brand); text-decoration: underline; }
.contact-card__go {
  margin-left: auto; flex: none; font-size: 13px; font-weight: 700; color: var(--brand);
  white-space: nowrap; text-decoration: none; padding: 8px 15px; border-radius: 999px;
  border: 1px solid rgba(229, 57, 53, .38); background: var(--brand-soft); transition: .2s;
}
.contact-card__go:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.contact-note { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--ink-3); }
@media (max-width: 680px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-card { padding: 15px 16px; }
}

/* ---------------- 页脚 ---------------- */
.footer {
  background: linear-gradient(135deg, #8e1c1c, #c62828 55%, #e53935); color: rgba(255,255,255,.9);
  text-align: center; padding: 42px 20px 34px; position: relative;
}
.footer__title { font-size: 16px; font-weight: 700; }
.footer__sub { margin-top: 6px; font-size: 13px; color: rgba(255,255,255,.65); }
.footer__refresh { margin-top: 18px; }
.footer__power { margin-top: 22px; font-size: 11.5px; color: rgba(255,255,255,.45); }
.footer__power b { color: #fde68a; }

/* ---------------- 弹窗 ---------------- */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__mask { position: absolute; inset: 0; background: rgba(23,24,48,.55); backdrop-filter: blur(4px); animation: fadeIn .2s ease; }
.modal__box {
  position: relative; width: min(440px, 100%); background: #fff; border-radius: 24px; padding: 28px 26px 24px;
  box-shadow: var(--shadow-lg); text-align: center; animation: riseIn .3s cubic-bezier(.2,.9,.3,1.2);
  max-height: 90vh; overflow: auto;
}
@keyframes fadeIn { from { opacity: 0; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(22px) scale(.96); } }
.modal__close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; background: var(--bg); color: var(--ink-2); }
.modal__close:hover { background: #fee2e2; color: #dc2626; }
.share-avatar {
  position: relative; overflow: hidden; width: 66px; height: 66px; margin: 4px auto 12px;
  border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 26px;
  font-weight: 800; box-shadow: var(--shadow-sm);
}
.share-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.modal__box h3 { font-size: 19px; font-weight: 800; }
.share-hint { margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.share-text {
  width: 100%; margin-top: 14px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px;
  font-family: inherit; font-size: 13.5px; color: var(--ink); background: var(--bg); resize: none; line-height: 1.6; outline: none;
}
.share-text:focus { border-color: var(--accent); }
.modal__actions { display: flex; gap: 12px; margin-top: 16px; }
.modal__actions .btn { flex: 1; }
.share-tip { margin-top: 14px; font-size: 12px; color: var(--ink-3); }
.share-tip b { color: var(--accent-deep); }

/* ---------------- Toast ---------------- */
.toast-wrap { position: fixed; z-index: 120; left: 50%; bottom: calc(30px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; align-items: center; width: min(92%, 420px); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 9px; background: #1e2340; color: #fff; font-size: 14px;
  padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow-lg); animation: toastIn .3s ease; max-width: 100%;
}
.toast--ok { background: linear-gradient(135deg, #10b981, #059669); }
.toast--warn { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.toast--err { background: linear-gradient(135deg, #f43f5e, #dc2626); }
.toast.out { opacity: 0; transform: translateY(10px); transition: .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } }

/* ---------------- 演示工具 ---------------- */
.demo-fab {
  position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); bottom: max(18px, env(safe-area-inset-bottom, 0px)); z-index: 60; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: rgba(30,35,64,.82); backdrop-filter: blur(6px);
  box-shadow: var(--shadow-md); transition: .25s;
}
.demo-fab svg { width: 22px; height: 22px; }
.demo-fab:hover { transform: rotate(90deg); background: var(--brand); }
.demo-panel {
  position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 60; width: 250px; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; padding: 16px; box-shadow: var(--shadow-lg); animation: riseIn .25s ease;
}
.demo-fab[hidden] { display: none; }
.demo-panel[hidden] { display: none; }
.demo-panel__title { font-size: 14px; font-weight: 800; }
.demo-panel__desc { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.demo-panel .btn { font-size: 13px; justify-content: flex-start; }
.demo-panel .btn:hover { border-color: var(--accent); color: var(--accent-deep); }

/* ---------------- 数字滚动 ---------------- */
.num { display: inline-block; }

/* ---------------- 移动端专项优化（<= 560px） ---------------- */
@media (max-width: 560px) {
  html { scroll-padding-top: 68px; }

  /* 顶栏：压缩高度与间距，避免品牌/按钮拥挤 */
  .topbar__inner { height: 64px; gap: 10px; }
  .topnav { inset: 64px 0 auto 0; max-height: calc(100vh - 64px); overflow-y: auto; }
  .brand__logo { width: 38px; height: 38px; border-radius: 11px; font-size: 19px; }
  .brand__text strong { font-size: 16px; }
  .brand__text small { font-size: 9.5px; }

  /* Hero：标题与媒体尺寸再收紧，留白自然过渡到统计条 */
  .hero__title { font-size: clamp(25px, 7.8vw, 33px); }
  .hero__org { margin-top: 14px; }
  .hero__media { width: min(82%, 300px); }

  /* 搜索与计数：窄屏分行，避免被挤出屏幕 */
  .candidate-toolbar { flex-wrap: wrap; row-gap: 12px; }
  .candidate-toolbar .search { flex: 1 1 100%; max-width: none; }
  .candidate-toolbar .search input { font-size: 16px; } /* ≥16px 避免 iOS 聚焦自动放大 */
  .candidate-toolbar__count { margin-left: 4px; }

  /* 卡片：收窄内边距，投票按钮更饱满易点 */
  .card { padding: 20px 16px 16px; }
  .card__head .avatar { width: 76px; height: 76px; font-size: 28px; margin-bottom: 11px; }
  .card__foot { gap: 8px; }
  .share-btn { width: 84px; }

  .section { padding: 48px 0 44px; }
  .section__head { margin-bottom: 30px; }

  /* 分享弹窗：改为底部弹层，贴近手机交互习惯 */
  .modal { padding: 0; place-items: end center; }
  .modal__box {
    width: 100%; border-radius: 26px 26px 0 0;
    padding: 26px 20px calc(18px + env(safe-area-inset-bottom, 0px));
    max-height: 92vh; animation: sheetUp .34s cubic-bezier(.2,.9,.3,1.05);
  }
  .modal__actions .btn { padding-block: 12px; }
  @keyframes sheetUp { from { opacity: .3; transform: translateY(70px); } }

  /* 浮动演示按钮 / 弹层 / Toast 适配安全区 */
  .demo-fab { right: max(14px, env(safe-area-inset-right, 0px)); bottom: max(14px, env(safe-area-inset-bottom, 0px)); }
  .demo-panel { right: max(14px, env(safe-area-inset-right, 0px)); bottom: calc(70px + env(safe-area-inset-bottom, 0px)); width: 240px; }
  .toast-wrap { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
}

/* 动画滚动进入 */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   自适应布局增强：多级断点叠加，保证任何屏幕宽度都整齐美观
   （置于文件末尾，覆盖/细化上方基础规则）
   ============================================================ */

/* 1) 候选卡等高：多列排列时投票按钮统一对齐卡片底部 */
.candidate-grid .card__foot { margin-top: auto; padding-top: 18px; }

/* 2) 中大屏（约 861–1080）：Hero 双列时让插图与文案比例更协调 */
@media (min-width: 861px) and (max-width: 1080px) {
  .hero__grid { gap: 26px; padding-block: 56px 26px; }
  .hero__media { width: min(100%, 400px); }
}

/* 3) 手机竖屏（≤640）通用细节：文字层级与留白更克制 */
@media (max-width: 640px) {
  .hero__status { font-size: 12.5px; letter-spacing: .5px; }
  .hero__desc { font-size: 14.5px; max-width: 46ch; }
  .section__head h2 { letter-spacing: .2px; }
}

/* 4) 排行脚注在窄屏改为纵向居中，两端不再参差 */
@media (max-width: 480px) {
  .ranking-foot { flex-direction: column; align-items: center; gap: 10px; text-align: center; }
  .ranking-foot__time { justify-content: center; }
}

/* 5) 超窄屏（≤360）：整体进一步收紧，避免拥挤与折行突兀 */
@media (max-width: 360px) {
  .container { width: calc(100% - 24px); }
  .topbar__inner { gap: 8px; }
  .brand__logo { width: 36px; height: 36px; font-size: 18px; }
  .brand__text strong { font-size: 15px; }
  .brand__text small { font-size: 9px; }
  .welcome-banner__inner { gap: 8px; }
  .welcome-banner p { font-size: 13.5px; }
  .hero__status { font-size: 12px; padding: 5px 11px; }
  .hero__org { font-size: 13px; }
  .hero__title { font-size: clamp(23px, 7.6vw, 28px); letter-spacing: .3px; }
  .hero__media { width: min(86%, 280px); }
  .stats { padding: 8px 4px; border-radius: 16px; }
  .stats__item dt { font-size: 10px; }
  .stats__item dd { font-size: clamp(16px, 5vw, 20px); margin-top: 0; }
  .card__head .avatar { width: 64px; height: 64px; font-size: 24px; margin-bottom: 10px; }
  .card { padding: 18px 14px 14px; }
  .share-btn { width: 76px; font-size: 11.5px; }
  .rank-votes b { font-size: 17px; }
  .program-card { padding: 26px 20px 22px; }
  .rule-card { padding: 22px 18px 18px; }
  .footer { padding-inline: 14px; }
  .modal__box { padding-inline: 18px; }
}

/* ---------------- 投票规则紧凑化 ---------------- */
#rules.section { padding-block: 62px 52px; }
#rules .section__head { margin-bottom: 28px; }
#rules .rule-grid { gap: 14px; }
#rules .rule-card { padding: 25px 18px 20px; }
#rules .rule-card__no { top: 15px; right: 15px; font-size: 10px; letter-spacing: 1.4px; }
#rules .rule-card h3 { font-size: 16px; }
#rules .rule-card p { margin-top: 9px; font-size: 13px; line-height: 1.55; }

/* ============================================================
   候选教师：校区标签 / 别名 / 简介全文展示
   （2026-09-06 全量更新为 4 校区 20 人，顺序会话内随机）
   ============================================================ */
/* 头像在左，姓名与校区全称在右 */
.card__head {
  flex-direction: row; align-items: center; gap: 14px;
  text-align: left;
}
.card__meta {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 6px; flex: 1 1 0; min-width: 0;
}
.card__head .avatar { margin-bottom: 0; }

/* 姓名与英文名/外号同排基线对齐 */
.card__head h3 { justify-content: flex-start; align-items: baseline; }
.card__head h3 small {
  font-size: 13px; font-weight: 700; color: var(--ink-3); letter-spacing: .4px;
  white-space: nowrap;
}

/* 校区小标签：四校区四色（卡片内显示校区全称） */
.campus-chip {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 0;
  padding: 3px 12px 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; line-height: 1.7; letter-spacing: .4px;
  overflow-wrap: anywhere;
}
.campus-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.campus-chip--heb  { color: #c0392b; background: #fdecea; }
.campus-chip--xa   { color: #b45309; background: #fef3c7; }
.campus-chip--qqhr { color: #0369a1; background: #e0f2fe; }
.campus-chip--xam  { color: #6d28d9; background: #ede9fe; }

/* 简介展示完整（不再截断为 3 行） */
.card__intro { display: block; overflow: visible; }

@media (max-width: 640px) {
  .card__head { gap: 12px; }
  .campus-chip { padding: 2px 10px 2px 8px; font-size: 11px; }
}

/* 候选教师模块文字排版全部左对齐 */
.card__intro,
.card__motto { text-align: left; }
.card__meta { text-align: left; }

/* ============================================================
   候选教师模块整体紧凑化
   （置于最末覆盖，仅作用于 #candidates 区块）
   ============================================================ */
#candidates.section { padding-block: 72px 64px; }
#candidates .section__head { margin-bottom: 28px; }
#candidates .candidate-toolbar { margin-bottom: 20px; }
#candidates .candidate-grid { gap: 18px; }

#candidates .card { padding: 20px 20px 17px; }
#candidates .card__head { gap: 26px; }
#candidates .card__head .avatar { width: 128px; height: 128px; font-size: 48px; }
#candidates .card__meta { gap: 5px; }
#candidates .card__head h3 { font-size: 18px; }
#candidates .card__head h3 small { font-size: 12px; }
#candidates .campus-chip { font-size: 11.5px; line-height: 1.6; padding: 2px 10px 2px 8px; }
#candidates .card__intro { margin-top: 11px; font-size: 13.5px; line-height: 1.65; }
#candidates .card__motto { margin-top: 10px; padding: 8px 13px; font-size: 12.5px; }
#candidates .candidate-grid .card__foot { margin-top: 0; padding-top: 14px; }
#candidates .vote-btn { padding: 8px 10px 7px; font-size: 14px; border-radius: 12px; }
#candidates .share-btn { padding: 8px 10px; font-size: 12px; }

@media (max-width: 720px) {
  #candidates.section { padding-block: 52px 46px; }
}
@media (max-width: 640px) {
  #candidates.section { padding-block: 44px 40px; }
  #candidates .section__head { margin-bottom: 22px; }
  #candidates .candidate-toolbar { margin-bottom: 16px; row-gap: 10px; }
  #candidates .candidate-grid { gap: 14px; }
  #candidates .card { padding: 18px 16px 16px; }
  #candidates .card__head { gap: 26px; }
  #candidates .card__head .avatar { width: 116px; height: 116px; font-size: 44px; }
  #candidates .card__intro { margin-top: 9px; font-size: 13px; }
  #candidates .card__motto { margin-top: 8px; }
  #candidates .candidate-grid .card__foot { padding-top: 12px; }
}
