/* style.css - Complete styles for Life Flourishing Questionnaire */

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

:root {
  --primary: #3f51b5;
  --primary-light: #7986cb;
  --primary-dark: #283593;
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --text: #333333;
  --text-secondary: #666666;
  --border: #e0e0e0;
  --success: #4caf50;
  --warning: #ff9800;
  --danger: #f44336;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #eef1f6;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

#app {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
}

/* Welcome Screen */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 80vh;
  padding: 0;
}

.cover-screen {
  overflow: hidden;
  max-width: 680px;
  min-height: auto;
  margin: 20px auto;
  border: 1px solid #e6e9f2;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(63, 81, 181, 0.10), transparent 38%),
    linear-gradient(215deg, rgba(35, 116, 85, 0.10), transparent 42%),
    #ffffff;
  box-shadow: 0 24px 70px rgba(34, 39, 74, 0.10);
}

.cover-hero {
  padding: 34px 36px 28px;
  border-bottom: 1px solid #eceef5;
  text-align: left;
}

.welcome-screen h1 {
  max-width: 560px;
  margin-top: 18px;
  color: #30323a;
  font-size: 3.8em;
  font-weight: 900;
  line-height: 1.08;
}

.welcome-image {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  margin: 0 0 28px;
  border-radius: 20px;
}

.cover-visual {
  position: relative;
  height: 190px;
  margin-bottom: 28px;
  border: 1px solid #dfe4f4;
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(63, 81, 181, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(63, 81, 181, 0.08) 1px, transparent 1px),
    #f8f9fd;
  background-size: 24px 24px;
}

.visual-mark {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-weight: 900;
  box-shadow: 0 14px 32px rgba(34, 39, 74, 0.12);
}

.visual-mark-main {
  left: 44px;
  top: 38px;
  width: 116px;
  height: 116px;
  color: #ffffff;
  background: var(--primary);
  font-size: 56px;
}

.visual-mark-side {
  right: 46px;
  top: 54px;
  width: 92px;
  height: 92px;
  color: #1f654d;
  border: 3px solid rgba(35, 116, 85, 0.38);
  background: #edf7f2;
  font-size: 44px;
}

.visual-line {
  position: absolute;
  left: 178px;
  right: 158px;
  top: 94px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), #237455);
}

.subtitle {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 30px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--primary);
  background: rgba(63, 81, 181, 0.10);
  font-size: 0.95em;
  font-weight: 800;
  margin-bottom: 0;
}

.cover-tagline {
  margin-top: 12px;
  color: #237455;
  font-size: 1.1em;
  font-weight: 900;
}

.welcome-desc {
  max-width: none;
  color: var(--text-secondary);
  margin: 28px 36px 0;
  font-size: 1.02em;
  text-align: left;
}

.cover-stats {
  display: flex;
  margin: 26px 36px 0;
  overflow: hidden;
  border: 1px solid #e1e5f0;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.cover-stat {
  flex: 1;
  padding: 18px 8px;
  text-align: center;
}

.cover-stat strong {
  display: block;
  color: #30323a;
  font-size: 1.8em;
  line-height: 1;
}

.cover-stat span {
  display: block;
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 0.85em;
  font-weight: 800;
}

.module-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 36px 0;
}

.module-strip span {
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--primary);
  background: #f0f2ff;
  font-size: 0.88em;
  font-weight: 800;
}

.welcome-time {
  color: var(--primary);
  font-weight: 600;
  margin: 22px 36px 0;
  text-align: center;
}

.cover-screen .btn-primary {
  align-self: center;
  min-width: 220px;
  margin-top: 22px;
  padding: 16px 48px;
  border-radius: 10px;
  background: #3344b0;
  box-shadow: 0 14px 30px rgba(63, 81, 181, 0.24);
}

.cover-screen .history-entry {
  align-self: center;
  margin-top: 14px;
}

.welcome-note {
  margin: 18px 36px 34px;
  font-size: 0.85em;
  color: #999;
  text-align: center;
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 14px 40px;
  font-size: 1.1em;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  padding: 12px 30px;
  font-size: 1em;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { background: rgba(63,81,181,0.05); }

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

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

.progress-text {
  text-align: right;
  font-size: 0.85em;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Quiz Container */
.quiz-container {
  padding: 10px 0;
}

.question-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}
.question-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.question-id {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.8em;
  margin-bottom: 16px;
}

.question-text {
  font-size: 1.2em;
  line-height: 1.6;
  margin-bottom: 24px;
  color: var(--text);
}

/* Options */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.option-item:hover { border-color: var(--primary-light); background: rgba(63,81,181,0.03); }
.option-item.selected { border-color: var(--primary); background: rgba(63,81,181,0.08); }

.option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  font-weight: 600;
  font-size: 0.85em;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.option-item.selected .option-letter {
  background: var(--primary);
  color: white;
}

.option-text { font-size: 0.95em; }

.option-item {
  flex-wrap: wrap;
}

.other-input {
  flex: 1 0 100%;
  min-height: 44px;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  font: inherit;
  outline: none;
}

.other-input:focus {
  border-color: var(--primary);
}

.slider-other-input {
  width: 100%;
  margin: 4px 0 12px;
}

/* Number Input */
.number-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.number-input {
  width: clamp(168px, 32vw, 220px);
  max-width: 100%;
  padding: 12px 16px;
  font-size: 1.15em;
  line-height: 1.4;
  border: 2px solid var(--border);
  border-radius: 8px;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}
.number-input:focus { border-color: var(--primary); }
.number-input::-webkit-outer-spin-button,
.number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.number-input::placeholder {
  color: #777;
  opacity: 1;
}
.input-suffix { font-size: 1.1em; color: var(--text-secondary); }
.warning-text { color: var(--danger); margin-top: 10px; margin-bottom: 20px; font-size: 0.9em; }

/* Sliders */
.slider-group { margin-bottom: 24px; }
.slider-item { margin-bottom: 16px; }
.slider-item label { display: block; margin-bottom: 6px; font-size: 0.95em; }
.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.slider-input {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  outline: none;
}
.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}
.slider-min, .slider-max { font-size: 0.8em; color: #999; min-width: 20px; text-align: center; }
.slider-val {
  min-width: 30px;
  text-align: center;
  font-weight: 600;
  color: var(--primary);
}

/* Ranking */
.ranking-list { margin-bottom: 16px; }
.ranking-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: grab;
  transition: all 0.2s;
  user-select: none;
  touch-action: none;
}
.ranking-item:active { cursor: grabbing; }
.ranking-item.dragging { opacity: 0.5; border-color: var(--primary); }
.ranking-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 0.85em;
  flex-shrink: 0;
}
.ranking-text { flex: 1; font-size: 0.95em; }
.ranking-handle { color: #ccc; font-size: 1.2em; }
.ranking-hint { color: var(--text-secondary); font-size: 0.85em; margin-bottom: 20px; }

/* Allocation & Weight */
.allocation-group, .weight-group { margin-bottom: 24px; }
.allocation-item, .weight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.allocation-item label, .weight-item label { font-size: 0.95em; flex: 1; }
.allocation-controls, .weight-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.alloc-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  cursor: pointer;
  font-size: 1em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.alloc-btn:hover { background: var(--bg); border-color: var(--primary); }
.alloc-value, .weight-value {
  min-width: 40px;
  text-align: center;
  font-weight: 600;
  font-size: 1.05em;
  color: var(--primary);
}
.allocation-total {
  text-align: center;
  font-size: 1.1em;
  font-weight: 600;
  padding: 16px;
  margin-top: 12px;
  border-radius: 8px;
  background: var(--bg);
}
.total-ok { color: var(--success); }
.total-bad { color: var(--danger); }
.weight-hint { color: var(--text-secondary); font-size: 0.85em; text-align: center; margin-top: 8px; }

/* Navigation */
.nav-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}
.nav-buttons .btn-skip {
  flex: 1 1 100%;
  border-color: #d6daf5;
  color: #6670c8;
  background: #f8f9ff;
}
.nav-buttons .btn-primary { margin-left: auto; }

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
.spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ REPORT ============ */
.report-container {
  padding-bottom: 60px;
}

.report-title {
  text-align: center;
  font-size: 1.8em;
  color: var(--primary-dark);
  margin: 30px 0 40px;
}

.report-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.report-section h2 {
  font-size: 1.4em;
  color: var(--primary-dark);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

/* Score Display */
.score-display {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 30px;
}

.score-circle {
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 4px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.score-number { font-size: 2em; font-weight: 700; color: var(--text); }
.score-grade { font-size: 1.2em; font-weight: 600; }
.score-info h3 { margin-bottom: 6px; font-size: 1.3em; }
.score-info p { color: var(--text-secondary); }

/* Consistency */
.consistency-display { margin-bottom: 30px; }
.consistency-display h4 { margin-bottom: 10px; }
.consistency-bar-container {
  width: 100%;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-bottom: 8px;
}
.consistency-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--warning), var(--success));
  border-radius: 10px;
  transition: width 1s ease;
}
.consistency-bar-container span {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  font-size: 0.85em;
}
.consistency-brief { color: var(--text-secondary); font-size: 0.9em; }

/* Radar */
.radar-container {
  text-align: center;
  margin-bottom: 30px;
}
.radar-container h4 { margin-bottom: 16px; }
canvas#radarChart {
  max-width: 100%;
  height: auto;
}

/* Insight */
.insight-box {
  background: #f8f9ff;
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
}
.insight-box h4 { margin-bottom: 8px; color: var(--primary-dark); }
.insight-text {
  font-family: inherit;
  white-space: pre-wrap;
  font-size: 0.95em;
  line-height: 1.8;
  color: var(--text);
}

/* Portrait Grid */
.portrait-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.portrait-card {
  border-radius: var(--radius);
  padding: 24px;
}
.portrait-card h3 {
  margin-bottom: 16px;
  font-size: 1.2em;
}
.ideal-self {
  background: #f3f0ff;
  border: 1px solid #d1c4e9;
}
.ideal-self h3 { color: #5e35b1; }
.real-self {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
}
.real-self h3 { color: #2e7d32; }

.portrait-p { margin-bottom: 16px; }
.portrait-p h4 { font-size: 0.9em; color: var(--text-secondary); margin-bottom: 6px; }
.portrait-p p { font-size: 0.9em; line-height: 1.6; }

.gap-summary {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius);
  padding: 20px;
}
.gap-summary h4 { color: #f57f17; margin-bottom: 8px; }
.weekly-action {
  margin-top: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.7);
  border-radius: 8px;
  font-weight: 600;
  color: var(--primary-dark);
}

/* Collapsible Cards */
.collapsible-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  background: var(--card-bg);
  font-weight: 600;
  font-size: 1em;
  transition: background 0.2s;
}
.card-header:hover { background: var(--bg); }
.card-toggle {
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg);
  font-size: 1.2em;
  color: var(--text-secondary);
}
.card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 20px;
}
.card-body.open {
  max-height: 5000px;
  padding: 20px;
  border-top: 1px solid var(--border);
}

/* 重点关注卡片 */
.priority-card {
  border: 2px solid #f44336;
  box-shadow: 0 2px 12px rgba(244,67,54,0.12);
}
.priority-card .card-header {
  background: #fff5f5;
}
.priority-card .card-header:hover {
  background: #ffebee;
}
.priority-badge {
  display: inline-block;
  background: #f44336;
  color: white;
  font-size: 0.72em;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-right: 8px;
  vertical-align: middle;
  letter-spacing: 0.05em;
}

/* 焦点区域（评分详解卡片内） */
.focus-area {
  margin: 18px 0 8px;
  padding: 16px 18px;
  background: #fff5f5;
  border-left: 4px solid #f44336;
  border-radius: 0 8px 8px 0;
}
.focus-area h5 {
  margin: 0 0 6px;
  font-size: 0.92em;
  color: #c62828;
  font-weight: 700;
}
.focus-hint {
  font-size: 0.85em;
  color: #888;
  margin: 0 0 12px;
}
.focus-mod-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: white;
  border-radius: 8px;
  margin-bottom: 8px;
  border: 1px solid #ffcdd2;
}
.focus-mod-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.focus-mod-icon { font-size: 1.2em; }
.focus-mod-name { font-weight: 600; font-size: 0.95em; }
.focus-mod-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.focus-mod-score {
  font-size: 1.3em;
  font-weight: 700;
  color: #f44336;
}
.focus-mod-score small {
  font-size: 0.6em;
  color: #999;
  font-weight: 400;
}
.focus-dim-hint {
  font-size: 0.78em;
  color: #e57373;
}

/* Report inner styles */
.grade-badge {
  display: inline-block;
  padding: 6px 20px;
  border-radius: 20px;
  color: white;
  font-weight: 700;
  font-size: 1.3em;
  margin-bottom: 12px;
}

.consistency-score {
  font-size: 2em;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

/* Gap items */
.gap-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.gap-rank {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.2em;
  min-width: 30px;
}
.gap-name { font-weight: 600; min-width: 80px; }
.gap-detail { color: var(--text-secondary); font-size: 0.9em; }

/* Module analysis */
.module-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.module-radar {
  font-size: 1.8em;
  font-weight: 700;
  color: var(--primary);
}
.module-quadrant {
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
}
.quadrant-star { background: #e8f5e9; color: #2e7d32; }
.quadrant-potential { background: #e3f2fd; color: #1565c0; }
.quadrant-attention { background: #fff3e0; color: #e65100; }
.quadrant-blind { background: #fce4ec; color: #c62828; }

.dim-section { margin-top: 16px; }
.dim-section h5 { margin-bottom: 10px; color: var(--text-secondary); font-size: 0.9em; }

.dim-item {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.dim-high { background: #e8f5e9; }
.dim-mid { background: #fff7e6; }
.dim-low { background: #fce4ec; }
.dim-score { font-weight: 600; margin-left: auto; }
.dim-desc { width: 100%; font-size: 0.85em; color: var(--text-secondary); }

/* Dimension bars */
.dim-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.dim-bar-label { min-width: 100px; font-size: 0.85em; }
.dim-bar-track {
  flex: 1;
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.dim-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
}
.dim-bar-val { min-width: 24px; text-align: right; font-size: 0.85em; font-weight: 600; }

/* Pattern cards */
.pattern-card {
  padding: 14px;
  border-radius: 8px;
  background: #f8f9ff;
  margin-bottom: 10px;
  border-left: 3px solid var(--primary);
}
.pattern-card strong { display: block; margin-bottom: 6px; }
.pattern-card p { font-size: 0.9em; line-height: 1.6; color: var(--text-secondary); }

.pattern-full {
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 10px;
}
.pattern-mid { background: #fff3e0; border-left: 3px solid var(--warning); }
.pattern-high { background: #e8f5e9; border-left: 3px solid var(--success); }
.pattern-cross { background: #fce4ec; border-left: 3px solid var(--danger); }
.pattern-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.pattern-id { font-size: 0.8em; color: var(--text-secondary); }
.pattern-name { font-weight: 600; }
.pattern-type {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.75em;
  font-weight: 600;
}
.pattern-mid .pattern-type { background: #ffe0b2; color: #e65100; }
.pattern-high .pattern-type { background: #c8e6c9; color: #2e7d32; }
.pattern-cross .pattern-type { background: #f8bbd0; color: #c62828; }

/* Blindspot */
.blindspot-item {
  padding: 12px;
  border-left: 3px solid var(--warning);
  background: #fffde7;
  margin-bottom: 8px;
  border-radius: 0 8px 8px 0;
}

/* Time bars */
.time-bars { margin-bottom: 20px; }
.time-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.time-label { min-width: 100px; font-size: 0.85em; }
.time-bar-track {
  flex: 1;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.time-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.75em;
  font-weight: 600;
  min-width: 20px;
}

/* Q14 */
.q14-conflict {
  padding: 14px;
  background: #fff3e0;
  border-radius: 8px;
  border-left: 3px solid var(--warning);
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 0.9em;
}
th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th { background: var(--bg); font-weight: 600; }
.match-good { color: var(--success); font-weight: 600; }
.match-ok { color: var(--warning); font-weight: 600; }
.match-bad { color: var(--danger); font-weight: 600; }

/* Action items */
.action-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.action-num {
  width: 28px; height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 0.85em;
  flex-shrink: 0;
}

/* Report footer */
.report-footer {
  text-align: center;
  padding: 30px 0;
}

.report-footer .btn-secondary + .btn-secondary {
  margin-left: 12px;
}

.report-footer p {
  margin-top: 16px;
  font-size: 0.85em;
  color: #999;
}

.history-saved {
  color: var(--success) !important;
  font-weight: 600;
}

/* History */
.history-screen {
  max-width: 760px;
  margin: 20px auto;
}

.history-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 30px 0 18px;
}

.history-header h1 {
  color: #30323a;
  font-size: 2.4em;
  line-height: 1.1;
}

.history-note {
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.history-card,
.empty-history {
  padding: 22px;
  border: 1px solid #e5e8f2;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(34, 39, 74, 0.07);
}

.history-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.history-card-top > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-grade {
  display: inline-flex;
  min-width: 52px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 900;
}

.history-card time,
.history-score {
  color: var(--text-secondary);
  font-size: 0.92em;
}

.history-score {
  margin-top: 12px;
  font-weight: 700;
}

.history-radar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.history-radar span {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--primary);
  background: #f0f2ff;
  font-size: 0.84em;
  font-weight: 700;
}

.history-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.sub { font-size: 0.85em; color: var(--text-secondary); margin-top: 8px; }
.detail-hint { color: var(--text-secondary); font-size: 0.9em; margin-bottom: 16px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  #app { padding: 12px; }
  .question-card { padding: 20px; }
  .question-text { font-size: 1.05em; }
  .cover-hero { padding: 26px 24px 22px; }
  .cover-visual { height: 156px; }
  .visual-mark-main { left: 28px; top: 34px; width: 88px; height: 88px; font-size: 42px; }
  .visual-mark-side { right: 28px; top: 48px; width: 70px; height: 70px; font-size: 34px; }
  .visual-line { left: 130px; right: 112px; top: 78px; }
  .welcome-screen h1 { font-size: 2.55em; }
  .welcome-desc,
  .cover-stats,
  .module-strip,
  .welcome-time,
  .welcome-note { margin-left: 24px; margin-right: 24px; }
  .report-section { padding: 20px; }
  .score-display { flex-direction: column; text-align: center; }
  .portrait-grid { grid-template-columns: 1fr; }
  .allocation-item, .weight-item { flex-direction: column; gap: 8px; align-items: flex-start; }
  .allocation-controls, .weight-controls { align-self: flex-end; }
  .dim-bar-label { min-width: 70px; font-size: 0.8em; }
  .time-label { min-width: 70px; font-size: 0.8em; }
  .gap-item { flex-direction: column; align-items: flex-start; gap: 4px; }

  table { font-size: 0.8em; }
  th, td { padding: 6px 8px; }
}

@media (max-width: 480px) {
  .btn-primary { padding: 12px 24px; font-size: 1em; }
  .welcome-screen h1 { font-size: 2.25em; }
  .cover-stats { border-radius: 14px; }
  .cover-stat { padding: 14px 6px; }
  .score-circle { width: 100px; height: 100px; }
  .score-number { font-size: 1.6em; }
}
