/* ========================================================
   2026-2 고급한국어 - Student Web View & Typing Practice Styles
   Modern, Clean, Academic & Professional UI
   ======================================================== */

/* Header & Navigation */
.student-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.75rem 0;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
}

.brand-badge {
  font-size: 0.72rem;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Student Profile Badge */
.student-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface-hover);
  border: 1px solid var(--border-strong);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
}

.student-profile-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.lesson-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.lesson-dropdown {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.45rem 2rem 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color var(--transition-fast);
}

.lesson-dropdown:hover {
  border-color: var(--primary);
}

.select-arrow-icon {
  position: absolute;
  right: 0.75rem;
  pointer-events: none;
  color: var(--text-muted);
  font-size: 0.7rem;
}

/* Header Language Selector Dropdown */
.lang-dropdown-wrap {
  position: relative;
  display: inline-block;
}

.lang-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

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

.lang-dropdown-arrow {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.lang-dropdown-wrap.open .lang-dropdown-arrow {
  transform: rotate(180deg);
}

.lang-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  padding: 0.4rem;
  z-index: 1000;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-dropdown-wrap.open .lang-dropdown-menu {
  display: block;
}

.lang-dropdown-header-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0.35rem 0.6rem;
  border-bottom: 1px solid #F1F5F9;
  margin-bottom: 0.25rem;
}

.lang-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: none;
  background: transparent;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.lang-dropdown-item:hover {
  background: #F1F5F9;
  color: var(--primary);
}

.lang-dropdown-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.lang-dropdown-item-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.lang-dropdown-native {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.lang-dropdown-check {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 800;
}

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

/* Hero Section */
.lesson-hero {
  padding: 1.75rem 0 1rem 0;
  text-align: center;
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.hero-objective-card {
  display: block;
  background: #F8FAFC;
  border: 1px solid var(--border-strong);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  max-width: 660px;
  margin: 0.5rem auto 0.75rem auto;
  box-sizing: border-box;
}

.objective-card-inner {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  text-align: left;
}

.objective-label-col {
  flex-shrink: 0;
  padding-top: 0.15rem;
}

.objective-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.objective-content-col {
  flex: 1;
}

.objective-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: left;
}

.objective-list-item {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.88rem;
  color: var(--text-main);
  line-height: 1.45;
  font-weight: 500;
  text-align: left;
}

.obj-bullet {
  color: var(--primary);
  font-weight: 800;
  flex-shrink: 0;
}

.obj-text {
  flex: 1;
  text-align: left;
}

/* Hero Assignments Row & Callout Banner */
.hero-assignments-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 1rem;
}

.hero-assignment-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  background: #FFFFFF;
  border: 1.5px solid #2563EB;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  min-width: 0;
  box-sizing: border-box;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.hero-assignment-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.16);
  background: #FAFCFF;
}

.assignment-banner-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.assignment-tag {
  background: #2563EB;
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}

.assignment-banner-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.assignment-banner-info strong {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.3;
  word-break: keep-all;
}

.assignment-status-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.3;
  word-break: keep-all;
}

.assignment-status-text.submitted {
  color: #16A34A;
  font-weight: 700;
}

.assignment-banner-btn {
  font-weight: 700;
  white-space: nowrap;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  flex-shrink: 0;
  margin-left: 0.25rem;
}

/* Main Navigation Tabs (Modern Segmented Bar) */
.main-nav-tabs {
  display: flex;
  justify-content: center;
  background: #F1F5F9;
  border: 1px solid var(--border);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  gap: 0.25rem;
  max-width: 840px;
  margin: 1.5rem auto 2rem auto;
}

.main-nav-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.55rem 0.75rem;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.main-nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.6);
}

.main-nav-tab.active {
  background: var(--surface);
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tab-content-section {
  display: none;
}

.tab-content-section.active {
  display: block;
}

/* Vocab Filter Navigation */
.vocab-filter-nav {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.vocab-filter-btn {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

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

/* Category Notice Banner */
.category-notice-banner {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

/* ========================================================
   1. 단어 학습 (Vocabulary & Flashcard)
   ======================================================== */
.flashcard-wrapper {
  max-width: 540px;
  margin: 0 auto 2.5rem auto;
  perspective: 1200px;
}

.flashcard-container {
  width: 100%;
  height: 330px;
  position: relative;
  cursor: pointer;
}

.flashcard-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.flashcard-container.is-flipped .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}

.flashcard-container:hover .flashcard-face {
  border-color: var(--primary-border);
}

.flashcard-back {
  transform: rotateY(180deg);
  background: #FAFBFC;
}

.fc-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fc-flip-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.fc-center-content {
  text-align: center;
  padding: 1rem 0;
}

.fc-korean-word {
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
  letter-spacing: -0.01em;
}

.fc-pronun-text {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
}

.fc-meaning-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.fc-bottom-example {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  color: var(--text-secondary);
  text-align: center;
}

.flashcard-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.card-counter-badge {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: var(--surface-hover);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

/* Words Grid */
.words-grid-section-title {
  margin-bottom: 1rem;
}

.words-grid-section-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.words-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.word-card-item {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.word-index-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.pos-badge {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.word-korean-text {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.15rem;
}

.word-pronun-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.word-en-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.85rem;
}

.word-example-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.word-example-box small {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

/* ========================================================
   다국어 (Multilingual UI) 컴포넌트 스타일
   ======================================================== */
.lang-selector-card {
  background: #FFFFFF;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-xs);
}

.lang-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.lang-selector-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.lang-selector-badge {
  font-size: 0.75rem;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-xs);
  font-weight: 600;
}

.lang-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.lang-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-subtle);
  border: 1.5px solid #E2E8F0;
  color: #334155;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lang-chip-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #FFFFFF;
  transform: translateY(-1px);
}

.lang-chip-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.lang-chip-flag {
  font-size: 1.05rem;
  line-height: 1;
}

.lang-native-label {
  font-size: 0.78rem;
  opacity: 0.85;
}

/* 전체 비교 테이블 뷰 (Comparison Table) */
.vocab-compare-container {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-xs);
}

.vocab-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  text-align: left;
  min-width: 850px;
}

.vocab-compare-table th {
  background: #F8FAFC;
  color: #334155;
  font-weight: 700;
  padding: 0.75rem 0.85rem;
  border-bottom: 1.5px solid #E2E8F0;
  white-space: nowrap;
}

.vocab-compare-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}

.vocab-compare-table tr:hover {
  background: #F8FAFC;
}

.vocab-compare-table .ko-col {
  font-weight: 800;
  color: var(--text-main);
  font-size: 0.95rem;
}

/* ========================================================
   2. 타자 연습 모드 (Typing Practice Engine)
   ======================================================== */
.typing-practice-wrap {
  max-width: 780px;
  margin: 0 auto 3rem auto;
}

.typing-sub-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.typing-sub-tab {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 0.45rem 1.15rem;
  border-radius: var(--radius-xs);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.typing-sub-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.typing-sub-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.stat-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.stat {
  background: var(--paper-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}

.stat .num {
  font-family: 'Noto Serif KR', serif;
  font-weight: 900;
  font-size: 22px;
  color: var(--ink);
  display: block;
  line-height: 1.2;
}

.stat .lab {
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: .03em;
}

.progress-track {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 22px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  width: 0%;
  transition: width .25s ease;
}

.sentence-count {
  font-size: 12.5px;
  color: var(--ink-soft);
  letter-spacing: .04em;
  margin-bottom: 12px;
}

.target-box {
  background: #F8FAFC;
  border: 1.5px solid #CBD5E1;
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 14px;
  user-select: none;
}

.typed-box {
  background: #FFFFFF;
  border: 2px solid #60A5FA;
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 16px;
  min-height: 80px;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.08);
}

.box-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748B;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.box-label.accent {
  color: #2563EB;
}

.target {
  font-family: 'Noto Serif KR', serif, -apple-system, sans-serif;
  font-size: clamp(20px, 3.8vw, 28px);
  font-weight: 700;
  line-height: 1.8;
  word-break: keep-all;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  color: #0F172A;
}

.user-typed {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: clamp(20px, 3.8vw, 28px);
  font-weight: 600;
  line-height: 1.8;
  word-break: break-all;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  min-height: 1.8em;
  color: #1E293B;
}

/* 대형 타이핑 입력창 스타일 */
#typing-typer {
  width: 100%;
  box-sizing: border-box;
  font-size: 1.45rem;
  font-weight: 600;
  padding: 1rem 1.25rem;
  height: auto;
  min-height: 64px;
  border-radius: 12px;
  border: 2.5px solid #3B82F6;
  background: #FFFFFF;
  color: #0F172A;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.12);
  outline: none;
  transition: all 0.2s ease;
  letter-spacing: 0.02em;
  margin-top: 0.5rem;
}

#typing-typer:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2), 0 6px 18px rgba(37, 99, 235, 0.18);
  background: #FAFCFF;
}

#typing-typer::placeholder {
  color: #94A3B8;
  font-size: 1.15rem;
  font-weight: 500;
}

.ch { position: relative; transition: color .1s, background .1s; }
.ch.correct { color: var(--jade); }
.ch.wrong, .ch.incorrect { color: var(--vermillion); background: var(--vermillion-bg); border-radius: 4px; }
.ch.current, .ch.current-target { background: var(--accent-soft); color: var(--ink); border-radius: 4px; box-shadow: 0 0 0 2px var(--accent) inset; }
.ch.composing { background: var(--accent-soft); color: var(--ink); border-radius: 4px; box-shadow: 0 0 0 2px var(--accent) inset; }
.ch.pending { color: #A9BFD3; }

.char { position: relative; transition: color .1s, background .1s; }
.char.correct { color: #059669; }
.char.wrong { color: #DC2626; background: #FEE2E2; border-radius: 4px; }
.char.current-target { background: #DBEAFE; color: #1E40AF; border-radius: 4px; }
.char.composing { background: #FEF3C7; color: #92400E; border-radius: 4px; }

.blinking-cursor, .typing-cursor {
  display: inline-block;
  width: 2.5px;
  height: 1.15em;
  background-color: var(--accent);
  vertical-align: -0.15em;
  margin-left: 2px;
  animation: blink 1s infinite;
}

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

.practice-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.practice-actions .btn { padding: 10px 18px; font-size: 13.5px; }

.who-bar { text-align: center; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 14px; }
.who-bar b { color: var(--ink); }

.result-wrap { text-align: center; }

.stamp {
  width: 132px;
  height: 132px;
  margin: 6px auto 18px;
  border-radius: 50%;
  border: 4px solid var(--accent);
  color: var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Serif KR', serif;
  transform: rotate(-8deg) scale(0);
  animation: stamp-in .45s cubic-bezier(.2,1.4,.4,1) forwards;
  animation-delay: .15s;
}

@keyframes stamp-in { to { transform: rotate(-8deg) scale(1); } }

.stamp .grade { font-size: 30px; font-weight: 900; line-height: 1; }
.stamp .grade-sub { font-size: 11px; font-weight: 700; margin-top: 4px; letter-spacing: .05em; }

.result-title { font-family: 'Noto Serif KR', serif; font-weight: 900; font-size: 22px; margin: 0 0 8px; }
.save-status { font-size: 12.5px; margin-bottom: 18px; }
.save-status.ok { color: var(--jade); }
.save-status.err { color: var(--vermillion); }
.save-status.loading { color: var(--ink-soft); }

.result-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.result-grid .stat .num { font-size: 26px; }

/* ========================================================
   3. 게임 액티비티 (Mini Games)
   ======================================================== */
.game-sub-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.game-sub-tab {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-xs);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.game-sub-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.game-sub-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.game-view-panel {
  max-width: 800px;
  margin: 0 auto 3rem auto;
}

.game-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-xs);
}

.game-stat {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.game-stat span[id] {
  color: var(--primary);
  font-weight: 700;
}

/* Match Game Grid */
.match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

@media (max-width: 640px) {
  .match-grid { grid-template-columns: repeat(2, 1fr); }
}

.match-card {
  height: 120px;
  perspective: 800px;
  cursor: pointer;
}

.match-card .card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.3s;
}

.match-card.flipped .card-inner { transform: rotateY(180deg); }

.match-card.matched .card-back {
  border-color: #10B981;
  background: #ECFDF5;
}

.match-card .card-front,
.match-card .card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  text-align: center;
  border: 1px solid var(--border-strong);
}

.match-card .card-front {
  background: #F1F5F9;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.match-card .card-back {
  transform: rotateY(180deg);
  background: white;
}

.match-card .card-main-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.match-card .card-type-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

/* Speed Quiz */
.quiz-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.quiz-question-box {
  text-align: center;
  margin-bottom: 1.75rem;
}

.quiz-korean-word {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.quiz-options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

@media (max-width: 580px) {
  .quiz-options-grid { grid-template-columns: 1fr; }
}

.quiz-option-btn {
  background: var(--surface-subtle);
  border: 1px solid var(--border-strong);
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}

.quiz-option-btn:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}

/* ========================================================
   4. 단어 활용 문장 만들기 스튜디오 (Sentence Studio)
   ======================================================== */
.assignment-header-card {
  padding: 1.5rem;
  background: #FFFFFF;
  border: 1.5px solid #2563EB;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}

.assignment-steps-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  flex-wrap: wrap;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.step-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #E2E8F0;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.step-item.active {
  color: var(--primary);
  font-weight: 700;
}

.step-item.active .step-circle {
  background: var(--primary);
  color: white;
}

.step-item.done {
  color: #15803D;
  font-weight: 600;
}

.step-item.done .step-circle {
  background: #DCFCE7;
  color: #15803D;
}

.step-divider {
  color: var(--border-strong);
  font-size: 0.75rem;
}

.studio-progress-card { padding: 1.25rem; }

.studio-progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 0.5rem;
}

.studio-progress-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.studio-word-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.word-chip {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.word-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.word-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.word-chip.completed {
  border-color: #10B981;
  background: #F0FDF4;
  color: #15803D;
}

.word-chip.completed.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.studio-main-card {
  padding: 1.75rem;
  margin-bottom: 3rem;
}

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

.studio-target-word-banner {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.word-big-title h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
}

.word-big-meaning {
  font-size: 1.05rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.word-example-hint {
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: white;
  border: 1px solid var(--border);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-xs);
}

.hint-tag {
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 0.4rem;
}

/* Step Card & Pattern Input Styles for Sentence Studio (동사/형용사 문형 쓰기 과제) */
.studio-step-card {
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-sm, 8px);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.studio-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.studio-step-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: #0F172A;
}

.step-num-badge {
  background: #2563EB;
  color: #FFFFFF;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  flex-shrink: 0;
}

.btn-dict-link {
  font-size: 0.82rem;
  font-weight: 700;
  color: #2563EB;
  border: 1px solid #BFDBFE;
  background: #EFF6FF;
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
}

.btn-dict-link:hover {
  background: #DBEAFE;
  border-color: #93C5FD;
  color: #1D4ED8;
}

.studio-step-subtext {
  font-size: 0.83rem;
  color: #64748B;
  margin-bottom: 0.6rem;
}

.studio-pattern-input {
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
  font-size: 0.92rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.studio-pattern-input:focus {
  border-color: #2563EB;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ========================================================
   5. 학습 결과 및 유인물 요약 (Summary & Print View)
   ======================================================== */
.summary-container {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  max-width: 860px;
  margin: 0 auto 3rem auto;
}

.summary-header-doc {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--text-main);
  padding-bottom: 1.25rem;
  margin-bottom: 1.75rem;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.summary-doc-title {
  flex: 1;
  min-width: 240px;
}

.summary-doc-title h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.25rem;
  letter-spacing: -0.01em;
}

.summary-doc-meta-card {
  background: #F8FAFC;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  padding: 0.6rem 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 0.35rem 1rem;
  font-size: 0.85rem;
  box-sizing: border-box;
}

.summary-meta-item {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  white-space: nowrap;
}

.summary-meta-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  min-width: 38px;
}

.summary-meta-value {
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.88rem;
}

.summary-progress-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 680px) {
  .summary-progress-row { grid-template-columns: 1fr; }
}

.summary-stat-card {
  background: var(--surface-subtle);
  border-radius: var(--radius-xs);
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
}

.summary-stat-card h4 {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
  font-weight: 600;
}

.summary-stat-card p {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.doc-sub-stat-text {
  font-size: 0.78rem;
  margin-top: 0.2rem;
}

.handout-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

.handout-table th, .handout-table td {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.handout-table th {
  background: #F8FAFC;
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.handout-section-heading {
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.summary-sentence-item {
  background: #F8FAFC;
  border: 1px solid var(--border);
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-xs);
  margin-bottom: 0.45rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.summary-sentence-item .sent-num {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
}

.summary-sentence-item .sent-text {
  font-size: 0.88rem;
  margin-bottom: 0.1rem;
  color: var(--text-main);
}

.summary-action-bar {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

/* A4 1페이지 인쇄 완벽 최적화 */
@page {
  size: A4 portrait;
  margin: 8mm 10mm;
}

@media print {
  html, body {
    background: white !important;
    color: #111 !important;
    font-size: 8.5pt !important;
    line-height: 1.2 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .student-header,
  .main-nav-tabs,
  .vocab-filter-nav,
  .summary-action-bar,
  .lesson-hero,
  #section-vocab,
  #section-typing,
  #section-games,
  #section-sentence,
  .btn-delete-sm,
  .btn {
    display: none !important;
  }

  #section-summary,
  .tab-content-section {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .summary-container {
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    border: none !important;
    margin: 0 !important;
  }

  .summary-header-doc {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    border-bottom: 1.5px solid #222 !important;
    padding-bottom: 4px !important;
    margin-bottom: 8px !important;
    gap: 8px !important;
  }

  .summary-doc-title h2 {
    font-size: 1.15rem !important;
    margin: 2px 0 0 0 !important;
  }

  .summary-doc-meta-card {
    background: transparent !important;
    border: 1px solid #777 !important;
    padding: 3px 8px !important;
    font-size: 7.5pt !important;
    gap: 2px 8px !important;
  }

  .summary-progress-row {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
    margin-bottom: 8px !important;
  }

  .summary-stat-card {
    background: transparent !important;
    border: 1px solid #888 !important;
    border-left: 3px solid #333 !important;
    padding: 3px 6px !important;
  }

  .summary-stat-card h4 {
    font-size: 7.5pt !important;
    margin: 0 0 1px 0 !important;
  }

  .summary-stat-card p {
    font-size: 9pt !important;
    margin: 0 !important;
  }

  .doc-sub-stat-text {
    font-size: 7.5pt !important;
    margin-top: 1px !important;
  }

  .handout-section-heading {
    font-size: 8.5pt !important;
    font-weight: 800 !important;
    margin: 6px 0 3px 0 !important;
    color: #000 !important;
  }

  .handout-table {
    margin-bottom: 6px !important;
    font-size: 7.5pt !important;
    width: 100% !important;
  }

  .handout-table th,
  .handout-table td {
    padding: 2.5px 5px !important;
    border: 1px solid #777 !important;
    line-height: 1.15 !important;
  }

  .handout-table th {
    background: #f2f2f2 !important;
    color: #000 !important;
  }

  .summary-sentence-item {
    background: transparent !important;
    border: 1px solid #999 !important;
    padding: 2.5px 6px !important;
    margin-bottom: 3px !important;
    gap: 4px !important;
    font-size: 7.5pt !important;
  }

  .summary-sentence-item .sent-num {
    background: #e2e8f0 !important;
    color: #000 !important;
    font-size: 6.5pt !important;
    padding: 1px 3px !important;
  }

  .summary-sentence-item .sent-text {
    font-size: 7.5pt !important;
    margin: 0 !important;
  }

  #summary-typing-report-container > div {
    background: transparent !important;
    border: 1px solid #999 !important;
    padding: 4px !important;
    margin-bottom: 0 !important;
  }

  #summary-typing-report-container table {
    font-size: 7pt !important;
    margin-bottom: 0 !important;
  }

  #summary-typing-report-container table th,
  #summary-typing-report-container table td {
    padding: 1.5px 4px !important;
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .hero-title { font-size: 1.45rem; }
  .main-nav-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.45rem; }
  .stat-bar { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .result-grid { grid-template-columns: 1fr; }
  .modal-content { width: 92% !important; padding: 1.5rem 1.25rem !important; }
  .aiprompt-header-card { padding: 1.15rem 1rem; }
}

/* ========================================================
   AI 글쓰기 프롬프트 (AI Writing Prompts) 스타일
   ======================================================== */
.aiprompt-wrapper {
  max-width: 1000px;
  margin: 0 auto;
}

.aiprompt-header-card {
  padding: 1.5rem 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  margin-bottom: 1.5rem;
}

.aiprompt-header-card h2 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.aiprompt-header-card p {
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.ai-quick-links-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.85rem;
  margin-top: 0.85rem;
  border-top: 1px solid var(--border);
}

.ai-links-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.ai-shortcut-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-main);
}

.ai-shortcut-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.ai-shortcut-btn.btn-chatgpt:hover { background: #10A37F; color: #fff; border-color: #10A37F; }
.ai-shortcut-btn.btn-gemini:hover { background: #1E88E5; color: #fff; border-color: #1E88E5; }
.ai-shortcut-btn.btn-claude:hover { background: #D97706; color: #fff; border-color: #D97706; }

/* AI Prompt Card */
.aiprompt-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: all 0.2s ease;
}

.aiprompt-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.aiprompt-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #F1F5F9;
  background: #FAFAFC;
}

.aiprompt-num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #2563EB;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}

.aiprompt-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1D4ED8;
  margin: 0;
}

.aiprompt-card-body {
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
}

.aiprompt-text-box {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
}

.btn-copy-prompt {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #2563EB;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-copy-prompt:hover {
  background: #2563EB;
  color: #fff;
  border-color: #2563EB;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-copy-prompt.copied {
  background: #10B981 !important;
  color: #fff !important;
  border-color: #10B981 !important;
}

/* Empty State */
.aiprompt-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  background: var(--surface-subtle);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
}
