/* ==========================================================================
   民调网 H5 弹性响应式样式表
   配色：主色 #4F46E5（靛蓝） 辅助色 #10B981（绿色） 背景 #F9FAFB
   移动优先：手机端底部导航栏，PC端顶部导航栏
   ========================================================================== */

/* ---------- CSS 变量 ---------- */
:root {
  --color-primary: #4F46E5;
  --color-primary-dark: #4338CA;
  --color-primary-light: #6366F1;
  --color-primary-bg: #EEF2FF;
  --color-secondary: #10B981;
  --color-secondary-dark: #059669;
  --color-secondary-bg: #ECFDF5;
  --color-bg: #F9FAFB;
  --color-surface: #FFFFFF;
  --color-text: #1F2937;
  --color-text-secondary: #6B7280;
  --color-text-light: #9CA3AF;
  --color-border: #E5E7EB;
  --color-border-light: #F3F4F6;
  --color-danger: #EF4444;
  --color-danger-bg: #FEF2F2;
  --color-warning: #F59E0B;
  --color-warning-bg: #FFFBEB;
  --color-info: #3B82F6;
  --color-info-bg: #EFF6FF;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-primary: 0 6px 16px rgba(79, 70, 229, 0.25);

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  --font-xs: 12px;
  --font-sm: 14px;
  --font-md: 16px;
  --font-lg: 18px;
  --font-xl: 22px;
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-dark); }

img { max-width: 100%; height: auto; }

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

/* ---------- 工具类 ---------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-secondary); font-size: var(--font-sm); }
.text-danger { color: var(--color-danger); }
.text-success { color: var(--color-secondary); }

.hidden { display: none !important; }
.invisible { visibility: hidden; }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ---------- 页面布局 ---------- */
.page-wrap {
  min-height: 100vh;
  padding-bottom: 80px; /* 为底部导航栏留空间 */
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ---------- 顶部导航 ---------- */
.nav-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
}

.nav-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  height: 56px;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: var(--font-lg);
  color: var(--color-text);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-search {
  flex: 1;
  max-width: 280px;
  position: relative;
}

.nav-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-light);
  font-size: var(--font-sm);
}

.nav-search input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-bg);
  font-size: var(--font-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nav-search input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
}

.nav-link {
  color: var(--color-text-secondary);
  font-size: var(--font-sm);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-text);
}

/* ---------- 底部导航 ---------- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-around;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  z-index: 100;
}

.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--color-text-secondary);
  font-size: 10px;
  padding: 4px 12px;
  transition: color 0.2s;
}

.bn-item.active {
  color: var(--color-primary);
}

.bn-icon {
  font-size: 20px;
  line-height: 1;
}

.bn-fab {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 300;
  box-shadow: var(--shadow-primary);
  margin-top: -20px;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-body {
  padding: var(--space-md);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-size: var(--font-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  background: var(--color-bg);
  color: var(--color-text);
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn-primary:hover { background: var(--color-primary-dark); }

.btn-secondary {
  background: var(--color-secondary);
  color: #fff;
  border-color: var(--color-secondary);
}

.btn-secondary:hover { background: var(--color-secondary-dark); }

.btn-outline {
  background: transparent;
  border-color: var(--color-border);
  color: var(--color-text-secondary);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-bg);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--color-text-secondary);
}

.btn-ghost:hover { background: var(--color-bg); }

.btn-sm { padding: 6px 12px; font-size: var(--font-xs); }
.btn-lg { padding: 14px 28px; font-size: var(--font-md); }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: var(--space-md); }

.form-label {
  display: block;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
}

.form-label .required { color: var(--color-danger); }

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: var(--font-sm);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.form-textarea { min-height: 100px; resize: vertical; }

.form-hint {
  font-size: var(--font-xs);
  color: var(--color-text-light);
  margin-top: 4px;
}

/* ---------- 单选/复选卡片 ---------- */
.radio-group, .checkbox-group {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.radio-group-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-sm); }

.radio-card, .checkbox-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-sm);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.radio-card input, .checkbox-card input {
  position: absolute;
  opacity: 0;
}

.radio-card:has(input:checked), .checkbox-card:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
}

.rc-title { font-size: var(--font-sm); font-weight: 600; color: var(--color-text); }
.rc-desc { font-size: var(--font-xs); color: var(--color-text-secondary); margin-top: 2px; }

/* ---------- Switch ---------- */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--color-border);
  border-radius: var(--radius-full);
  transition: background 0.3s;
}

.switch-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: var(--shadow-sm);
}

.switch input:checked + .switch-slider { background: var(--color-primary); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--color-surface);
  color: var(--color-text);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: var(--font-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.3s ease;
  pointer-events: auto;
  border: 1px solid var(--color-border);
}

.toast.success { border-left: 4px solid var(--color-secondary); }
.toast.error { border-left: 4px solid var(--color-danger); }
.toast.warning { border-left: 4px solid var(--color-warning); }
.toast.info { border-left: 4px solid var(--color-info); }

.toast.fade-out { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-10px); }
}

/* ---------- Loading ---------- */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- 首页统计栏 ---------- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

@media (min-width: 640px) {
  .stats-bar {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stats-item {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: all 0.2s;
}

.stats-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stats-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stats-icon.primary {
  background: var(--color-primary-bg);
}

.stats-icon.secondary {
  background: var(--color-secondary-bg);
}

.stats-num {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.stats-label {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
}

/* ---------- 首页民调列表 ---------- */
.poll-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-md) 0;
}

.poll-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  padding: var(--space-md);
  transition: all 0.2s;
  cursor: pointer;
}

.poll-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

/* ---------- 民调卡片头部：标题 + 类型标签 ---------- */
.poll-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.poll-title {
  flex: 1;
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

.poll-type-badge {
  flex-shrink: 0;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.6;
}

.poll-type-badge.single {
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

.poll-type-badge.multiple {
  background: var(--color-secondary-bg);
  color: var(--color-secondary-dark);
}

/* ---------- 民调简介 ---------- */
.poll-desc {
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-sm);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 民调元信息 ---------- */
.poll-meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--font-xs);
  color: var(--color-text-light);
  flex-wrap: wrap;
  margin-bottom: var(--space-xs);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

/* ---------- 标签 ---------- */
.poll-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-sm);
}

/* ---------- 状态行（我的民调） ---------- */
.poll-status-row {
  margin-bottom: var(--space-xs);
}

.poll-status-badge-mini {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
}

.poll-status-badge-mini.status-active {
  background: rgba(16, 185, 129, 0.15);
  color: #10B981;
}

.poll-status-badge-mini.status-pending {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
}

.poll-status-badge-mini.status-closed {
  background: rgba(107, 114, 128, 0.15);
  color: #6B7280;
}

.poll-status-badge-mini.status-draft {
  background: rgba(107, 114, 128, 0.15);
  color: #6B7280;
}

.tag-mini {
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--color-text-secondary);
  transition: all 0.2s;
}

.tag-mini:hover {
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

/* ---------- 卡片底部操作栏 ---------- */
.poll-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border-light);
}

.poll-card-stats {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-border-light);
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-weight: 500;
}

/* ---------- 详情页 ---------- */
.detail-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
}

.detail-hero h1 {
  font-size: var(--font-xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.detail-desc {
  font-size: var(--font-sm);
  opacity: 0.9;
  margin-bottom: var(--space-md);
  line-height: 1.6;
}

.detail-badge {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.detail-badge span {
  font-size: var(--font-xs);
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(4px);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  font-size: var(--font-xs);
  opacity: 0.85;
}

/* ---------- 区域标题 ---------- */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.section-title h2 {
  font-size: var(--font-lg);
  font-weight: 700;
  color: var(--color-text);
}

/* ---------- 详情页工具栏 ---------- */
.detail-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

/* ---------- 排序控件 ---------- */
.sort-control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
}

.sort-label {
  white-space: nowrap;
  font-size: var(--font-xs);
}

.sort-control select {
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  font-size: var(--font-xs);
  color: var(--color-text);
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.sort-control select:focus {
  border-color: var(--color-primary);
}

/* ---------- 首页标签页 ---------- */
.home-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  border-bottom: 2px solid var(--color-border-light);
}

.home-tab {
  padding: 10px 16px;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
}

.home-tab:hover {
  color: var(--color-primary);
}

.home-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* ---------- 详情页管理操作栏 ---------- */
.detail-admin-bar .btn-outline {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  backdrop-filter: blur(4px);
}

.detail-admin-bar .btn-outline:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}

.detail-admin-bar .btn-outline#deletePollBtn {
  border-color: rgba(239, 68, 68, 0.6);
  color: #FECACA;
}

.detail-admin-bar .btn-outline#deletePollBtn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.8);
  color: #fff;
}

/* ---------- 状态标签 ---------- */
.poll-status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
}

.poll-status-badge.status-active {
  background: rgba(16, 185, 129, 0.2);
  color: #10B981;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.poll-status-badge.status-pending {
  background: rgba(245, 158, 11, 0.2);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.poll-status-badge.status-closed {
  background: rgba(107, 114, 128, 0.2);
  color: #6B7280;
  border: 1px solid rgba(107, 114, 128, 0.4);
}

.poll-status-badge.status-draft {
  background: rgba(107, 114, 128, 0.2);
  color: #6B7280;
  border: 1px solid rgba(107, 114, 128, 0.4);
}

/* ---------- 管理员状态切换 ---------- */
.admin-status-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  padding: 4px 10px;
  backdrop-filter: blur(4px);
}

.admin-status-switch .text-muted {
  color: rgba(255, 255, 255, 0.8);
}

.admin-status-switch select {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.admin-status-switch select option {
  color: #1F2937;
}

/* ---------- 创建者工具栏 ---------- */
.creator-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-info-bg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

/* ---------- 选项卡片 ---------- */
.option-card {
  position: relative;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
}

.option-card:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-sm);
}

.option-card.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
}

.option-card.voted {
  cursor: default;
}

.option-card.my-choice {
  border-color: var(--color-secondary);
  background: var(--color-secondary-bg);
}

.option-card.correct-answer {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 2px var(--color-secondary-bg);
}

.option-progress-bg {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--color-primary-bg);
  opacity: 0.3;
  transition: width 0.5s ease;
  pointer-events: none;
}

.option-content {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  z-index: 1;
}

.option-radio {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.2s;
}

.option-card.multiple .option-radio {
  border-radius: var(--radius-sm);
}

.option-card.selected .option-radio {
  border-color: var(--color-primary);
  background: var(--color-primary);
  box-shadow: inset 0 0 0 3px #fff;
}

.option-main { flex: 1; min-width: 0; }

.option-text {
  font-weight: 500;
  font-size: var(--font-sm);
  color: var(--color-text);
  word-break: break-word;
}

.option-desc {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}

.option-stats {
  text-align: right;
  flex-shrink: 0;
  min-width: 60px;
}

.option-percent {
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--color-primary);
}

.option-vote-count {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
}

.option-media {
  margin-top: var(--space-sm);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.option-image {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  margin-top: var(--space-sm);
}

.option-video, .option-audio {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-top: var(--space-sm);
}

.option-location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--space-sm);
  padding: 4px 10px;
  background: var(--color-info-bg);
  color: var(--color-info);
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  cursor: pointer;
}

.option-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--space-sm);
  padding: 4px 10px;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
}

.option-rank {
  position: absolute;
  top: -8px;
  left: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xs);
  font-weight: 700;
  color: #fff;
  z-index: 2;
}

.option-rank.rank-1 { background: linear-gradient(135deg, #FBBF24, #F59E0B); }
.option-rank.rank-2 { background: linear-gradient(135deg, #9CA3AF, #6B7280); }
.option-rank.rank-3 { background: linear-gradient(135deg, #D97706, #B45309); }

.answer-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  background: var(--color-secondary-bg);
  color: var(--color-secondary-dark);
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  font-weight: 500;
  margin-left: 6px;
  vertical-align: middle;
}

/* ---------- 选项进度状态颜色 ---------- */
.option-card.status-green,
.img-gallery-item.status-green,
.video-gallery-item.status-green,
.grid-shuffle-item.status-green {
  background: linear-gradient(135deg, rgba(16,185,129,0.08) 0%, rgba(16,185,129,0.04) 100%);
  border-color: rgba(16,185,129,0.35);
}

.option-card.status-yellow,
.img-gallery-item.status-yellow,
.video-gallery-item.status-yellow,
.grid-shuffle-item.status-yellow {
  background: linear-gradient(135deg, rgba(245,158,11,0.08) 0%, rgba(245,158,11,0.04) 100%);
  border-color: rgba(245,158,11,0.35);
}

.option-card.status-red,
.img-gallery-item.status-red,
.video-gallery-item.status-red,
.grid-shuffle-item.status-red {
  background: linear-gradient(135deg, rgba(239,68,68,0.08) 0%, rgba(239,68,68,0.04) 100%);
  border-color: rgba(239,68,68,0.35);
}

/* 进度状态 + 选中态兼容 */
.option-card.status-green.selected,
.option-card.status-yellow.selected,
.option-card.status-red.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

/* ---------- 民调操作栏 ---------- */
.vote-action-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.vote-action-bar .selected-info {
  flex: 1;
  font-size: var(--font-sm);
  color: var(--color-text);
}

.vote-action-bar .text-light {
  font-size: var(--font-xs);
  color: var(--color-text-light);
  white-space: nowrap;
}

.vote-action-bar-bottom {
  position: sticky;
  bottom: 72px;
  margin-top: var(--space-md);
  margin-bottom: var(--space-md);
  border-color: var(--color-border);
  box-shadow: var(--shadow-md);
  z-index: 50;
}

/* ---------- 已民调横幅 ---------- */
.voted-banner {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-secondary-bg);
  border: 1px solid var(--color-secondary);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
}

.voted-banner-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-secondary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.voted-banner-text {
  flex: 1;
}

.voted-banner-title {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--color-secondary-dark);
}

.voted-banner-sub {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* ---------- 图表 ---------- */
.chart-bar {
  display: flex;
  align-items: flex-end;
  gap: var(--space-sm);
  padding: var(--space-md);
  height: 200px;
}

.chart-bar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.chart-bar-fill {
  width: 100%;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 0.5s ease;
  min-height: 4px;
}

.chart-bar-label {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-bar-count {
  font-size: var(--font-xs);
  font-weight: 600;
  color: var(--color-text);
}

.chart-bar-pct {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
}

.chart-pie-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-md);
}

.chart-pie-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-xs);
}

.chart-pie-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-pie-legend-text {
  color: var(--color-text);
  font-weight: 500;
}

.chart-pie-legend-value {
  color: var(--color-text-secondary);
}

/* ---------- 模态框 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-border-light);
}

.modal-header h3 { font-size: var(--font-md); font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--color-text-secondary);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.modal-close:hover { background: var(--color-bg); }

.modal-body {
  padding: var(--space-md);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-top: 1px solid var(--color-border-light);
}

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center;
  padding: var(--space-xl) var(--space-md);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
}

.empty-text {
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

/* ---------- 分割线 ---------- */
.divider {
  height: 1px;
  background: var(--color-border-light);
  margin: var(--space-md) 0;
}

/* ---------- 用户资料页 ---------- */
.profile-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  padding: var(--space-lg) var(--space-md);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  border: 3px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.profile-info h2 {
  font-size: var(--font-lg);
  font-weight: 700;
  margin-bottom: 2px;
  color: #fff;
}

.profile-sub {
  font-size: var(--font-sm);
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.4;
}

.profile-stats {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-sm);
}

.ps-item {
  text-align: center;
}

.ps-num {
  font-size: var(--font-lg);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.ps-label {
  font-size: var(--font-xs);
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

/* ---------- 快捷操作 ---------- */
.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.profile-actions .btn {
  font-size: var(--font-sm);
  padding: 8px 14px;
}

/* ---------- 标签页 ---------- */
.profile-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  border-bottom: 2px solid var(--color-border-light);
}

.pt-item {
  padding: 10px 16px;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
}

.pt-item:hover {
  color: var(--color-primary);
}

.pt-item.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.profile-name {
  font-size: var(--font-xl);
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.profile-role {
  font-size: var(--font-sm);
  opacity: 0.85;
}

/* ---------- 统计卡片 ---------- */
.stat-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  border: 1px solid var(--color-border-light);
}

.stat-value {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--color-primary);
}

.stat-label {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  margin-top: 4px;
}

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-sm);
}

th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--color-border-light);
}

th {
  background: var(--color-bg);
  font-weight: 600;
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:hover td { background: var(--color-bg); }

/* ---------- 分页 ---------- */
.load-more {
  display: flex;
  justify-content: center;
  padding: var(--space-md) 0;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-md) 0;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover, .page-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- 响应式 ---------- */
@media (min-width: 768px) {
  .container { max-width: 720px; }
  .bottom-nav { display: none; }
  .page-wrap { padding-bottom: 0; }
}

@media (max-width: 767px) {
  .nav-search { display: none; }
  .nav-actions .nav-link { display: none; }
  .nav-header { position: fixed; top: 0; left: 0; right: 0; }
  .page-wrap { padding-top: 56px; }
}

/* ---------- 动画 ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.3s ease; }
.slide-up { animation: slideUp 0.4s ease; }

/* ---------- 防刷提示 ---------- */
.anti-fraud-tip {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-warning-bg);
  border-radius: var(--radius-md);
  font-size: var(--font-sm);
  color: var(--color-warning);
  margin-bottom: var(--space-md);
}

/* ---------- 倒计时覆盖层 ---------- */
.countdown-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.countdown-number {
  font-size: 80px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  font-size: var(--font-md);
  opacity: 0.8;
  margin-top: var(--space-md);
}

/* ---------- 背景图片支持 ---------- */
.bg-image-body {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

.bg-image-body .card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}

.bg-image-body .detail-hero {
  background: rgba(79, 70, 229, 0.85);
  backdrop-filter: blur(4px);
}

/* ---------- 密码门 ---------- */
.password-gate {
  max-width: 420px;
  margin: 60px auto;
  text-align: center;
}

.password-gate input {
  text-align: center;
  letter-spacing: 8px;
  font-size: var(--font-lg);
}

/* ---------- 实名投票者 ---------- */
.realname-voters-toggle {
  cursor: pointer;
  user-select: none;
}

.realname-voters-list {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
}

.realname-voter-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.realname-voter-item:last-child {
  border-bottom: none;
}

.realname-voter-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xs);
  font-weight: 600;
  flex-shrink: 0;
}

/* ---------- 管理后台 ---------- */
.admin-table-row {
  cursor: pointer;
  transition: background 0.2s;
}

.admin-table-row:hover {
  background: var(--color-primary-bg);
}

/* ---------- 创建页选项编辑器 ---------- */
.option-editor-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-sm) var(--space-sm);
  margin-bottom: var(--space-sm);
  position: relative;
  transition: border-color 0.2s;
}

.option-editor-item:hover {
  border-color: var(--color-primary-light);
}

.opt-index {
  position: absolute;
  top: -8px;
  left: 12px;
  background: var(--color-primary);
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
}

.opt-row {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-xs);
}

.opt-text {
  flex: 1;
}

.opt-actions {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  z-index: 2;
}

.opt-answer {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  cursor: pointer;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text-secondary);
  transition: all 0.2s;
}

.opt-answer:hover {
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.opt-answer.active {
  background: var(--color-warning-bg);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.opt-media-inputs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xs);
}

.opt-media-inputs input {
  font-size: var(--font-xs);
  padding: 6px 10px;
}

/* ---------- 问答结果 ---------- */
.quiz-result-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-light);
  margin-bottom: var(--space-md);
}

.quiz-result-item {
  text-align: center;
}

.quiz-result-label {
  display: block;
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.quiz-result-value {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--color-primary);
}

.quiz-result-divider {
  width: 1px;
  height: 40px;
  background: var(--color-border);
}

/* ---------- 高级设置标记 ---------- */
.advanced-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: linear-gradient(135deg, #8B5CF6, #7C3AED);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: var(--font-xs);
  font-weight: 500;
}

/* ---------- 导出按钮区域 ---------- */
.export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-warning-bg);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  border: 1px solid #FDE68A;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* ---------- 选项创建者操作按钮 ---------- */
.option-creator-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: var(--space-sm);
}

/* ---------- 相关推荐 ---------- */
.related-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.related-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  transition: all 0.2s;
  text-decoration: none;
  color: var(--color-text);
}

.related-item:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

.ri-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.ri-title {
  flex: 1;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ri-votes {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

/* ================================================================
   展示模板样式：图片画廊 / 视频画廊 / 九宫格
   ================================================================ */

/* ---------- 通用网格容器 ---------- */
.img-gallery,
.video-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

@media (min-width: 768px) {
  .img-gallery,
  .video-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- 图片画廊 ---------- */
.img-gallery-item {
  position: relative;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.img-gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.img-gallery-item.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg), var(--shadow-md);
}

.img-gallery-item.voted {
  cursor: default;
}

.img-gallery-item.my-choice {
  border-color: var(--color-secondary);
}

.img-gallery-item.correct-answer {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 2px var(--color-secondary-bg);
}

.img-gallery-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg);
}

.img-gallery-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.img-gallery-item:hover .img-gallery-img-wrap img {
  transform: scale(1.05);
}

.img-gallery-zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 24px;
  opacity: 0;
  transition: opacity 0.2s;
  cursor: zoom-in;
}

.img-gallery-img-wrap:hover .img-gallery-zoom {
  opacity: 1;
}

.img-gallery-info {
  padding: var(--space-sm) var(--space-md) var(--space-md);
  text-align: center;
}

.img-gallery-text {
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--color-text);
  line-height: 1.4;
  word-break: break-word;
}

.img-gallery-desc {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  margin-top: 4px;
  line-height: 1.4;
}

.img-gallery-progress {
  height: 4px;
  background: var(--color-border-light);
  border-radius: var(--radius-full);
  margin-top: var(--space-sm);
  overflow: hidden;
}

.img-gallery-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.img-gallery-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  font-size: var(--font-xs);
}

.img-gallery-pct {
  font-weight: 700;
  color: var(--color-primary);
}

.img-gallery-count {
  color: var(--color-text-secondary);
}

/* ---------- 视频画廊 ---------- */
.video-gallery-item {
  position: relative;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.video-gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.video-gallery-item.selected {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg), var(--shadow-md);
}

.video-gallery-item.voted {
  cursor: default;
}

.video-gallery-item.my-choice {
  border-color: var(--color-secondary);
}

.video-gallery-item.correct-answer {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 2px var(--color-secondary-bg);
}

.video-gallery-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #1F2937, #374151);
}

.video-gallery-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-gallery-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: background 0.2s;
}

.video-gallery-play:hover {
  background: rgba(0, 0, 0, 0.5);
}

.video-gallery-play svg {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
  transition: transform 0.2s;
}

.video-gallery-play:hover svg {
  transform: scale(1.1);
}

.video-gallery-info {
  padding: var(--space-sm) var(--space-md) var(--space-md);
  text-align: center;
}

.video-gallery-text {
  font-weight: 600;
  font-size: var(--font-sm);
  color: var(--color-text);
  line-height: 1.4;
  word-break: break-word;
}

.video-gallery-desc {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  margin-top: 4px;
  line-height: 1.4;
}

.video-gallery-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  font-size: var(--font-xs);
}

.video-gallery-pct {
  font-weight: 700;
  color: var(--color-primary);
}

.video-gallery-count {
  color: var(--color-text-secondary);
}

/* ---------- 九宫格 ---------- */
.grid-shuffle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

@media (max-width: 480px) {
  .grid-shuffle {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-shuffle-item {
  position: relative;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
  cursor: pointer;
  transition: all 0.25s ease;
  border: 2px solid transparent;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.grid-shuffle-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 0;
}

.grid-shuffle-item:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}

.grid-shuffle-item.selected {
  border-color: #fff;
  box-shadow: 0 0 0 3px var(--color-primary), var(--shadow-md);
}

.grid-shuffle-item.voted {
  cursor: default;
}

.grid-shuffle-item.my-choice {
  border-color: var(--color-secondary);
}

.grid-shuffle-item.correct-answer {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 2px var(--color-secondary-bg);
}

.grid-shuffle-num {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  z-index: 1;
}

.grid-answer {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-secondary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 1;
}

.grid-shuffle-text {
  position: relative;
  z-index: 1;
  color: #fff;
  font-weight: 600;
  font-size: var(--font-sm);
  text-align: center;
  line-height: 1.3;
  word-break: break-word;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.grid-shuffle-pct {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: var(--font-xl);
  font-weight: 700;
  margin-top: 4px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.grid-shuffle-count {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--font-xs);
  margin-top: 2px;
}

/* ---------- 创建页4列模板选择 ---------- */
.radio-group-4 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

@media (min-width: 640px) {
  .radio-group-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ---------- 创建页开关行 ---------- */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.switch-row:last-child {
  border-bottom: none;
}

.switch-label {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--color-text);
}

.switch-hint {
  font-size: var(--font-xs);
  color: var(--color-text-light);
  margin-top: 2px;
  line-height: 1.4;
}

/* ---------- 创建页选项编辑器增强 ---------- */
.opt-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-left: 28px;
}

.opt-fields .form-input {
  font-size: var(--font-xs);
  padding: 8px 12px;
}

.opt-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-danger);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}

.opt-remove:hover {
  transform: scale(1.15);
}

.opt-location-row {
  position: relative;
}

/* ---------- 创建页表单行 ---------- */
.form-row {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* ---------- 创建页步骤标题 ---------- */
.create-step-title {
  font-size: var(--font-md);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: 8px;
}

.create-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

/* ---------- 创建页提交按钮区 ---------- */
.create-submit-bar {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

/* ---------- 地图模板 ---------- */
.map-template {
  margin-bottom: var(--space-md);
}

.map-template-map {
  width: 100%;
  height: 400px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  z-index: 1;
}

.map-template-legend {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) 0;
}

.map-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-text-light);
  font-size: var(--font-sm);
  padding: var(--space-xl);
}

/* 百度地图标记编号样式（已弃用，保留兼容） */
.map-marker-label {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* 百度地图信息窗口样式 */
.BMap_bubble_content {
  overflow: hidden;
}

/* 无位置选项列表 */
.map-template-nogeo {
  margin-top: var(--space-md);
}

.map-template-nogeo-title {
  font-size: var(--font-sm);
  color: var(--color-text-light);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--color-border-light);
}

.map-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
}

.map-item:hover {
  border-color: var(--color-primary-light);
  box-shadow: var(--shadow-sm);
}

.map-item.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
}

.map-item-info {
  flex: 1;
  min-width: 0;
}

.map-item-text {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
}

.map-item-desc {
  font-size: var(--font-xs);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.map-item-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.map-item-pct {
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--color-primary);
}

.map-item-count {
  font-size: var(--font-xs);
  color: var(--color-text-light);
}

/* ---------- 地图选项缩略图 ---------- */
.map-item-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-bg);
  cursor: pointer;
}

.map-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-item-thumb.video-thumb {
  position: relative;
  background: #000;
}

.map-item-thumb.video-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
}

.thumb-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- 百度地图投票按钮 ---------- */
.map-vote-btn:hover {
  background: #4338CA !important;
}
.map-vote-btn:active {
  background: #3730A3 !important;
}

/* ---------- 登录/注册页 ---------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg) var(--space-md);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-xl) var(--space-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.auth-logo img {
  display: block;
  margin: 0 auto var(--space-sm);
}

.auth-logo h1 {
  font-size: var(--font-xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.auth-logo p {
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
}

.auth-tabs {
  display: flex;
  gap: var(--space-xs);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: var(--space-lg);
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 10px;
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--color-surface);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.pwd-toggle {
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}
