/* ============ 行业评测投票 - 前台样式（移动优先） ============ */
:root {
  --bg: #f4f5fb;
  --card: #ffffff;
  --ink: #1a1c2b;
  --muted: #6b7280;
  --line: #eceef6;
  --primary: #5b5bd6;
  --primary-2: #8b5cf6;
  --grad: linear-gradient(135deg, #5b5bd6, #8b5cf6);
  --green: #0e9f6e;
  --green-bg: #e6f7f0;
  --amber: #d97706;
  --amber-bg: #fdf3e3;
  --gray: #6b7280;
  --gray-bg: #eef0f5;
  --red: #e02424;
  --radius: 16px;
  --shadow: 0 4px 18px rgba(26, 28, 43, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.container { flex: 1; padding-top: 16px; padding-bottom: 40px; }

/* ---- 顶部导航 ---- */
.site-header {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.logo { font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad);
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
  box-shadow: 0 3px 8px rgba(91, 91, 214, 0.35);
}
.user-box { display: flex; align-items: center; gap: 8px; font-size: 14px; min-width: 0; }
.user-box .uname { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.link-btn { color: var(--primary); font-weight: 600; cursor: pointer; background: none; border: none; font-size: 14px; }
.admin-link { font-size: 13px; color: var(--muted); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }

/* ---- 通用组件 ---- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: none; cursor: pointer;
  font-size: 15px; font-weight: 700; background: var(--grad); color: #fff;
  box-shadow: 0 4px 12px rgba(91, 91, 214, 0.3);
  transition: transform 0.12s ease, opacity 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { background: var(--gray-bg); color: var(--gray); box-shadow: none; cursor: not-allowed; }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); box-shadow: none; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-danger { background: linear-gradient(135deg, #ef4444, #f97316); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
.btn-green { background: linear-gradient(135deg, #0e9f6e, #10b981); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge.green { color: var(--green); background: var(--green-bg); }
.badge.amber { color: var(--amber); background: var(--amber-bg); }
.badge.gray { color: var(--gray); background: var(--gray-bg); }
.badge.red { color: var(--red); background: #fdeaea; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.green .dot { animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.chip-mini { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--primary); background: #eeeefe; padding: 3px 10px; border-radius: 999px; }
.muted { color: var(--muted); }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }

/* ---- 首页 Hero ---- */
.hero {
  background: var(--grad);
  color: #fff; border-radius: 20px; padding: 28px 20px;
  box-shadow: 0 10px 30px rgba(91, 91, 214, 0.35);
  position: relative; overflow: hidden;
}
.hero::after {
  content: '🏆'; position: absolute; right: -10px; top: -18px; font-size: 110px;
  opacity: 0.14; transform: rotate(18deg);
}
.hero h1 { font-size: 22px; font-weight: 800; letter-spacing: 0.5px; }
.hero p { margin-top: 6px; font-size: 14px; opacity: 0.92; max-width: 560px; }
.hero-stats { display: flex; gap: 22px; margin-top: 18px; flex-wrap: wrap; }
.hero-stat b { font-size: 22px; font-weight: 800; }
.hero-stat span { display: block; font-size: 12px; opacity: 0.85; }

/* ---- 行业筛选 ---- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 16px 2px 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line);
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: all 0.15s ease; -webkit-tap-highlight-color: transparent;
}
.chip.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 3px 10px rgba(91, 91, 214, 0.35); }
.chip .cnt { font-size: 12px; opacity: 0.7; }

/* ---- 活动卡片 ---- */
.group-title { font-size: 16px; font-weight: 800; margin: 22px 0 12px; display: flex; align-items: center; gap: 8px; }
.act-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.act-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease; border: 1.5px solid transparent;
}
.act-card:active { transform: scale(0.985); }
.act-card:hover { border-color: #d9dcf5; }
.act-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.act-card h3 { font-size: 16px; font-weight: 700; line-height: 1.4; }
.act-window { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.act-meta { display: flex; gap: 14px; font-size: 13px; color: var(--muted); padding-top: 8px; border-top: 1px dashed var(--line); }
.act-meta b { color: var(--ink); }
.act-card .go { color: var(--primary); font-weight: 700; font-size: 14px; }
.empty {
  text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px;
  background: var(--card); border-radius: var(--radius); border: 1.5px dashed var(--line);
}

/* ---- 活动详情页 ---- */
.breadcrumbs { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.breadcrumbs a { color: var(--primary); }
.act-head .act-top { margin-bottom: 8px; }
.act-head h1 { font-size: 20px; font-weight: 800; line-height: 1.4; }
.act-head .desc { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.head-info { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 12px; font-size: 13px; color: var(--muted); align-items: center; }
.head-info b { color: var(--ink); }
.countdown-line {
  margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; padding: 10px 12px; border-radius: 12px; background: var(--gray-bg);
}
.countdown-line.open { background: var(--green-bg); color: var(--green); }
.countdown-line.upcoming, .countdown-line.closed { background: var(--amber-bg); color: var(--amber); }
.countdown-line.ended { background: var(--gray-bg); color: var(--gray); }
.countdown-line .cd { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 15px; letter-spacing: 0.5px; }

.notice-bar {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.notice-bar.info { background: #eef0fe; color: var(--primary); }
.notice-bar.warn { background: var(--amber-bg); color: var(--amber); }
.notice-bar.info a, .notice-bar.warn a { font-weight: 700; text-decoration: underline; }

/* Tabs */
.tabs {
  display: flex; background: #e8eaf4; border-radius: 999px; padding: 4px; margin: 16px 0 14px;
}
.tab {
  flex: 1; border: none; background: transparent; padding: 10px 0; border-radius: 999px;
  font-size: 14.5px; font-weight: 700; color: var(--muted); cursor: pointer;
  transition: all 0.15s ease; -webkit-tap-highlight-color: transparent;
}
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }

/* ---- 参评对象卡片 ---- */
.cand-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cand {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px 12px; display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 6px; border: 1.5px solid transparent; position: relative;
}
.cand.voted { border-color: #10b981; background: #f4fdf9; }
.avatar {
  width: 62px; height: 62px; border-radius: 50%; background: var(--grad);
  color: #fff; font-size: 24px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: 0 4px 10px rgba(91, 91, 214, 0.3);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.cand-name { font-size: 15px; font-weight: 700; line-height: 1.3; word-break: break-all; }
.cand-intro { font-size: 12px; color: var(--muted); line-height: 1.4; min-height: 17px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cand-votes { font-size: 13px; color: var(--muted); }
.cand-votes b { color: var(--primary); font-size: 16px; font-weight: 800; }
.vote-btn { width: 100%; min-height: 40px; font-size: 14px; padding: 0 10px; }
.vote-btn.voted-btn { background: var(--green-bg); color: var(--green); box-shadow: none; }
.vote-tick { position: absolute; top: 10px; right: 10px; font-size: 13px; color: var(--green); font-weight: 800; display: none; }
.cand.voted .vote-tick { display: block; }
.my-vote-chip { margin-top: 10px; font-size: 12.5px; color: var(--green); background: var(--green-bg); border-radius: 999px; padding: 5px 12px; display: inline-flex; gap: 4px; }

/* ---- 排行榜 ---- */
.rank-card { padding: 8px 16px; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: none; }
.rank-no {
  width: 30px; height: 30px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; background: var(--gray-bg); color: var(--gray);
}
.rank-no.r1 { background: #fff4d6; color: #d97706; font-size: 16px; }
.rank-no.r2 { background: #eef1f6; color: #64748b; font-size: 16px; }
.rank-no.r3 { background: #fdeadd; color: #c2410c; font-size: 16px; }
.rank-body { flex: 1; min-width: 0; }
.rank-name { font-size: 14.5px; font-weight: 700; display: flex; justify-content: space-between; gap: 8px; }
.rank-name .rv { color: var(--primary); font-variant-numeric: tabular-nums; }
.rank-bar { height: 8px; border-radius: 999px; background: var(--gray-bg); margin-top: 7px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: 999px; background: var(--grad); transition: width 0.5s ease; min-width: 2%; }
.rank-empty { padding: 30px 0; text-align: center; color: var(--muted); font-size: 14px; }
.live-hint { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; padding: 10px 0 2px; }
.live-hint::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 1.5s infinite; }

/* ---- 登录注册 ---- */
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: var(--grad); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 20px; padding: 30px 24px; box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18); }
.auth-card h1 { font-size: 20px; font-weight: 800; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: 13.5px; margin: 6px 0 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px;
  font-size: 15px; font-family: inherit; background: #fafbff; outline: none; transition: border 0.15s ease;
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); background: #fff; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.auth-foot { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 16px; }
.auth-foot a { color: var(--primary); font-weight: 700; }
.btn-block { width: 100%; min-height: 46px; }

/* ---- Toast ---- */
.toast-wrap { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 380px); pointer-events: none; }
.toast {
  background: rgba(26, 28, 43, 0.92); color: #fff; padding: 11px 16px; border-radius: 12px;
  font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: toastIn 0.25s ease; text-align: center; word-break: break-all;
}
.toast.success { background: rgba(14, 143, 105, 0.95); }
.toast.error { background: rgba(216, 43, 52, 0.95); }
.toast.warn { background: rgba(196, 124, 11, 0.95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---- 页脚 ---- */
.site-footer { border-top: 1px solid var(--line); padding: 18px 0 26px; text-align: center; color: var(--muted); font-size: 12.5px; background: #fff; }

/* ---- 骨架屏 ---- */
.skel { background: linear-gradient(90deg, #eef0f6 25%, #f7f8fc 50%, #eef0f6 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- 响应式 ---- */
@media (min-width: 560px) {
  .cand-grid { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 26px; }
}
@media (min-width: 820px) {
  .act-grid { grid-template-columns: repeat(2, 1fr); }
  .cand-grid { grid-template-columns: repeat(4, 1fr); }
  .act-head h1 { font-size: 24px; }
  .tabs { max-width: 320px; }
}
@media (min-width: 1080px) {
  .cand-grid { grid-template-columns: repeat(5, 1fr); }
}
