/* Power Up 备课系统专属样式表 - Modern Clean & Responsive UI */
:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --secondary: #0ea5e9;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* App Header */
.app-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #4f46e5, #0ea5e9);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.brand-title h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-title p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Level Switcher */
.level-switcher {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-full);
  gap: 4px;
}

.level-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.level-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.btn-placement-nav {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  color: #4f46e5 !important;
  font-weight: 700;
  border: 1px solid #ddd6fe;
}

.btn-placement-nav:hover {
  background: linear-gradient(135deg, #ede9fe 0%, #e0e7ff 100%);
  color: #4338ca !important;
}

.btn-placement-nav.active {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%) !important;
  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35) !important;
}

/* Main Layout */
.app-body {
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
}

/* Sidebar Navigation */
.sidebar {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  height: calc(100vh - 110px);
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sidebar-header {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-badge {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.unit-tree-container {
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
}

.unit-tree-container::-webkit-scrollbar {
  width: 5px;
}
.unit-tree-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.unit-group {
  margin-bottom: 0.75rem;
}

.unit-header-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.unit-header-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.unit-header-btn.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #c7d2fe;
}

.lesson-sublist {
  padding-left: 0.75rem;
  margin-top: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lesson-nav-btn {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s;
}

.lesson-nav-btn:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.lesson-nav-btn.active {
  background: #e0e7ff;
  color: var(--primary);
  font-weight: 600;
}

.lesson-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
}

.lesson-nav-btn.active .lesson-dot {
  background: var(--primary);
}

/* Main Content Area */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

/* Tabs Bar */
.module-tabs {
  display: flex;
  background: #ffffff;
  padding: 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  gap: 6px;
  overflow-x: auto;
}

.tab-btn {
  flex: 1;
  min-width: 140px;
  padding: 0.65rem 1rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  background: #f8fafc;
  color: var(--text-main);
}

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

/* View Sections */
.view-section {
  display: none;
}
.view-section.active {
  display: block;
}

/* Cards & Containers */
.content-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Objectives Grid */
.objectives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.obj-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.obj-box.vocab { border-left: 4px solid var(--primary); }
.obj-box.sentence { border-left: 4px solid var(--secondary); }
.obj-box.phonics { border-left: 4px solid var(--accent); }
.obj-box.mission { border-left: 4px solid var(--success); }

.obj-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.word-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.word-tag {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.word-tag b { color: var(--primary); }

.sentence-item {
  font-size: 0.875rem;
  margin-bottom: 0.4rem;
  padding: 0.4rem 0.6rem;
  background: #ffffff;
  border-radius: var(--radius-sm);
  border-left: 2px solid #cbd5e1;
}
.sentence-item .en { font-weight: 600; color: #1e293b; }
.sentence-item .cn { color: #64748b; font-size: 0.8rem; margin-top: 2px; }

/* Teaching Flow Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  margin-left: 0.5rem;
  padding-left: 1.5rem;
  border-left: 2px dashed #cbd5e1;
}

.timeline-step {
  position: relative;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: all 0.2s;
}

.timeline-step:hover {
  background: #ffffff;
  box-shadow: var(--shadow-sm);
  border-color: #cbd5e1;
}

.step-marker {
  position: absolute;
  left: -2.05rem;
  top: 1rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--primary);
}

.timeline-step.break-step {
  background: #fffbeb;
  border-color: #fde68a;
}
.timeline-step.break-step .step-marker {
  border-color: var(--accent);
}

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

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

.step-time {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.step-desc {
  font-size: 0.875rem;
  color: #334155;
  line-height: 1.6;
}

/* Game Cards */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.game-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.game-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.game-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.game-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.game-rules {
  font-size: 0.875rem;
  color: #334155;
  background: #f8fafc;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

/* Homework Card Preview & Export Container */
.homework-card-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.card-actions-bar {
  display: flex;
  gap: 0.75rem;
  width: 100%;
  max-width: 680px;
  justify-content: flex-end;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

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

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}
.btn-success:hover {
  background: #059669;
}

.preset-chip-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.preset-chip-btn:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
  transform: translateY(-1px);
}


/* The Graphical Homework Card (rendered like a poster) */
.poster-card {
  width: 100%;
  max-width: 680px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08), 0 5px 15px rgba(0, 0, 0, 0.04);
  border: 1px solid #e2e8f0;
  overflow: hidden;
  font-size: 14px;
}

.poster-header {
  background: linear-gradient(135deg, #4f46e5 0%, #3b82f6 50%, #06b6d4 100%);
  color: #ffffff;
  padding: 1.75rem 2rem 1.25rem 2rem;
  position: relative;
}

.poster-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.poster-title {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1.3;
}

.poster-subtitle {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-top: 0.25rem;
}

.poster-meta-strip {
  display: flex;
  background: rgba(0, 0, 0, 0.15);
  margin: 1rem -2rem -1.25rem -2rem;
  padding: 0.6rem 2rem;
  font-size: 0.8125rem;
  gap: 1.5rem;
}

.poster-body {
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.poster-section {
  border-bottom: 1px dashed #e2e8f0;
  padding-bottom: 1rem;
}
.poster-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.poster-sec-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: #f8fafc;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid #f1f5f9;
}

.task-icon {
  font-size: 1.1rem;
  line-height: 1;
  margin-top: 2px;
}

.task-text {
  flex: 1;
  font-size: 0.875rem;
  color: #334155;
  line-height: 1.5;
}
.task-text strong {
  color: #0f172a;
}

.poster-footer {
  background: #f8fafc;
  padding: 1rem 2rem;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #64748b;
}

/* Feedback Generator Section */
.feedback-editor-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
}

.roster-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

.student-select-box {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-select, .form-input, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  background: #ffffff;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s;
}

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

.score-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.score-row {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s;
}

.score-row.disabled {
  opacity: 0.45;
  background: #f1f5f9;
}

.score-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.score-check {
  cursor: pointer;
}

.score-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
}

.star-rating {
  display: flex;
  gap: 2px;
}

.star-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #cbd5e1;
  padding: 2px;
  transition: color 0.15s;
}

.star-btn.active {
  color: #f59e0b;
}

.feedback-preview-pane {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.feedback-text-box {
  width: 100%;
  height: 220px;
  font-family: inherit;
  line-height: 1.6;
}

/* Printable / Export 1-Page PDF Poster */
.feedback-pdf-poster {
  background: #ffffff;
  width: 100%;
  max-width: 650px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin: 0 auto;
}

.pdf-header {
  border-bottom: 2px solid #4f46e5;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pdf-student-badge {
  font-size: 1.25rem;
  font-weight: 800;
  color: #4f46e5;
}

.pdf-date {
  font-size: 0.8125rem;
  color: #64748b;
}

.pdf-scores-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.pdf-score-cell {
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
}

.pdf-comment-body {
  background: #fdfaf3;
  border-left: 4px solid #f59e0b;
  padding: 1rem 1.25rem;
  border-radius: 0 8px 8px 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #334155;
  margin-bottom: 1.5rem;
  white-space: pre-wrap;
}

.pdf-badge-stamp {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.honor-badge {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}
.modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--text-muted);
}

/* Toast Message */
.toast-notice {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .app-body {
    grid-template-columns: 1fr;
  }
  .sidebar {
    height: auto;
    position: static;
  }
  .feedback-editor-grid {
    grid-template-columns: 1fr;
  }
}

/* Brand Logo Image in Header */
.brand-logo-img {
  height: 48px;
  max-width: 220px;
  object-fit: contain;
  border-radius: 6px;
  transition: transform 0.2s ease;
}
.brand-logo-img:hover {
  transform: scale(1.02);
}

/* Class and Student Selector Bar in Feedback Generator */
.class-student-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  background: #f8fafc;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.class-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
  background: #ffffff;
  transition: all 0.2s ease;
}
.class-item-row:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}
.class-item-row.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* Document Cards & Resource Grid */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}
.doc-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.doc-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.doc-card-thumb {
  height: 150px;
  background: #f1f5f9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  border: 1px solid #e2e8f0;
}
.doc-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.2s ease;
}
.doc-card-thumb:hover img {
  transform: scale(1.03);
}
.doc-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.doc-badge.copybook { background: #e0e7ff; color: #4338ca; }
.doc-badge.sight_word { background: #fef3c7; color: #b45309; }
.doc-badge.knowledge_list { background: #dcfce7; color: #15803d; }
.doc-badge.courseware { background: #f3e8ff; color: #7e22ce; }

.doc-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}
.doc-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  flex: 1;
  line-height: 1.5;
}
.doc-actions {
  display: flex;
  gap: 0.4rem;
}
.doc-actions button, .doc-actions a {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}

/* Document Preview Modal Styling */
.preview-modal-dialog {
  max-width: 900px;
  width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.preview-modal-body {
  flex: 1;
  overflow-y: auto;
  text-align: center;
  padding: 1.25rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.preview-modal-body img {
  max-width: 100%;
  height: auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  margin-bottom: 1rem;
  background: #fff;
}

/* Direct Print Engine */
@media print {
  body * {
    visibility: hidden !important;
  }
  #print-mount-area, #print-mount-area * {
    visibility: visible !important;
  }
  #print-mount-area {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  #print-mount-area img {
    width: 100% !important;
    height: auto !important;
    max-height: 100vh !important;
    object-fit: contain !important;
    page-break-after: always !important;
    display: block !important;
  }
}

/* Placement Test (定级测) Styling */
.placement-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.placement-hero-bar {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.placement-path-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid #bfdbfe;
}
.placement-switchers {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.selector-group {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-sm);
  gap: 3px;
}
.selector-btn {
  border: none;
  background: transparent;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.selector-btn:hover {
  color: var(--text-main);
}
.selector-btn.active {
  background: #ffffff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.placement-audio-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 6px 18px rgba(49, 46, 129, 0.25);
}
.audio-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.audio-parts-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.audio-part-pill {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 0.4rem 0.85rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.audio-part-pill:hover, .audio-part-pill.active {
  background: #fbbf24;
  color: #1e1b4b;
  border-color: #fbbf24;
  font-weight: 700;
}
.placement-view-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
  gap: 0.75rem;
}
.placement-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}
.placement-page-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.placement-page-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.placement-page-card img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  background: #f8fafc;
}
.placement-page-footer {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Button & Feedback Enhancements */
.btn-danger {
  background: var(--danger);
  color: #ffffff;
}
.btn-danger:hover {
  background: #dc2626;
}

.mode-tab-btn {
  transition: all 0.2s ease-in-out;
  cursor: pointer;
}
.mode-tab-btn:hover {
  filter: brightness(0.96);
}

