:root {
  color-scheme: light;
  --bg: #f4f7f2;
  --surface: #ffffff;
  --ink: #15241d;
  --ink-soft: #34483e;
  --muted: #74837b;
  --line: #e3ebe4;
  --line-strong: #d2ded5;
  --brand: #0d604d;
  --brand-2: #0e7a60;
  --brand-deep: #083f33;
  --brand-soft: #e8f4ed;
  --accent: #e6a33d;
  --accent-soft: #fcf1db;
  --danger: #bf4a40;
  --danger-soft: #fcefea;
  --ok: #10795a;
  --ok-soft: #e8f7ef;
  --shadow-sm: 0 4px 14px rgba(17, 50, 38, 0.05);
  --shadow: 0 16px 38px rgba(17, 50, 38, 0.09);
  --radius: 22px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: #dce8df;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(252, 255, 249, 0.98), transparent 38%),
    radial-gradient(circle at 92% 92%, #c8ddd0, transparent 48%),
    #dfeae2;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

img,
svg {
  display: block;
}

h1,
h2,
h3,
p {
  margin: 0;
}

::selection {
  background: #cde8da;
}

.app-shell {
  width: min(100%, 560px);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

#view {
  min-height: 100dvh;
}

.page {
  padding-bottom: calc(96px + var(--safe-bottom));
}

.inner-page {
  padding: calc(20px + var(--safe-top)) 18px calc(104px + var(--safe-bottom));
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.head-spacer {
  width: 40px;
  flex: 0 0 40px;
}

.icon {
  flex: none;
}

/* ---------- 品牌与通用按钮 ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, #f5d99d, #e8ae4d);
  color: #123d30;
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: 23px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.brand-mark.large {
  width: 66px;
  height: 66px;
  border-radius: 21px;
  font-size: 36px;
  margin: 0 auto;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.brand-copy strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.brand-copy small {
  font-size: 8px;
  letter-spacing: 1.8px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 3px;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 14px;
  min-height: 46px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.2px;
  transition: transform 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.58;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 22px rgba(13, 96, 77, 0.2);
}

.btn-primary:hover {
  background: #0a5343;
}

.btn-dark {
  background: #17352b;
  color: #fff;
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink-soft);
}

.btn-soft {
  background: var(--brand-soft);
  color: var(--brand);
}

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

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 40px;
  height: 40px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  display: grid;
  place-items: center;
}

.small-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand);
  border-radius: 12px;
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 650;
}

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 560px);
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 7px 12px calc(7px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid rgba(213, 226, 216, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.tabbar.hidden {
  display: none;
}

.tab-item {
  flex: 1;
  min-height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #829087;
  font-size: 10px;
  font-weight: 550;
  transition: color 0.18s ease;
}

.tab-icon {
  width: 42px;
  height: 28px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  transition: background 0.18s ease, color 0.18s ease;
}

.tab-item.is-active {
  color: var(--brand);
  font-weight: 700;
}

.tab-item.is-active .tab-icon {
  color: var(--brand);
  background: var(--brand-soft);
}

/* ---------- 加载 ---------- */
.page-loader {
  min-height: 74dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.loading-mark {
  width: 58px;
  height: 58px;
  border-radius: 19px;
  font-size: 30px;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #d8e5dc;
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}

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

.boot-inline {
  min-height: 70dvh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.boot-error {
  min-height: 80dvh;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
}

.boot-error h1 {
  font-size: 24px;
  margin-top: 10px;
}

.boot-error p {
  color: var(--muted);
  max-width: 280px;
  margin-bottom: 10px;
}

/* ---------- 首页 ---------- */
.home-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: calc(16px + var(--safe-top)) 20px 58px;
  border-radius: 0 0 30px 30px;
  background:
    linear-gradient(158deg, rgba(255, 255, 255, 0.08), transparent 32%),
    linear-gradient(145deg, #0b4c3d 0%, #0e6652 52%, #083b30 100%);
  box-shadow: 0 24px 50px rgba(8, 61, 48, 0.23);
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

.hero-orb-a {
  width: 230px;
  height: 230px;
  right: -92px;
  top: 24px;
  background: radial-gradient(circle, rgba(98, 200, 166, 0.24), transparent 68%);
}

.hero-orb-b {
  width: 160px;
  height: 160px;
  left: -70px;
  bottom: 26px;
  background: radial-gradient(circle, rgba(230, 163, 61, 0.18), transparent 70%);
}

.hero-nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-copy strong {
  color: inherit;
}

.avatar-btn {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #f7dfae;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
}

.hero-main {
  position: relative;
  z-index: 1;
  padding: 34px 2px 28px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #a9cbbd;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
}

.hero-kicker > span {
  width: 16px;
  height: 1px;
  background: #e6b45b;
}

.home-hero h1 {
  margin-top: 13px;
  font-size: clamp(33px, 9vw, 43px);
  line-height: 1.24;
  letter-spacing: -0.8px;
  font-weight: 600;
}

.home-hero h1 em {
  color: #f2cc85;
  font-style: normal;
}

.hero-sub {
  margin-top: 14px;
  max-width: 285px;
  color: rgba(224, 240, 232, 0.7);
  font-size: 12px;
  line-height: 1.7;
}

.hero-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 22px;
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.hero-meta > div:not(.hero-badge) {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-meta strong {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.3px;
}

.hero-meta span {
  font-size: 9px;
  color: rgba(213, 233, 223, 0.58);
  letter-spacing: 0.6px;
}

.hero-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 9px;
  border-radius: 20px;
  background: rgba(240, 200, 128, 0.14);
  color: #f2cf91;
  border: 1px solid rgba(240, 200, 128, 0.18);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.quick-grid {
  position: relative;
  z-index: 2;
  margin: -33px 18px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.quick-card {
  background: #fff;
  border: 1px solid rgba(226, 236, 229, 0.9);
  border-radius: 18px;
  padding: 12px 11px 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease;
}

.quick-card:active {
  transform: translateY(1px) scale(0.99);
}

.quick-card strong {
  font-size: 13px;
  margin-top: 7px;
  letter-spacing: -0.2px;
}

.quick-card small {
  font-size: 9px;
  color: var(--muted);
}

.quick-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
}

.quick-daily .quick-icon {
  background: var(--accent-soft);
  color: #ad721b;
}

.quick-random .quick-icon {
  background: var(--brand-soft);
  color: var(--brand);
}

.quick-exam .quick-icon {
  background: #eef0f7;
  color: #3e4c7a;
}

.study-card {
  margin: 17px 18px 0;
  padding: 17px;
  display: flex;
  align-items: center;
  gap: 17px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.ring {
  --size: 92px;
  width: var(--size);
  height: var(--size);
  flex: none;
  border-radius: 50%;
  padding: 7px;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), #e6eee8 0);
  position: relative;
}

.ring::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #fff;
}

.ring-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50%;
}

.ring-inner strong {
  font-size: 20px;
  letter-spacing: -0.6px;
}

.ring-inner span {
  font-size: 8px;
  color: var(--muted);
  margin-top: 1px;
}

.study-copy {
  min-width: 0;
}

.section-kicker {
  display: block;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}

.study-copy h2 {
  font-size: 16px;
  letter-spacing: -0.3px;
}

.study-copy p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.notice-card {
  margin: 14px 18px 0;
  display: flex;
  gap: 9px;
  padding: 12px 13px;
  border-radius: 14px;
  background: #fdf6e7;
  border: 1px solid #f2e2bf;
  color: #82612a;
}

.notice-icon {
  margin-top: 1px;
  color: #b88222;
}

.notice-card p {
  font-size: 10px;
  line-height: 1.65;
}

.section-block {
  margin: 24px 18px 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.section-head h2 {
  font-size: 17px;
  letter-spacing: -0.3px;
}

.section-head a {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.category-tile {
  position: relative;
  min-height: 112px;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  overflow: hidden;
  transition: transform 0.18s ease;
}

.category-tile::before {
  content: "";
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  right: -24px;
  bottom: -22px;
  background: var(--cat);
  opacity: 0.08;
}

.category-tile:active {
  transform: scale(0.985);
}

.category-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--cat);
  color: #fff;
  margin-bottom: 3px;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--cat) 28%, transparent);
}

.category-name {
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  padding-right: 12px;
}

.category-count {
  font-size: 9px;
  color: var(--muted);
  margin-top: auto;
}

.category-arrow {
  position: absolute;
  right: 12px;
  bottom: 13px;
  color: var(--cat);
  opacity: 0.7;
}

.feature-list {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 4px 16px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid #eef3ee;
  color: var(--brand);
}

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

.feature-item > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feature-item strong {
  color: var(--ink);
  font-size: 12px;
}

.feature-item span {
  color: var(--muted);
  font-size: 10px;
}

.app-footer {
  text-align: center;
  padding: 30px 20px 10px;
  color: #9aa89f;
  font-size: 9px;
  line-height: 1.8;
}

/* ---------- 内页头部 ---------- */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.page-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.page-head h1 {
  font-size: 25px;
  letter-spacing: -0.7px;
  line-height: 1.2;
}

.page-head p {
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
}

/* ---------- 题库列表 ---------- */
.search-box {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: #89988f;
  margin-bottom: 15px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}

.search-box input::placeholder {
  color: #a9b5ad;
}

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

.bank-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 15px;
  overflow: hidden;
}

.bank-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 3px;
  background: var(--cat);
}

.bank-card-top {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.bank-icon {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--cat) 11%, #fff);
  color: var(--cat);
}

.bank-title {
  min-width: 0;
  flex: 1;
}

.bank-title h3 {
  font-size: 14px;
  letter-spacing: -0.2px;
}

.bank-title p {
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bank-percent {
  font-size: 11px;
  font-weight: 700;
  color: var(--cat);
  background: color-mix(in srgb, var(--cat) 9%, #fff);
  border-radius: 8px;
  padding: 4px 7px;
}

.bank-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 9px;
}

.progress-track {
  height: 4px;
  background: #edf2ee;
  border-radius: 4px;
  overflow: hidden;
}

.progress-track > span {
  display: block;
  height: 100%;
  background: var(--cat);
  border-radius: 4px;
  transition: width 0.35s ease;
}

.bank-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.bank-actions .btn {
  flex: 1;
  min-height: 38px;
  font-size: 11px;
  border-radius: 11px;
}

/* ---------- 错题、收藏列表 ---------- */
.question-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.question-row {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  color: var(--ink);
}

.question-index {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 9px;
  background: #f2f6f2;
  color: #93a198;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.question-row-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.row-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  color: var(--muted);
}

.cat-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--cat) 10%, #fff);
  color: var(--cat);
  font-size: 8px;
  font-weight: 700;
}

.question-row-stem {
  font-size: 12px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.row-chevron {
  color: #a7b4ab;
  flex: none;
}

.favorite-row {
  align-items: flex-start;
  padding-right: 8px;
}

.favorite-main {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  padding: 1px 0;
  color: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.star-btn {
  width: 40px;
  height: 40px;
  flex: none;
  border: 0;
  background: transparent;
  border-radius: 12px;
  color: #a5b2a9;
  display: grid;
  place-items: center;
}

.star-btn.is-active {
  color: #d79a30;
}

.star-btn.is-active .icon {
  fill: #f0bd5d;
  stroke: #d79a30;
}

/* ---------- 空状态 ---------- */
.empty-state {
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.empty-icon {
  width: 68px;
  height: 68px;
  border-radius: 22px;
  background: #eaf1eb;
  color: #88a094;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 17px;
}

.empty-state p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  max-width: 270px;
  margin: 6px 0 18px;
}

.empty-state .btn {
  font-size: 12px;
  min-height: 42px;
}

/* ---------- 我的 ---------- */
.profile-hero {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 19px;
  color: #fff;
  background:
    radial-gradient(circle at 90% 0%, rgba(238, 196, 116, 0.24), transparent 36%),
    linear-gradient(145deg, #0d5b49, #083b30);
  box-shadow: 0 18px 36px rgba(8, 61, 48, 0.2);
}

.profile-hero::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  right: -40px;
  bottom: -50px;
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 11px;
  position: relative;
  z-index: 1;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 16px;
  background: linear-gradient(145deg, #f5d99d, #dea13e);
  color: #144234;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 750;
}

.profile-copy {
  min-width: 0;
  flex: 1;
}

.profile-copy h1 {
  font-size: 17px;
  letter-spacing: -0.2px;
}

.profile-copy p {
  font-size: 10px;
  color: rgba(221, 238, 229, 0.6);
  margin-top: 3px;
  letter-spacing: 0.4px;
}

.profile-streak {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.11);
  color: #f2cf91;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.profile-stats {
  margin-top: 19px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  position: relative;
  z-index: 1;
}

.profile-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-stats strong {
  font-size: 18px;
  letter-spacing: -0.4px;
}

.profile-stats span {
  font-size: 8px;
  color: rgba(217, 237, 226, 0.55);
}

.week-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 19px;
  padding: 14px;
  margin-top: 11px;
}

.week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.week-head strong {
  font-size: 11px;
}

.week-head span {
  color: var(--muted);
  font-size: 9px;
}

.week-bars {
  height: 84px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 7px;
  margin-top: 10px;
  padding: 0 4px;
}

.week-bar {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.week-bar span {
  width: 100%;
  max-width: 20px;
  border-radius: 5px;
  background: #edf2ee;
}

.week-bar span.has-data {
  background: linear-gradient(180deg, #2b9476, #0d604d);
}

.week-bar small {
  color: #9aa89f;
  font-size: 8px;
  white-space: nowrap;
}

.guest-card {
  padding: 25px 22px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 95% 0%, rgba(230, 163, 61, 0.13), transparent 35%),
    #fff;
  border: 1px solid var(--line);
  text-align: center;
}

.guest-mark {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  border-radius: 19px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: #a8711e;
}

.guest-card h1 {
  font-size: 20px;
  letter-spacing: -0.4px;
}

.guest-card p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  margin: 6px auto 18px;
  max-width: 270px;
}

.guest-actions {
  display: flex;
  gap: 8px;
}

.guest-actions .btn {
  flex: 1;
}

.menu-card {
  margin-top: 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 19px;
  overflow: hidden;
}

.menu-row {
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #eff3ef;
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-align: left;
}

.menu-row:last-child {
  border-bottom: 0;
}

.menu-icon {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #f1f6f2;
  color: var(--brand);
}

.install-icon {
  background: var(--accent-soft);
  color: #ae7620;
}

.menu-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.menu-copy strong {
  font-size: 12px;
  font-weight: 600;
}

.menu-copy small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.menu-arrow {
  color: #b0bbb3;
}

.menu-badge {
  font-size: 8px;
  color: var(--ok);
  background: var(--ok-soft);
  padding: 3px 7px;
  border-radius: 6px;
  font-weight: 650;
}

.logout-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 12px;
  border: 1px solid #efdeda;
  border-radius: 16px;
  background: #fff;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ---------- 考试记录 ---------- */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.history-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.score-badge {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.4px;
}

.score-badge.great {
  background: var(--ok-soft);
  color: var(--ok);
}

.score-badge.good {
  background: var(--brand-soft);
  color: var(--brand);
}

.score-badge.warn {
  background: var(--danger-soft);
  color: var(--danger);
}

.history-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.history-title {
  font-size: 12px;
  font-weight: 650;
}

.history-meta {
  color: var(--muted);
  font-size: 9px;
}

.pass-tag {
  font-size: 9px;
  font-weight: 650;
  border-radius: 6px;
  padding: 3px 6px;
  white-space: nowrap;
}

.pass-tag.pass {
  background: var(--ok-soft);
  color: var(--ok);
}

.pass-tag.fail {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ---------- 表单 / 认证 ---------- */
.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  font-size: 10px;
  color: var(--ink-soft);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fbfcfb;
  color: var(--ink);
  outline: none;
  font-size: 13px;
  transition: border 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field input:focus {
  border-color: var(--brand-2);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(14, 122, 96, 0.09);
}

.field input::placeholder {
  color: #a5b1a9;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: #8b9a91;
  display: grid;
  place-items: center;
}

.auth-page {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  padding: calc(17px + var(--safe-top)) 20px calc(22px + var(--safe-bottom));
  background:
    radial-gradient(circle at 90% 8%, rgba(229, 172, 77, 0.18), transparent 35%),
    radial-gradient(circle at 4% 85%, rgba(73, 157, 131, 0.2), transparent 35%),
    linear-gradient(160deg, #0b4b3c, #0a3b30 62%, #062d25);
  color: #fff;
  display: flex;
  flex-direction: column;
}

.auth-deco {
  position: absolute;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 50%;
  right: -100px;
  top: 100px;
  pointer-events: none;
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.brand-light .brand-copy small {
  color: rgba(255, 255, 255, 0.45);
}

.auth-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  display: grid;
  place-items: center;
}

.auth-intro {
  position: relative;
  z-index: 1;
  padding: 58px 2px 32px;
}

.auth-intro-small {
  padding-top: 38px;
  padding-bottom: 22px;
}

.auth-intro .hero-kicker {
  color: #aacdbd;
}

.auth-intro h1 {
  margin-top: 12px;
  font-size: clamp(32px, 9vw, 40px);
  line-height: 1.22;
  letter-spacing: -0.8px;
  font-weight: 600;
}

.auth-intro h1 em {
  color: #f2cc85;
  font-style: normal;
}

.auth-intro > p:last-child {
  margin-top: 12px;
  color: rgba(220, 238, 228, 0.62);
  font-size: 11px;
}

.auth-card {
  position: relative;
  z-index: 1;
  margin-top: auto;
  background: #fff;
  color: var(--ink);
  border-radius: 24px;
  padding: 19px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.auth-card .btn {
  margin-top: 4px;
}

.auth-switch {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 15px;
}

.auth-switch a {
  color: var(--brand);
  font-weight: 700;
}

.auth-note {
  position: relative;
  z-index: 1;
  text-align: center;
  color: rgba(218, 236, 226, 0.4);
  font-size: 9px;
  line-height: 1.6;
  margin-top: 14px;
}

/* ---------- 关于 ---------- */
.about-brand {
  text-align: center;
  padding: 18px 0 24px;
}

.about-brand .brand-mark {
  margin-bottom: 11px;
}

.about-brand h1 {
  font-size: 20px;
}

.about-brand p {
  color: var(--muted);
  font-size: 10px;
  margin-top: 4px;
}

.prose-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}

.prose-card h2 {
  font-size: 12px;
  margin: 18px 0 6px;
  color: var(--brand);
}

.prose-card h2:first-child {
  margin-top: 0;
}

.prose-card p {
  font-size: 11px;
  color: #5e6e65;
  line-height: 1.85;
}

/* ---------- 答题页 ---------- */
.subpage-head {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: calc(58px + var(--safe-top));
  padding: calc(8px + var(--safe-top)) 15px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(244, 247, 242, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.subpage-head > strong {
  flex: 1;
  text-align: center;
  font-size: 14px;
  letter-spacing: -0.2px;
}

.subpage-head .head-spacer:last-child {
  margin-left: 0;
}

.practice-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-align: center;
}

.practice-title span {
  font-size: 8px;
  color: var(--muted);
  letter-spacing: 0.8px;
}

.practice-title strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.practice-progress {
  height: 3px;
  background: #e5ece6;
  overflow: hidden;
}

.practice-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #0d604d, #2f9b7a);
  border-radius: 0 3px 3px 0;
  transition: width 0.35s ease;
}

.practice-subline {
  padding: 9px 20px 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
}

.practice-main {
  padding: 20px 19px 180px;
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.type-single {
  background: #e8f4ed;
  color: #0d6953;
}

.type-multiple {
  background: #eef0fa;
  color: #46558c;
}

.type-judge {
  background: #fdf2e1;
  color: #a16b1a;
}

.question-category {
  color: var(--muted);
  font-size: 9px;
}

.question-stem {
  font-size: 20px;
  line-height: 1.62;
  letter-spacing: -0.35px;
  font-weight: 600;
  color: #17271f;
  margin-bottom: 21px;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.option-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 13px;
  min-height: 54px;
  border: 1.5px solid var(--line);
  border-radius: 15px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.option-row:active {
  transform: scale(0.993);
}

.option-row:disabled {
  opacity: 1;
}

.option-key {
  width: 27px;
  height: 27px;
  flex: none;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #f2f6f2;
  color: #73837a;
  font-size: 10px;
  font-weight: 700;
  transition: background 0.16s ease, color 0.16s ease;
}

.option-text {
  flex: 1;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.option-mark {
  width: 18px;
  height: 18px;
  flex: none;
  display: grid;
  place-items: center;
  color: inherit;
}

.option-row.is-selected {
  border-color: var(--brand-2);
  background: #eff8f2;
}

.option-row.is-selected .option-key {
  background: var(--brand);
  color: #fff;
}

.option-row.is-correct {
  border-color: #5db492;
  background: #ecf8f1;
}

.option-row.is-correct .option-key {
  background: var(--ok);
  color: #fff;
}

.option-row.is-correct .option-mark {
  color: var(--ok);
}

.option-row.is-wrong {
  border-color: #e3a49d;
  background: #fdf0ed;
}

.option-row.is-wrong .option-key {
  background: var(--danger);
  color: #fff;
}

.option-row.is-wrong .option-mark {
  color: var(--danger);
}

.feedback {
  margin-top: 18px;
  border-radius: 17px;
  padding: 15px;
  border: 1px solid;
}

.feedback.is-correct {
  background: #eef8f2;
  border-color: #cfeadd;
}

.feedback.is-wrong {
  background: #fdf1ee;
  border-color: #f1d3ce;
}

.feedback-title {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.feedback-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
}

.feedback.is-correct .feedback-icon {
  background: var(--ok);
}

.feedback.is-wrong .feedback-icon {
  background: var(--danger);
}

.feedback-title strong {
  font-size: 13px;
}

.feedback-answer {
  margin-left: auto;
  font-size: 9px;
  color: var(--muted);
}

.explanation {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(21, 60, 45, 0.08);
}

.explanation strong {
  display: block;
  font-size: 9px;
  color: var(--brand);
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.explanation p {
  font-size: 11px;
  line-height: 1.8;
  color: #53665b;
  white-space: pre-wrap;
}

.practice-footer {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 560px);
  padding: 10px 19px calc(12px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.practice-hint {
  text-align: center;
  color: var(--muted);
  font-size: 9px;
  margin-bottom: 8px;
}

.practice-footer .btn {
  min-height: 47px;
}

.practice-error {
  min-height: 100dvh;
}

/* ---------- 练习完成 ---------- */
.practice-result {
  min-height: 100dvh;
  padding: 0 20px calc(30px + var(--safe-bottom));
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 8%, rgba(41, 153, 120, 0.12), transparent 38%),
    var(--bg);
}

.result-glow {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 163, 61, 0.13), transparent 68%);
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.practice-result-card {
  position: relative;
  z-index: 1;
  max-width: 360px;
  margin: 6vh auto 0;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 30px 22px 22px;
  box-shadow: var(--shadow);
}

.result-emoji {
  font-size: 42px;
  line-height: 1;
  display: block;
  margin-bottom: 13px;
}

.result-eyebrow {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.practice-result-card h1 {
  font-size: 25px;
  margin-top: 5px;
  letter-spacing: -0.6px;
}

.result-score {
  font-size: 54px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -2px;
  margin: 14px 0 0;
}

.result-score span {
  font-size: 16px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0;
  margin-left: 5px;
}

.result-desc {
  color: var(--muted);
  font-size: 10px;
  margin: 5px 0 20px;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-tip,
.review-tip {
  color: #8c9a92;
  font-size: 9px;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 5px;
  max-width: 360px;
  margin: 18px auto 0;
}

/* ---------- 考试设置 ---------- */
.exam-setup {
  min-height: 100dvh;
  padding-bottom: 130px;
}

.exam-setup-hero {
  padding: 24px 20px 12px;
}

.exam-setup-hero h1 {
  font-size: clamp(28px, 8vw, 36px);
  line-height: 1.28;
  letter-spacing: -0.7px;
  margin-top: 10px;
  font-weight: 600;
}

.exam-setup-hero h1 em {
  color: var(--brand-2);
  font-style: normal;
}

.exam-setup-hero > p:last-child {
  color: var(--muted);
  font-size: 11px;
  margin-top: 10px;
}

.exam-rules {
  margin: 15px 20px 0;
  padding: 12px 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.exam-rules > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  text-align: center;
  flex: 1;
}

.exam-rules span {
  color: var(--muted);
  font-size: 8px;
  line-height: 1.3;
}

.exam-setup > .section-head {
  margin: 22px 20px 10px;
}

.exam-category-list {
  margin: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.exam-category {
  width: 100%;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  color: var(--ink);
}

.exam-category.is-selected {
  border-color: var(--cat);
  background: color-mix(in srgb, var(--cat) 4%, #fff);
}

.exam-cat-icon {
  width: 39px;
  height: 39px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--cat);
  background: color-mix(in srgb, var(--cat) 10%, #fff);
}

.exam-cat-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.exam-cat-main strong {
  font-size: 12px;
}

.exam-cat-main small {
  color: var(--muted);
  font-size: 8px;
}

.radio-dot {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  position: relative;
}

.exam-category.is-selected .radio-dot {
  border-color: var(--cat);
}

.exam-category.is-selected .radio-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--cat);
}

.exam-tip {
  margin: 14px 20px 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 9px;
}

.exam-setup-footer {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 560px);
  padding: 11px 20px calc(13px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.exam-setup-footer .btn {
  min-height: 48px;
}

/* ---------- 考试答题 ---------- */
.exam-page {
  min-height: 100dvh;
  padding-bottom: 88px;
}

.exam-head .practice-title span {
  color: #a17229;
}

.exam-submit-btn {
  border: 0;
  border-radius: 10px;
  min-height: 34px;
  padding: 0 11px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.exam-timer-row {
  padding: 10px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 9px;
}

.exam-timer {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.exam-timer strong {
  font-size: 15px;
  letter-spacing: 0.5px;
}

.exam-timer-row.is-warning .exam-timer {
  color: var(--danger);
}

.exam-progress {
  height: 3px;
  background: #e6ede7;
}

.exam-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand-2);
  transition: width 0.3s ease;
}

.exam-main {
  padding: 13px 19px 32px;
}

.exam-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 19px;
}

.palette-num {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fbfcfb;
  color: #7b8b82;
  font-size: 10px;
  font-weight: 600;
}

.palette-num.is-answered {
  background: var(--brand-soft);
  border-color: #cce5d8;
  color: var(--brand);
}

.palette-num.is-current {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.exam-footer {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 560px);
  padding: 10px 19px calc(12px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  backdrop-filter: blur(16px);
}

.exam-footer .btn {
  flex: 1;
  min-height: 45px;
  font-size: 12px;
}

/* ---------- 成绩单 ---------- */
.result-page {
  min-height: 100dvh;
  padding-bottom: calc(30px + var(--safe-bottom));
}

.result-head {
  background: transparent;
}

.score-hero {
  position: relative;
  overflow: hidden;
  margin: 4px 18px 0;
  padding: 24px 20px 22px;
  border-radius: 26px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(circle at 85% 0%, rgba(239, 196, 115, 0.24), transparent 35%),
    linear-gradient(145deg, #0c5847, #083a2f);
  box-shadow: 0 20px 40px rgba(8, 58, 47, 0.2);
}

.score-hero.is-fail {
  background:
    radial-gradient(circle at 85% 0%, rgba(239, 196, 115, 0.2), transparent 35%),
    linear-gradient(145deg, #5a423a, #362823);
}

.score-glow {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  right: -60px;
  bottom: -70px;
}

.score-ring {
  width: 116px;
  height: 116px;
  margin: 15px auto 10px;
  border-radius: 50%;
  padding: 6px;
  background: conic-gradient(#ecc578 calc(var(--score) * 1%), rgba(255, 255, 255, 0.12) 0);
  position: relative;
}

.score-ring::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #0a4337;
}

.score-hero.is-fail .score-ring::after {
  background: #44322c;
}

.score-ring-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding-top: 34px;
}

.score-ring-inner strong {
  font-size: 38px;
  line-height: 1;
  letter-spacing: -1.5px;
}

.score-ring-inner span {
  font-size: 10px;
  margin-left: 3px;
  color: rgba(255, 255, 255, 0.55);
}

.score-hero .result-eyebrow {
  color: rgba(218, 238, 228, 0.55);
}

.score-hero h1 {
  font-size: 19px;
  letter-spacing: -0.3px;
  margin-top: 4px;
}

.score-hero > p:not(.result-eyebrow) {
  color: rgba(222, 239, 230, 0.6);
  font-size: 9px;
  margin-top: 5px;
}

.result-pass-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 11px;
  padding: 5px 9px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: #f2d49b;
  font-size: 9px;
  font-weight: 650;
}

.score-stats {
  display: flex;
  margin: 12px 18px 0;
  padding: 13px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.score-stats > div {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border-right: 1px solid #edf2ee;
  text-align: center;
}

.score-stats > div:last-child {
  border-right: 0;
}

.score-stats strong {
  font-size: 13px;
  letter-spacing: -0.2px;
}

.score-stats span {
  color: var(--muted);
  font-size: 8px;
}

.result-bar {
  margin: 22px 18px 0;
}

.result-bar .section-head {
  margin-bottom: 9px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 10px;
  background: #e9efe9;
  gap: 2px;
}

.segmented button {
  border: 0;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
}

.segmented button.is-active {
  background: #fff;
  color: var(--brand);
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(20, 50, 38, 0.08);
}

.review-list {
  margin: 0 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.review-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 14px;
}

.review-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.review-index {
  font-size: 9px;
  font-weight: 700;
  color: #9aa89f;
  margin-right: 2px;
}

.review-status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 9px;
  font-weight: 650;
}

.review-card.is-correct .review-status {
  color: var(--ok);
}

.review-card.is-wrong .review-status {
  color: var(--danger);
}

.review-card h3 {
  margin: 10px 0 11px;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 600;
  white-space: pre-wrap;
}

.review-options {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.review-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px;
  border-radius: 8px;
  background: #fafcfa;
  color: #5a6d62;
  font-size: 10px;
  line-height: 1.5;
}

.review-option .option-key {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-size: 8px;
}

.review-option.is-correct {
  background: var(--ok-soft);
  color: #176c54;
}

.review-option.is-correct .option-key {
  background: var(--ok);
  color: #fff;
}

.review-option.is-wrong {
  background: var(--danger-soft);
  color: #8f443c;
}

.review-option.is-wrong .option-key {
  background: var(--danger);
  color: #fff;
}

.review-option .icon {
  margin-left: auto;
}

.review-answers {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 0;
  margin-top: 8px;
  border-top: 1px dashed #e6ede7;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.review-answers b {
  color: var(--ink-soft);
  font-weight: 550;
}

.review-explanation {
  background: #f7faf7;
  border-radius: 10px;
  padding: 10px;
}

.review-explanation strong {
  display: block;
  font-size: 8px;
  color: var(--brand);
  margin-bottom: 3px;
}

.review-explanation p {
  color: #5c6f64;
  font-size: 10px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.result-page .result-actions {
  margin: 18px 18px 0;
  flex-direction: row;
}

.result-page .result-actions .btn {
  flex: 1;
}

/* ---------- 弹层 / Toast ---------- */
.sheet-layer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.sheet-layer.show {
  opacity: 1;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 31, 24, 0.44);
  backdrop-filter: blur(2px);
}

.confirm-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  padding: 22px 20px calc(20px + var(--safe-bottom));
  border-radius: 24px 24px 0 0;
  background: #fff;
  transform: translateY(18px);
  transition: transform 0.2s ease;
}

.sheet-layer.show .confirm-sheet {
  transform: translateY(0);
}

.confirm-sheet h3 {
  font-size: 18px;
  letter-spacing: -0.3px;
}

.confirm-sheet p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  margin: 7px 0 19px;
}

.confirm-actions {
  display: flex;
  gap: 8px;
}

.confirm-actions .btn {
  flex: 1;
}

.toast-root {
  position: fixed;
  z-index: 200;
  left: 50%;
  top: calc(18px + var(--safe-top));
  transform: translateX(-50%);
  width: min(calc(100% - 40px), 420px);
  pointer-events: none;
}

.toast {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  background: rgba(21, 42, 33, 0.94);
  color: #fff;
  border-radius: 12px;
  padding: 11px 15px;
  font-size: 11px;
  line-height: 1.5;
  box-shadow: 0 12px 30px rgba(7, 30, 22, 0.25);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-error {
  background: rgba(153, 51, 43, 0.96);
}

.toast-success {
  background: rgba(10, 99, 75, 0.96);
}

/* ---------- 桌面 ---------- */
@media (min-width: 720px) {
  body {
    padding: 22px 0;
  }

  .app-shell {
    min-height: calc(100dvh - 44px);
    border-radius: 32px;
    box-shadow: 0 40px 90px rgba(9, 48, 37, 0.2);
  }

  #view {
    min-height: calc(100dvh - 44px);
  }

  .home-hero {
    border-radius: 32px 32px 30px 30px;
    padding-left: 28px;
    padding-right: 28px;
  }

  .tabbar {
    width: 516px;
    bottom: 32px;
    border-radius: 20px;
    border: 1px solid var(--line);
    box-shadow: 0 20px 40px rgba(10, 45, 34, 0.14);
    padding-bottom: 7px;
  }

  .practice-footer,
  .exam-footer,
  .exam-setup-footer {
    width: 516px;
    bottom: 32px;
    border-radius: 18px;
    border: 1px solid var(--line);
    box-shadow: 0 16px 34px rgba(10, 45, 34, 0.12);
    padding-bottom: 12px;
  }

  .confirm-sheet {
    border-radius: 24px;
    margin-bottom: max(24px, calc((100dvh - 800px) / 2));
  }

  .inner-page {
    padding-left: 26px;
    padding-right: 26px;
  }
}

@media (max-width: 350px) {
  .hero-meta {
    gap: 13px;
  }

  .hero-badge {
    display: none;
  }

  .quick-card {
    padding: 10px 9px;
  }

  .quick-card strong {
    font-size: 12px;
  }

  .question-stem {
    font-size: 18px;
  }

  .profile-stats strong {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
