/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  font-size: 15px;
  background: #f5f5f5;
  background-attachment: fixed;
  color: #333;
  -webkit-tap-highlight-color: transparent;
}

/* ── App Layout ─────────────────────────────────────────── */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
}
.app-header-left { display: flex; align-items: center; gap: 8px; }
.app-logo { font-size: 20px; }
.app-title { color: #333; font-size: 17px; font-weight: 600; }
.app-header-right { display: flex; align-items: center; gap: 8px; }

.header-login-btn {
  background: none;
  color: #999;
  border: 1px solid #e8e8e8;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  cursor: pointer;
}
.header-user { display: flex; align-items: center; gap: 6px; }
.header-balance {
  font-size: 12px;
  color: #666;
  background: #f8f9fa;
  padding: 3px 10px;
  border-radius: 12px;
}
.header-username { color: #666; font-size: 13px; }

.app-body {
  margin-top: 52px;
  margin-bottom: 56px;
  min-height: calc(100vh - 108px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.app-tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  box-shadow: 0 -1px 0 rgba(0,0,0,0.06);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-item {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px;
  cursor: pointer;
  color: #b0b8c9;
  transition: color 0.2s;
  border: none;
  background: none;
  padding: 0;
}
.tabbar-item.active { color: #2563eb; }
.tabbar-item.active .tabbar-icon { stroke-width: 2.2; }
.tabbar-icon { width: 22px; height: 22px; stroke-width: 1.6; transition: stroke-width 0.2s; }
.tabbar-label { font-size: 10px; font-weight: 600; letter-spacing: 0.2px; }

/* ── Tab Content ────────────────────────────────────────── */
.tab-content { display: none; padding: 16px; padding-bottom: 80px; }
.tab-content.active { display: block; }

/* ── Cards ──────────────────────────────────────────────── */
.m-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.m-card-title {
  font-size: 13px; font-weight: 600; color: #999;
  letter-spacing: 0.8px;
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

/* ── Form Elements ──────────────────────────────────────── */
.m-form-group { margin-bottom: 18px; }
.m-label {
  display: block; font-size: 14px; font-weight: 500;
  color: #333; margin-bottom: 8px;
}
.m-select, .m-input {
  width: 100%; padding: 12px 14px;
  border: 1px solid #e8e8e8; border-radius: 10px;
  font-size: 15px; background: #fff; color: #333;
  appearance: none; -webkit-appearance: none;
  outline: none; transition: border-color 0.15s;
}
.m-select:focus, .m-input:focus { border-color: #999; }
.m-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
  padding-right: 36px;
}

/* Toggle */
.m-toggle-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.m-toggle { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.m-toggle input { opacity: 0; width: 0; height: 0; }
.m-toggle-track {
  position: absolute; inset: 0; background: #d9d9d9;
  border-radius: 13px; cursor: pointer; transition: background 0.2s;
}
.m-toggle-track::before {
  content: ""; position: absolute;
  width: 20px; height: 20px; left: 3px; top: 3px;
  background: white; border-radius: 50%;
  transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.m-toggle input:checked + .m-toggle-track { background: #1a1a2e; }
.m-toggle input:checked + .m-toggle-track::before { transform: translateX(22px); }

.m-exam-hint {
  font-size: 13px; color: #666; background: #f8f9fa;
  padding: 8px 12px; border-radius: 8px; margin-top: 8px;
}
.m-exam-preview {
  margin-top: 12px; padding: 14px;
  background: #f8f9fa; border: 1px solid #e8e8e8;
  border-radius: 10px; font-size: 13px; color: #666; line-height: 1.9;
}
.m-exam-preview strong { color: #333; display: block; margin-bottom: 6px; }

/* Difficulty */
.m-difficulty-group { display: flex; gap: 10px; }
.m-diff-btn {
  flex: 1; padding: 10px 0;
  border: 1px solid #e8e8e8; border-radius: 10px;
  background: #fff; font-size: 14px; color: #666; cursor: pointer;
  transition: all 0.15s;
}
.m-diff-btn.active {
  background: #1a1a2e; border-color: #1a1a2e; color: #fff; font-weight: 600;
}

/* Quantity control */
.m-quantity-control {
  display: flex; align-items: center; justify-content: center;
  gap: 24px; padding: 10px;
  border: 1px solid #e8e8e8; border-radius: 10px;
}
.m-qty-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: #1a1a2e; color: #fff;
  font-size: 20px; display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.m-qty-btn:active { opacity: 0.8; }
.m-qty-value { font-size: 18px; font-weight: 600; color: #333; min-width: 30px; text-align: center; }

/* Range slider */
.m-range {
  width: 100%; accent-color: #1a1a2e;
}

/* Generate button */
.m-generate-btn {
  width: 100%; padding: 14px;
  background: #1a1a2e; color: #fff; border: none; border-radius: 10px;
  font-size: 16px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity 0.15s; margin-top: 4px;
}
.m-generate-btn:active { opacity: 0.85; }
.m-generate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Spinner */
.m-spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4); border-top-color: white;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result Area ────────────────────────────────────────── */
.m-result-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0 8px;
}
.m-result-meta { font-size: 13px; color: #999; }
.m-toggle-all-btn {
  font-size: 13px; color: #666; background: #fff;
  border: 1px solid #e8e8e8; border-radius: 14px; padding: 5px 14px; cursor: pointer;
}

/* Question card */
.question-card {
  background: #fff; border-radius: 14px; padding: 18px 16px;
  margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.question-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.question-num {
  width: 28px; height: 28px; background: #1a1a2e; color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.question-header span:last-child { font-size: 14px; font-weight: 600; color: #333; }
.question-body { font-size: 15px; line-height: 1.8; color: #333; }
.question-body p { margin-bottom: 4px; }
.diagram-placeholder,
.diagram-wrap {
  margin-top: 12px;
}
.diagram-wrap svg,
.diagram-placeholder svg {
  width: 100%;
  max-width: 360px;
  height: auto;
}
.diagram-error {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #ffd8bf;
  background: #fff7e6;
  color: #d46b08;
  font-size: 13px;
  line-height: 1.6;
}
.question-table {
  width: 100%;
  margin: 8px 0 10px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
  background: #fff;
}
.question-table th,
.question-table td {
  border: 1px solid #d9e2ec;
  padding: 8px 6px;
  text-align: center;
  vertical-align: middle;
  word-break: break-word;
}
.question-table th {
  background: #f8fafc;
  font-weight: 600;
}
.choice-option {
  display: block; font-size: 14px; color: #555;
  padding: 3px 0 3px 12px; line-height: 1.7;
}

.answer-section { margin-top: 14px; }
.answer-toggle-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #f6fff0; border: 1px solid #b7eb8f;
  border-radius: 8px; font-size: 14px; color: #389e0d; font-weight: 500; cursor: pointer;
}
.answer-toggle-btn .toggle-icon { font-size: 11px; transition: transform 0.2s; }
.answer-toggle-btn.open .toggle-icon { transform: rotate(180deg); }

.answer-content {
  display: none; margin-top: 10px;
  background: #f6fff0; border-left: 4px solid #52c41a;
  border-radius: 0 10px 10px 0; padding: 14px 16px; font-size: 14px;
}
.answer-content.visible { display: block; }
.answer-label { font-weight: 600; color: #389e0d; display: block; margin-bottom: 4px; }
.analysis-label { font-weight: 600; color: #237804; display: block; margin-top: 12px; margin-bottom: 4px; }

.section-header {
  background: #f8f9fa; padding: 12px 16px; font-size: 15px; font-weight: 600;
  color: #333; border-radius: 10px; margin-bottom: 10px; margin-top: 6px;
}
.streaming-area {
  background: #fff; border-radius: 14px; padding: 16px;
  font-size: 14px; line-height: 1.7; color: #555;
  white-space: pre-wrap; min-height: 80px;
}
.error-msg {
  background: #fff1f0; border: 1px solid #ffccc7; border-radius: 10px;
  color: #cf1322; padding: 14px 16px; font-size: 14px;
}

/* ── Empty State ────────────────────────────────────────── */
.m-empty-state { text-align: center; padding: 48px 24px; color: #ccc; }
.m-empty-icon { font-size: 56px; margin-bottom: 16px; }
.m-empty-text { font-size: 16px; color: #999; margin-bottom: 6px; }
.m-empty-sub { font-size: 13px; }

/* ── Profile Tab ──────────────��─────────────────────────── */
.m-profile-login { text-align: center; padding: 80px 24px; }
.m-profile-avatar { font-size: 64px; margin-bottom: 16px; }
.m-profile-login p { color: #999; font-size: 15px; margin-bottom: 4px; }

.m-profile-info { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.m-profile-avatar-lg { font-size: 48px; }
.m-profile-name { font-size: 18px; font-weight: 700; color: #333; }
.m-profile-badge {
  font-size: 12px; color: #666; background: #f8f9fa;
  display: inline-block; padding: 2px 10px; border-radius: 10px; margin-top: 4px;
}

.m-points-row {
  display: flex; align-items: center;
  background: #f8f9fa; border-radius: 12px;
  padding: 16px 0; margin-bottom: 16px;
}
.m-points-item { flex: 1; text-align: center; }
.m-points-value { font-size: 22px; font-weight: 700; color: #333; }
.m-points-label { font-size: 12px; color: #999; margin-top: 3px; }
.m-points-divider { width: 1px; height: 40px; background: #e8e8e8; }

.m-profile-action-row {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  padding: 14px;
}

.m-recharge-entry-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  background: #2563eb;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
}

.m-recharge-entry-btn:active { opacity: 0.9; }

.m-profile-action-text {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: #5b6b83;
}

.m-points-packages {
  display: grid;
  gap: 10px;
}

.m-points-package-card {
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 14px;
  background: #f8f9fa;
}

.m-points-package-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.m-points-package-name {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}

.m-points-package-desc {
  margin-top: 3px;
  font-size: 12px;
  color: #999;
}

.m-points-package-price {
  font-size: 20px;
  font-weight: 700;
  color: #2563eb;
  white-space: nowrap;
}

.m-points-package-btn {
  width: 100%;
  margin-top: 12px;
  border: none;
  border-radius: 20px;
  background: #1a1a2e;
  color: #fff;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.m-points-package-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.m-plan-card:first-child {
  margin-top: 14px;
}

.m-profile-logout-wrap {
  margin-top: 8px;
  padding: 8px 0 24px;
}

.m-logout-btn {
  width: 100%;
  padding: 12px;
  background: #fff1f0;
  color: #cf1322;
  border: 1px solid #ffccc7;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(207, 19, 34, 0.05);
}

.m-section-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 600; color: #333;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0;
}
.m-section-more { font-size: 13px; color: #999; cursor: pointer; }
.m-loading { color: #ccc; font-size: 14px; text-align: center; padding: 16px; }
.m-no-membership { color: #999; font-size: 14px; }

/* Plans */
.m-plan-card {
  border: 1px solid #e8e8e8; border-radius: 12px;
  padding: 14px; margin-bottom: 10px; background: #f8f9fa;
}
.m-plan-name { font-size: 15px; font-weight: 600; color: #333; }
.m-plan-desc { font-size: 12px; color: #999; margin-top: 3px; }
.m-plan-footer {
  display: flex; align-items: center; justify-content: space-between; margin-top: 10px;
}
.m-plan-price { font-size: 18px; font-weight: 700; color: #ff6b6b; }
.m-plan-btn {
  background: #1a1a2e; color: #fff; border: none;
  border-radius: 20px; padding: 8px 20px; font-size: 13px; font-weight: 500; cursor: pointer;
}
.m-plan-btn:active { opacity: 0.85; }

/* Orders */
.m-order-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid #f5f5f5; font-size: 14px;
}
.m-order-item:last-child { border-bottom: none; }
.m-order-type { color: #333; font-weight: 500; }
.m-order-time { font-size: 12px; color: #ccc; margin-top: 2px; }
.m-order-right { text-align: right; }
.m-order-amount { font-weight: 700; color: #333; }
.m-order-status-paid { color: #52c41a; font-size: 12px; }
.m-order-status-pending { color: #faad14; font-size: 12px; }

/* Gen records */
.m-gen-item { padding: 12px 0; border-bottom: 1px solid #f5f5f5; font-size: 14px; }
.m-gen-item:last-child { border-bottom: none; }
.m-gen-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.m-gen-tag {
  font-size: 11px; background: #f5f5f5; color: #666;
  padding: 2px 8px; border-radius: 8px;
}
.m-gen-tag-exam { background: rgba(82,196,26,0.1); color: #389e0d; }
.m-gen-free { background: rgba(82,196,26,0.1); color: #389e0d; }
.m-empty-list { color: #ccc; font-size: 14px; text-align: center; padding: 20px 0; }
.m-more-btn { display: block; width: 100%; margin-top: 10px; padding: 8px; background: none; border: 1px solid #e2e8f0; border-radius: 8px; color: #64748b; font-size: 13px; cursor: pointer; }

/* Current membership */
.m-membership-active {
  background: #1a1a2e;
  border-radius: 12px; padding: 14px; color: #fff;
}
.m-membership-active-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.m-membership-active-info { font-size: 13px; opacity: 0.75; }

/* ── Auth Modal ─────────────────────────────────────────── */
.m-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 200; display: flex; align-items: flex-end;
}
.m-modal-box {
  width: 100%; background: #fff; border-radius: 20px 20px 0 0;
  padding: 16px 20px 32px; animation: slideUp 0.25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.m-modal-handle {
  width: 40px; height: 4px; background: #e8e8e8;
  border-radius: 2px; margin: 0 auto 18px;
}
.m-modal-tabs {
  display: flex; margin-bottom: 20px; border-bottom: 1px solid #f0f0f0;
}
.m-modal-tab {
  flex: 1; padding: 10px 0; background: none; border: none;
  font-size: 15px; font-weight: 600; color: #999; cursor: pointer;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.m-modal-tab.active { color: #333; border-bottom-color: #1a1a2e; }
.m-auth-error {
  background: #fff1f0; border: 1px solid #ffccc7; border-radius: 8px;
  color: #cf1322; padding: 10px 14px; font-size: 13px; margin-bottom: 14px;
}
.m-auth-submit {
  width: 100%; padding: 14px; background: #1a1a2e; color: #fff;
  border: none; border-radius: 10px; font-size: 16px; font-weight: 500; cursor: pointer;
  margin-top: 4px;
}
.m-auth-submit:active { opacity: 0.85; }
.m-auth-submit:disabled { opacity: 0.5; }

/* ── Auth Modal ─────────────────────────────────────────── */
.auth-modal {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.auth-modal-content {
  background: #fff; border-radius: 16px; padding: 28px 24px 24px;
  width: 100%; max-width: 360px; position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}
.auth-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; font-size: 22px; color: #999;
  cursor: pointer; line-height: 1; padding: 4px;
}
.auth-tabs {
  display: flex; gap: 0; margin-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}
.auth-tab {
  flex: 1; background: none; border: none; padding: 10px 0;
  font-size: 15px; font-weight: 500; color: #999; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}
.auth-tab.active { color: #2563eb; border-bottom-color: #2563eb; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }

/* ── Buttons ────────────────────────────────────────────── */
.m-btn-primary {
  display: block; width: 100%; padding: 14px;
  background: #2563eb; color: #fff; border: none; border-radius: 12px;
  font-size: 16px; font-weight: 600; cursor: pointer; text-align: center;
  transition: opacity 0.15s;
}
.m-btn-primary:active { opacity: 0.85; }
.m-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.m-btn-outline {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 20px;
  background: #fff; color: #2563eb; border: 1.5px solid #2563eb;
  border-radius: 12px; font-size: 15px; font-weight: 500; cursor: pointer;
  transition: opacity 0.15s;
}
.m-btn-outline:active { opacity: 0.8; }

.m-btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px;
  background: #f4f4f5; color: #333; border: none;
  border-radius: 10px; font-size: 14px; font-weight: 500; cursor: pointer;
  transition: opacity 0.15s;
}
.m-btn-secondary:active { opacity: 0.8; }
.m-btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }

.m-btn-logout {
  display: block; width: 100%; padding: 13px;
  background: #fff1f0; color: #cf1322;
  border: 1.5px solid #ffccc7; border-radius: 12px;
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: opacity 0.15s;
}
.m-btn-logout:active { opacity: 0.8; }

.m-form-actions {
  padding-top: 6px;
}
.m-actions-row {
  display: flex; gap: 12px; margin-top: 4px; margin-bottom: 12px;
}
.m-actions-row .m-btn-outline { flex: 1; }
.m-actions-row .m-btn-primary { flex: 1.5; }

/* ── Count Stepper ──────────────────────────────────────── */
.m-count-stepper {
  display: flex; align-items: center;
  border: 1px solid #e8e8e8; border-radius: 10px; overflow: hidden;
  background: #fff;
}
.m-stepper-btn {
  width: 44px; height: 44px; flex-shrink: 0;
  background: #f8f9fa; border: none; color: #333;
  font-size: 20px; font-weight: 400; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.m-stepper-btn:active { background: #eee; }
.m-stepper-input {
  flex: 1; border: none; outline: none; text-align: center;
  font-size: 16px; font-weight: 600; color: #333;
  padding: 0; height: 44px; background: transparent;
}

/* ── Copy Button ────────────────────────────────────────── */
.m-copy-btn {
  float: right; background: none; border: 1px solid #e8e8e8;
  border-radius: 8px; padding: 4px 12px;
  font-size: 12px; color: #666; cursor: pointer;
}
.m-copy-btn:active { background: #f5f5f5; }

/* ── Result / Questions ─────────────────────────────────── */
.result-area { padding-top: 4px; max-height: 70vh; overflow-y: auto; }
.m-streaming-text {
  font-size: 15px; line-height: 1.8;
  color: #333; white-space: pre-wrap;
  word-break: break-word;
  min-height: 100px;
  padding: 10px 0;
}
.m-streaming-text::after {
  content: '|'; animation: blink 1s infinite;
  color: #2563eb; margin-left: 2px;
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
.m-error-msg {
  color: #dc2626; text-align: center;
  padding: 40px 20px; font-size: 14px;
}

/* 答案区块样式 */
.m-answers-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px dashed #e0e0e0;
}
.m-answers-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
  text-align: center;
  padding: 12px 0;
  margin-bottom: 16px;
}
.m-answers-list {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
}
.m-answer-item {
  padding: 10px 0;
  border-bottom: 1px solid #e8e8e8;
  font-size: 14px;
  line-height: 1.6;
}
.m-answer-item:last-child {
  border-bottom: none;
}
.m-answer-num {
  font-weight: 600;
  color: #2563eb;
  margin-right: 8px;
}
.m-answer-text {
  color: #389e0d;
  font-weight: 500;
}
.m-answer-analysis {
  margin-top: 6px;
  padding-left: 16px;
  color: #666;
  font-size: 13px;
}
.m-answer-analysis span {
  color: #999;
}

/* 结果区操作按钮 */
.m-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.m-result-actions .m-copy-btn {
  font-size: 12px;
  padding: 4px 10px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.m-result-actions .m-copy-btn:hover {
  background: #e0e0e0;
}

/* 结果区卡片 */
#result-section {
  margin-top: 16px;
}
#result-section .m-card {
  margin-bottom: 12px;
}
.m-question-item {
  padding: 14px 0; border-bottom: 1px solid #f0f0f0;
  font-size: 15px; line-height: 1.7;
}
.m-question-item:last-child { border-bottom: none; }
.m-question-num {
  font-weight: 700; color: #2563eb; margin-right: 6px;
}
.m-question-content { color: #333; }
.m-exam-preview-item {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; padding: 4px 0; color: #555;
}

/* ── Header Auth Buttons ────────────────────────────────── */
.header-auth-btns { display: flex; align-items: center; gap: 6px; }

/* ── Utilities ──────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Header back button ─────────────────────────────────── */
.header-back-btn {
  background: none; border: none; color: #333;
  font-size: 22px; cursor: pointer; padding: 0 8px 0 0; line-height: 1;
}

/* ── Home Title Bar ────────────────────────────────────── */
.home-title-bar {
  margin: -4px 0 14px;
}

.home-title-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: #1a1a2e;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ── Grade Tabs ─────────────────────────────────────────── */
.grade-tabs {
  display: flex; background: #fff;
  border-bottom: 1px solid #f0f0f0;
  margin: -16px -16px 16px;
  padding: 0 16px;
}
.grade-tabs.hidden { display: none !important; }

.grade-context-bar {
  background: #f5f7ff;
  border: 1px solid #dde4ff;
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #4a6cf7;
  font-weight: 500;
}
.grade-tab {
  flex: 1; padding: 14px 0 12px; background: none; border: none;
  border-bottom: 3px solid transparent;
  font-size: 14px; font-weight: 500;
  color: #999; cursor: pointer;
  margin-bottom: -1px;
}
.grade-tab.active {
  color: #333; font-weight: 600;
  border-bottom-color: #1a1a2e;
}

/* ── Subject Grid ───────────────────────────────────────── */
.subject-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.subject-card {
  background: #fff; border-radius: 16px; padding: 20px 10px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: transform 0.15s;
}
.subject-card:active { transform: scale(0.96); }
.subject-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
}
.subject-name { font-size: 13px; font-weight: 500; color: #333; text-align: center; }

.subject-icon-yuwen   { background: #fff9db; }
.subject-icon-shuxue  { background: #e8f4ff; }
.subject-icon-yingyu  { background: #e6fff0; }
.subject-icon-wuli    { background: #fff3e0; }
.subject-icon-huaxue  { background: #f5f0ff; }
.subject-icon-shengwu { background: #e8fff5; }
.subject-icon-lishi   { background: #fff8e6; }
.subject-icon-dili    { background: #e8f6ff; }
.subject-icon-daode   { background: #fff0f6; }

/* ── 真题入口卡片 ─────────────────────────────────────── */
.exam-entry-card {
  display: flex;
  align-items: center;
  margin: 20px 16px 0;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: opacity 0.15s;
}
.exam-entry-card:active { opacity: 0.8; }
.exam-entry-icon {
  width: 48px;
  height: 48px;
  line-height: 48px;
  text-align: center;
  background: #f0f4f8;
  border-radius: 10px;
  font-size: 22px;
  margin-right: 14px;
}
.exam-entry-info { flex: 1; }
.exam-entry-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
}
.exam-entry-desc {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}
.exam-entry-arrow {
  font-size: 24px;
  color: #ccc;
}

/* ── 长春专题入口卡片 ──────────────────────────────────── */
.cc-entry-card {
  display: flex;
  align-items: center;
  margin: 20px 16px 0;
  padding: 16px;
  background: linear-gradient(135deg, #1A73E8 0%, #4285F4 100%);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(26, 115, 232, 0.25);
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.cc-entry-card:active { opacity: 0.9; transform: scale(0.99); }
.cc-entry-icon {
  width: 48px;
  height: 48px;
  line-height: 48px;
  text-align: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  font-size: 24px;
  margin-right: 14px;
}
.cc-entry-info { flex: 1; }
.cc-entry-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cc-entry-badge {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.cc-entry-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 4px;
}
.cc-entry-card .exam-entry-arrow { color: rgba(255, 255, 255, 0.8); }

/* ── Print ──────────────────────────────────────────────── */
@media print {
  .app-header, .app-tabbar, .m-generate-btn, .result-actions,
  .share-overlay, .m-modal-overlay { display: none !important; }
  .app-body { margin: 0; }
  .question-card { break-inside: avoid; box-shadow: none; border: 1px solid #e8e8e8; }
  .answers-card { break-inside: avoid; box-shadow: none; }
  .answers-card-header { display: none; }
  .answers-list { display: block !important; }
  .answer-item { break-inside: avoid; }
}

/* ── Action Bar ────────────────────────────��────────────── */
.result-actions {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.action-btn {
  flex: 1; padding: 9px 0;
  background: #fff; border: 1px solid #e8e8e8;
  border-radius: 10px; font-size: 13px; color: #555;
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; gap: 5px; transition: background 0.15s;
}
.action-btn:active { background: #f5f5f5; }

/* ── Answers Card ───────────────────────────────────────── */
.answers-card {
  background: #fff; border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  margin-bottom: 12px; overflow: hidden;
}
.answers-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  background: #f6fff0;
}
.answers-card-title { font-size: 14px; font-weight: 600; color: #389e0d; }
.answers-card-toggle { font-size: 12px; color: #389e0d; }
.answers-list { padding: 4px 0; }
.answer-item {
  padding: 12px 16px; border-bottom: 1px solid #f5f5f5; font-size: 14px;
}
.answer-item:last-child { border-bottom: none; }
.answer-item-num {
  font-size: 12px; font-weight: 700; color: #fff;
  background: #1a1a2e; display: inline-block;
  padding: 2px 10px; border-radius: 10px; margin-bottom: 6px;
}
.answer-item-body { color: #333; line-height: 1.7; }
.answer-item-analysis { margin-top: 6px; color: #555; }

/* ── Share Overlay ──────────────────────────────────────── */
.share-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 300; display: flex; align-items: flex-end;
}
.share-panel {
  width: 100%; background: #fff; border-radius: 20px 20px 0 0;
  padding: 20px 16px 32px; animation: slideUp 0.25s ease;
}
.share-panel-title {
  font-size: 15px; font-weight: 600; color: #333;
  text-align: center; margin-bottom: 16px;
}
.share-panel-btns { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.share-panel-btn {
  width: 100%; padding: 14px; background: #f8f9fa;
  border: none; border-radius: 10px;
  font-size: 15px; color: #333; cursor: pointer;
}
.share-panel-btn:active { background: #efefef; }
.share-panel-cancel {
  width: 100%; padding: 14px; background: #fff;
  border: 1px solid #e8e8e8; border-radius: 10px;
  font-size: 15px; color: #999; cursor: pointer;
}

/* ── Toast ──────────────────────────────────────────────── */
.app-toast {
  position: fixed; bottom: 72px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(0,0,0,0.7); color: #fff;
  padding: 9px 20px; border-radius: 20px; font-size: 13px;
  pointer-events: none; opacity: 0; transition: opacity 0.2s, transform 0.2s;
  z-index: 400;
}
.app-toast.success { background: rgba(22,163,74,0.9); }
.app-toast.error   { background: rgba(220,38,38,0.9); }
.app-toast.info    { background: rgba(37,99,235,0.9); }

/* ── SMS Code Button ───────────────────────────────────── */
.m-btn-secondary {
  padding: 10px 14px;
  background: #f5f7fa;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 13px;
  color: #2563eb;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.m-btn-secondary:disabled {
  background: #f0f0f0 !important;
  color: #999 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  opacity: 0.6 !important;
}
.m-btn-secondary:not(:disabled):active {
  background: #e8ecf1;
}

/* 确保短信验证码按钮可点击 */
#sms-btn {
  position: relative;
  z-index: 1;
}
#sms-btn:not(:disabled) {
  pointer-events: auto !important;
}


/* ── Card Activation Section ───────────────────────────── */
.m-card-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.m-card-input-row .m-input {
  flex: 1;
}
.m-btn-sm {
  padding: 10px 14px;
  background: #2563eb;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}
.m-btn-sm:active { background: #1d4ed8; }
.m-card-info-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid #e8f0fe;
  font-size: 13px;
  color: #374151;
}
.m-card-info-row:last-of-type { border-bottom: none; }

/* ── Bottom Tab Bar ──────────────────────────────────────── */
.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: #fff;
  border-top: 1px solid #f0f0f0;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}
.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  color: #999;
  transition: color 0.2s;
}
.tab-btn.active { color: #667eea; }
.tab-icon { font-size: 22px; }
.tab-label { font-size: 11px; font-weight: 500; }

/* ── Modal Overlay ─────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.hidden { display: none !important; }

.modal-content {
  width: 100%;
  max-height: 80vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  animation: slideUp 0.25s ease;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: #333;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}


