/* 早安南充选题原型 · 基础与外壳 */
:root {
  --brand: #2f6bff;
  --brand-2: #5b8cff;
  --brand-deep: #1746c7;
  --sky: #eaf4ff;
  --bg: #f4f8ff;
  --ink: #12213f;
  --ink-2: #344563;
  --muted: #71809c;
  --faint: #98a5b9;
  --line: #e3edfb;
  --pink: #ff5b8a;
  --orange: #ff9f43;
  --teal: #22c7a9;
  --purple: #8b6cff;
  --green: #20b486;
  --danger: #ef4b5f;
  --shadow: 0 10px 30px rgba(30, 74, 150, .10);
  --shadow-soft: 0 4px 16px rgba(30, 74, 150, .06);
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --kai: "STKaiti", "KaiTi", "Kaiti SC", "Songti SC", serif;
  --type-scale: 1;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 600px at 8% 8%, #dcecff 0, transparent 55%),
    radial-gradient(900px 700px at 94% 88%, #e5f4ff 0, transparent 55%),
    #eef4ff;
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
svg { display: block; }
::selection { background: rgba(47, 107, 255, .2); }

.tabbar { display: none; }

/* 底部导航 */
.tabbar {
  flex: 0 0 92px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 2px;
  padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid #e8f0fc;
  backdrop-filter: blur(18px);
  z-index: 30;
}
.tabbar.two-tabs { grid-template-columns: repeat(2, 1fr); }
.tab {
  border: 0;
  background: transparent;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  color: #91a0b6;
  font-size: calc(9px * var(--type-scale));
  font-weight: 600;
  padding: 3px 0 2px;
  position: relative;
  white-space: nowrap;
}
.tab svg { width: 23px; height: 23px; }
.tab.is-active { color: var(--brand); font-weight: 800; }
.tab.is-active::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 16px;
  height: 3px;
  border-radius: 3px;
  background: var(--brand);
}
.tab.center-tab { justify-content: flex-end; }
.tab.center-tab .tab-icon {
  width: 44px;
  height: 44px;
  margin-top: -25px;
  margin-bottom: 2px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #6d9cff, #2f6bff);
  border: 4px solid #fff;
  box-shadow: 0 8px 18px rgba(47, 107, 255, .36);
}
.tab.center-tab .tab-icon svg { width: 22px; height: 22px; }
.tab.center-tab.is-active::after { display: none; }
.tab-badge {
  position: absolute;
  top: 3px;
  right: 22%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pink);
  border: 1.5px solid #fff;
}

/* 通用组件 */
.screen {
  min-height: 100%;
  background: #f6f9ff;
  animation: screen-in .28s ease both;
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.page-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 249, 255, .94);
  backdrop-filter: blur(16px);
  padding: 10px 16px 10px;
}
.page-head .head-actions { flex: 0 0 auto; }
.page-head .head-actions .primary-btn { white-space: nowrap; }
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.page-head h1 { margin: 0; font-size: calc(21px * var(--type-scale)); font-weight: 900; letter-spacing: -.04em; }
.page-head p { margin: 4px 0 0; font-size: calc(10.5px * var(--type-scale)); color: var(--muted); }
.page-head .head-sub { font-size: calc(10px * var(--type-scale)); color: var(--faint); }
.head-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #e1ebf9;
  background: #fff;
  display: grid;
  place-items: center;
  color: #53627b;
  box-shadow: 0 3px 10px rgba(30, 74, 150, .04);
  transition: .2s ease;
}
.icon-btn:hover { color: var(--brand); border-color: #c8dbf7; }
.icon-btn svg { width: 18px; height: 18px; }
.text-btn {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: calc(11px * var(--type-scale));
  font-weight: 800;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.text-btn svg { width: 14px; height: 14px; }
.primary-btn {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #5b8cff, #2f6bff);
  color: #fff;
  font-size: calc(14px * var(--type-scale));
  font-weight: 800;
  padding: 13px 18px;
  box-shadow: 0 8px 20px rgba(47, 107, 255, .24);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.primary-btn:active { transform: translateY(1px) scale(.995); }
.primary-btn svg { width: 17px; height: 17px; }
.secondary-btn {
  border: 1px solid #d9e7fa;
  border-radius: 14px;
  background: #fff;
  color: #4e5f7a;
  font-size: calc(13px * var(--type-scale));
  font-weight: 800;
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.secondary-btn svg { width: 16px; height: 16px; }
.full-btn { width: 100%; }
.section { margin-top: 18px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.section-head h2 {
  margin: 0;
  font-size: calc(15px * var(--type-scale));
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: -.02em;
}
.section-head h2::before {
  content: "";
  width: 4px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, #6d9cff, #2f6bff);
}
.section-head .section-link {
  border: 0;
  background: transparent;
  color: #8f9db2;
  font-size: calc(10.5px * var(--type-scale));
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
}
.section-head .section-link svg { width: 13px; height: 13px; }
.tag {
  display: inline-flex;
  align-items: center;
  font-size: calc(9.5px * var(--type-scale));
  line-height: 1;
  color: #74839a;
  background: #f2f6fd;
  border-radius: 6px;
  padding: 5px 6px;
  white-space: nowrap;
}
.tag.hot { color: #ff5b4a; background: #fff0ed; font-weight: 800; }
.tag.blue { color: var(--brand); background: #eaf3ff; font-weight: 800; }
.tag.green { color: #0e9b73; background: #e8faf4; font-weight: 800; }
.tag.orange { color: #c86a0a; background: #fff5e7; font-weight: 800; }
.tag.gray { color: #75849a; background: #f1f4f9; }
.district-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: calc(10px * var(--type-scale));
  font-weight: 700;
  color: #fff;
  background: rgba(13, 29, 55, .52);
  border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 5px 8px;
}
.district-pill svg { width: 11px; height: 11px; }
.bookmark-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #e3edfb;
  background: #fff;
  display: grid;
  place-items: center;
  color: #93a2b7;
  transition: .2s ease;
  flex: 0 0 auto;
}
.bookmark-btn svg { width: 17px; height: 17px; }
.bookmark-btn.is-on { color: var(--brand); background: #eaf3ff; border-color: #cfe1ff; }
.bookmark-btn:hover { color: var(--brand); border-color: #cfe1ff; }
.empty {
  margin: 24px 16px;
  background: #fff;
  border: 1px dashed #d9e7f9;
  border-radius: 18px;
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .empty-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 12px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #edf5ff;
  color: var(--brand);
}
.empty .empty-icon svg { width: 24px; height: 24px; }
.empty h3 { margin: 0; font-size: calc(14px * var(--type-scale)); color: var(--ink-2); }
.empty p { margin: 6px 0 14px; font-size: calc(11px * var(--type-scale)); line-height: 1.6; }
.hidden { display: none !important; }
.divider { height: 1px; background: #edf3fc; margin: 12px 0; }
.muted { color: var(--muted); }
.small { font-size: calc(10.5px * var(--type-scale)); }
.strong { font-weight: 800; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pre-wrap { white-space: pre-wrap; }

/* 弹层 */
#modal-root { position: absolute; inset: 0; z-index: 70; pointer-events: none; }
#modal-root:has(.modal-backdrop) { pointer-events: auto; }
#modal-root:has(.video-screen) { pointer-events: auto; }
#modal-root:has(.ref-image-screen) { pointer-events: auto; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 20, 40, .48);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: fade-in .2s ease both;
}
.modal-backdrop.center { align-items: center; padding: 22px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%;
  max-height: 88%;
  overflow-y: auto;
  scrollbar-width: none;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px rgba(6, 20, 45, .2);
  animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1) both;
}
.modal::-webkit-scrollbar { display: none; }
.modal-backdrop.center .modal {
  border-radius: 22px;
  max-width: 320px;
  animation: pop-in .22s ease both;
}
.modal-backdrop.center .modal.wide { max-width: 360px; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
@keyframes pop-in { from { transform: scale(.96); opacity: .5; } to { transform: scale(1); opacity: 1; } }
.modal-handle {
  width: 36px;
  height: 4px;
  border-radius: 4px;
  background: #e3eaf5;
  margin: -6px auto 14px;
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.modal-head h2 { margin: 0; font-size: calc(18px * var(--type-scale)); font-weight: 900; letter-spacing: -.03em; }
.modal-head p { margin: 5px 0 0; font-size: calc(11px * var(--type-scale)); line-height: 1.6; color: var(--muted); }
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #e4edf9;
  background: #f8fbff;
  color: #75849a;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.modal-close svg { width: 15px; height: 15px; }
.modal-body { margin-top: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions > * { flex: 1; }
.modal-note {
  background: #f7faff;
  border: 1px solid #e8f1fd;
  border-radius: 12px;
  padding: 11px 12px;
  font-size: calc(11px * var(--type-scale));
  line-height: 1.6;
  color: #6c7c96;
}
.modal-list { display: flex; flex-direction: column; gap: 8px; }
.modal-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e9f1fc;
  border-radius: 12px;
  background: #fff;
  text-align: left;
}
.modal-list-item strong { display: block; font-size: calc(12px * var(--type-scale)); }
.modal-list-item span { display: block; font-size: calc(10px * var(--type-scale)); color: var(--muted); margin-top: 2px; }

/* Toast */
.toast {
  position: absolute;
  left: 50%;
  bottom: 88px;
  transform: translate(-50%, 10px);
  max-width: 82%;
  background: rgba(15, 29, 52, .92);
  color: #fff;
  font-size: calc(11.5px * var(--type-scale));
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(5, 16, 36, .25);
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
  z-index: 90;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 滚动条 */
.side-right::-webkit-scrollbar,
.chips::-webkit-scrollbar { display: none; }

