:root {
  --bg: #f8fafc;
  --bg-subtle: #f1f5f9;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --primary: #0d9488;
  --primary-hover: #0f766e;
  --primary-active: #115e59;
  --primary-light: #f0fdfa;
  --primary-border: #99f6e4;
  --emerald: #10b981;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-card: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 8px -1px rgba(15, 23, 42, 0.03);
  --shadow-hover: 0 12px 32px -4px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}
html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg);
  background-image: radial-gradient(circle at 50% 12%, rgba(204, 251, 241, 0.5) 0%, rgba(240, 253, 250, 0.25) 35%, #f8fafc 70%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography & Links */
a {
  color: inherit;
  text-decoration: none;
}
button, input, textarea, select {
  font: inherit;
  color: inherit;
}
button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

[hidden] {
  display: none !important;
}

/* Shared Header */
.site-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
}
.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
}
.site-brand .brand-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  transition: all 0.15s ease;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-light);
}
.user-btn {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-btn:hover {
  border-color: var(--primary-border);
  color: var(--primary);
}

/* Common Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.4);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

/* ==========================================================
   1. LANDING & PRACTICE STAGE
   ========================================================== */
.stage-wrap {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}
.stage-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  outline: none;
}
.stage-content {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
}
.stage-content.scene-fading {
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
}

/* Minimalist prompt like Image 1 */
.landing-prompt {
  font-size: clamp(48px, 6vw, 84px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 0 0 18px 0;
  color: var(--text-main);
}
.prompt-accent {
  color: var(--primary);
  position: relative;
  display: inline-block;
}
.landing-sub {
  font-size: 15px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin: 0;
}

/* Active exercise timer / progress */
.timer-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--primary-border);
  color: var(--primary);
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.12);
  margin-top: 24px;
}
.dots-progress {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
  flex-wrap: wrap;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}
.dots-progress span {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.3s ease;
}
.dots-progress span.active {
  background: var(--primary);
}

/* ==========================================================
   2. COMPLETION VIEW (Image 2 style)
   ========================================================== */
.completion-container {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  text-align: left;
  cursor: default;
}
.completion-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 36px;
  margin-bottom: 24px;
}
.completion-check-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}
.check-aura {
  position: absolute;
  inset: -10px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, rgba(16, 185, 129, 0) 70%);
  border-radius: 50%;
  animation: pulseAura 3s infinite ease-in-out;
}
@keyframes pulseAura {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 0.4; }
}
.check-circle {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}
.check-circle svg {
  width: 48px;
  height: 48px;
  stroke-width: 3;
}
.completion-info {
  flex: 1;
  min-width: 0;
}
.completion-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px 0;
  color: var(--text-main);
}
.completion-title .rank-num {
  color: var(--primary);
}
.completion-reward-text {
  font-size: 18px;
  color: var(--text-muted);
  margin: 0 0 20px 0;
}
.completion-reward-text b {
  color: var(--primary);
  font-size: 22px;
}
.completion-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.status-pill {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-muted);
}
.status-pill.credited {
  background: #ecfdf5;
  color: var(--emerald);
  border: 1px solid #a7f3d0;
}

/* Two column layout like Image 2 */
.completion-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  align-items: start;
}

/* Collapsible card (native details/summary accordion) */
.card-collapse {
  padding: 0;
  overflow: hidden;
}
.card-collapse > .collapse-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 20px 24px;
  gap: 12px;
  user-select: none;
  border-radius: var(--radius);
  transition: background-color 0.15s ease;
}
.card-collapse > .collapse-summary::-webkit-details-marker {
  display: none;
}
.card-collapse > .collapse-summary:hover {
  background: var(--bg-subtle);
}
.card-collapse > .collapse-summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.collapse-chevron {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}
.card-collapse[open] .collapse-chevron {
  transform: rotate(180deg);
}
.collapse-body {
  padding: 0 24px 24px;
}

.card-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}
.card-subtitle {
  font-size: 12px;
  color: var(--text-dim);
  font-weight: normal;
  margin-left: 8px;
}

/* Rank Table */
.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 320px;
}
.rank-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-subtle);
  box-shadow: 0 1px 0 var(--border);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 10px 14px;
  white-space: nowrap;
}
.rank-table th:last-child {
  text-align: right;
}
.rank-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
  white-space: nowrap;
}
.rank-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--primary);
}
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}
.rank-1 { background: #fef3c7; color: #b45309; }
.rank-2 { background: #e2e8f0; color: #475569; }
.rank-3 { background: #fed7aa; color: #c2410c; }
.rank-table tr.current-user {
  background: var(--primary-light);
  border-radius: var(--radius-sm);
}

/* Rules List */
.rules-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
}
.rules-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}
.rules-list li .tier-range {
  color: var(--text-main);
  font-weight: 500;
}
.rules-list li .tier-val {
  color: var(--primary);
  font-weight: 600;
}

/* Quota progress bar */
.quota-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.quota-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}
.quota-bar-track {
  width: 100%;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: 4px;
  overflow: hidden;
}
.quota-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #14b8a6, #0d9488);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ==========================================================
   3. SHOP & DONATE PAGES (Image 3 style)
   ========================================================== */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}
.page-hero {
  margin-bottom: 32px;
}
.page-hero h1 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px 0;
}
.page-hero p {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0;
}

.shop-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
.wallet-box-balance {
  font-size: 44px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.03em;
  margin: 12px 0 20px 0;
}
.wallet-box-balance span {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 6px;
}

/* Product Cards Grid */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.product-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
}
.product-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.product-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 4px;
  padding: 2px 6px;
  align-self: flex-start;
  margin-bottom: 12px;
}
.product-name {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px 0;
}
.product-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 16px 0;
  flex: 1;
}
.product-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

/* Donate page preset chips */
.amount-chips {
  display: flex;
  gap: 8px;
  margin: 12px 0 20px 0;
  flex-wrap: wrap;
}
.amount-chip {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  background: #ffffff;
  transition: all 0.15s ease;
}
.amount-chip:hover, .amount-chip.selected {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.notice-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #92400e;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
}

/* ==========================================================
   4. ADMIN BACKEND (Image 4 style)
   ========================================================== */
.admin-shell {
  display: flex;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: var(--bg);
}
.admin-sidebar {
  width: 240px;
  height: 100%;
  background: #ffffff;
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;

}
.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  padding: 0 12px 24px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
}
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.admin-nav-item:hover, .admin-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.admin-content {
  flex: 1;
  height: 100%;
  padding: 32px 40px 100px;
  max-width: 1400px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  scroll-behavior: smooth;

}

/* Admin Metric Stat Cards */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.metric-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.metric-val {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 8px;
}
.metric-sub {
  font-size: 12px;
  color: var(--text-dim);
}

/* Modern Tables & Custom Scrollbars */
.table-wrap {
  max-height: 280px;
  overflow: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #ffffff;
  width: 100%;
}
.data-scroll-box {
  max-height: 640px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
}
.table-wrap::-webkit-scrollbar,
.data-scroll-box::-webkit-scrollbar,
.admin-content::-webkit-scrollbar,
.admin-sidebar::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.table-wrap::-webkit-scrollbar-track,
.data-scroll-box::-webkit-scrollbar-track,
.admin-content::-webkit-scrollbar-track,
.admin-sidebar::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 5px;
}
.table-wrap::-webkit-scrollbar-thumb,
.data-scroll-box::-webkit-scrollbar-thumb,
.admin-content::-webkit-scrollbar-thumb,
.admin-sidebar::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 5px;
  border: 2px solid #f1f5f9;
}
.table-wrap::-webkit-scrollbar-thumb:hover,
.data-scroll-box::-webkit-scrollbar-thumb:hover,
.admin-content::-webkit-scrollbar-thumb:hover,
.admin-sidebar::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}
.table-wrap::-webkit-scrollbar-corner,
.data-scroll-box::-webkit-scrollbar-corner {
  background: #f1f5f9;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-subtle);
  box-shadow: 0 1px 0 var(--border);
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.data-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.data-table td.cell-wrap {
  white-space: normal;
  word-break: break-word;
  min-width: 120px;
  max-width: 240px;
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table tr:hover td {
  background: #f8fafc;
}

/* Prevent accidental wrap on badges, pills, buttons, and keys */
.status-pill, .product-badge, .brand-badge, .rank-badge, .amount-chip, .btn-primary, .btn-secondary, .user-btn {
  white-space: nowrap;
  flex-shrink: 0;
}
/* Forms */
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}
.input-text, .input-select, .input-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-text:focus, .input-select:focus, .input-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

/* Dialogs */
.dialog-modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 32px;
  background: #ffffff;
  box-shadow: var(--shadow-hover);
  max-width: 440px;
  width: 90%;
}
.dialog-modal::backdrop {
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
}

/* Toast Notice */
.toast-notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-main);
  color: #ffffff;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  box-shadow: var(--shadow-hover);
  z-index: 9999;
  animation: toastIn 0.25s ease-out;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.landing-prompt,
.landing-sub {
  opacity: 1;
  transition: opacity 0.2s ease !important;
}
#prompt {
  transition-duration: var(--prompt-fade-duration, 1s) !important;
  transition-timing-function: linear !important;
}
#prompt[data-auto-prompt] {
  transition: none !important;
}
#stageCountdown {
  font-variant-numeric: tabular-nums;
}
.practice-text-fading {
  opacity: 0 !important;
}
.auto-stop-button {
  margin-top: 20px;
}

.practice-preferences {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10000;
  color: var(--text-main);
}
.practice-preferences > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-left: auto;
  border: 1px solid var(--primary-border);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--primary-active);
  box-shadow: var(--shadow-hover);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  list-style: none;
}
.practice-preferences > summary::-webkit-details-marker {
  display: none;
}
.practice-preferences[open] > summary {
  margin-top: 10px;
  order: 2;
}
.practice-preferences[open] {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.preferences-panel {
  width: min(350px, calc(100vw - 28px));
  max-height: min(680px, calc(100vh - 100px));
  overflow-y: auto;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-hover);
}
.preferences-panel h2 {
  margin: 0 0 16px;
  font-size: 18px;
}
.preference-mode {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}
.preference-mode legend {
  margin-bottom: 10px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}
.preference-mode-options {
  display: flex;
  gap: 24px;
}
.preference-mode-options .preference-check {
  margin: 0;
}
.preference-error {
  color: #dc2626;
  font-size: 12px;
  font-weight: 400;
}
.preference-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.preference-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}
.preference-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  color: var(--text-muted);
  font-size: 13px;
}
.preference-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}
.preference-reminders {
  margin: 16px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.preference-reminders legend {
  padding: 0 4px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
}
.preference-note {
  margin: 8px 0 12px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
}

html.practice-page-root,
html.practice-page-root body {
  overflow-x: clip;
}
.practice-page .site-header {
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(10px);
}
.practice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 28px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
  align-items: start;
}
.practice-main-column {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
.practice-ranking {
  padding: 24px;
}
.practice-ranking-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.practice-ranking-total {
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
}
.practice-settings-panel {
  padding: 0;
  overflow: hidden;
}
.practice-settings-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px;
  cursor: pointer;
  list-style: none;
}
.practice-settings-summary::-webkit-details-marker {
  display: none;
}
.practice-settings-title {
  color: var(--text-main);
  font-size: 18px;
  font-weight: 700;
}
.practice-settings-toggle {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
}
.practice-settings-toggle::before {
  content: "收起";
}
.practice-settings-panel:not([open]) .practice-settings-toggle::before {
  content: "展开";
}
.practice-settings-body {
  padding: 0 22px 22px;
}
.practice-layout .stage-main {
  min-height: 540px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}
.practice-layout .landing-prompt {
  font-size: clamp(32px, 4.5vw, 64px);
}
.practice-layout > aside .preferences-panel {
  width: 100%;
  max-height: none;
  overflow: visible;
}
.practice-footer {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
}
@media (max-width: 820px) {
  .practice-layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px;
  }
  .practice-layout .stage-main {
    min-height: 340px;
    padding: 32px 16px;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .site-header {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 8px;
  }
  .site-brand {
    font-size: 18px;
  }
  .site-nav {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 4px;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .nav-link {
    font-size: 13px;
    padding: 6px 10px;
  }
  .user-btn {
    font-size: 12px;
    padding: 5px 10px;
    max-width: 130px;
  }
  .page-wrap {
    padding: 16px 14px 60px;
  }
  .card {
    padding: 20px 16px;
  }
  .card-collapse {
    padding: 0;
  }
  .card-collapse > .collapse-summary {
    padding: 16px;
  }
  .collapse-body {
    padding: 0 16px 16px;
  }
  .completion-grid, .shop-columns, .metrics-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .completion-card {
    flex-direction: column;
    text-align: center;
    gap: 18px;
    padding: 24px 16px;
  }
  .completion-actions {
    justify-content: center;
  }
  .table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .admin-shell {
    position: static;
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .admin-sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .admin-sidebar-brand {
    padding: 0 0 12px;
    margin-bottom: 8px;
  }
  .admin-nav {
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 6px;
  }
  .admin-content {
    height: auto;
    padding: 20px 14px 60px;
    overflow: visible;
  }
  #sec-products > div {
    grid-template-columns: 1fr !important;
  }
  #sec-records > div {
    grid-template-columns: 1fr !important;
  }
}
@media (max-width: 768px) {
  .practice-preferences {
    right: 14px;
    bottom: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  .landing-prompt,
  .landing-sub,
  .stage-content {
    transition: opacity 0.2s ease !important;
  }
  .stage-content.scene-fading {
    transform: none;
  }
}
