/* ============================================================
   English Assessment Platform — Modern Design System
   Clean, international, fully responsive
   ============================================================ */

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --primary-lighter: #f5f3ff;
  --accent: #7c3aed;
  --teal: #0d9488;
  --teal-light: #ccfbf1;
  --amber: #d97706;
  --amber-light: #fef3c7;
  --rose: #e11d48;
  --rose-light: #ffe4e6;
  --green: #059669;
  --green-light: #d1fae5;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #2563eb;
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0f172a;
  --text-2: #334155;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-2: #cbd5e1;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.08), 0 8px 40px rgba(0,0,0,0.10);
  --shadow-xl: 0 8px 60px rgba(0,0,0,0.12);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Navbar ===== */
.navbar {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  padding: 0 40px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.3px;
}

.navbar-brand .logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px; font-weight: 800;
  box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}

.navbar-nav { display: flex; gap: 4px; align-items: center; }
.navbar-hamburger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px;
  width: 40px; height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.navbar-hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: var(--transition);
}
.navbar-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-hamburger.open span:nth-child(2) { opacity: 0; }
.navbar-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.navbar-hamburger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px;
  width: 40px; height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.navbar-hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text-2);
  border-radius: 2px;
  transition: var(--transition);
}
.navbar-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-hamburger.open span:nth-child(2) { opacity: 0; }
.navbar-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.navbar-nav a {
  color: var(--text-2);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.navbar-nav a:hover { background: var(--primary-light); color: var(--primary); }
.navbar-nav a.active { background: var(--primary); color: white; }

.navbar-right { display: flex; align-items: center; gap: 12px; }

/* Language switcher */
.lang-switch {
  display: flex; gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.lang-btn {
  padding: 6px 12px;
  font-size: 13px; font-weight: 600;
  border: none; background: transparent;
  cursor: pointer; transition: var(--transition);
  color: var(--text-muted);
}
.lang-btn.active { background: var(--primary); color: white; }
.lang-btn:hover:not(.active) { background: var(--bg-alt); }

/* ===== Language dropdown (5 languages) ===== */
.lang-dropdown { position: relative; }
.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: transparent; cursor: pointer;
  color: var(--text-2); transition: var(--transition);
  white-space: nowrap;
}
.lang-toggle:hover { background: var(--bg-alt); }
.lang-caret { font-size: 10px; color: var(--text-muted); }
.lang-menu {
  display: none;
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 140px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 1000;
}
.lang-menu.open { display: block; }
.lang-option {
  display: block; width: 100%;
  padding: 10px 14px;
  font-size: 13px; text-align: left;
  border: none; background: transparent;
  cursor: pointer; color: var(--text-2);
  transition: var(--transition);
}
.lang-option:hover { background: var(--bg-alt); }
.lang-option.active { background: var(--primary); color: white; font-weight: 600; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 28px;
  border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: var(--transition);
  text-decoration: none; font-family: inherit;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(79,70,229,0.25); }
.btn-secondary { background: white; color: var(--primary); border: 2px solid var(--border-2); }
.btn-secondary:hover { background: var(--primary-light); border-color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-alt); }
.btn-large { padding: 16px 40px; font-size: 17px; border-radius: var(--radius); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Landing Page Hero ===== */
.hero {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #6366f1 100%);
  color: white;
  padding: 80px 32px 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute;
  top: -40%; right: -10%;
  width: 500px; height: 500px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.hero::after {
  content: ''; position: absolute;
  bottom: -30%; left: -5%;
  width: 400px; height: 400px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}
.hero-content { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: 44px; font-weight: 800; margin-bottom: 20px; letter-spacing: -1px; line-height: 1.2; }
.hero p { font-size: 18px; opacity: 0.92; margin-bottom: 36px; line-height: 1.7; }
.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero .btn-primary { background: white; color: var(--primary); }
.hero .btn-primary:hover { background: #f8fafc; }
.hero .btn-secondary { background: transparent; color: white; border: 2px solid rgba(255,255,255,0.5); }
.hero .btn-secondary:hover { background: rgba(255,255,255,0.12); border-color: white; }

.hero-stats {
  display: flex; gap: 40px; justify-content: center;
  margin-top: 48px; flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat .stat-num { font-size: 32px; font-weight: 800; }
.hero-stat .stat-label { font-size: 13px; opacity: 0.8; }

/* ===== Features ===== */
.features {
  max-width: 1080px; margin: -60px auto 0;
  position: relative; z-index: 2;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.feature-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 16px;
}
.feature-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.feature-card p { color: var(--text-muted); font-size: 14px; line-height: 1.6; }

/* ===== How It Works ===== */
.how-section { max-width: 1080px; margin: 0 auto; padding: 80px 24px; }
.how-section h2 { text-align: center; font-size: 32px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.5px; }
.how-section .subtitle { text-align: center; color: var(--text-muted); font-size: 16px; margin-bottom: 48px; }
.how-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.how-step { text-align: center; }
.how-step-num {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 24px; font-weight: 800;
  margin: 0 auto 16px;
  box-shadow: 0 4px 16px rgba(79,70,229,0.25);
}
.how-step h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.how-step p { color: var(--text-muted); font-size: 14px; }

/* ===== RIT Scale Section ===== */
.rit-section { background: var(--surface); padding: 80px 24px; }
.rit-section-inner { max-width: 1080px; margin: 0 auto; }
.rit-section h2 { text-align: center; font-size: 32px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.5px; }
.rit-section .subtitle { text-align: center; color: var(--text-muted); font-size: 16px; margin-bottom: 48px; }

.rit-scale { display: flex; flex-direction: column; gap: 4px; max-width: 800px; margin: 0 auto; }
.rit-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.rit-bar:hover { transform: translateX(4px); }
.rit-bar .rit-range { font-weight: 800; font-size: 16px; width: 80px; flex-shrink: 0; }
.rit-bar .rit-label { flex: 1; font-size: 14px; color: var(--text-2); }
.rit-bar .rit-cefr { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 20px; }

/* ===== Age/Grade Selection Page ===== */
.grade-container { max-width: 720px; margin: 0 auto; padding: 60px 24px; }
.grade-header { text-align: center; margin-bottom: 40px; }
.grade-header h1 { font-size: 32px; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.5px; }
.grade-header p { color: var(--text-muted); font-size: 16px; }

.grade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.grade-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text);
  display: block;
}
.grade-card:hover { border-color: var(--primary); background: var(--primary-light); transform: translateY(-2px); box-shadow: var(--shadow); }
.grade-card .gc-label { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.grade-card .gc-age { font-size: 12px; color: var(--text-muted); }

.phone-input-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.phone-input-section h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.phone-input-section p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.phone-input-wrap { display: flex; gap: 12px; align-items: center; }
.phone-input {
  flex: 1; padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px; transition: var(--transition);
  font-family: inherit;
}
.phone-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.phone-note { font-size: 12px; color: var(--text-light); margin-top: 12px; }

/* ===== Test Page ===== */
.test-container { max-width: 780px; margin: 0 auto; padding: 24px 24px 60px; }

.test-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.test-progress-bar {
  width: 100%; height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 28px;
  overflow: hidden;
}
.test-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width 0.3s ease;
}

.test-question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px;
}

.question-meta { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.meta-tag { font-size: 11px; padding: 4px 10px; border-radius: 20px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; }
.meta-subject-reading { background: var(--teal-light); color: var(--teal); }
.meta-subject-language { background: var(--primary-lighter); color: var(--accent); }
.meta-rit { background: var(--bg-alt); color: var(--text-muted); }

.question-text {
  font-size: 17px; font-weight: 600;
  line-height: 1.7; margin-bottom: 28px;
  white-space: pre-wrap;
}

.options-list { display: flex; flex-direction: column; gap: 10px; }
.option-item {
  display: flex; align-items: center;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--transition);
  font-size: 15px; line-height: 1.5;
}
.option-item:hover { border-color: var(--primary); background: var(--primary-light); }
.option-item.selected { border-color: var(--primary); background: var(--primary-light); }
.option-letter {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  margin-right: 14px; flex-shrink: 0;
  transition: var(--transition);
}
.option-item:hover .option-letter,
.option-item.selected .option-letter { background: var(--primary); color: white; }

.test-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 28px;
}
.test-info { font-size: 13px; color: var(--text-muted); }

.result-feedback {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-top: 16px;
  font-size: 14px; font-weight: 600;
}
.result-feedback.correct { background: var(--green-light); color: var(--green); }
.result-feedback.wrong { background: var(--rose-light); color: var(--rose); }

/* ===== Report Page ===== */
.report-container { max-width: 920px; margin: 0 auto; padding: 24px 24px 60px; }

.report-header { text-align: center; margin-bottom: 32px; }
.report-header h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.5px; }
.report-header .report-date { color: var(--text-muted); font-size: 14px; }

.report-actions {
  display: flex; gap: 12px; justify-content: center;
  margin-bottom: 32px; flex-wrap: wrap;
}

/* RIT Score Hero */
.rit-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: var(--radius-xl);
  padding: 40px;
  text-align: center;
  color: white;
  margin-bottom: 24px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.rit-hero::before {
  content: ''; position: absolute;
  top: -30%; right: -10%;
  width: 300px; height: 300px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
}
.rit-score-big {
  font-size: 64px; font-weight: 800;
  line-height: 1; margin-bottom: 8px;
  position: relative; z-index: 1;
}
.rit-label-big { font-size: 14px; opacity: 0.85; margin-bottom: 24px; position: relative; z-index: 1; }

.rit-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  position: relative; z-index: 1;
}
.rit-score-item {
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.rit-score-item .rs-value { font-size: 20px; font-weight: 700; }
.rit-score-item .rs-label { font-size: 11px; opacity: 0.8; margin-top: 2px; }

/* Report sections */
.report-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  margin-bottom: 20px;
}
.report-section h2 {
  font-size: 18px; font-weight: 700;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 8px;
}
.report-section h2 .icon { font-size: 20px; }

/* Bar chart (CSS-based) */
.bar-chart { display: flex; flex-direction: column; gap: 16px; }
.bar-chart-row {
  display: flex; align-items: center; gap: 12px;
}
.bar-chart-label {
  width: 140px; font-size: 14px; font-weight: 600;
  color: var(--text-2); flex-shrink: 0;
}
.bar-chart-track {
  flex: 1; height: 32px;
  background: var(--bg-alt);
  border-radius: var(--radius-xs);
  overflow: hidden;
  position: relative;
}
.bar-chart-fill {
  height: 100%;
  border-radius: var(--radius-xs);
  transition: width 0.8s ease;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 10px;
  font-size: 13px; font-weight: 700; color: white;
}
.bar-fill-green { background: linear-gradient(90deg, var(--green), #10b981); }
.bar-fill-amber { background: linear-gradient(90deg, var(--amber), #f59e0b); }
.bar-fill-rose { background: linear-gradient(90deg, var(--rose), #f43f5e); }
.bar-fill-primary { background: linear-gradient(90deg, var(--primary), #818cf8); }
.bar-fill-teal { background: linear-gradient(90deg, var(--teal), #14b8a6); }
.bar-fill-purple { background: linear-gradient(90deg, var(--accent), #a78bfa); }

/* Percentile visual */
.percentile-box {
  text-align: center; padding: 24px;
}
.percentile-chart {
  position: relative; height: 60px;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  margin: 20px 0;
  overflow: hidden;
}
.percentile-marker {
  position: absolute;
  top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
}
.percentile-marker::after {
  content: attr(data-pct);
  position: absolute;
  top: -28px; left: 50%;
  transform: translateX(-50%);
  font-size: 12px; font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}
.percentile-desc { font-size: 14px; color: var(--text-muted); margin-top: 8px; }

/* Gap analysis */
.gap-card {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  border-left: 4px solid;
}
.gap-card.reached { background: var(--green-light); border-color: var(--green); }
.gap-card.not-reached { background: var(--amber-light); border-color: var(--amber); }
.gap-card .gap-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.gap-card .gap-desc { font-size: 14px; color: var(--text-2); }
.gap-progress {
  height: 8px; background: var(--bg-alt);
  border-radius: 4px; margin-top: 10px;
  overflow: hidden;
}
.gap-progress-fill { height: 100%; border-radius: 4px; transition: width 0.8s; }

/* Recommendations */
.rec-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.rec-item {
  display: flex; gap: 14px;
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.rec-icon { font-size: 20px; flex-shrink: 0; }
.rec-content { flex: 1; }
.rec-title { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.rec-author { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.rec-desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* Answer review */
.answer-review { display: flex; flex-direction: column; gap: 10px; }
.answer-review-item {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border-left: 3px solid;
}
.answer-review-item .arq-question { font-size: 14px; font-weight: 600; margin-bottom: 8px; line-height: 1.5; }
.answer-review-item .arq-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.answer-review-item .arq-result { font-size: 13px; font-weight: 600; }

/* ===== History Page ===== */
.history-container { max-width: 880px; margin: 0 auto; padding: 24px 24px 60px; }
.history-header { margin-bottom: 32px; }
.history-header h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.history-header p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.history-search {
  display: flex; gap: 12px;
  margin-bottom: 32px;
}
.history-search input {
  flex: 1; padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px; font-family: inherit;
  transition: var(--transition);
}
.history-search input:focus { outline: none; border-color: var(--primary); }

/* ===== Page Container & Titles (history page) ===== */
.page-container { max-width: 1000px; margin: 0 auto; padding: 40px 24px 60px; }
.page-title { font-size: 28px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.page-subtitle { font-size: 15px; color: var(--text-muted); margin-bottom: 28px; }

.history-search-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 40px 36px;
  max-width: 560px;
  margin: 0 auto 40px;
}
.history-search-card .phone-input-wrap { margin-bottom: 12px; }
.history-search-card .phone-input { flex: 1; }
.search-error { color: var(--danger); font-size: 13px; min-height: 18px; font-weight: 500; }

/* ===== History Result Cards ===== */
.history-list { display: flex; flex-direction: column; gap: 12px; }
.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 22px; align-items: center;
  transition: var(--transition);
}
.history-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.hc-left { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hc-rit-circle {
  width: 68px; height: 68px;
  border: 3px solid var(--primary);
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: var(--surface);
}
.hc-rit-circle .hc-rit-num { font-size: 20px; font-weight: 800; line-height: 1.1; }
.hc-rit-circle .hc-rit-label { font-size: 10px; color: var(--text-muted); font-weight: 600; letter-spacing: 0.5px; }
.hc-badge { font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px; }

.hc-center { min-width: 0; }
.hc-center .hc-date { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.hc-center .hc-scores { display: flex; gap: 18px; font-size: 13px; flex-wrap: wrap; margin-bottom: 10px; }
.hc-center .hc-scores span { color: var(--text-muted); }
.hc-center .hc-scores span strong { color: var(--text); }
.hc-subjects { display: flex; flex-direction: column; gap: 6px; }
.mini-bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.mini-bar-label { width: 90px; color: var(--text-muted); flex-shrink: 0; }
.mini-bar-track { flex: 1; height: 8px; background: var(--bg-alt); border-radius: 999px; overflow: hidden; max-width: 220px; }
.mini-bar-fill { height: 100%; border-radius: 999px; transition: width 0.6s ease; }
.mini-bar-score { font-weight: 700; color: var(--text-2); }

.hc-right .btn-sm { padding: 8px 18px; font-size: 13px; white-space: nowrap; }

.history-actions { text-align: center; padding: 32px 0 8px; }

/* ===== RIT Growth Trend Chart ===== */
.trend-section { margin-bottom: 28px; }
.trend-chart {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 28px; height: 180px;
  padding: 20px 12px 8px;
  border-bottom: 2px solid var(--border);
}
.trend-bar-group { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.trend-bar {
  width: 44px; border-radius: 8px 8px 0 0;
  position: relative;
  display: flex; align-items: flex-start; justify-content: center;
  animation: growUp 0.8s ease both;
  min-height: 12px;
}
.trend-bar-label {
  position: absolute; top: -22px;
  font-size: 12px; font-weight: 700; color: var(--text);
}
.trend-bar-date { font-size: 11px; color: var(--text-muted); margin-top: 8px; white-space: nowrap; }
@keyframes growUp { from { height: 0; } }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 15px; margin-bottom: 20px; }

/* ===== Loading ===== */
.loading-overlay { display: flex; align-items: center; justify-content: center; min-height: 300px; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Mobile Notice Banner ===== */
.mobile-notice {
  display: none;
  background: var(--amber-light);
  color: #92400e;
  padding: 10px 24px;
  text-align: center;
  font-size: 13px; font-weight: 500;
  border-bottom: 1px solid var(--amber);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .navbar { padding: 0 12px; gap: 8px; }
  .navbar-brand .brand-text { display: none; }
  .navbar-hamburger { display: flex; }
  .navbar-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: white;
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: 8px 12px;
    gap: 0;
    display: none;
  }
  .navbar-nav.open { display: flex; }
  .navbar-nav a {
    padding: 12px 14px;
    font-size: 15px;
    border-radius: var(--radius-sm);
    border-bottom: 1px solid var(--border);
  }
  .navbar-nav a:last-child { border-bottom: none; }
  .navbar-right .lang-toggle { padding: 6px 10px; font-size: 12px; }
  .lang-menu { right: -10px; }

  .hero { padding: 36px 16px 48px; }
  .hero h1 { font-size: 26px; line-height: 1.3; }
  .hero p { font-size: 14px; line-height: 1.7; }
  .hero-buttons { flex-direction: column; gap: 12px; width: 100%; max-width: 320px; margin-left: auto; margin-right: auto; }
  .hero-buttons .btn { width: 100%; padding: 14px 24px; }
  .hero-stats { gap: 16px; margin-top: 28px; }
  .hero-stat .stat-num { font-size: 22px; }
  .hero-stat .stat-label { font-size: 12px; }

  .features { grid-template-columns: 1fr; padding: 0 16px; margin-top: -32px; gap: 12px; }
  .feature-card { padding: 18px; }
  .feature-card h3 { font-size: 15px; }
  .feature-card p { font-size: 13px; }

  .how-section { padding: 40px 16px; }
  .how-section h2 { font-size: 22px; }
  .how-section .subtitle { font-size: 14px; }
  .how-steps { grid-template-columns: 1fr 1fr; gap: 12px; }
  .how-step { padding: 16px 12px; }
  .how-step h3 { font-size: 14px; }
  .how-step p { font-size: 12px; }

  .rit-section { padding: 40px 16px; }
  .rit-section h2 { font-size: 22px; }
  .rit-bar { padding: 8px 12px; flex-wrap: wrap; gap: 4px 8px; }
  .rit-range { font-size: 12px; min-width: 60px; }
  .rit-label { font-size: 12px; flex: 1 1 100%; }
  .rit-cefr { font-size: 11px; padding: 2px 8px; }

  .mobile-notice { display: block; padding: 8px 16px; font-size: 12px; }

  .grade-container { padding: 32px 14px; }
  .grade-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .grade-card { padding: 12px 6px; }
  .grade-card .gc-label { font-size: 13px; }
  .grade-card .gc-sub { font-size: 11px; }

  .phone-input-wrap { flex-direction: column; }

  .test-container { padding: 14px 10px 32px; }
  .test-question-card { padding: 18px; border-radius: var(--radius); }
  .question-text { font-size: 15px; line-height: 1.6; }
  .option-item { padding: 12px 14px; font-size: 14px; }
  .test-progress { font-size: 12px; }

  .report-container { padding: 14px 10px 32px; }
  .rit-hero { padding: 24px 16px; border-radius: var(--radius); }
  .rit-score-big { font-size: 40px; }
  .rit-score-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .report-section { padding: 18px; }

  .bar-chart-label { width: 90px; font-size: 12px; }

  .history-container { padding: 14px 10px 32px; }
  .page-container { padding: 20px 12px 32px; }
  .history-search-card { padding: 22px 16px; }
  .history-card { grid-template-columns: 70px 1fr; padding: 14px; gap: 12px; }
  .history-card .hc-right { grid-column: 1 / -1; text-align: right; padding-top: 8px; border-top: 1px solid var(--border); }
  .history-card .hc-rit-circle { width: 52px; height: 52px; }
  .history-card .hc-rit-circle .hc-rit-num { font-size: 16px; }
  .trend-chart { gap: 12px; height: 140px; }
  .trend-bar { width: 28px; }
  .mini-bar-track { max-width: 140px; }

  .history-search { flex-direction: column; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 24px; }
  .grade-grid { grid-template-columns: repeat(2, 1fr); }
  .rit-score-grid { grid-template-columns: 1fr 1fr; }
  .how-steps { grid-template-columns: 1fr; }
}
