:root {
  --primary: #d32f2f;
  --primary-dark: #b71c1c;
  --secondary: #f5f5f5;
  --text: #333;
  --muted: #666;
  --border: #ddd;
  --bg: #fafafa;
  --card-bg: #fff;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }

.nav { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 1rem; background: #fff; box-shadow: var(--shadow); position: sticky; top: 0; z-index: 100; }
.nav-brand { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--text); }
.logo-wrap { position: relative; display: inline-block; line-height: 0; }
.logo-r { position: absolute; top: -6px; right: -10px; font-size: 14px; font-weight: bold; color: #b41e1e; line-height: 1; }
.logo-r-lg { font-size: 20px; top: -8px; right: -14px; }
.brand-logo { height: 32px; width: auto; }
.nav-brand-text { font-weight: bold; font-size: 1.1rem; }
.nav-toggle { background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.nav-menu { display: none; list-style: none; margin: 0; padding: 0; gap: 1rem; }
.nav-menu.open { display: flex; flex-direction: column; position: absolute; top: 50px; left: 0; right: 0; background: #fff; padding: 1rem; box-shadow: var(--shadow); }
.nav-menu a { text-decoration: none; color: var(--text); font-size: 0.95rem; padding: 0.4rem 0; }
.nav-menu a.highlight { color: var(--primary); font-weight: bold; }

@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .nav-menu { display: flex; flex-direction: row; position: static; box-shadow: none; padding: 0; }
}

.main { min-height: 70vh; padding: 1rem; max-width: 800px; margin: 0 auto; }
.page { background: var(--card-bg); padding: 1.2rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.page h1 { margin-top: 0; font-size: 1.5rem; }

.hero { text-align: center; padding: 1.5rem 1rem; }
.hero-slogan { font-size: 1.3rem; font-weight: bold; color: var(--primary); letter-spacing: 0.1rem; margin-bottom: 1.2rem; }
.hero-welcome { display: flex; align-items: center; justify-content: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.welcome-text { font-size: 1rem; color: var(--muted); }
.hero-logo { height: 48px; width: auto; }
.brand-text { font-size: 1.4rem; font-weight: bold; color: var(--text); }
.activity-select { margin-bottom: 1.5rem; }
.select-label { color: var(--muted); font-size: 0.95rem; margin-bottom: 0.4rem; }
.activity-name { font-size: 1.1rem; font-weight: bold; color: var(--primary); padding: 0.6rem 1rem; background: #fff5f5; border: 1px solid var(--primary); border-radius: var(--radius); display: inline-block; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.hero-meta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; font-size: 0.9rem; color: var(--muted); margin-bottom: 1.5rem; }
.hero-disclaimer { font-size: 0.8rem; color: var(--muted); border-top: 1px solid #eee; padding-top: 1rem; max-width: 640px; margin: 0 auto; text-align: center; line-height: 1.5; }
.qr-box { text-align: center; margin: 1.5rem 0 0.5rem; }
.qr-img { width: 180px; height: 180px; border: 1px solid var(--border); border-radius: var(--radius); }
.qr-tip { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }

.btn { display: inline-block; padding: 0.7rem 1.4rem; border-radius: var(--radius); text-decoration: none; border: none; cursor: pointer; font-size: 1rem; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: var(--text); border: 1px solid var(--border); }
.btn-large { padding: 0.9rem 2rem; font-size: 1.1rem; width: 100%; }
.btn-small { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.verify-card { background: #f9f9f9; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin: 1.5rem auto; max-width: 480px; }
.verify-label { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.5rem; }
.verify-code { font-family: monospace; font-size: 1.2rem; letter-spacing: 1px; color: var(--primary); background: #fff; border: 1px dashed var(--primary); border-radius: var(--radius); padding: 0.6rem; word-break: break-all; margin-bottom: 0.8rem; }
.verify-form { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.verify-form input { flex: 1; min-width: 200px; }
.verify-result { margin: 1.5rem 0; padding: 1rem; border-radius: var(--radius); }
.verify-result.ok { background: #e8f5e9; border: 1px solid #a5d6a7; }
.verify-result.fail { background: #ffebee; border: 1px solid #ef9a9a; }
.verify-status { font-weight: bold; margin: 0 0 0.5rem; }
.verify-detail { list-style: none; padding: 0; margin: 0; }
.verify-detail li { padding: 0.2rem 0; }

.tag { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px; background: #e0e0e0; font-size: 0.8rem; }
.tag-success { background: #c8e6c9; color: #1b5e20; }

.vote-status { margin: 0.4rem auto 1.2rem; max-width: 420px; padding: 0.55rem 1rem; border-radius: 10px; font-size: 0.95rem; text-align: center; }
.vote-status-open { background: #e6f4ea; color: #1b5e20; border: 1px solid #b7dfc2; }
.vote-status-before { background: #fff4e0; color: #8a5a00; border: 1px solid #f0d49a; }
.vote-status-after { background: #fdeaea; color: #8a1f1f; border: 1px solid #f0b9b9; }

.rule-list { padding-left: 1.2rem; }
.rule-list li { margin-bottom: 0.6rem; }

.hint { color: var(--muted); font-size: 0.9rem; }
.required { color: var(--primary); }

.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; margin: 1rem 0; }
.dish-card { background: #f9f9f9; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.6rem; text-align: center; }
.dish-id { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 0.2rem; }
.dish-name { font-weight: 500; font-size: 0.95rem; }

.actions { margin-top: 1.5rem; display: flex; gap: 1rem; flex-wrap: wrap; }

.table-wrapper { overflow-x: auto; margin: 1rem 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td { border: 1px solid var(--border); padding: 0.5rem; text-align: left; }
.data-table th { background: #f5f5f5; }
.data-table .rank, .data-table .score { font-weight: bold; text-align: center; }
.data-table .disqualified { background: #ffebee; color: #b71c1c; }
.half-tag { display: inline-block; margin-left: 0.3rem; padding: 0.05rem 0.4rem; border-radius: 4px; background: #fff0d6; color: #8a5a00; font-size: 0.75rem; }

.vote-form { margin-top: 1rem; }
.question { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid #eee; }
.question h3, .question h4 { margin: 0 0 0.6rem; font-size: 1rem; }
.qno { display: inline-block; background: var(--primary); color: #fff; border-radius: 999px; padding: 0.1rem 0.5rem; font-size: 0.8rem; margin-right: 0.4rem; }
.qtip { color: var(--muted); font-size: 0.85rem; margin: 0.3rem 0 0.8rem; }

input[type="text"], input[type="tel"], input[type="number"], textarea, select {
  width: 100%; padding: 0.7rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: 1rem; }
input[type="number"] { width: 120px; }

.options { display: flex; flex-direction: column; gap: 0.5rem; }
.options-multi { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.option { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; background: #fff; }
.option:hover { border-color: var(--primary); }
.option input { margin: 0; }
.option.selected { border-color: var(--primary); background: #ffebee; }

.dish-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.5rem; }
.pick-item { display: flex; align-items: center; gap: 0.4rem; padding: 0.5rem; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-size: 0.9rem; background: #fff; }
.pick-item.selected { border-color: var(--primary); background: #ffebee; }
.pick-item input { display: none; }
.pick-item strong { color: var(--muted); font-size: 0.75rem; margin-right: 0.3rem; }

.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list li { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.5rem; background: #fff; cursor: grab; }
.rank-list li:active { cursor: grabbing; }
.rank-list li.sortable-ghost { opacity: 0.4; }
.rank-list li.sortable-chosen { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.rank-list li .rank-handle { color: #aaa; font-size: 1.1rem; margin-right: 0.4rem; cursor: grab; user-select: none; }
.rank-list li .rank-no { font-weight: bold; color: var(--primary); margin-right: 0.5rem; }
.rank-list li .rank-name { flex: 1; }
.rank-list li .rank-btns { display: flex; gap: 0.3rem; }
.rank-list li .rank-btns button { background: #f5f5f5; border: 1px solid var(--border); border-radius: 4px; padding: 0.2rem 0.5rem; cursor: pointer; }
.rank-list li .rank-btns button:disabled { opacity: 0.4; cursor: not-allowed; }
.rank-placeholder { color: var(--muted); justify-content: center !important; cursor: default; }

.branch-note { background: #fff8e1; padding: 0.8rem; border-radius: var(--radius); color: #5d4037; margin-bottom: 1rem; }

.submit-wrap { text-align: center; margin-top: 2rem; }
.submit-note { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }
.vote-closed-note { background: #fff4e0; color: #8a5a00; border: 1px solid #f0d49a; border-radius: 10px; padding: 0.7rem 1rem; margin-bottom: 1rem; font-size: 0.95rem; }
button:disabled.btn-primary { background: #bbb; cursor: not-allowed; }

/* 预测未开放弹窗 */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 16px;
  max-width: 340px;
  width: 100%;
  padding: 1.8rem 1.4rem 1.5rem;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  animation: modalPop 0.22s ease;
}
@keyframes modalPop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-icon { font-size: 3rem; line-height: 1; margin-bottom: 0.4rem; }
.modal-title { font-size: 1.3rem; margin: 0.2rem 0 0.6rem; color: #8a5a00; }
.modal-text { font-size: 1rem; color: #333; margin: 0.2rem 0; }
.modal-text strong { color: var(--primary); }
.modal-sub { font-size: 0.85rem; color: var(--muted); margin: 0.4rem 0 1.2rem; }
.modal-box .btn { width: 100%; }

.success-page { text-align: center; padding: 2rem 1rem; }
.success-icon { font-size: 4rem; color: #4caf50; line-height: 1; }

.admin-page h2 { margin-top: 1.5rem; font-size: 1.2rem; border-left: 4px solid var(--primary); padding-left: 0.5rem; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; }
.card-label { font-size: 0.85rem; color: var(--muted); }
.card-value { font-size: 1.4rem; font-weight: bold; margin-top: 0.3rem; }

.stat-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.stat-list li { display: flex; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px solid #eee; }

.admin-form { background: #f9f9f9; padding: 1rem; border-radius: var(--radius); margin: 1rem 0; }
.admin-form textarea { margin-bottom: 0.8rem; }
.admin-form label { display: block; margin: 0.6rem 0 0.2rem; font-size: 0.9rem; color: #555; }
.admin-form input[type="text"] { width: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.95rem; box-sizing: border-box; margin-bottom: 0.6rem; }
.inline-option { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 1rem; }

.login-page { max-width: 360px; margin: 0 auto; text-align: center; }
.login-form { display: flex; flex-direction: column; gap: 1rem; }

.notice { background: #e3f2fd; padding: 1rem; border-radius: var(--radius); text-align: center; color: #1565c0; }

/* 公信力验证亮点 */
.trust-highlight {
  margin: 1.5rem 0;
  padding: 1.5rem 1.3rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  color: #fff;
  text-align: center;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
}
.trust-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.3rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
  backdrop-filter: blur(4px);
}
.trust-title { font-size: 1.3rem; font-weight: 700; margin: 0.3rem 0 0.6rem; }
.trust-desc { font-size: 0.9rem; line-height: 1.6; margin: 0 0 1rem; opacity: 0.95; }
.trust-desc strong { color: #ffe082; }
.trust-features {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 70px;
}
.trust-icon { font-size: 1.8rem; }
.trust-text { font-size: 0.75rem; opacity: 0.9; }
.trust-verify-btn {
  background: #fff !important;
  color: #5e35b1 !important;
  font-weight: 700;
  border: none;
  width: 100%;
}
.trust-verify-btn:hover { background: #f3e5f5 !important; }

/* 主办方联系方式 */
.contact-box {
  margin-top: 1.5rem;
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
}
.contact-title {
  font-size: 1.1rem;
  margin: 0 0 0.8rem;
  border-left: 4px solid var(--primary);
  padding-left: 0.5rem;
}
.contact-list { list-style: none; padding: 0; margin: 0 0 1rem; text-align: left; }
.contact-list li {
  display: flex;
  gap: 0.4rem;
  padding: 0.35rem 0;
  font-size: 0.95rem;
  text-align: left;
  border-bottom: 1px dashed #eee;
}
.contact-list li:last-child { border-bottom: none; }
.contact-label { color: var(--muted); display: inline-block; width: 8em; flex-shrink: 0; text-align: left; }
.contact-winners { width: 100%; text-align: center; }

/* 中奖名单 */
.winners-table .award-tag {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #f6c453, #e6a817);
  color: #5a3b00;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}
.winners-table .amount-cell { font-weight: 600; }
.winners-note { font-size: 0.85rem; color: var(--muted); margin-top: 0.8rem; line-height: 1.6; }
.forfeit-tag { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 4px; background: #fdecea; color: #c62828; font-size: 0.75rem; margin-left: 0.3rem; }
.forfeit-row { opacity: 0.6; }

/* 后台状态标签 */
.status-tag { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 4px; font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
.status-formal { background: #e8f5e9; color: #2e7d32; }
.status-forfeit { background: #fdecea; color: #c62828; }
.status-reserve { background: #fff3e0; color: #e65100; }
.reserve-row { background: #fafafa; }
.disqualified { opacity: 0.6; }

.footer { text-align: center; padding: 1.5rem 1rem; font-size: 0.85rem; color: var(--muted); }

/* 留言板 */
.msg-form-box { background: #f9f9f9; padding: 1rem; border-radius: var(--radius); margin-bottom: 1.5rem; }
.msg-form-row { display: flex; gap: 0.6rem; margin-bottom: 0.6rem; }
.msg-form-row input { flex: 1; padding: 0.5rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.9rem; }
.msg-form textarea { width: 100%; padding: 0.6rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.95rem; resize: vertical; box-sizing: border-box; }
.msg-form-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 0.5rem; }
.msg-char-count { font-size: 0.8rem; color: var(--muted); }
.msg-list { display: flex; flex-direction: column; gap: 0.8rem; }
.msg-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 1rem; }
.msg-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.msg-nickname { font-weight: 600; color: var(--primary); font-size: 0.9rem; }
.msg-time { font-size: 0.75rem; color: var(--muted); }
.msg-text { font-size: 0.95rem; line-height: 1.6; word-break: break-word; }
.msg-empty { text-align: center; color: var(--muted); padding: 2rem; }
.ann-box { background: #fffbe6; border: 1px solid #ffe58f; border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.5rem; }
.ann-box h2 { margin-top: 0; font-size: 1.2rem; color: #ad6800; }
.ann-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 1rem; margin-bottom: 0.8rem; }
.ann-item:last-child { margin-bottom: 0; }
.ann-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.ann-title { font-weight: 600; font-size: 1rem; }
.ann-time { color: var(--muted); font-size: 0.8rem; }
.ann-text { font-size: 0.95rem; line-height: 1.6; word-break: break-word; white-space: pre-wrap; }
.ann-empty { text-align: center; color: var(--muted); padding: 1rem; }
.msg-load-more { text-align: center; margin-top: 1.5rem; }

/* 回复 */
.msg-actions-bar { margin-top: 0.4rem; }
.reply-toggle-btn { background: none; border: none; color: var(--primary); font-size: 0.8rem; cursor: pointer; padding: 0.2rem 0; }
.reply-toggle-btn:hover { text-decoration: underline; }
.reply-form-box { margin-top: 0.6rem; padding: 0.6rem; background: #f5f5f5; border-radius: 8px; }
.reply-form-box input { width: 100%; padding: 0.4rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.85rem; margin-bottom: 0.4rem; box-sizing: border-box; }
.reply-form-box textarea { width: 100%; padding: 0.4rem; border: 1px solid var(--border); border-radius: 6px; font-size: 0.85rem; resize: vertical; box-sizing: border-box; margin-bottom: 0.4rem; }
.reply-form-bottom { display: flex; gap: 0.4rem; }
.reply-list { margin-top: 0.6rem; padding-left: 0.8rem; border-left: 3px solid #e0e0e0; }
.reply-item { padding: 0.3rem 0; font-size: 0.85rem; display: flex; gap: 0.4rem; align-items: baseline; flex-wrap: wrap; }
.reply-item .reply-nickname { color: var(--primary); font-weight: 600; }
.reply-item .reply-text { flex: 1; min-width: 0; word-break: break-word; }
.reply-item .reply-time { font-size: 0.7rem; color: var(--muted); }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.8rem; }
.btn-danger { background: #e53935; color: #fff; border: none; }
.msg-content { max-width: 200px; word-break: break-word; }
.msg-actions { white-space: nowrap; }

@media (max-width: 480px) {
  .hero-actions, .actions { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; text-align: center; }
  .msg-form-row { flex-direction: column; }
  .msg-actions { display: flex; gap: 0.3rem; }
  .btn-sm { width: auto; }
}

/* ── 关于页面：活动独特之处 ── */
.highlights-section { margin-top: 2rem; }
.highlights-title {
  text-align: center;
  font-size: 1.4rem;
  color: var(--primary-dark);
  margin-bottom: 0.3rem;
}
.highlights-subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}
.highlight-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.8rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.highlight-card-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}
.highlight-card-title strong { color: var(--primary-dark); }
.highlight-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: bold;
  flex-shrink: 0;
}
.highlight-card p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #444;
}
.highlight-card p strong { color: var(--primary-dark); }
