:root {
  --bg: #edf1ef;
  --panel: #ffffff;
  --panel-subtle: #f7f9f8;
  --ink: #182327;
  --muted: #68767b;
  --line: #d7dfdb;
  --line-strong: #c6d1cc;
  --accent: #0c7467;
  --accent-dark: #085a51;
  --accent-soft: #e3f3ef;
  --blue: #2e6597;
  --blue-soft: #e7eff8;
  --warn: #a86609;
  --warn-soft: #fff1d6;
  --danger: #b43a47;
  --danger-soft: #fae8eb;
  --success: #23784f;
  --graphite: #26383b;
  --shadow-sm: 0 4px 14px rgba(24, 35, 39, 0.06);
  --shadow-md: 0 14px 34px rgba(24, 35, 39, 0.10);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  line-height: 1.6;
  letter-spacing: 0;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  z-index: 3000;
  height: 5px;
  background: var(--accent);
}
::selection { background: #cce8e1; color: var(--ink); }
.app-wrap { max-width: 1040px; padding-top: 30px !important; padding-bottom: 48px !important; }
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm) !important;
}
.card-body { border-radius: 8px; padding: 20px; }
.btn {
  min-height: 42px;
  border-radius: 7px;
  padding: 8px 16px;
  font-weight: 700;
  letter-spacing: 0;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn-sm { min-height: 36px; padding: 6px 12px; }
.btn-primary, .btn-success { background: var(--accent); border-color: var(--accent); }
.btn-primary:hover, .btn-success:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-outline-primary { color: var(--accent); border-color: #7db3aa; background: #fff; }
.btn-outline-primary:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.btn-outline-secondary { color: #526066; border-color: #aeb9b5; background: #fff; }
.btn-outline-secondary:hover { background: #f0f3f2; color: var(--ink); border-color: #82918b; }
.btn-outline-danger { color: var(--danger); border-color: #d59ba2; background: #fff; }
.btn-outline-danger:hover { background: var(--danger-soft); color: #8e2531; border-color: var(--danger); }
.btn:focus-visible, button:focus-visible, .form-control:focus-visible, .form-select:focus-visible {
  outline: 3px solid rgba(12, 116, 103, 0.18);
  outline-offset: 2px;
}
.form-control, .form-select {
  min-height: 46px;
  border-radius: 7px;
  border-color: var(--line-strong);
  background-color: #fbfcfc;
}
.form-control:hover, .form-select:hover { border-color: #9eada7; }
.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  background-color: #fff;
  box-shadow: 0 0 0 0.2rem rgba(12, 116, 103, 0.12);
}
.form-label { color: #405057; font-weight: 700; }
.text-muted { color: var(--muted) !important; }
.auth-card {
  max-width: 440px;
  margin: 7vh auto;
  border-top: 5px solid var(--accent);
  box-shadow: var(--shadow-md) !important;
}
.auth-card .card-body { padding: 30px !important; }
.app-download-card {
  max-width: 440px;
  margin: -4vh auto 6vh;
  border: 1px solid #c9d8d4;
  border-left: 5px solid var(--blue);
  background: #fbfdfd;
}
.app-download-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.app-download-icon {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(24, 35, 39, 0.13);
}
.app-download-meta {
  min-width: 0;
  flex: 1 1 auto;
}
.app-download-title {
  font-weight: 800;
  color: var(--ink);
}
.app-download-action {
  flex: 0 0 auto;
  white-space: nowrap;
}
.app-download-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid #c9d8d4;
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: #fbfdfd;
  box-shadow: var(--shadow-sm);
}
.install-options {
  max-width: 720px;
  margin: -4vh auto 6vh;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.install-options .app-download-card {
  max-width: none;
  margin: 0;
}
.ios-install-card {
  border-left-color: var(--accent);
}
.ios-step-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  line-height: 1.8;
}
.auth-logo {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--graphite);
  color: #fff;
  border-bottom: 5px solid #38a995;
  font-size: 1.55rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(38, 56, 59, 0.16);
}
#page-register > .card, #page-results > .card, #page-settings > .card {
  border-top: 5px solid var(--accent);
  box-shadow: var(--shadow-md) !important;
}
.app-topbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 15px 16px;
  color: #fff;
  background: var(--graphite);
  border: 1px solid #1f3033;
  border-left: 5px solid #3db09b;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(38, 56, 59, 0.14);
}
.app-topbar .text-muted { color: #bfcdca !important; }
.brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--accent-dark);
  border-bottom: 4px solid #3db09b;
  font-weight: 800;
}
.user-pill {
  max-width: 340px;
  color: #eff7f5;
  background: #344a4d;
  border: 1px solid #52686a;
  border-radius: 999px;
  padding: 7px 12px;
  overflow-wrap: anywhere;
}
.section-title {
  position: relative;
  padding-left: 12px;
  font-size: 1rem;
  font-weight: 800;
  margin-bottom: 14px;
}
.section-title::before {
  content: "";
  position: absolute;
  inset: 2px auto 2px 0;
  width: 4px;
  border-radius: 4px;
  background: var(--accent);
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 13px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.page-heading h5 { font-size: 1.06rem; }
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.module-btn {
  position: relative;
  min-height: 126px;
  padding: 17px;
  overflow: hidden;
  text-align: left;
  border: 1px solid var(--line);
  border-top: 4px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.module-btn:hover { border-color: #8cbeb5; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.module-btn:nth-child(2) { border-top-color: var(--blue); }
.module-btn:nth-child(3) { border-top-color: var(--warn); }
.module-btn:nth-child(4) { border-top-color: var(--danger); }
.module-btn:nth-child(5) { border-top-color: #6b7780; }
.module-btn:nth-child(6) { border-top-color: #366d4f; }
.module-btn:disabled { cursor: default; background: #f2f4f3; color: var(--muted); opacity: 1; box-shadow: none; }
.account-summary {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 90px;
  margin-bottom: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 5px solid #6b7780;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.account-summary-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.account-summary-heading strong { display: block; font-size: 1rem; }
.account-summary-heading small { display: block; color: var(--muted); margin-top: 2px; }
.account-summary-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #e8ecee;
  color: #52616a;
  font-weight: 800;
}
.account-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.account-data-item { min-width: 0; padding: 0 14px; }
.account-data-item:nth-child(3n + 2), .account-data-item:nth-child(3n + 3) { border-left: 1px solid var(--line); }
.account-data-item:nth-child(n + 4) { padding-top: 7px; border-top: 1px solid var(--line); }
.account-data-item .label { display: block; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.account-data-item .value { display: block; color: var(--ink); font-size: .9rem; font-weight: 800; line-height: 1.45; overflow-wrap: anywhere; }
.module-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 800;
  margin-bottom: 11px;
}
.module-btn:nth-child(2) .module-icon { background: var(--blue-soft); color: var(--blue); }
.module-btn:nth-child(3) .module-icon { background: var(--warn-soft); color: var(--warn); }
.module-btn:nth-child(4) .module-icon { background: var(--danger-soft); color: var(--danger); }
.module-btn:nth-child(5) .module-icon { background: #e8ecee; color: #52616a; }
.module-btn:nth-child(6) .module-icon { background: #e5f0e9; color: #346947; }
.module-btn strong, .module-btn small { display: block; }
.module-btn strong { font-size: 1.02rem; }
.module-btn small { color: var(--muted); margin-top: 5px; line-height: 1.55; overflow-wrap: anywhere; }
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  background: var(--panel-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.metric {
  min-height: 92px;
  padding: 16px;
  background: transparent;
  border-right: 1px solid var(--line);
}
.metric:last-child { border-right: 0; }
.metric .value { color: var(--accent-dark); font-size: 1.52rem; font-weight: 800; line-height: 1.25; }
.metric:nth-child(2) .value { color: var(--blue); }
.metric:nth-child(3) .value { color: var(--success); }
.metric:nth-child(4) .value { color: var(--danger); }
.metric .label { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.goal-panel {
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid #c8ded8;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #f1f8f6;
}
.goal-panel .progress-rail { height: 10px; }
.progress-rail { height: 9px; border-radius: 999px; overflow: hidden; background: #dfe6e3; }
.progress-fill { height: 100%; width: 0%; background: var(--accent); transition: width .18s ease; }
#leaderboard-area > [class*="col-"] > .border,
#admin-leaderboard-area > [class*="col-"] > .border {
  border: 0 !important;
  border-left: 4px solid var(--accent) !important;
  border-radius: 8px !important;
  padding: 12px !important;
  background: var(--panel-subtle);
}
#leaderboard-area > [class*="col-"]:nth-of-type(3) > .border,
#admin-leaderboard-area > [class*="col-"]:nth-of-type(3) > .border { border-left-color: var(--blue) !important; }
#leaderboard-area > [class*="col-"]:nth-of-type(4) > .border,
#admin-leaderboard-area > [class*="col-"]:nth-of-type(4) > .border { border-left-color: var(--danger) !important; }
.leader-list { margin: 0; padding-left: 20px; }
.leader-list li { margin-bottom: 5px; padding-left: 2px; }
.quick-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.quick-btn {
  min-height: 106px;
  width: 100%;
  padding: 15px;
  text-align: left;
  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.quick-btn:nth-child(2) { border-left-color: var(--warn); }
.quick-btn:nth-child(3) { border-left-color: var(--danger); }
.quick-btn:hover { transform: translateY(-2px); border-color: #91a19b; box-shadow: var(--shadow-md); background: #fbfcfc; }
.quick-btn strong { display: block; font-size: 1.05rem; margin-bottom: 5px; }
.quick-btn small { color: var(--muted); }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; }
.action-row .btn { flex: 1 1 170px; }
.status-bar { font-size: 0.9rem; color: var(--muted); font-weight: 700; }
.practice-shell { max-width: 920px; margin: 0 auto; }
.practice-top { position: sticky; top: 5px; z-index: 20; background: rgba(237, 241, 239, 0.96); padding: 10px 0; }
.question-card { min-height: 320px; border-top: 5px solid var(--accent); box-shadow: var(--shadow-md) !important; }
.question-area { min-height: 140px; font-size: 1.1rem; line-height: 1.85; overflow-wrap: anywhere; }
.option-btn {
  display: flex;
  width: 100%;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  padding: 14px 15px;
  margin-bottom: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.option-btn:hover:not(.disabled) { border-color: var(--accent); background: #f1f8f6; box-shadow: var(--shadow-sm); transform: translateX(2px); }
.option-btn.selected { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.option-btn.correct { border-color: #7bb892; background: #e6f4ea; color: #0f5132; }
.option-btn.wrong { border-color: #e09aa1; background: #fde9eb; color: #842029; }
.option-btn.disabled { cursor: default; opacity: 0.94; }
.option-key {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e9eeec;
  color: #405057;
  font-weight: 800;
}
.option-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.type-badge { display: inline-block; padding: 5px 11px; border-radius: 999px; font-size: 0.78rem; font-weight: 800; margin-bottom: 10px; }
.type-choice { background: var(--blue-soft); color: #174a78; }
.type-judge { background: var(--warn-soft); color: #7b4d00; }
.type-theory { background: var(--danger-soft); color: #842029; }
.feedback-correct { background: #e6f4ea; border: 1px solid #a6d7b8; color: #0f5132; }
.feedback-wrong { background: #fde9eb; border: 1px solid #e4a3aa; color: #842029; }
.feedback-neutral { background: #edf4f3; border: 1px solid #c7dcda; color: #174d48; }
.practice-actions {
  position: sticky;
  bottom: 0;
  z-index: 20;
  margin-top: 10px;
  padding: 10px 10px 8px;
  background: rgba(247, 249, 248, 0.97);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -8px 20px rgba(24, 35, 39, 0.08);
}
.answer-sheet-card .card-body { padding: 14px; }
.answer-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 7px; }
.answer-dot { border: 1px solid var(--line-strong); background: #fff; color: var(--muted); border-radius: 7px; min-height: 36px; font-size: .86rem; font-weight: 800; }
.answer-dot.current { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 -3px 0 #9fcfc5; }
.answer-dot.correct { border-color: #7bb892; background: #e6f4ea; color: #0f5132; }
.answer-dot.wrong { border-color: #e4a3aa; background: #fde9eb; color: #842029; }
.answer-dot.neutral { border-color: #c7dcda; background: #edf4f3; color: #174d48; }
.result-meter { height: 12px; border-radius: 999px; overflow: hidden; background: #dfe6e3; }
.result-meter-fill { height: 100%; width: 0%; background: var(--accent); transition: width .2s ease; }
.result-tone { display: inline-block; border-radius: 999px; padding: 6px 13px; background: var(--accent-soft); color: var(--accent-dark); font-weight: 800; }
.preset-explanation, .ai-content {
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: var(--panel-subtle);
  font-size: .92rem;
  line-height: 1.75;
  white-space: pre-wrap;
}
.ai-content { max-height: 300px; overflow-y: auto; border-left-color: var(--accent); }
.service-qr { width: 164px; max-width: 100%; padding: 5px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; box-shadow: var(--shadow-sm); }
.support-service-qr { width: 220px; }
.payment-grid { display: flex; justify-content: center; }
.payment-card { width: min(100%, 250px); border: 1px solid var(--line); border-radius: 8px; background: var(--panel-subtle); padding: 9px; text-align: center; }
.payment-card img { width: 100%; aspect-ratio: 1 / 1.28; object-fit: contain; border-radius: 7px; background: #fff; }
.payment-card .pay-title { font-weight: 800; margin-top: 8px; }
.member-hint { border: 1px solid #c8ded8; border-left: 4px solid var(--accent); border-radius: 8px; padding: 12px; background: #f1f8f6; color: #315651; }
.locked-panel { opacity: .72; }
.trial-status-card { border-left: 5px solid var(--warn); }
.pk-lobby-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 12px; }
.pk-bot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pk-bot-item { padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; background: var(--panel-subtle); }
.pk-bot-item:nth-child(2) { border-left-color: var(--blue); }
.pk-bot-item:nth-child(3) { border-left-color: var(--warn); }
.pk-bot-item:nth-child(4) { border-left-color: var(--danger); }
.pk-rule-list { margin: 0; padding-left: 20px; color: var(--muted); font-size: .88rem; line-height: 1.7; }
.pk-leader-list { margin: 0; padding-left: 24px; }
.pk-leader-list li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.pk-leader-list li:last-child { border-bottom: 0; }
.pk-status-card { border-left: 5px solid var(--blue); background: #fbfdfd; }
.pk-status-card.waiting { border-left-color: var(--warn); }
.pk-player-list { max-height: 360px; overflow-y: auto; }
.pk-player-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.pk-player-row:last-child { border-bottom: 0; }
.pk-player-name { min-width: 0; font-weight: 800; overflow-wrap: anywhere; }
.pk-player-meta { color: var(--muted); font-size: .8rem; }
.pk-scoreboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.pk-score-item { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pk-score-item .label { display: block; color: var(--muted); font-size: .78rem; }
.pk-score-item .value { display: block; overflow-wrap: anywhere; color: var(--ink); font-size: 1rem; font-weight: 800; }
.pk-score-item.timer { border-color: #e3c38d; background: #fffaf0; }
.pk-score-item.timer .value { color: var(--warn); }
.pk-question-card { border-top: 5px solid var(--blue); }
.pk-feedback { min-height: 48px; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 8px; background: var(--panel-subtle); }
.pk-feedback.correct { border-left-color: var(--success); background: #e6f4ea; color: #0f5132; }
.pk-feedback.wrong { border-left-color: var(--danger); background: #fde9eb; color: #842029; }
.pk-result-card { border-top: 5px solid var(--blue); }
.pk-result-card.win { border-top-color: var(--success); }
.pk-result-card.lose { border-top-color: var(--danger); }
.pk-result-card .result-tone { margin-bottom: 10px; }
.donation-modal { max-width: 780px; }
.roster-table { max-height: 320px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.message-list { max-height: 260px; overflow-y: auto; }
.message-item { border-bottom: 1px solid #e6ebe9; padding: 11px 2px; }
.message-item:last-child { border-bottom: 0; }
.toast-area { position: fixed; top: 18px; right: 16px; z-index: 2000; width: min(350px, calc(100vw - 32px)); }
.toast-note { background: #fff; border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 8px; padding: 11px 13px; margin-bottom: 8px; box-shadow: var(--shadow-md); font-size: .92rem; transition: opacity .18s ease, transform .18s ease; }
.toast-note.error { border-left-color: var(--danger); }
.modal-overlay { position: fixed; inset: 0; background: rgba(24, 35, 39, 0.56); z-index: 1050; display: flex; align-items: center; justify-content: center; padding: 14px; }
.modal-box { background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--accent); border-radius: 8px; padding: 22px; width: 90%; max-width: 470px; box-shadow: 0 20px 54px rgba(24, 35, 39, 0.22); max-height: 90vh; overflow-y: auto; }
.announcement-modal { max-width: 520px; }
.announcement-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 800;
}
.announcement-content {
  min-height: 116px;
  max-height: 42vh;
  overflow-y: auto;
  padding: 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-left: 4px solid var(--warn);
  border-radius: 8px;
  background: #fffaf0;
  line-height: 1.8;
}
.announcement-editor { min-height: 116px; resize: vertical; }
.count-pills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.count-pills button { min-height: 40px; border: 1px solid var(--line-strong); background: #fff; border-radius: 7px; padding: 8px; font-weight: 700; }
.count-pills button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); box-shadow: inset 0 -3px 0 #9fcfc5; }
.study-range-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.study-range-item { border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 8px; padding: 13px; background: #fff; box-shadow: var(--shadow-sm); }
.study-range-item.complete { border-color: #8fc5a3; border-left-color: var(--success); background: #fbfefc; }
.study-answer { background: #edf6f3; border: 1px solid #c7dcda; border-left: 4px solid var(--accent); border-radius: 8px; padding: 13px; white-space: pre-wrap; line-height: 1.75; }
.favorite-item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.favorite-item:last-child { border-bottom: 0; }
.empty-state { border: 1px dashed #b9c6c1; border-radius: 8px; padding: 30px 16px; color: var(--muted); background: var(--panel-subtle); text-align: center; }
.status-chip { display: inline-block; border-radius: 999px; padding: 5px 10px; background: #e8ecea; color: #52615b; font-size: .78rem; font-weight: 800; }
.status-chip.complete { background: #e6f4ea; color: var(--success); }
.table { --bs-table-bg: transparent; --bs-table-hover-bg: #eef6f3; color: var(--ink); }
.table thead th { color: #47565b; background: #eef2f0; border-bottom-color: var(--line-strong); white-space: nowrap; }
.table td { border-color: #e6ebe9; vertical-align: middle; }
.admin-users-card .card-body { padding: 18px; }
.admin-users-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-users-toolbar h6 { margin: 0; }
.admin-users-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.admin-users-controls .form-select { min-width: 148px; }
#admin-users-table { min-width: 1180px; }
#admin-users-table td:last-child { min-width: 245px; }
.admin-user-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.admin-user-actions .btn { white-space: nowrap; }
.admin-user-points { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.admin-user-value { min-width: 0; }
#page-admin > .row .card { border-top: 4px solid var(--accent); box-shadow: var(--shadow-sm) !important; }
#page-admin > .row > div:nth-child(2) .card { border-top-color: var(--blue); }
#page-admin > .row > div:nth-child(3) .card { border-top-color: var(--danger); }
#page-admin > .row > div:nth-child(4) .card { border-top-color: var(--warn); }
@media (max-width: 860px) {
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pk-lobby-grid { grid-template-columns: 1fr; }
  .pk-bot-grid { grid-template-columns: 1fr; }
  .account-summary { grid-template-columns: 1fr; gap: 10px; }
  .account-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .study-range-grid { grid-template-columns: 1fr; }
  .install-options { grid-template-columns: 1fr; max-width: 440px; }
  .admin-users-card .table-responsive { overflow: visible; }
  #admin-users-table { min-width: 0; }
  #admin-users-table thead { display: none; }
  #admin-users-table,
  #admin-users-table tbody,
  #admin-users-table tr,
  #admin-users-table td { display: block; width: 100%; }
  #admin-users-table tbody { display: grid; gap: 12px; }
  #admin-users-table tr {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: var(--shadow-sm);
  }
  #admin-users-table tbody tr:nth-child(even) { background: #fbfdfc; }
  #admin-users-table td {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
    min-height: 54px;
    padding: 7px 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  #admin-users-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.25;
  }
  #admin-users-table td:nth-child(1),
  #admin-users-table td:nth-child(2),
  #admin-users-table td:nth-child(3) { min-height: 62px; }
  #admin-users-table td:nth-child(1) { grid-column: span 1; }
  #admin-users-table td:nth-child(2) { grid-column: span 1; }
  #admin-users-table td:nth-child(3) { grid-column: span 1; }
  #admin-users-table td:nth-child(13) { grid-column: 1 / -1; min-height: 0; padding-top: 10px; border-top: 1px solid var(--line); }
  #admin-users-table td:nth-child(13)::before { margin-bottom: 7px; }
  #admin-users-table td:nth-child(4) .form-select,
  #admin-users-table td:nth-child(5) .form-select,
  #admin-users-table td:nth-child(6) .form-select { width: 100%; min-width: 0; }
  #admin-users-table td:nth-child(7) .admin-user-points { width: 100%; justify-content: space-between; }
  #admin-users-table td:nth-child(8),
  #admin-users-table td:nth-child(11),
  #admin-users-table td:nth-child(12) { font-size: .82rem; }
  .admin-user-actions { width: 100%; }
  .admin-user-actions .btn { flex: 1 1 auto; }
}
@media (max-width: 620px) {
  .app-wrap { padding: 18px 12px 36px !important; }
  .auth-card { margin: 3vh auto; }
  .app-download-card { margin: 12px auto 30px; }
  .install-options { margin: 12px auto 30px; }
  .app-download-row, .app-download-banner {
    align-items: stretch;
    flex-direction: column;
  }
  .app-download-action { width: 100%; }
  .app-download-action .btn { width: 100%; }
  .auth-card .card-body { padding: 22px !important; }
  .app-topbar { align-items: stretch; flex-direction: column; padding: 14px; }
  .app-topbar > .d-flex:last-child { justify-content: space-between !important; width: 100%; }
  .user-pill { max-width: calc(100% - 82px); }
  .page-heading { align-items: flex-start; padding: 12px; }
  .module-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pk-scoreboard { grid-template-columns: 1fr; }
  .account-summary { padding: 13px; }
  .account-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-data-item { padding: 7px 10px; }
  .account-data-item:nth-child(n) { border-left: 0; }
  .account-data-item:nth-child(2n) { border-left: 1px solid var(--line); }
  .account-data-item:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .quick-grid { grid-template-columns: 1fr; }
  .module-btn { min-height: 148px; padding: 14px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { min-height: 84px; padding: 13px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .metric:nth-child(2n) { border-right: 0; }
  .metric:nth-last-child(-n+2) { border-bottom: 0; }
  .question-area { min-height: 120px; font-size: 1rem; line-height: 1.75; }
  .option-btn { padding: 12px; }
  .practice-actions .btn { flex: 1 1 auto; padding-left: 10px; padding-right: 10px; }
  .action-row .btn { flex-basis: 100%; }
  .service-qr { width: 160px; }
  .support-service-qr { width: 200px; }
  .payment-card { width: min(100%, 230px); }
  #page-admin > .row.g-2.mb-3 > .col-sm-3 { width: 50%; }
  .admin-users-card .card-body { padding: 13px; }
  .admin-users-toolbar { align-items: stretch; }
  .admin-users-controls { width: 100%; justify-content: stretch; }
  .admin-users-controls .form-select,
  .admin-users-controls .btn { flex: 1 1 100%; width: 100%; }
  #admin-users-table tr { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; padding: 10px; }
  #admin-users-table td:nth-child(3) { grid-column: 1 / -1; min-height: 54px; }
  #admin-users-table td:nth-child(1),
  #admin-users-table td:nth-child(2) { min-height: 58px; }
  #admin-users-table td:nth-child(7) .admin-user-points { align-items: flex-start; flex-direction: column; gap: 5px; }
  #admin-users-table td:nth-child(7) .admin-user-points .btn { width: 100%; }
  #admin-users-table td:nth-child(13) .admin-user-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #admin-users-table td:nth-child(13) .admin-user-actions .btn { width: 100%; }
}
@media (max-width: 340px) {
  .module-grid { grid-template-columns: 1fr; }
  .module-btn { min-height: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

.site-footer { margin-top: 8px; }
.beian-row { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 18px; }
.beian-link { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); text-decoration: none; line-height: 1; }
.beian-link:hover { color: var(--accent-dark); }
.beian-link:hover span { text-decoration: underline; }
.beian-icon { width: 18px; height: 18px; flex: 0 0 auto; }
