:root {
  --bg: #f5f7fb;
  --text: #172033;
  --muted: #697386;
  --line: #e5e9f0;
  --primary: #1677ff;
  --green: #16a34a;
  --danger: #dc2626;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  min-height: 100vh;
  padding: 14px 14px 88px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.top-nav {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  min-height: 44px;
  margin: -4px 0 14px;
}

.top-nav-title {
  margin: 0;
  overflow: hidden;
  font-size: 1.125rem;
  font-weight: 750;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 38px;
  color: var(--primary);
  font-size: 0.9375rem;
}

.back-arrow {
  margin: -2px 4px 0 0;
  font-size: 1.8rem;
  font-weight: 300;
  line-height: 1;
}

.top-nav-side {
  width: 72px;
}

.title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 750;
}

.section-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
}

.page-intro {
  margin: -2px 0 16px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.card {
  margin-bottom: 12px;
  padding: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-card {
  min-height: 180px;
  padding: 20px 18px;
}

.article-header {
  padding: 20px 18px;
  text-align: center;
}

.article-title {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.45;
}

.vote-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.vote-stat-card {
  padding: 15px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.vote-stat-card span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.vote-stat-card strong {
  color: var(--text);
  font-size: 1.2rem;
}

.vote-stat-card small {
  margin-left: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
}

.empty-state {
  padding: 32px 20px;
  text-align: center;
}

.empty-state h2 {
  margin: 12px 0 6px;
  font-size: 1.0625rem;
}

.empty-state .sub {
  margin-bottom: 20px;
  line-height: 1.6;
}

.empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 750;
  background: #eaf3ff;
  border-radius: 50%;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.nav-item {
  min-height: 82px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.nav-item strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1rem;
}

.nav-item span {
  color: var(--muted);
  font-size: 0.8125rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  color: #fff;
  font-size: 1rem;
  font-weight: 650;
  background: var(--primary);
  border: 0;
  border-radius: 6px;
}

.button.secondary {
  color: var(--primary);
  background: #eaf3ff;
}

.button.danger {
  background: var(--danger);
}

.button[disabled] {
  opacity: 0.55;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: #374151;
  font-size: 0.875rem;
}
.inline-field { display:flex; gap:8px; }
.inline-field .input { flex:1; min-width:0; }
.button.compact { width:auto; min-width:112px; white-space:nowrap; }
.image-picker { position:relative; min-height:120px; overflow:hidden; border:1px dashed #b9c2d0; border-radius:8px; background:#f8fafc; }
.image-picker input[type="file"] { position:absolute; inset:0; z-index:2; width:100%; opacity:0; cursor:pointer; }
.image-preview { display:flex; align-items:center; justify-content:center; min-height:120px; color:var(--muted); }
.image-preview img { width:100%; height:180px; object-fit:cover; }
.image-uploading,.image-uploaded { position:absolute; left:8px; bottom:8px; z-index:3; padding:4px 8px; color:#fff; font-size:12px; background:rgba(23,32,51,.72); border-radius:4px; }
.image-uploaded { background:rgba(22,163,74,.88); }
.image-remove { position:absolute; top:7px; right:7px; z-index:3; width:28px; height:28px; padding:0; color:#fff; font-size:22px; line-height:26px; background:var(--danger); border:0; border-radius:50%; }
.detail-list { margin-top:10px; }
.detail-row { display:flex; justify-content:space-between; gap:20px; padding:12px 0; border-bottom:1px solid var(--line); }
.detail-row:last-child { border-bottom:0; }
.detail-row span { color:var(--muted); }
.detail-row strong { text-align:right; }

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.textarea {
  min-height: 100px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-item {
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.list-item h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.candidate-item {
  display: grid;
  grid-template-columns: auto 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  cursor: pointer;
}

.candidate-checkbox {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--primary);
}

.candidate-photo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  overflow: hidden;
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 700;
  background: #eaf3ff;
  border-radius: 8px;
}

.candidate-avatar {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.candidate-photo.has-image .candidate-avatar-fallback {
  visibility: hidden;
}

.candidate-content,
.candidate-intro {
  display: block;
  min-width: 0;
}

.candidate-content strong {
  line-height: 1.45;
}

.candidate-intro {
  margin-top: 6px;
  overflow-wrap: anywhere;
  line-height: 1.5;
}

.candidate-result-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.candidate-result-item h3 {
  margin-bottom: 6px;
  line-height: 1.45;
}

.candidate-result-item .meta {
  margin-bottom: 10px;
}

.vote-progress {
  height: 8px;
  overflow: hidden;
  background: #eef2f7;
  border-radius: 99px;
}

.vote-progress > div {
  height: 100%;
}

.notice-item h3 {
  margin: 0;
  line-height: 1.55;
}

.notice-item-with-cover {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.notice-cover {
  width: 112px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
}

.meta {
  color: var(--muted);
  font-size: 0.8125rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  color: var(--primary);
  font-size: 0.75rem;
  background: #eaf3ff;
  border-radius: 999px;
}

.bottom-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
}

.rich {
  color: #293244;
  line-height: 1.75;
}

.rich img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px auto;
  border-radius: 6px;
}

.toast {
  position: fixed;
  bottom: 18%;
  left: 50%;
  z-index: 99;
  max-width: 78vw;
  padding: 10px 14px;
  color: #fff;
  font-size: 0.875rem;
  background: rgba(17, 24, 39, 0.9);
  border-radius: 6px;
  opacity: 0;
  transform: translateX(-50%) translateY(10px);
  transition: all 0.2s ease;
}

.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 640px) {
  .page {
    max-width: 520px;
    margin: 0 auto;
  }

  .bottom-bar {
    right: 50%;
    left: 50%;
    width: 520px;
    margin-left: -260px;
  }
}
.rich, .rich-content, #additionalVoteContent { overflow-wrap: anywhere; }
.rich .table-scroll, .rich-content .table-scroll, #additionalVoteContent .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rich table, .rich-content table, #additionalVoteContent table { width: 100%; min-width: 420px; border-collapse: collapse; background: #fff; }
.rich th, .rich td, .rich-content th, .rich-content td, #additionalVoteContent th, #additionalVoteContent td { padding: 9px 10px; border: 1px solid #cbd5e1; text-align: left; vertical-align: top; }
.rich th, .rich-content th, #additionalVoteContent th { background: #f1f5f9; font-weight: 700; }
#additionalVoteCard { margin-top: 18px; }
