:root {
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --brand: #2f6f6b;
  --brand-dark: #1f4e4a;
}

body {
  background: #f4f6f8;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

.navbar {
  background: var(--brand-dark) !important;
  box-shadow: 0 1px 8px rgba(0, 0, 0, .12);
}
.navbar .navbar-brand,
.navbar .nav-link {
  color: #fff !important;
  font-weight: 600;
}
.navbar .nav-link.active {
  color: #ffd166 !important;
}
.nav-user {
  color: #cfe3e1;
  font-size: .9rem;
  margin-right: .5rem;
}
.btn-logout {
  color: #fff;
  border-color: rgba(255, 255, 255, .5);
}
.btn-logout:hover {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

/* 登录 / 注册 */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}
.auth-brand {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brand-dark);
  text-align: center;
}
.auth-sub {
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
  margin: .25rem 0 1rem;
}
.auth-msg {
  color: #b42318;
  font-size: .875rem;
  margin-top: .75rem;
}

/* 通用页面 */
.page-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 1.25rem 0 3rem;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.q-card {
  background: #fff;
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 2px 14px rgba(15, 23, 42, .06);
}
.q-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: .85rem;
}
.q-progress {
  height: 6px;
  margin: .75rem 0 1.25rem;
  background: #eef1f4;
}
.q-progress .progress-bar {
  background: var(--brand);
}
.q-stem {
  font-size: 1.08rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
  white-space: pre-wrap;
}

/* 选项：整行可点，手机上好按 */
.q-card .form-check {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .8rem .9rem .8rem 2.5rem;
  margin-bottom: .6rem;
  background: #fff;
  transition: border-color .15s, background .15s;
  line-height: 1.6;
}
.q-card .form-check:hover {
  border-color: var(--brand);
  background: #f7fbfa;
}
.q-card .form-check-input {
  margin-left: -1.55rem;
  margin-top: .35rem;
}
.q-card .form-check-input:checked ~ span {
  font-weight: 600;
}
.opt-key {
  display: inline-block;
  min-width: 1.5rem;
  font-weight: 700;
  color: var(--brand);
  margin-right: .35rem;
}

.feedback {
  padding: .8rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  margin-top: 1.25rem;
}
.feedback.ok {
  background: #e8f5e9;
  color: #1b5e20;
}
.feedback.bad {
  background: #fdecea;
  color: #b71c1c;
}
.explain {
  background: #f8fafc;
  border-left: 3px solid #94a3b8;
  padding: .85rem 1rem;
  margin-top: .75rem;
  color: #334155;
  line-height: 1.75;
  border-radius: 0 8px 8px 0;
}

.result-score {
  text-align: center;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--brand-dark);
}
.wrong-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: .75rem;
  background: #fff;
}
.q-stem-sm {
  font-size: .98rem;
  line-height: 1.7;
  margin: .5rem 0 .4rem;
  white-space: pre-wrap;
}
.badge-wrong {
  background: #fef2f2;
  color: #b42318;
  border-radius: 999px;
  padding: .15rem .6rem;
  font-size: .75rem;
}

.empty-state {
  background: #fff;
  border-radius: 14px;
  padding: 3rem 1.5rem;
  text-align: center;
  box-shadow: 0 2px 14px rgba(15, 23, 42, .05);
}
.empty-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: .35rem;
}

/* 统计卡片 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.stat-box {
  background: #fff;
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 2px 14px rgba(15, 23, 42, .05);
}
.stat-label {
  color: var(--muted);
  font-size: .85rem;
}
.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--brand-dark);
  line-height: 1.2;
}

.card {
  border: none;
  border-radius: 14px;
  box-shadow: 0 2px 14px rgba(15, 23, 42, .05);
  margin-bottom: 1rem;
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

@media (max-width: 576px) {
  .page-wrap {
    padding: .75rem 0 2rem;
  }
  .q-card {
    padding: 1rem;
    border-radius: 12px;
  }
  .q-stem {
    font-size: 1rem;
    line-height: 1.75;
  }
  .auth-card {
    padding: 1.15rem;
  }
  .stat-value {
    font-size: 1.5rem;
  }
}

/* 触屏设备去掉 hover 态 */
@media (hover: none) {
  .q-card .form-check:hover {
    border-color: var(--line);
    background: #fff;
  }
}

/* Shiny 单选仍是 BS3 结构（.radio），这里做整行卡片化 */
.q-card .shiny-options-group .radio {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .8rem .9rem;
  margin: 0 0 .6rem 0;
  background: #fff;
  transition: border-color .15s, background .15s;
  min-height: 44px;
}
.q-card .shiny-options-group .radio label {
  display: flex;
  align-items: flex-start;
  gap: .55rem;
  margin: 0;
  cursor: pointer;
  line-height: 1.6;
  font-weight: 400;
}
.q-card .shiny-options-group .radio input[type="radio"] {
  margin: .35rem 0 0 0;
  flex: 0 0 auto;
}
.q-card .shiny-options-group .radio:has(input:checked) {
  border-color: var(--brand);
  background: #f0f8f7;
}
.q-card .shiny-options-group .radio:hover {
  border-color: var(--brand);
  background: #f7fbfa;
}
@media (hover: none) {
  .q-card .shiny-options-group .radio:hover {
    border-color: var(--line);
    background: #fff;
  }
}


/* 读图题 */
.q-figure {
  text-align: center;
  margin: .25rem 0 1rem;
}
.q-figure img {
  max-width: 100%;
  max-height: 420px;
  width: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 6px;
}
.q-figure-sm {
  margin: .45rem 0 .25rem;
}
.q-figure-sm img {
  max-height: 200px;
  padding: 4px;
}
@media (max-width: 576px) {
  .q-figure img { max-height: 300px; padding: 4px; }
  .q-figure-sm img { max-height: 150px; }
}


.q-credit {
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.4;
  margin-top: .35rem;
}

.feedback-answer {
  font-weight: 500;
  margin-top: .2rem;
}

/* 钱包 */
.balance-card {
  background: linear-gradient(135deg, #2f6f6b, #1f4e4a);
  color: #fff;
  border-radius: 16px;
  padding: 1.5rem 1.5rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 6px 20px rgba(31, 78, 74, .25);
}
.balance-label { font-size: .85rem; opacity: .85; }
.balance-value {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.1;
}
.balance-sub { font-size: .78rem; opacity: .8; margin-top: .35rem; line-height: 1.5; }
@media (max-width: 576px) {
  .balance-value { font-size: 2.1rem; }
}

/* 背单词 */
.word-card {
  background: #fff;
  border-radius: 18px;
  padding: 40px 20px 34px;
  margin: 1rem 0;
  box-shadow: 0 4px 20px rgba(15,23,42,.08);
}
.word-text { font-size: 42px; font-weight: 700; color: #1f4e4a; letter-spacing: .5px; }
.word-phonetic { color: #6b7280; font-size: 17px; margin-top: 8px; font-family: Georgia, serif; }
.word-meaning {
  font-size: 20px; color: #1f2937; font-weight: 600;
  background: #f0f8f7; border-radius: 12px; padding: 18px; margin-top: 1rem;
  line-height: 1.7;
}
@media (max-width: 576px) {
  .word-text { font-size: 34px; }
  .word-meaning { font-size: 17px; padding: 14px; }
  .word-card { padding: 30px 14px 26px; }
}
