﻿:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-border: #c7d2fe;
  
  --success: #10b981;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-border: #fde68a;

  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;

  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border-color: #e2e8f0;

  --font-sans: 'Plus Jakarta Sans', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.06);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ================== Navbar ================== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  text-decoration: none;
}

.brand-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e1b4b;
  letter-spacing: -0.02em;
  display: block;
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-framework-badge {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary-hover);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.nav-btn:hover {
  background: var(--bg-subtle);
  border-color: #cbd5e1;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 4px;
}
.dot-warn {
  background-color: var(--warning);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}
.dot-ok {
  background-color: var(--success);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* ================== Views Layout ================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.view-panel {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}
.view-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ================== View 1: Setup View ================== */
.setup-container {
  max-width: 960px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
}

.page-intro {
  text-align: center;
  margin-bottom: 2.5rem;
}

.page-intro h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}

.page-intro p {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
}

.setup-card {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  margin-bottom: 2rem;
  transition: box-shadow 0.2s ease;
}

.setup-card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
}

.card-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.section-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Framework Selector Grid */
.framework-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.fw-card {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  cursor: pointer;
  background: #ffffff;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

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

.fw-card.selected {
  border-color: var(--primary);
  background: #fbfbfe;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.fw-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.fw-icon {
  font-size: 1.6rem;
}

.fw-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.badge-green { background: #dcfce7; color: #15803d; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-teal { background: #ccfbf1; color: #0f766e; }
.badge-gray { background: #f1f5f9; color: #475569; }

.fw-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.fw-tagline {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.fw-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  flex: 1;
}

/* Framework Preview */
.framework-preview-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1rem;
}

.preview-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #334155;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.step-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
}

.step-name {
  font-weight: 700;
  font-size: 0.82rem;
  color: #1e293b;
  margin-bottom: 0.2rem;
}

.step-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.pro-tip-box {
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  padding: 0.6rem 0.8rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.82rem;
  color: #92400e;
}

.custom-framework-box {
  margin-top: 1rem;
}
.custom-framework-box label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
}
.custom-framework-box textarea {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
}

/* Preset Section */
.preset-section {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.preset-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.75rem;
}

.preset-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-full);
  padding: 0.4rem 0.85rem;
  font-size: 0.83rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary-hover);
  transform: scale(1.02);
}

/* Form Styles */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.4rem;
}

.form-group label .req {
  color: var(--danger);
}

input[type="text"],
input[type="password"],
textarea,
select {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: #1e293b;
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

textarea {
  resize: vertical;
}

.setup-actions {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0.65rem 1.3rem;
  font-size: 0.92rem;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
  background: #334155;
  color: #ffffff;
}
.btn-secondary:hover {
  background: #1e293b;
}

.btn-outline {
  background: transparent;
  border-color: #cbd5e1;
  color: #334155;
}
.btn-outline:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  background: #dc2626;
}

.btn-large {
  padding: 0.95rem 2.5rem;
  font-size: 1.1rem;
  border-radius: var(--radius-full);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
}

/* ================== View 2: Practice Room ================== */
.practice-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 65px);
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 1rem 1.5rem 1.25rem;
}

.practice-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.8rem 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.75rem;
  flex-shrink: 0;
}

.persona-badge {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.persona-badge .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: 2px solid #cbd5e1;
  flex-shrink: 0;
}

.persona-title-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.persona-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: #0f172a;
}

.persona-role {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.difficulty-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  background: #fef3c7;
  color: #b45309;
}

.persona-scenario-brief {
  font-size: 0.8rem;
  color: #64748b;
  max-width: 500px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-right-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.turn-counter {
  font-size: 0.85rem;
  font-weight: 600;
  color: #64748b;
}

.badge-count {
  background: #e0e7ff;
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* Cheat Sheet Accordion */
.cheat-sheet-card {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: #0369a1;
  animation: fadeIn 0.2s ease;
}

/* Chat Viewport */
.chat-viewport {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  overflow-y: auto;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

/* Message Bubbles */
.message-row {
  display: flex;
  gap: 0.75rem;
  max-width: 82%;
  animation: messageIn 0.25s ease-out;
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-row.target {
  align-self: flex-start;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.message-row.user .message-avatar {
  background: var(--primary-light);
}

.message-content-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.message-author {
  font-size: 0.76rem;
  font-weight: 600;
  color: #94a3b8;
}
.message-row.user .message-author {
  text-align: right;
}

.message-bubble {
  padding: 0.85rem 1.15rem;
  border-radius: 16px;
  font-size: 0.94rem;
  line-height: 1.55;
  word-break: break-word;
  white-space: pre-wrap;
}

.message-row.target .message-bubble {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #1e293b;
  border-top-left-radius: 4px;
}

.message-row.user .message-bubble {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #ffffff;
  border-top-right-radius: 4px;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.15);
}

/* Inner Thought Pill */
.inner-thought-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fefce8;
  border: 1px dashed #fde047;
  color: #854d0e;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  margin-top: 0.1rem;
  max-width: fit-content;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.75rem 1rem;
  background: #f1f5f9;
  border-radius: 16px;
  width: fit-content;
}
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  animation: blink 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Input Panel */
.practice-input-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.input-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #f1f5f9;
}

.tool-btn {
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.tool-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.hint-btn {
  background: #fefce8;
  border-color: #fde047;
  color: #854d0e;
}
.hint-btn:hover {
  background: #fef9c3;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: #64748b;
  cursor: pointer;
}

.input-form {
  display: flex;
  gap: 0.6rem;
}

.input-form textarea {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  font-size: 0.92rem;
  line-height: 1.4;
  height: 58px;
  resize: none;
}

.btn-send {
  align-self: flex-end;
  height: 58px;
  padding: 0 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 700;
}

/* ================== View 3: Evaluation Report View ================== */
.report-container {
  max-width: 980px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.report-hero-card {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 2.2rem 2.5rem;
  display: flex;
  align-items: center;
  gap: 2.5rem;
  box-shadow: var(--shadow-xl);
}

.report-score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 4px solid #6366f1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

.score-number {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  color: #ffffff;
}

.score-max {
  font-size: 0.75rem;
  color: #c7d2fe;
  font-weight: 600;
}

.score-level-badge {
  background: #4ade80;
  color: #064e3b;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 0.25rem 0.8rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.report-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  color: #c7d2fe;
}

.report-meta-row .badge {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.report-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
}

.report-summary {
  font-size: 0.95rem;
  color: #e0e7ff;
  line-height: 1.6;
}

/* Report Cards */
.report-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1e293b;
}

.card-sub-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.text-success { color: #059669; }
.text-warning { color: #d97706; }

/* Dimensions Bar Grid */
.dimension-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}

.dimension-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.dimension-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}

.dimension-score-val {
  font-weight: 700;
  color: var(--primary);
}

.bar-track {
  height: 9px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #4f46e5);
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Strengths Items */
.strengths-list,
.growth-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.strength-item {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.strength-title {
  font-weight: 700;
  font-size: 1rem;
  color: #166534;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.quote-box {
  background: #ffffff;
  border-left: 3px solid #22c55e;
  padding: 0.6rem 0.9rem;
  font-size: 0.88rem;
  font-style: italic;
  color: #334155;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 0.6rem;
}

.analysis-text {
  font-size: 0.88rem;
  color: #1e293b;
  line-height: 1.5;
}

/* Growth Items (Before vs After) */
.growth-item {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.growth-title {
  font-weight: 700;
  font-size: 1rem;
  color: #92400e;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.quote-box-warn {
  background: #ffffff;
  border-left: 3px solid #ef4444;
  padding: 0.6rem 0.9rem;
  font-size: 0.88rem;
  color: #334155;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 0.5rem;
}

.impact-desc {
  font-size: 0.85rem;
  color: #78350f;
  margin-bottom: 0.75rem;
}

.rewrite-box {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
}

.rewrite-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #047857;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.rewrite-quote {
  font-weight: 600;
  color: #065f46;
  font-size: 0.92rem;
  margin-bottom: 0.4rem;
}

.rewrite-rationale {
  font-size: 0.82rem;
  color: #047857;
}

/* Deep dive */
.deepdive-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.deepdive-section {
  font-size: 0.9rem;
  line-height: 1.6;
}
.deepdive-label {
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.3rem;
}
.highlight-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.9rem;
}

/* Action tips list */
.action-tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.action-tip-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.9rem;
  line-height: 1.5;
  background: #f1f5f9;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
}

.action-tip-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Report footer actions */
.report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 1rem;
}

/* ================== Modals ================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  animation: fadeIn 0.15s ease-out;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.modal-dialog.modal-large {
  max-width: 760px;
}

.modal-dialog.modal-hint-dialog {
  max-width: 620px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover {
  color: #0f172a;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 0.9rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: #fafafa;
}

.modal-tip {
  font-size: 0.85rem;
  color: #475569;
  background: #f1f5f9;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.input-with-action {
  display: flex;
  gap: 0.4rem;
}

.input-with-action input {
  flex: 1;
}

.btn-icon {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0 0.8rem;
  cursor: pointer;
}

.help-text {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.4rem;
}

.help-text a {
  color: var(--primary);
  text-decoration: underline;
}

.test-result-box {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}
.test-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.test-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* Hint content */
.hint-content-box {
  line-height: 1.6;
  font-size: 0.94rem;
  white-space: pre-wrap;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  gap: 1rem;
  color: #64748b;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* History Card */
.history-item-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  transition: all 0.15s ease;
}

.history-item-card:hover {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
}

.history-item-left {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.history-item-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1e293b;
}

.history-item-meta {
  font-size: 0.8rem;
  color: #64748b;
}

.history-item-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.history-score-chip {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
}

/* Responsive */
@media (max-width: 768px) {
  .navbar { padding: 0.75rem 1rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full-width { grid-column: span 1; }
  .report-hero-card { flex-direction: column; text-align: center; }
  .dimension-grid { grid-template-columns: 1fr; }
  .message-row { max-width: 92%; }
}

.hidden {
  display: none !important;
}

