/* ========================================
   EikenWriter - 英検2級ライティング添削AI
   Beatwriting-inspired design
   ======================================== */

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #059669;
  --primary-light: #10b981;
  --primary-dark: #047857;
  --primary-bg: #ecfdf5;
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --accent-bg: #fffbeb;
  --bg: #f9fafb;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --red: #ef4444;
  --red-light: #fef2f2;
  --blue: #3b82f6;
  --blue-light: #eff6ff;
  --border: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 40px -5px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font-ja: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
  --font-en: 'Inter', sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-ja);
  color: var(--gray-800);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Header ---- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--gray-900);
}

.logo-icon {
  font-size: 24px;
}

.logo-text {
  font-family: var(--font-en);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-accent {
  color: var(--primary);
}

.nav {
  display: flex;
  gap: 32px;
}

.nav-link {
  text-decoration: none;
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--primary);
}

/* Hamburger Menu Button (hidden on desktop) */
.menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-700);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.menu-btn:hover {
  background: var(--gray-100);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ja);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  background: var(--gray-300);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--white);
  color: var(--gray-700);
  border: 2px solid var(--gray-200);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-outline {
  background: transparent;
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-large {
  padding: 14px 32px;
  font-size: 16px;
  border-radius: var(--radius);
}

/* ---- Hero Section ---- */
.hero {
  position: relative;
  padding: 120px 24px 80px;
  overflow: hidden;
  background: var(--white);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, var(--gray-200) 1px, transparent 0);
  background-size: 32px 32px;
  opacity: 0.5;
}

.hero-content {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  background: var(--primary-bg);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(5, 150, 105, 0.2);
}

.hero-title {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--gray-900);
  margin-bottom: 20px;
}

.hero-title-accent {
  display: block;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 17px;
  color: var(--gray-600);
  line-height: 1.8;
  margin-bottom: 28px;
}

.highlight {
  position: relative;
  font-weight: 600;
  color: var(--gray-800);
}

.highlight::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: var(--accent);
  opacity: 0.3;
  border-radius: 2px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 24px;
  font-size: 13px;
  color: var(--gray-700);
  font-weight: 500;
}

.badge-icon {
  font-size: 16px;
}

.hero-cta {
  display: flex;
  gap: 14px;
}

/* Demo Card */
.demo-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  border: 1px solid var(--border);
}

.demo-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
}

.demo-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.demo-dot.red { background: #ef4444; }
.demo-dot.yellow { background: #f59e0b; }
.demo-dot.green { background: #10b981; }

.demo-card-title {
  margin-left: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-500);
}

.demo-card-body {
  padding: 24px;
}

.demo-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.demo-label {
  width: 40px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
}

.demo-bar {
  flex: 1;
  height: 10px;
  background: var(--gray-100);
  border-radius: 5px;
  overflow: hidden;
}

.demo-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 5px;
  transition: width 1s ease;
}

.demo-score {
  width: 36px;
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  text-align: right;
}

.demo-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 2px solid var(--gray-100);
  font-weight: 600;
  color: var(--gray-700);
}

.demo-total-score {
  font-family: var(--font-en);
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

.demo-total-score small {
  font-size: 16px;
  color: var(--gray-400);
  font-weight: 500;
}

/* ---- Section Common ---- */
.section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  font-size: 16px;
  color: var(--gray-500);
  margin-bottom: 48px;
}

/* ---- Features ---- */
.features-section {
  background: var(--white);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  padding: 32px;
  background: var(--gray-50);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: all 0.3s;
}

.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: rgba(5, 150, 105, 0.2);
}

.feature-icon {
  font-size: 36px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 14px;
  color: var(--gray-500);
  line-height: 1.7;
}

/* ---- Practice Section ---- */
.practice-section {
  background: var(--bg);
}

.practice-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

/* Topic Selector */
.input-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 8px;
}

.topic-controls {
  display: flex;
  gap: 10px;
}

.select-input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-ja);
  font-size: 14px;
  color: var(--gray-700);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.2s;
}

.select-input:focus {
  outline: none;
  border-color: var(--primary);
}

.topic-selector {
  margin-bottom: 20px;
}

.topic-display {
  background: var(--white);
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.topic-header {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
  letter-spacing: 1px;
}

.topic-text {
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  line-height: 1.6;
  margin-bottom: 16px;
}

.points-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.points-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.points-list li {
  font-family: var(--font-en);
  font-size: 14px;
  padding: 4px 14px;
  background: var(--primary-bg);
  color: var(--primary-dark);
  border-radius: 16px;
  font-weight: 500;
}

/* Writing Area */
.writing-area {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.writing-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
}

.word-count {
  font-size: 13px;
  color: var(--gray-500);
}

.word-count-num {
  font-family: var(--font-en);
  font-weight: 700;
  color: var(--gray-700);
}

.word-count-status {
  font-size: 12px;
  margin-left: 8px;
  font-weight: 600;
}

.word-count-status.ok { color: var(--primary); }
.word-count-status.warning { color: var(--accent); }
.word-count-status.danger { color: var(--red); }

.timer-display {
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-left: 10px;
}

.timer-display.urgent {
  color: var(--red);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.essay-textarea {
  width: 100%;
  padding: 20px;
  border: none;
  font-family: var(--font-en);
  font-size: 15px;
  line-height: 1.8;
  color: var(--gray-800);
  resize: vertical;
  min-height: 280px;
}

.essay-textarea:focus {
  outline: none;
}

.essay-textarea::placeholder {
  color: var(--gray-300);
}

.writing-actions {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--gray-50);
  border-top: 1px solid var(--border);
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---- Results Panel ---- */
.results-panel {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 28px;
  position: sticky;
  top: 80px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.results-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
}

/* Score Overview */
.score-overview {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.score-chart-wrapper {
  flex-shrink: 0;
}

.score-summary {
  flex: 1;
}

.total-score {
  margin-bottom: 8px;
}

.total-score-num {
  font-family: var(--font-en);
  font-size: 48px;
  font-weight: 800;
  color: var(--primary);
}

.total-score-max {
  font-family: var(--font-en);
  font-size: 20px;
  color: var(--gray-400);
  font-weight: 500;
}

.overall-comment {
  font-size: 14px;
  color: var(--gray-600);
  line-height: 1.7;
}

/* Score Detail Cards */
.score-details {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.score-detail-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--gray-50);
}

.score-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.score-detail-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-700);
}

.score-detail-value {
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
}

.score-detail-feedback {
  font-size: 13px;
  color: var(--gray-600);
  line-height: 1.7;
}

/* Corrections */
.corrections-section, .tips-section, .model-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.corrections-section h4, .tips-section h4, .model-section h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 16px;
}

.corrected-essay {
  font-family: var(--font-en);
  font-size: 14px;
  line-height: 1.8;
  color: var(--gray-700);
  padding: 16px;
  background: var(--blue-light);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  border-left: 4px solid var(--blue);
}

.corrected-essay mark {
  background: rgba(245, 158, 11, 0.25);
  color: var(--gray-900);
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
}

.corrections-list {
  display: grid;
  gap: 10px;
}

.correction-item {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.correction-original {
  font-family: var(--font-en);
  color: var(--red);
  text-decoration: line-through;
}

.correction-arrow {
  color: var(--gray-400);
  font-size: 16px;
}

.correction-fixed {
  font-family: var(--font-en);
  color: var(--primary);
  font-weight: 600;
}

.correction-explanation {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--gray-500);
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

/* Tips */
.tips-list {
  list-style: none;
  display: grid;
  gap: 10px;
}

.tips-list li {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  background: var(--accent-bg);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.6;
  border-left: 3px solid var(--accent);
}

.tips-list li::before {
  content: '💡';
  flex-shrink: 0;
}

/* Model Opening */
.model-opening {
  font-family: var(--font-en);
  font-size: 15px;
  line-height: 1.8;
  color: var(--gray-700);
  padding: 16px;
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
  font-style: italic;
}

/* ---- Topics Library ---- */
.topics-section {
  background: var(--white);
}

.topics-filter {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border: 2px solid var(--gray-200);
  border-radius: 24px;
  background: var(--white);
  color: var(--gray-600);
  font-family: var(--font-ja);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.topic-card {
  padding: 24px;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s;
}

.topic-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.topic-card-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-bg);
  padding: 3px 10px;
  border-radius: 12px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.topic-card-text {
  font-family: var(--font-en);
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-800);
  line-height: 1.5;
  margin-bottom: 12px;
}

.topic-card-points {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topic-card-point {
  font-family: var(--font-en);
  font-size: 12px;
  padding: 3px 10px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  color: var(--gray-600);
}

/* ---- Writing Guide ---- */
.guide-section {
  background: var(--bg);
}

.guide-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.guide-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.guide-card-large {
  grid-column: 1 / -1;
}

.guide-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 20px;
}

/* Template */
.template-block {
  display: grid;
  gap: 16px;
}

.template-section {
  padding: 16px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
}

.template-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.template-text {
  font-family: var(--font-en);
  font-size: 15px;
  color: var(--gray-700);
  line-height: 1.6;
}

.template-alt {
  font-size: 13px;
  color: var(--gray-500);
  margin-top: 6px;
  font-style: italic;
}

/* Phrases */
.phrase-group {
  margin-bottom: 18px;
}

.phrase-group:last-child {
  margin-bottom: 0;
}

.phrase-group h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.phrase-list {
  list-style: none;
  display: grid;
  gap: 6px;
}

.phrase-list li {
  font-family: var(--font-en);
  font-size: 14px;
  color: var(--gray-700);
  padding: 6px 12px;
  background: var(--gray-50);
  border-radius: 6px;
}

/* Tips */
.tip-item {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}

.tip-item:last-child {
  margin-bottom: 0;
}

.tip-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: white;
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  border-radius: 50%;
}

.tip-item strong {
  display: block;
  font-size: 14px;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.tip-item p {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.6;
}

/* ---- Footer ---- */
.footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 48px 0;
}

.footer-content {
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.footer .logo-icon {
  color: var(--gray-400);
}

.footer .logo-text {
  color: var(--gray-300);
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 700;
}

.footer .logo-accent {
  color: var(--primary-light);
}

.footer-note {
  font-size: 12px;
  line-height: 1.8;
  margin-bottom: 12px;
}

.footer-copy {
  font-size: 13px;
  color: var(--gray-500);
}

/* ---- Rewrite Section ---- */
.rewrite-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.rewrite-section h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.rewrite-description {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 12px;
}

.rewritten-essay {
  font-family: var(--font-en);
  font-size: 15px;
  line-height: 1.8;
  color: var(--gray-800);
  padding: 16px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--primary);
}

/* ---- Model Answers Section ---- */
.model-answers-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.model-answers-section h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.model-answers-description {
  font-size: 13px;
  color: var(--gray-500);
  margin-bottom: 16px;
}

.model-answer-wrapper {
  display: grid;
  gap: 16px;
}

.model-answer-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.model-answer-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  background: var(--primary);
  padding: 8px 16px;
}

.model-answer-card:nth-child(2) .model-answer-label {
  background: var(--blue);
}

.model-answer-text {
  font-family: var(--font-en);
  font-size: 14px;
  line-height: 1.8;
  color: var(--gray-700);
  padding: 16px;
  background: var(--gray-50);
}

/* ---- Rewrite Explanation ---- */
.rewrite-explanation {
  margin-top: 16px;
  padding: 16px;
  background: #f0fdf4;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
}

.rewrite-explanation h5 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.rewrite-explanation p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--gray-700);
}

/* ---- Model Answer Notes ---- */
.model-answer-notes {
  margin-top: 16px;
  padding: 16px;
  background: #fffbeb;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
}

.model-answer-notes h5 {
  font-size: 15px;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 8px;
}

.model-answer-notes p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--gray-700);
  white-space: pre-line;
}

/* ---- Footer Link ---- */
.footer-link {
  color: var(--primary-light);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--accent-light);
  text-decoration: underline;
}

/* Logo small text */
.logo-text small {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-400);
  margin-left: 4px;
}

.footer .logo-text small {
  color: var(--gray-500);
}

/* ---- Utility ---- */
.hidden {
  display: none !important;
}

/* ---- Responsive ---- */

/* --- Tablet (max-width: 900px) --- */
@media (max-width: 900px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero-title {
    font-size: 32px;
  }

  .practice-layout {
    grid-template-columns: 1fr;
  }

  .results-panel {
    position: static;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .topics-grid {
    grid-template-columns: 1fr;
  }

  .guide-layout {
    grid-template-columns: 1fr;
  }

  .nav {
    gap: 16px;
  }

  .nav-link {
    font-size: 13px;
  }
}

/* --- Mobile (max-width: 600px) --- */
@media (max-width: 600px) {
  /* Container */
  .container {
    padding: 0 14px;
  }

  /* Header */
  .header-inner {
    height: 52px;
    padding: 0 12px;
  }

  /* Mobile menu */
  .menu-btn {
    display: block;
  }

  .nav {
    display: none;
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    padding: 8px 0;
    z-index: 99;
  }

  .nav.open {
    display: flex;
  }

  .nav-link {
    padding: 12px 20px;
    font-size: 15px;
    border-bottom: 1px solid var(--gray-100);
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .logo-icon {
    font-size: 20px;
  }

  .logo-text {
    font-size: 17px;
  }

  .logo-text small {
    font-size: 10px;
    margin-left: 2px;
  }

  /* Hero */
  .hero {
    padding: 70px 14px 40px;
  }

  .hero-title {
    font-size: 24px;
    margin-bottom: 14px;
  }

  .hero-subtitle {
    font-size: 14px;
    margin-bottom: 18px;
  }

  .hero-badge {
    font-size: 11px;
    padding: 4px 10px;
    margin-bottom: 14px;
  }

  .hero-badges {
    gap: 6px;
    margin-bottom: 20px;
  }

  .badge {
    font-size: 11px;
    padding: 5px 10px;
    gap: 4px;
  }

  .badge-icon {
    font-size: 13px;
  }

  .hero-cta {
    flex-direction: column;
    gap: 10px;
  }

  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-right {
    display: none;
  }

  /* Sections */
  .section {
    padding: 40px 0;
  }

  .section-title {
    font-size: 22px;
    margin-bottom: 8px;
  }

  .section-subtitle {
    font-size: 14px;
    margin-bottom: 28px;
  }

  /* Features */
  .features-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .feature-card {
    padding: 20px;
  }

  .feature-card:hover {
    transform: none;
  }

  .feature-icon {
    font-size: 28px;
    margin-bottom: 10px;
  }

  .feature-card h3 {
    font-size: 15px;
  }

  .feature-card p {
    font-size: 13px;
  }

  /* Practice Section */
  .topic-controls {
    flex-direction: column;
    gap: 8px;
  }

  .select-input {
    width: 100%;
    font-size: 13px;
    padding: 10px 12px;
  }

  .topic-display {
    padding: 14px;
    margin-bottom: 14px;
  }

  .topic-text {
    font-size: 14px;
  }

  .points-list {
    gap: 6px;
  }

  .points-list li {
    font-size: 12px;
    padding: 3px 10px;
  }

  /* Writing Area */
  .writing-toolbar {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    padding: 10px 12px;
  }

  .timer-controls {
    display: flex;
    align-items: center;
    width: 100%;
  }

  .timer-display {
    font-size: 16px;
  }

  .essay-textarea {
    padding: 14px;
    font-size: 14px;
    min-height: 220px;
  }

  .writing-actions {
    flex-direction: column;
    gap: 10px;
    padding: 12px;
  }

  .writing-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .btn-large {
    padding: 12px 20px;
    font-size: 15px;
  }

  /* Results Panel */
  .results-panel {
    padding: 16px;
    border-radius: var(--radius-sm);
  }

  .results-header {
    margin-bottom: 16px;
  }

  .results-header h3 {
    font-size: 17px;
  }

  .score-overview {
    flex-direction: column;
    text-align: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
  }

  .score-chart-wrapper canvas {
    width: 180px !important;
    height: 180px !important;
  }

  .total-score-num {
    font-size: 40px;
  }

  .total-score-max {
    font-size: 17px;
  }

  .overall-comment {
    font-size: 13px;
  }

  .score-detail-card {
    padding: 12px;
  }

  .score-detail-label {
    font-size: 13px;
  }

  .score-detail-value {
    font-size: 16px;
  }

  .score-detail-feedback {
    font-size: 12px;
  }

  /* Corrections */
  .correction-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .correction-arrow {
    display: none;
  }

  .correction-original,
  .correction-fixed {
    font-size: 13px;
  }

  .corrected-essay {
    font-size: 13px;
    padding: 12px;
  }

  /* Tips */
  .tips-list li {
    font-size: 13px;
    padding: 10px 12px;
  }

  /* Model Opening */
  .model-opening {
    font-size: 13px;
    padding: 12px;
  }

  /* Rewrite */
  .rewritten-essay {
    font-size: 13px;
    padding: 12px;
  }

  /* Model Answers */
  .model-answer-text {
    font-size: 13px;
    padding: 12px;
  }

  .model-answer-label {
    font-size: 12px;
    padding: 6px 12px;
  }

  /* Topics Library */
  .topics-filter {
    gap: 6px;
    margin-bottom: 20px;
  }

  .filter-btn {
    padding: 6px 14px;
    font-size: 12px;
  }

  .topic-card {
    padding: 16px;
  }

  .topic-card:hover {
    transform: none;
  }

  .topic-card-text {
    font-size: 13px;
  }

  .topic-card-point {
    font-size: 11px;
    padding: 2px 8px;
  }

  .topic-card-category {
    font-size: 10px;
    padding: 2px 8px;
  }

  /* Writing Guide */
  .guide-card {
    padding: 18px;
  }

  .guide-card h3 {
    font-size: 16px;
    margin-bottom: 14px;
  }

  .template-section {
    padding: 12px;
  }

  .template-text {
    font-size: 13px;
  }

  .template-alt {
    font-size: 12px;
  }

  .template-label {
    font-size: 11px;
  }

  .phrase-list li {
    font-size: 13px;
    padding: 5px 10px;
  }

  .tip-item {
    gap: 10px;
    margin-bottom: 14px;
  }

  .tip-number {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .tip-item strong {
    font-size: 13px;
  }

  .tip-item p {
    font-size: 12px;
  }

  /* Footer */
  .footer {
    padding: 32px 0;
  }

  .footer .logo-text {
    font-size: 17px;
  }

  .footer-note {
    font-size: 11px;
  }

  .footer-copy {
    font-size: 12px;
  }
}
