/* ==========================================================================
   민트영어 프리미엄 지문 분석기 디자인 시스템 (Vanilla CSS)
   Theme: Mint (#00D2C4) to Sky Blue (#3B82F6) Gradient / Dark-Light Support
   ========================================================================== */

/* 1. 디자인 시스템 토큰 및 변수 설정 */
:root {
  --font-primary: 'Outfit', 'Noto Sans KR', sans-serif;
  
  /* Light Mode Palette */
  --bg-app: #f0f7f7;
  --bg-gradient: linear-gradient(135deg, #e0f2f1 0%, #e0f7fa 100%);
  --bg-card: rgba(255, 255, 255, 0.85);
  --border-card: rgba(255, 255, 255, 0.5);
  --shadow-card: 0 8px 32px 0 rgba(0, 180, 170, 0.06);
  
  --color-text-main: #1f2937;
  --color-text-muted: #4b5563;
  --color-text-light: #9ca3af;
  
  /* Brand Theme Colors */
  --mint-primary: #00D2C4;
  --mint-hover: #00b3a6;
  --mint-light: #e0f2f1;
  --blue-primary: #3B82F6;
  --blue-hover: #2563eb;
  --blue-light: #dbeafe;
  --dark-mint: #00796B;
  
  --gradient-brand: linear-gradient(135deg, var(--mint-primary) 0%, var(--blue-primary) 100%);
  
  /* Functional Status */
  --color-success: #10B981;
  --color-warning: #F59E0B;
  --color-danger: #EF4444;
  --color-info: #06B6D4;
}

/* Dark Mode Palette Overrides */
body.dark-mode {
  --bg-app: #0f172a;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
  --bg-card: rgba(30, 41, 59, 0.75);
  --border-card: rgba(255, 255, 255, 0.08);
  --shadow-card: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  
  --color-text-main: #f1f5f9;
  --color-text-muted: #cbd5e1;
  --color-text-light: #64748b;
  
  --mint-light: rgba(0, 210, 196, 0.15);
  --blue-light: rgba(59, 130, 246, 0.15);
}

/* 2. 전역 스타일 초기화 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-app);
  color: var(--color-text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.6;
}

/* 3. 레이아웃 구조 */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2.5rem;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-card);
  box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.02);
  z-index: 100;
  position: sticky;
  top: 0;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  height: 44px;
  width: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: white;
  padding: 2px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--mint-hover);
  letter-spacing: -0.5px;
}

.brand-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

/* Dashboard Grid Layout */
.dashboard-main {
  flex: 1;
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 2rem;
  padding: 2rem 2.5rem;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.content-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0; /* flex-item overflow 방지 */
}

/* 4. 공통 컴포넌트: Glassmorphic Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
}

.welcome-card {
  background: linear-gradient(135deg, rgba(0, 210, 196, 0.08) 0%, rgba(59, 130, 246, 0.08) 100%), var(--bg-card);
}

.mint-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--mint-light);
  color: var(--dark-mint);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50px;
  margin-bottom: 0.75rem;
}

.glass-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.glass-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-main);
}

.glass-card p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* 5. 입력 및 컨트롤 요소 */
.custom-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-card);
  background: var(--bg-app);
  color: var(--color-text-main);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300D2C4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.25rem;
}

.passage-meta-info {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-card);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.meta-pill {
  padding: 0.2rem 0.6rem;
  background: var(--bg-app);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.textarea-wrapper {
  position: relative;
  margin-top: 0.75rem;
}

textarea {
  width: 100%;
  height: 120px;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-card);
  background: var(--bg-app);
  color: var(--color-text-main);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
}

textarea:focus {
  border-color: var(--mint-primary);
}

.card-hint {
  font-size: 0.8rem !important;
  color: var(--color-text-light) !important;
}

/* API Settings Panel */
.ai-api-toggle {
  margin-top: 0.75rem;
}

.text-link-btn {
  background: none;
  border: none;
  color: var(--blue-primary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.settings-panel {
  margin-top: 0.5rem;
  padding: 0.75rem;
  background: var(--bg-app);
  border-radius: 8px;
  border: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.settings-panel label {
  font-size: 0.8rem;
  font-weight: 600;
}

.custom-input {
  width: 100%;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--color-text-main);
  font-size: 0.85rem;
  outline: none;
}

.input-desc {
  font-size: 0.7rem;
  color: var(--color-text-light);
}

.hidden {
  display: none !important;
}

/* Buttons */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transform: translateY(0);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn:hover {
  transform: translateY(-2px);
}

.action-btn:active {
  transform: translateY(0);
}

.primary-btn {
  background: var(--gradient-brand);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 210, 196, 0.2);
}

.primary-btn:hover {
  box-shadow: 0 6px 20px rgba(0, 210, 196, 0.3);
}

.outline-btn {
  background: transparent;
  border: 1px solid var(--mint-primary);
  color: var(--color-text-main);
}

.outline-btn:hover {
  background: var(--mint-light);
}

.highlight-btn {
  background: var(--gradient-brand);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.w-full {
  width: 100%;
}

.mt-2 {
  margin-top: 0.75rem;
}

.sm-btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 6px;
}

.icon-btn {
  background: var(--bg-app);
  border: 1px solid var(--border-card);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-main);
}

.icon-btn:hover {
  background: var(--border-card);
}

/* 6. TTS 카드 */
.tts-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-left: 5px solid var(--mint-primary);
}

.tts-left {
  display: flex;
  flex-direction: column;
}

.tts-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.tts-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-light);
}

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

.tts-circle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--mint-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.tts-circle-btn:disabled {
  background: var(--color-text-light);
  opacity: 0.5;
  cursor: not-allowed;
}

.tts-circle-btn#tts-stop {
  background: var(--color-danger);
}

.tts-speed-selector {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.speed-select {
  padding: 0.25rem;
  border-radius: 4px;
  background: var(--bg-app);
  color: var(--color-text-main);
  border: 1px solid var(--border-card);
}

/* 7. 분석 결과 네비게이션 탭 */
.analysis-tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.35rem;
  border-radius: 12px;
  border: 1px solid var(--border-card);
  overflow-x: auto;
}

.tab-btn {
  flex: 1;
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover {
  color: var(--mint-hover);
  background: rgba(0, 210, 196, 0.05);
}

.tab-btn.active {
  background: var(--mint-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 210, 196, 0.15);
}

.highlight-tab {
  background: rgba(59, 130, 246, 0.08);
  border: 1px dashed var(--blue-primary);
}

.highlight-tab:hover {
  background: rgba(59, 130, 246, 0.12);
}

.highlight-tab.active {
  background: var(--blue-primary);
  color: white;
  border-style: solid;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* 8. 분석 탭별 콘텐츠 영역 */
.analysis-content-area {
  position: relative;
  min-height: 350px;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.4s ease forwards;
}

.tab-pane.active {
  display: block;
}

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

.tab-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.tab-header-row h3 {
  font-size: 1.25rem;
  font-weight: 700;
}

.mint-accent {
  color: var(--mint-primary);
  font-weight: 900;
  margin-right: 0.25rem;
}

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

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(240, 247, 247, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 10;
  border-radius: 16px;
  gap: 1rem;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(0, 210, 196, 0.15);
  border-top-color: var(--mint-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==================== 탭 1: 끊어읽기 스타일 ==================== */
.chunking-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.chunk-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.01);
}

.chunk-original {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-text-main);
  margin-bottom: 0.5rem;
  letter-spacing: 0.5px;
}

/* 끊어읽기 화살표 구분자 스타일 */
.chunk-separator {
  color: var(--mint-primary);
  font-weight: 700;
  margin: 0 0.4rem;
  display: inline-block;
  user-select: none;
}

.chunk-flow-lines {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-card);
}

.chunk-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
}

.chunk-segment:hover {
  background: rgba(0, 210, 196, 0.03);
}

.segment-eng {
  font-weight: 600;
  color: var(--blue-primary);
  font-size: 0.95rem;
}

.segment-kor {
  color: var(--color-text-muted);
  font-size: 0.92rem;
}

.segment-tip {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  background: rgba(59, 130, 246, 0.05);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border-left: 4px solid var(--blue-primary);
  margin-top: 0.35rem;
  line-height: 1.5;
}

body.dark-mode .segment-tip {
  background: rgba(59, 130, 246, 0.08);
  color: var(--color-text-main);
  border-left-color: #60a5fa;
}

/* 유의어/반의어 태그 스타일 */
.vocab-extra {
  font-size: 0.8rem;
  margin-top: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text-muted);
}

.vocab-tag {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.vocab-tag.syn {
  background: var(--blue-light);
  color: var(--blue-primary);
}

.vocab-tag.ant {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

body.dark-mode .vocab-tag.syn {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

body.dark-mode .vocab-tag.ant {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* ==================== 탭 2: 어휘 사전 스타일 ==================== */
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.vocab-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.01);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vocab-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 210, 196, 0.08);
}

.vocab-word {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--mint-hover);
}

.vocab-meaning {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-main);
  background: rgba(59, 130, 246, 0.08);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.vocab-meaning.masked {
  filter: blur(5px);
  opacity: 0.4;
  cursor: pointer;
}

.vocab-meaning.masked::after {
  content: "클릭하면 뜻이 보여요";
  font-size: 0.7rem;
  display: block;
  color: var(--color-text-light);
  margin-top: 2px;
}

.vocab-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-top: 0.25rem;
  border-top: 1px solid var(--border-card);
  padding-top: 0.4rem;
}

/* ==================== 탭 3: 핵심 어법 스타일 ==================== */
.grammar-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.grammar-card {
  background: var(--bg-card);
  border-left: 5px solid var(--blue-primary);
  border-top: 1px solid var(--border-card);
  border-right: 1px solid var(--border-card);
  border-bottom: 1px solid var(--border-card);
  border-radius: 0 12px 12px 0;
  padding: 1.2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.01);
}

.grammar-card h4 {
  font-size: 1.05rem;
  color: var(--blue-primary);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.grammar-target {
  font-size: 0.92rem;
  font-family: monospace;
  background: var(--bg-app);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  color: var(--color-text-main);
  margin-bottom: 0.75rem;
  border: 1px solid var(--border-card);
  display: block;
}

.grammar-explanation {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.grammar-explanation strong {
  color: var(--mint-hover);
}

/* ==================== 탭 4: 글의 흐름 스타일 ==================== */
.flow-chart-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1rem 0;
  position: relative;
}

.flow-chart-container::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  background: var(--gradient-brand);
  opacity: 0.3;
}

.flow-step {
  display: grid;
  grid-template-columns: 60px 1fr;
  align-items: flex-start;
  position: relative;
  z-index: 1;
}

.flow-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(0, 210, 196, 0.2);
  margin-top: 5px;
}

.flow-content-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
}

.flow-content-box h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 0.35rem;
}

.flow-content-box p {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ==================== 탭 5: 학습지 스타일 ==================== */
.worksheet-creator-dashboard {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: flex-start;
}

.creator-options {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.option-group {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1rem;
}

.option-group h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text-main);
}

.button-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.button-row .action-btn {
  font-size: 0.8rem;
  padding: 0.4rem;
  text-align: left;
  justify-content: flex-start;
}

.active-choice {
  background: var(--mint-light) !important;
  color: var(--dark-mint) !important;
  border-color: var(--mint-primary) !important;
}

/* Worksheet Paper Preview */
.worksheet-preview-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.worksheet-paper {
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 2.5rem;
  min-height: 450px;
  color: #111827; /* 인쇄 가독성을 위해 어둡게 */
  position: relative;
}

body.dark-mode .worksheet-paper {
  background: white;
  color: #111827;
}

.worksheet-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 350px;
  color: var(--color-text-light);
  gap: 0.75rem;
  text-align: center;
}

.worksheet-placeholder i {
  font-size: 3rem;
  opacity: 0.5;
}

/* Worksheet Content Styling (For print preview and actual print) */
.paper-title-area {
  text-align: center;
  border-bottom: 2px solid #00D2C4;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.paper-school-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #00796B;
  letter-spacing: 2px;
}

.paper-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0.25rem 0;
  color: #111827;
}

.paper-subtitle {
  font-size: 0.85rem;
  color: #6b7280;
}

.paper-meta-row {
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
}

/* Vocab Test Layout */
.vocab-test-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 2rem;
  row-gap: 0.8rem;
}

.vocab-test-item {
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  border-bottom: 1px dashed #e5e7eb;
  padding-bottom: 0.4rem;
}

.vocab-test-num {
  font-weight: 600;
  width: 28px;
  color: #6b7280;
}

.vocab-test-q {
  font-weight: 600;
  flex: 1;
  color: #111827;
}

.vocab-test-ans-line {
  flex: 1.2;
  border-bottom: 1px solid #111827;
  height: 20px;
  margin-left: 0.5rem;
}

/* Blank Worksheet Layout */
.blank-passage-box {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.8;
  letter-spacing: 0.5px;
  margin-bottom: 1.5rem;
}

.blank-under {
  display: inline-block;
  border-bottom: 1.5px solid #111827;
  padding: 0 0.5rem;
  min-width: 60px;
  text-align: center;
  font-weight: 700;
}

.blank-under.hint-active {
  color: #6b7280;
  font-size: 0.85rem;
  vertical-align: bottom;
}

.blank-under-num {
  font-size: 0.7rem;
  color: #3b82f6;
  font-weight: 700;
  vertical-align: super;
  margin-left: 2px;
}

.blank-hints-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

.blank-hints-section h5 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.blank-hints-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.5rem;
  font-size: 0.82rem;
}

.blank-hint-item {
  display: flex;
  gap: 0.25rem;
}

.hint-num {
  font-weight: 700;
  color: #3b82f6;
}

/* App Footer */
.app-footer {
  text-align: center;
  padding: 2rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-card);
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-top: auto;
}

/* ==================== 9. 인쇄 전용 워터마크 및 레이아웃 (@media print) ==================== */
.print-header-watermark {
  display: none;
}

@media print {
  /* 불필요한 스크린 요소 전부 감추기 */
  .app-header,
  .sidebar-section,
  .tts-card,
  .analysis-tabs,
  .tab-desc,
  .vocab-controls,
  .tab-header-row,
  .worksheet-creator-dashboard > .creator-options,
  .preview-header,
  .app-footer,
  #theme-toggle,
  #print-doc,
  .no-print {
    display: none !important;
  }

  /* 인쇄 엔진을 위해 오버플로우와 포지션 완벽 초기화 */
  body, html {
    background: white !important;
    color: black !important;
    font-size: 11pt;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* layout container display 초기화 (flex/grid 완전 해제) */
  .app-container,
  .dashboard-main,
  .content-section,
  .analysis-content-area,
  .tab-pane,
  .chunking-list {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    position: static !important; /* absolute/fixed 방지 */
  }

  /* 현재 활성화된 탭 패널만 크게 노출 */
  .tab-pane {
    display: block !important;
    opacity: 1 !important;
    transform: none !important;
    position: relative !important;
    page-break-after: auto !important;
  }

  /* 인쇄 시 현재 켜져 있는 탭페이지만 깔끔하게 인쇄되도록 함 */
  .tab-pane:not(.active) {
    display: none !important;
  }

  /* A4 화이트 종이 스타일 강제화 */
  .worksheet-paper {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    min-height: auto !important;
    background: transparent !important;
    overflow: visible !important;
  }

  /* 인쇄 전용 상단 학원 헤더/워터마크 출력 */
  .print-header-watermark {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #00D2C4;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    width: 100%;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .print-brand-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .print-watermark-logo {
    height: 36px;
    width: 36px;
    object-fit: contain;
  }

  .print-brand-text {
    display: flex;
    flex-direction: column;
  }

  .print-brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #00796B;
  }

  .print-brand-tag {
    font-size: 0.65rem;
    color: #6b7280;
    text-transform: uppercase;
  }

  .print-student-info {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
  }

  /* 인쇄 시 끊어읽기 그리드 및 플렉스 해제하여 겹침/찢어짐 원천 차단 */
  .chunk-flow-lines {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .chunk-segment {
    display: block !important;
    width: 100% !important;
    margin-bottom: 0.8rem !important;
    padding: 0.6rem !important;
    border: 1px solid #d1d5db !important;
    background-color: #f9fafb !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    border-radius: 6px !important;
  }
  
  .segment-eng {
    display: block !important;
    font-size: 1.05rem !important;
    font-weight: bold !important;
    color: #1e3a8a !important;
    margin-bottom: 0.3rem !important;
  }
  
  .segment-kor {
    display: block !important;
    font-size: 0.95rem !important;
    color: #374151 !important;
    margin-bottom: 0.3rem !important;
    padding-left: 0.5rem !important;
  }
  
  .segment-tip {
    display: block !important;
    font-size: 0.85rem !important;
    color: #0f766e !important;
    background-color: #f0fdf4 !important;
    border-left: 3px solid #10b981 !important;
    padding: 0.3rem 0.5rem !important;
    margin-top: 0.3rem !important;
    border-radius: 0 4px 4px 0 !important;
  }

  /* 인쇄 시 레이아웃 겹침 방지를 위해 Grid 해제 및 Block화 */
  .sentence-vocab-grid {
    display: block !important;
    overflow: visible !important;
    width: 100% !important;
  }

  /* 단어 카드는 2열 inline-block으로 정렬하여 공간 활용 & page-break 안정화 */
  .vocab-small-card {
    display: inline-block !important;
    width: 48% !important;
    margin-right: 3% !important;
    margin-bottom: 0.75rem !important;
    vertical-align: top !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    position: relative !important;
    box-sizing: border-box !important;
  }

  .vocab-small-card:nth-child(2n) {
    margin-right: 0 !important;
  }

  /* 제목 태그 바로 뒤에서 잘림 방지 (Orphan 방지) */
  h1, h2, h3, h4, h5,
  .sentence-header,
  .sentence-section h5 {
    page-break-after: avoid !important;
    break-after: avoid-page !important;
  }

  /* 각 문장별 소섹션(단어구역, 어법구역) 내부 쪼개짐 철저 방지 */
  .sentence-section {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    overflow: visible !important;
    margin-bottom: 1.5rem !important;
    display: block !important;
  }

  /* 지문 본문 및 카드 스타일 인쇄용 조정 (중간 쪼개짐 철저 방지) */
  .chunk-card, 
  .vocab-card, 
  .grammar-card, 
  .flow-content-box,
  .grammar-small-card {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid #9ca3af !important;
    color: #000000 !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    margin-bottom: 1.5rem !important;
    position: relative !important;
    overflow: visible !important;
  }

  /* 문장 카드 부모 컨테이너는 페이지 끊김을 허용하되 내부 섹션에서 avoid하게 제어 */
  .sentence-analysis-card {
    background: #ffffff !important;
    background-color: #ffffff !important;
    border: 1px solid #9ca3af !important;
    border-left: 5px solid #00D2C4 !important;
    color: #000000 !important;
    box-shadow: none !important;
    page-break-inside: auto !important;
    break-inside: auto !important;
    margin-bottom: 2.25rem !important;
    position: relative !important;
    overflow: visible !important;
    display: block !important;
  }

  .flow-chart-container::before {
    background: #9ca3af !important;
  }

  .flow-icon-circle {
    background: #00D2C4 !important;
    color: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* 백그라운드 색상 인쇄 허용 설정 */
  .blank-passage-box {
    background: #f3f4f6 !important;
    border: 1px solid #d1d5db !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* 예상문제 인쇄 스타일 */
  .question-card {
    background: white !important;
    border: 1px solid #9ca3af !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    margin-bottom: 2rem !important;
  }
  .question-option {
    border: 1px solid #d1d5db !important;
    background: transparent !important;
    color: black !important;
  }
  .question-explanation {
    display: block !important;
    background: #f9fafb !important;
    border: 1px dashed #9ca3af !important;
    color: black !important;
  }

  /* 학습지 단어 시험지 리스트 (인쇄 시 그리드 오류 방지) */
  .vocab-test-list {
    display: block !important;
  }
  .vocab-test-item {
    display: inline-block !important;
    width: 48% !important;
    margin-right: 4% !important;
    margin-bottom: 0.5rem !important;
    vertical-align: top !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  .vocab-test-item:nth-child(2n) {
    margin-right: 0 !important;
  }

  /* 빈칸 학습지 힌트 리스트 (인쇄 시 그리드 오류 방지) */
  .blank-hints-list {
    display: block !important;
  }
  .blank-hint-item {
    display: inline-block !important;
    width: 31% !important;
    margin-right: 2% !important;
    margin-bottom: 0.4rem !important;
    vertical-align: top !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  .blank-hint-item:nth-child(3n) {
    margin-right: 0 !important;
  }

  /* 인쇄 시 유의어/반의어 흑백 및 가독성 대응 */
  .vocab-tag {
    border: 1px solid #9ca3af !important;
    background: transparent !important;
    color: #000000 !important;
  }
  .vocab-tag.syn {
    border-color: #3b82f6 !important;
    color: #1e3a8a !important;
  }
  .vocab-tag.ant {
    border-color: #ef4444 !important;
    color: #b91c1c !important;
  }
}

/* ==================== 탭: 예상 문제 화면용 스타일 ==================== */
.questions-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.question-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.question-badge {
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  background: var(--blue-light);
  color: var(--blue-primary);
}

.question-num {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--mint-hover);
}

.question-text {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text-main);
  line-height: 1.6;
}

.question-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.question-option {
  padding: 0.8rem 1.2rem;
  border-radius: 10px;
  border: 1px solid var(--border-card);
  background: var(--bg-app);
  color: var(--color-text-main);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.question-option:hover {
  border-color: var(--mint-primary);
  background: var(--mint-light);
}

/* 정답/오답 클릭 피드백 */
.question-option.correct {
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: var(--color-success) !important;
  color: var(--color-success) !important;
  font-weight: 700;
}

.question-option.wrong {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: var(--color-danger) !important;
  color: var(--color-danger) !important;
}

/* 주관식/서술형 입력 및 힌트 */
.question-hint-box {
  margin-top: 0.75rem;
  padding: 0.6rem 0.8rem;
  background: var(--blue-light);
  border-left: 4px solid var(--blue-primary);
  border-radius: 0 8px 8px 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.question-textarea-mock {
  width: 100%;
  height: 60px;
  border-radius: 8px;
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  padding: 0.5rem;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  outline: none;
  color: var(--color-text-main);
}

.show-answer-btn {
  margin-top: 0.75rem;
}

/* 해설 박스 */
.question-explanation {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 10px;
  background: rgba(0, 210, 196, 0.08);
  border: 1px dashed var(--mint-primary);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--color-text-muted);
  animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==================== 10. 문장 중심(Sentence-Centric) 분석 레이아웃 스타일 ==================== */
.sentence-analysis-card {
  border-left: 6px solid var(--mint-primary) !important;
  margin-bottom: 2.25rem !important;
}

.sentence-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.sentence-num-badge {
  background: var(--mint-primary);
  color: white;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 210, 196, 0.15);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.sentence-eng-raw {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text-main);
  font-family: 'Outfit', sans-serif;
  line-height: 1.45;
  letter-spacing: 0.3px;
}

.sentence-kor-raw {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--mint-light);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.dark-mode .sentence-kor-raw {
  background: rgba(0, 210, 196, 0.1);
  color: var(--color-text-main);
}

.sentence-section {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px dashed var(--border-card);
}

.sentence-section h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mint-hover);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* 문장 밑 미니 단어 그리드 */
.sentence-vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}

.vocab-small-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.01);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: transform 0.2s ease;
}

.vocab-small-card:hover {
  transform: translateY(-2px);
}

.vocab-w-word {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mint-hover);
}

.vocab-w-meaning {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue-primary);
  background: var(--blue-light);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  display: inline-block;
  width: fit-content;
  margin: 0.15rem 0;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.vocab-w-desc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin-top: 0.25rem;
  border-top: 1px solid var(--border-card);
  padding-top: 0.25rem;
}

/* 문장 밑 미니 문법 카드 */
.grammar-small-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--blue-primary) !important;
  border-radius: 0 10px 10px 0;
  padding: 0.8rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.01);
}

.grammar-g-title {
  font-size: 0.9rem;
  color: var(--blue-primary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.grammar-g-target {
  font-size: 0.8rem;
  font-family: monospace;
  background: var(--bg-app);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: var(--color-text-main);
  display: block;
  margin: 0.4rem 0;
  border: 1px solid var(--border-card);
  width: fit-content;
}

.grammar-g-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.45;
}

/* 인쇄 모드 서브 컴포넌트 보정 */
@media print {
  .vocab-small-card, .grammar-small-card {
    background: white !important;
    border: 1px solid #d1d5db !important;
    box-shadow: none !important;
  }
}

/* ==========================================================================
   10. 반응형 미디어 쿼리 (Tablet & Mobile Support)
   ========================================================================== */

/* 태블릿 이하 해상도 (대략 1024px 이하) */
@media screen and (max-width: 1024px) {
  .dashboard-main {
    grid-template-columns: 1fr; /* 사이드바를 세로 1열로 변경 */
    gap: 1.5rem;
    padding: 1.5rem 1.5rem;
  }
  
  .app-header {
    padding: 1rem 1.5rem;
  }
}

/* 모바일 및 소형 태블릿 해상도 (768px 이하) */
@media screen and (max-width: 768px) {
  .dashboard-main {
    padding: 1rem 0.75rem;
  }

  .app-header {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }

  .brand-subtitle {
    display: none;
  }

  #print-doc {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .logo-area {
    gap: 0.5rem;
  }
  
  .brand-title {
    font-size: 1.15rem;
  }
  
  .brand-logo {
    height: 32px;
    width: 32px;
  }
  
  /* 끊어읽기 덩어리 가로 2열을 세로로 변경하여 좁은 화면에서 흐름이 깨지지 않게 보정 */
  .chunk-segment {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    padding: 0.5rem 0.5rem;
    border-bottom: 1px solid var(--border-card);
  }
  
  .segment-kor {
    padding-left: 0.75rem;
    position: relative;
  }
  
  .segment-kor::before {
    content: "↳";
    position: absolute;
    left: 0;
    color: var(--mint-primary);
  }
  
  .analysis-tabs {
    border-radius: 8px;
    padding: 0.25rem;
  }
  
  .tab-btn {
    padding: 0.5rem 0.5rem;
    font-size: 0.8rem;
    min-width: 80px;
  }
  
  .vocab-grid {
    grid-template-columns: 1fr; /* 어휘 카드도 1열 정렬 */
  }
  
  /* 시험지 프린트 설정 대시보드 구조 모바일 대응 */
  .worksheet-creator-dashboard {
    display: flex; /* grid에서 flex로 변경하여 280px 열 고정 해제 */
    flex-direction: column;
    gap: 1.5rem;
  }

  /* 모바일 화면에서 워크시트 종이 패딩 줄여서 텍스트 영역 극대화 */
  .worksheet-paper {
    padding: 1.25rem 1rem !important;
  }

  .paper-title {
    font-size: 1.2rem;
  }

  .paper-subtitle {
    font-size: 0.75rem;
  }

  .paper-meta-row {
    padding: 0.4rem;
    font-size: 0.75rem;
    gap: 0.75rem;
  }
}


/* 2차 챌린지 미션 관련 스타일 */
.phase2-header-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(255, 94, 58, 0.08) 0%, rgba(255, 149, 0, 0.08) 100%);
  border: 1px solid rgba(255, 94, 58, 0.2);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 12px rgba(255, 94, 58, 0.05);
  animation: fadeIn 0.4s ease forwards;
}

.phase2-banner-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.phase2-banner-text p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--color-text-muted);
}

.challenge-tag {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ff5e3a;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.phase2-card {
  border-left: 4px solid #ff5e3a !important;
}

.phase2-badge {
  background: linear-gradient(135deg, #ff5e3a 0%, #ff9500 100%) !important;
  color: white !important;
}

.mission-unlock-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(135deg, rgba(0, 210, 196, 0.06) 0%, rgba(26, 115, 232, 0.06) 100%);
  border: 1px solid rgba(0, 210, 196, 0.2);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 8px 20px rgba(0, 210, 196, 0.08);
  animation: slideUpFade 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.mission-clear-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(5, 150, 105, 0.06) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.08);
  animation: slideUpFade 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.banner-icon {
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

.mission-unlock-banner .banner-icon {
  background: rgba(0, 210, 196, 0.1);
  color: var(--mint-primary);
}

.mission-clear-banner .banner-icon {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  animation: scaleBounce 1.5s infinite alternate;
}

.banner-content {
  flex: 1;
}

.banner-content h4 {
  margin: 0 0 0.4rem 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text-main);
}

.banner-content p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--color-text-muted);
}

#start-phase2-btn {
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ff5e3a 0%, #ff9500 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 10px rgba(255, 94, 58, 0.25);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#start-phase2-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(255, 94, 58, 0.35);
}

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

@keyframes scaleBounce {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

/* ==================== 11. 대화형 디지털 학습지 스타일 & 프린트/반응형 보정 ==================== */
.print-only {
  display: none !important;
}

@media print {
  .print-only {
    display: inline-block !important;
  }
  .no-print {
    display: none !important;
  }
}

/* 단어 테스트 입력 상자 */
.vocab-test-input {
  flex: 1.2;
  border: 1.5px solid var(--border-card);
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  font-family: var(--font-primary);
  font-size: 0.9rem;
  background: var(--bg-app);
  color: var(--color-text-main);
  outline: none;
  transition: all 0.2s ease;
  margin-left: 0.5rem;
  box-sizing: border-box;
}

.vocab-test-input:focus {
  border-color: var(--mint-primary);
  box-shadow: 0 0 0 3px rgba(0, 210, 196, 0.12);
}

.vocab-test-input.correct {
  border-color: var(--color-success) !important;
  background-color: rgba(16, 185, 129, 0.08) !important;
  color: var(--color-success) !important;
}

.vocab-test-input.wrong {
  border-color: var(--color-danger) !important;
  background-color: rgba(239, 68, 68, 0.08) !important;
  color: var(--color-danger) !important;
}

/* 본문 빈칸 완성용 인라인 입력 상자 */
.blank-test-input {
  border: none !important;
  border-bottom: 2px solid var(--mint-primary) !important;
  background: transparent !important;
  color: var(--color-text-main) !important;
  font-family: var(--font-primary) !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  text-align: center !important;
  outline: none !important;
  padding: 0 !important;
  margin: 0 0.2rem !important;
  transition: all 0.2s ease !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

.blank-test-input:focus {
  background: rgba(0, 210, 196, 0.06) !important;
  border-bottom-color: var(--blue-primary) !important;
}

.blank-test-input.correct {
  border-bottom-color: var(--color-success) !important;
  background-color: rgba(16, 185, 129, 0.08) !important;
  color: var(--color-success) !important;
}

.blank-test-input.wrong {
  border-bottom-color: var(--color-danger) !important;
  background-color: rgba(239, 68, 68, 0.08) !important;
  color: var(--color-danger) !important;
}

/* 빈칸 채우기 정답 박스 내부 줄바꿈 정렬 */
.blank-passage-box {
  background: var(--bg-app);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1.5rem;
  color: var(--color-text-main);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.02);
  margin-bottom: 1.5rem;
}

body.dark-mode .blank-passage-box {
  background: rgba(255, 255, 255, 0.02);
}

/* 모바일 화면 대응 보정 */
@media screen and (max-width: 768px) {
  .vocab-test-list {
    grid-template-columns: 1fr !important; /* 모바일에서는 세로 1열로 표시 */
    row-gap: 1rem !important;
  }

  .vocab-test-item {
    flex-wrap: wrap; /* 모바일 기기에서 좁을 시 자동 줄바꿈 */
    gap: 0.5rem;
    padding-bottom: 0.6rem;
  }

  .vocab-test-q {
    min-width: 120px;
  }

  .vocab-test-input {
    flex: 1 0 100%; /* 줄바꿈 시 입력칸이 넓게 자리 잡도록 유도 */
    margin-left: 0;
    margin-top: 0.25rem;
  }
  
  .worksheet-actions {
    flex-direction: column;
    width: 100%;
  }
  
  .worksheet-actions button {
    width: 100%;
  }

  .blank-hints-list {
    grid-template-columns: repeat(2, 1fr) !important; /* 모바일에서 힌트는 2열 */
  }
}
