:root {
  --primary-color: #0066cc; /* 默认 RME 蓝色 */
  --brand-blue: var(--primary-color);
  --brand-light-blue: #e6f0ff;
  --brand-gold: #d4af37;
  --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  --card-bg: rgba(255, 255, 255, 0.9);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --text-dark: #2d3436;
  --text-muted: #636e72;
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #d63031;
  --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  --radius: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
}

body {
  background: var(--bg-gradient);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  overflow: hidden; /* 防止 Body 滚动，由容器内部处理 */
}

.app-container {
  width: 100%;
  max-width: 450px; /* 严格限制宽度，模拟手机屏�?*/
  height: 100vh;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

@media (min-height: 700px) {
  .app-container {
    height: 92vh;
    border-radius: 30px;
    box-shadow: var(--shadow);
  }
}

/* --- Teacher Branding System --- */
.app-container.teacher-branded {
  max-width: 900px; /* 有老师展示时放宽整体宽�?*/
  flex-direction: row-reverse;
  overflow: visible;
  gap: 20px;
}

.teacher-sidebar {
  flex: 0 0 280px;
  animation: fadeInRight 0.8s ease-out;
}

.teacher-card {
  background: var(--card-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow);
  text-align: center;
  position: sticky;
  top: 0;
}

.teacher-photo {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--primary-color);
  margin-bottom: 15px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.teacher-info h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.teacher-info .slogan {
  color: var(--primary-color);
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 12px;
}

.teacher-info .description {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.contact-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 20px;
  width: 100%;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.contact-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 800px) {
  .app-container.teacher-branded {
    flex-direction: column;
    height: auto;
    max-width: 450px;
  }
  .teacher-sidebar {
    flex: none;
    width: 100%;
  }
}

/* Header Styles */
.header {
  padding: 10px 16px 4px 16px;
  background: white;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: all 0.3s ease;
  z-index: 99;
}

.header-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.brand-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo-small {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 50%;
  border: 1.5px solid var(--brand-blue);
  background: white;
}

.brand-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brand-blue);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-action-btn {
  background: rgba(0, 102, 204, 0.06);
  border: 1px solid rgba(0, 102, 204, 0.15);
  color: var(--brand-blue);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.header-action-btn:hover {
  background: rgba(0, 102, 204, 0.12);
  transform: translateY(-1px);
}

.guide-circle-btn {
  background: #f0f0f0;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.guide-circle-btn:hover {
  background: #e0e0e0;
}

/* Collapsible Settings Panel */
.settings-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(248, 250, 252, 0.95);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius);
  padding: 14px;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, padding 0.3s ease, margin 0.3s ease;
  overflow: hidden;
  max-height: 500px;
  opacity: 1;
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.settings-panel.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-color: transparent;
  pointer-events: none;
}

.settings-row {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  width: 100%;
}

.settings-row.flex-row {
  flex-direction: row;
}

.settings-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.level-selector {
  display: flex;
  gap: 6px;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 20px;
  width: 100%;
}

.level-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 15px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  text-align: center;
}

.level-btn.active {
  background: var(--brand-blue);
  color: white;
  box-shadow: 0 2px 6px rgba(0, 102, 204, 0.25);
}

.exam-selector {
  display: flex;
  gap: 4px;
  width: 100%;
}

.exam-btn {
  flex: 1;
  border: 1px solid #cbd5e1;
  background: white;
  padding: 4px 6px;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
  text-align: center;
}

.exam-btn.active {
  background: var(--brand-gold);
  color: white;
  border-color: var(--brand-gold);
  box-shadow: 0 2px 6px rgba(212, 175, 55, 0.25);
}

.task-nav-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  width: 100%;
  padding: 4px 0 6px 0;
  justify-content: flex-start;
  scrollbar-width: none;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.task-nav-pills::-webkit-scrollbar {
  display: none;
}

.pill {
  min-width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid #e2e8f0;
  background: white;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.pill.active {
  background: var(--brand-blue);
  color: white;
  border-color: var(--brand-blue);
  transform: scale(1.08);
  box-shadow: 0 3px 8px rgba(0, 102, 204, 0.25);
}

.pill.pill-set {
  min-width: auto;
  padding: 0 10px;
  border-radius: 14px;
  font-size: 0.72rem;
  white-space: nowrap;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto; /* 允许主区域滚�?*/
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fdfdfd;
}

.task-card {
  flex-shrink: 0; /* 防止题目卡片被压�?*/
  background: white;
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  position: relative;
  border-left: 6px solid var(--brand-blue);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-toggle-btn {
  display: none;
}

.card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.b1-part-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  color: #3730a3;
  border: 1px solid #c7d2fe;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 2px 4px rgba(55, 48, 163, 0.08);
}

.category-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.task-card h2 {
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.task-scenario {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #444;
  margin-bottom: 16px;
  padding: 12px;
  background: #f8faff;
  border-radius: 12px;
}

.points-box {
  background: #fff;
}

.points-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-blue);
  margin-bottom: 8px;
}

.points-box ul {
  list-style: none;
}

.points-box li {
  font-size: 0.9rem;
  margin-bottom: 6px;
  padding-left: 20px;
  position: relative;
}

.points-box li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: bold;
}

/* Editor */
.editor-container {
  flex: 1; /* Allow editor container to grow and fill vertical space */
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  border: 2px solid #eee; /* 增加明显的边栏 */
  transition: all 0.3s;
  min-height: 200px; /* 降低最小高度限制，允许更多弹性伸缩 */
}

.editor-container:focus-within {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

.text-editor {
  width: 100%;
  flex: 1; /* 使文本输入区域自动铺满容器 */
  min-height: 120px;
  padding: 16px;
  border: none;
  font-size: 1.05rem;
  line-height: 1.6;
  resize: none;
  outline: none;
}

.direct-mode-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.coach-mode-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.editor-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f8f9fa;
  border-top: 1px solid #eee;
}

.word-counter {
  font-size: 0.8rem;
  font-weight: 600;
}

.word-counter.insufficient { color: var(--text-muted); }
.word-counter.perfect { color: var(--success); font-weight: 800; }
.word-counter.too-many { color: var(--danger); }

.level-badge {
  background: var(--text-dark);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

/* Action Bar */
.action-bar {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 12px;
  margin-top: auto;
  padding-bottom: 20px;
}

.primary-btn {
  background: var(--brand-blue);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(0, 102, 204, 0.3);
}

.primary-btn:disabled {
  background: #ccc;
  box-shadow: none;
  cursor: not-allowed;
}

.secondary-btn {
  background: white;
  color: var(--brand-blue);
  border: 1px solid var(--brand-blue);
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.secondary-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Result Modal */
.result-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.result-modal {
  width: 100%;
  background: white;
  border-radius: 32px 32px 0 0;
  padding: 32px 24px;
  max-height: 85%;
  overflow-y: auto;
  animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
}

@keyframes slideIn {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: #f0f0f0;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
}

.score-header {
  text-align: center;
  margin-bottom: 24px;
}

.score-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 6px solid var(--brand-blue);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0 auto 12px;
}

.score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.score-item {
  background: #f8f9fa;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
}

.score-item span {
  color: var(--text-muted);
}

.score-item strong {
  color: var(--brand-blue);
}

.score-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--brand-blue);
}

.score-total {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: -4px;
}

.feedback-section, .correction-section, .model-section {
  margin-bottom: 24px;
}

h4 {
  font-size: 0.9rem;
  color: var(--brand-blue);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.feedback-section p {
  font-size: 0.95rem;
  line-height: 1.6;
  padding: 12px;
  background: #f0f7ff;
  border-radius: 12px;
  font-style: italic;
}

.correction-item {
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.error {
  color: var(--danger);
  text-decoration: line-through;
  margin-right: 8px;
}

.correct {
  color: var(--success);
  font-weight: 700;
}

.reason {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.model-text {
  padding: 16px;
  background: #fff9e6;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.6;
  border: 1px dashed var(--brand-gold);
}



.history-item {
  background: #f8faff;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 12px;
  border-left: 4px solid var(--brand-blue);
  transition: all 0.2s;
}

.history-item:hover {
  transform: translateX(5px);
  background: #f0f7ff;
  box-shadow: 4px 4px 15px rgba(0,0,0,0.05);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.history-item-content {
  font-size: 0.85rem;
  color: var(--text-dark);
}

.history-badge {
  background: var(--brand-blue);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: bold;
}

.copy-btn {
  background: var(--brand-blue);
  color: white;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: opacity 0.2s;
}

.copy-btn:hover {
  opacity: 0.8;
}

/* Custom Task Button Styles */
.custom-action-area {
  padding: 0 20px;
  width: 100%;
}

.custom-pill-btn {
  width: 100%;
  background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
  color: white;
  border: none;
  padding: 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
  transition: all 0.3s;
}

.custom-pill-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.4);
}

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

/* --- Premium Report Styles --- */
.premium-report {
  background: #f8faff !important;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 40px 24px !important;
}

.report-header {
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: white;
  padding: 24px;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 102, 204, 0.08);
  position: relative;
}

.score-summary {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 15px;
}

.score-ring-container {
  text-align: center;
}

.score-ring {
  width: 100px !important;
  height: 100px !important;
  border: 8px solid var(--brand-blue) !important;
  background: white;
  box-shadow: 0 0 20px rgba(0, 102, 204, 0.1);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.score-value {
  font-size: 2.2rem !important;
  font-weight: 800;
  color: var(--brand-blue);
}

.score-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: -5px;
}

.score-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 8px;
}

.radar-container {
  width: 160px;
  height: 160px;
}

.report-info {
  text-align: center;
}

.report-info h3 {
  font-size: 1.1rem;
  color: var(--brand-blue);
  margin-bottom: 8px;
}

.exam-status-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.passing-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.prob-value {
  color: #6c5ce7;
  font-size: 1.1rem;
  font-weight: 900;
}

.exam-status {
  font-size: 0.8rem;
  font-weight: 800;
}

.report-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: white;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  border: 1px solid rgba(0, 102, 204, 0.05);
}

.card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--brand-blue);
  margin-bottom: 12px;
}

.icon {
  font-style: normal;
}

.correction-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.correction-item {
  background: #fdfdfd;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  padding: 12px;
}

.correction-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.error-text {
  color: var(--danger);
  text-decoration: line-through;
  font-size: 0.9rem;
}

.arrow {
  color: #ccc;
}

.correct-text {
  color: var(--success);
  font-weight: 700;
  font-size: 0.95rem;
}

.reason-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.model-answer-text {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #444;
  font-style: italic;
  padding: 12px;
  background: #f8faff;
  border-radius: 12px;
  border: 1px dashed var(--brand-blue);
}

.copy-btn-new {
  margin-top: 10px;
  width: 100%;
  padding: 8px;
  background: white;
  border: 1px solid var(--brand-blue);
  color: var(--brand-blue);
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.brand-footer {
  text-align: center;
  padding: 20px;
  background: #fff9e6;
  border-radius: 20px;
  border: 1px solid #d4af37;
}

.brand-footer p {
  font-size: 0.85rem;
  color: #d4af37;
  font-weight: 800;
  margin-bottom: 10px;
}

.cta-btn {
  background: #d4af37;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.perfect-msg {
  text-align: center;
  color: var(--success);
  font-weight: 700;
  padding: 20px;
}

/* --- Medal & Share Styles --- */
.medal-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: 40px;
  margin: 0 auto 20px;
  width: fit-content;
  color: white;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.medal-icon {
  font-size: 2rem;
}

.medal-title {
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 1px;
}

.medal-desc {
  font-size: 0.7rem;
  opacity: 0.9;
}

.action-footer-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.share-btn {
  background: var(--brand-blue);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 102, 204, 0.2);
  transition: all 0.2s;
}

/* --- Guide Styles --- */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 10px;
}

.guide-circle-btn {
  background: white;
  border: 2px solid #eee;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.guide-circle-btn:hover {
  transform: rotate(15deg) scale(1.1);
  border-color: var(--brand-blue);
}

.guide-modal {
  max-width: 500px !important;
  max-height: 80vh !important;
  display: flex;
  flex-direction: column;
}

.guide-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 10px;
}

.guide-tabs .tab-btn {
  background: none;
  border: none;
  padding: 8px 15px;
  font-weight: bold;
  cursor: pointer;
  color: #999;
  position: relative;
}

.guide-tabs .tab-btn.active {
  color: var(--brand-blue);
}

.guide-tabs .tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--brand-blue);
  border-radius: 3px;
}

.guide-body {
  overflow-y: auto;
  padding-right: 5px;
}

.guide-item {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8faff;
  border-radius: 12px;
  border-left: 4px solid var(--brand-blue);
}

.guide-item h3 {
  margin-top: 0;
  font-size: 1rem;
  color: var(--brand-blue);
}

.guide-item p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: #555;
  margin-bottom: 0;
}

/* --- Agent System Styles --- */
.agent-input-box {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeIn 0.5s ease-out;
}

.agent-input-box input {
  width: 100%;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: white;
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  transition: all 0.3s;
}

.agent-input-box input:focus {
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.agent-input-box input.agent-success {
  border-color: var(--success);
  background: #f0fff4;
  color: var(--success);
}

.agent-tip {
  font-size: 0.75rem;
  color: var(--success);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: bounceIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
  0% { transform: scale(0.8); opacity: 0; }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.footer {
  text-align: center;
  color: var(--brand-blue);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.85);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
  order: 10 !important;
}
.legal-details {
  width: 100%;
}
.legal-summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text-muted);
  outline: none;
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  user-select: none;
}
.legal-summary::-webkit-details-marker {
  display: none;
}
.legal-summary::after {
  content: " 🔽";
  font-size: 0.65rem;
}
.legal-details[open] .legal-summary::after {
  content: " 🔼";
}
.footer a {
  color: var(--brand-blue);
  text-decoration: none;
  margin: 0 10px;
  transition: opacity 0.2s;
  opacity: 0.85;
}
.footer a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* --- Dual-Mode and Writing Coach Stepper & Panels --- */
.mode-selector {
  display: flex;
  gap: 4px;
  background: rgba(0, 102, 204, 0.06);
  border: 1px solid rgba(0, 102, 204, 0.15);
  padding: 4px;
  border-radius: 20px;
  margin: 10px auto;
  max-width: 320px;
  width: calc(100% - 40px);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.mode-toggle-btn {
  flex: 1;
  border: none;
  background: none;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 16px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.mode-toggle-btn.active {
  background: linear-gradient(135deg, var(--brand-blue) 0%, #0088ff 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.2);
}

.coach-mode-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.coach-stepper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding: 12px 20px;
  background: white;
  border-radius: 14px;
  margin-bottom: 4px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}
.coach-stepper::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 30px;
  right: 30px;
  height: 2px;
  background: #e2e8f0;
  z-index: 1;
  transform: translateY(-50%);
}
.coach-step-node {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  border: 2px solid #cbd5e1;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  position: relative;
  z-index: 2;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.coach-step-node.active {
  border-color: var(--brand-blue);
  background: var(--brand-blue);
  color: white;
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.15);
}
.coach-step-node.completed {
  border-color: var(--success);
  background: var(--success);
  color: white;
}
.coach-step-node-label {
  position: absolute;
  bottom: -20px;
  font-size: 0.65rem;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text-muted);
}
.coach-step-node.active .coach-step-node-label {
  color: var(--brand-blue);
}
.coach-step-node.completed .coach-step-node-label {
  color: var(--success);
}

.coach-step-panel {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.coach-step-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--brand-blue);
  border-bottom: 2px solid rgba(0,102,204,0.08);
  padding-bottom: 8px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Step 1 Styles */
.analysis-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  margin-bottom: 8px;
}
.analysis-badge.formell {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.analysis-badge.informell {
  background: #ecfeff;
  color: #0891b2;
  border: 1px solid #cffafe;
}
.rules-table {
  width: 100%;
  font-size: 0.8rem;
  border-collapse: collapse;
  margin-bottom: 8px;
  background: #f8fafc;
  border-radius: 8px;
  overflow: hidden;
}
.rules-table th, .rules-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}
.rules-table th {
  font-weight: 700;
  color: var(--text-muted);
  width: 35%;
  background: rgba(0,0,0,0.01);
}
.rules-table td {
  color: var(--text-dark);
}
.pitfall-item {
  font-size: 0.78rem;
  background: #fef2f2;
  border-left: 4px solid var(--danger);
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 6px;
  color: #991b1b;
  line-height: 1.4;
}

/* Step 2 Styles */
.chunk-item-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: #f8fafc;
}
.chunk-item-card:hover {
  border-color: var(--brand-blue);
  background: rgba(0, 102, 204, 0.01);
}
.chunk-item-card.selected {
  border-color: var(--brand-blue);
  background: rgba(0, 102, 204, 0.04);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.05);
}
.chunk-checkbox {
  margin-top: 3px;
  accent-color: var(--brand-blue);
  cursor: pointer;
}
.chunk-content {
  font-size: 0.8rem;
  flex: 1;
}
.chunk-german {
  font-weight: 700;
  color: var(--text-dark);
  font-size: 0.85rem;
}
.chunk-chinese {
  color: var(--text-muted);
  margin-top: 2px;
}
.chunk-example {
  font-style: italic;
  color: #64748b;
  margin-top: 4px;
  font-size: 0.75rem;
  border-left: 2px solid #cbd5e1;
  padding-left: 6px;
}

/* Step 3 Styles */
.sentence-point-info {
  background: #f8fafc;
  border-left: 4px solid var(--brand-gold);
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.4;
}
.sentence-point-label {
  font-weight: 800;
  color: #b7950b;
  margin-bottom: 4px;
}
.sentence-point-desc {
  color: var(--text-dark);
}
.sandwich-feedback-box {
  border-radius: 12px;
  padding: 12px;
  font-size: 0.82rem;
  line-height: 1.5;
  margin-top: 12px;
  animation: fadeIn 0.4s;
}
.sandwich-feedback-box.correct {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #15803d;
}
.sandwich-feedback-box.incorrect {
  background: #fffbeb;
  border: 1px solid #fef3c7;
  color: #b45309;
}
.cards-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.correction-card {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.78rem;
  border-left: 4px solid;
  line-height: 1.4;
}
.correction-card.red {
  background: #fef2f2;
  border-color: var(--danger);
  color: #991b1b;
}
.correction-card.yellow {
  background: #fffbeb;
  border-color: var(--warning);
  color: #92400e;
}
.correction-card.green {
  background: #f0fdf4;
  border-color: var(--success);
  color: #166534;
}

/* Step 4 Styles */
.self-check-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.self-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-dark);
  font-weight: 600;
}
.self-check-item input {
  accent-color: var(--brand-blue);
  cursor: pointer;
}

/* Responsive Mobile Layout optimizations */
@media (max-width: 480px) {
  .header {
    padding: 8px 12px 2px 12px;
  }
  
  .brand-logo-small {
    width: 24px;
    height: 24px;
  }
  
  .brand-title {
    font-size: 0.85rem;
  }
  
  .header-action-btn {
    padding: 4px 8px;
    border-radius: 12px;
  }
  
  .header-action-btn .btn-text {
    display: none; /* Hide button text, only show icons for space saving */
  }
  
  .settings-panel {
    padding: 10px;
    gap: 8px;
  }
  
  .settings-row {
    gap: 8px;
  }
  
  .main-content {
    padding: 10px;
    gap: 10px;
  }
  
  .task-card {
    padding: 12px;
  }
}

/* ==========================================================================
   SATZBAU Training Mode Premium Styling
   ========================================================================== */

.satzbau-lens-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  margin-bottom: 8px;
}

.lens-tab {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.lens-tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

.lens-tab.active {
  border-color: var(--brand-blue);
  background: rgba(0, 102, 204, 0.02);
  box-shadow: 0 8px 20px -4px rgba(0, 102, 204, 0.15);
}

.lens-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
}

.s1-badge {
  border: 1px solid #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
}

.s2-badge {
  border: 1px solid #eab308;
  background: rgba(234, 179, 8, 0.1);
  color: #a16207;
}

.s3-badge {
  border: 1px solid #22c55e;
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
}

.lens-tab.active.s1-active { border-color: #3b82f6; }
.lens-tab.active.s2-active { border-color: #eab308; }
.lens-tab.active.s3-active { border-color: #22c55e; }

.lens-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lens-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
}

.lens-level {
  font-size: 0.7rem;
  color: #64748b;
}

/* Visual Slot Templates */
.slots-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
}

.slot-item {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  background: white;
  border: 1px solid #e2e8f0;
  color: #64748b;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.slot-item.highlight-verb {
  background: rgba(239, 68, 68, 0.05);
  border: 1.5px solid #ef4444;
  color: #dc2626;
  animation: pulse-verb 2s infinite;
}

.slot-item.highlight-verb-tail {
  background: rgba(59, 130, 246, 0.05);
  border: 1.5px dashed #3b82f6;
  color: #2563eb;
}

@keyframes pulse-verb {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* Satzbau Exercise Card */
.satzbau-card {
  background: white;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.satzbau-progress-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.satzbau-progress-bar {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  margin-right: 12px;
  overflow: hidden;
  position: relative;
}

.satzbau-progress-fill {
  height: 100%;
  background: var(--brand-blue);
  border-radius: 3px;
  width: 0;
  transition: width 0.4s ease;
}

.satzbau-progress-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}

.satzbau-chinese-prompt {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.5;
  background: rgba(0, 102, 204, 0.03);
  border-left: 4px solid var(--brand-blue);
  padding: 10px 14px;
  border-radius: 4px 8px 8px 4px;
}

.satzbau-hints {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.6;
  background: #fdfbf7;
  border: 1px solid #f5ebe0;
  border-radius: 8px;
  padding: 10px 14px;
}

.satzbau-input-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.satzbau-textarea {
  width: 100%;
  min-height: 80px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  padding: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: all 0.3s;
  resize: vertical;
  background: #fafafa;
}

.satzbau-textarea:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
  background: white;
}

/* Sandwich Feedback Box */
.coach-sandwich-card {
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: slide-up 0.3s ease-out;
}

.coach-sandwich-card.score-2 {
  background: rgba(34, 197, 94, 0.06);
  border: 1.5px solid rgba(34, 197, 94, 0.2);
}

.coach-sandwich-card.score-1 {
  background: rgba(234, 179, 8, 0.06);
  border: 1.5px solid rgba(234, 179, 8, 0.2);
}

.coach-sandwich-card.score-0 {
  background: rgba(239, 68, 68, 0.06);
  border: 1.5px solid rgba(239, 68, 68, 0.2);
}

.sandwich-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

.score-2 .sandwich-header { color: #15803d; }
.score-1 .sandwich-header { color: #a16207; }
.score-0 .sandwich-header { color: #b91c1c; }

.sandwich-body {
  font-size: 0.85rem;
  color: #334155;
  line-height: 1.6;
  white-space: pre-wrap;
}

.sandwich-correction-table {
  background: white;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  padding: 10px;
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.correction-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.correction-original {
  text-decoration: line-through;
  color: #b91c1c;
  font-weight: 600;
}

.correction-corrected {
  color: #15803d;
  font-weight: 700;
}

.correction-reason {
  color: #475569;
  font-style: italic;
  font-size: 0.75rem;
}

/* Satzbau Complete Panel */
.complete-overlay {
  text-align: center;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 248, 255, 0.9) 100%);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.complete-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand-blue);
}

.complete-score-ring {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--brand-blue);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 25px rgba(0, 102, 204, 0.3);
  font-size: 1.8rem;
  font-weight: 800;
}

.complete-score-ring span {
  font-size: 0.75rem;
  opacity: 0.8;
  font-weight: 600;
}

.complete-comment {
  font-size: 0.9rem;
  color: #475569;
  max-width: 320px;
  line-height: 1.6;
}

.complete-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

/* Animations */
@keyframes slide-up {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .satzbau-lens-selector {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .lens-tab {
    flex-direction: row;
    justify-content: flex-start;
    padding: 10px;
    gap: 12px;
    text-align: left;
  }
}

/* --- Responsive Dual Column Layout System --- */
.sidebar-task, .main-workspace {
  display: contents; /* Fallback to natural flow on mobile */
}

.workspace-header {
  order: 1 !important;
}

.brand-branding {
  display: none !important;
}

.mobile-header-bar {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 16px;
  background: white;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.brand-info-mobile {
  display: flex;
  align-items: center;
  gap: 8px;
}

.desktop-header-bar {
  display: flex !important;
  width: 100%;
  padding: 8px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.desktop-header-bar .header-actions-desktop {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

.desktop-header-bar .header-action-btn {
  flex: 1;
  text-align: center;
  padding: 6px 10px;
  font-size: 0.78rem;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.desktop-header-bar #static-vocab-trigger.active {
  background: var(--brand-blue) !important;
  color: white !important;
  border-color: var(--brand-blue) !important;
  box-shadow: 0 4px 10px rgba(0, 102, 204, 0.15);
}

.desktop-header-bar #static-satzbau-trigger.active {
  background: #10b981 !important;
  color: white !important;
  border-color: #10b981 !important;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.15);
}

.special-training-label {
  display: flex !important;
  width: 100%;
  margin-bottom: 4px;
  font-size: 0.78rem;
}

#settings-panel {
  order: 2 !important;
}

.sidebar-section {
  order: 3 !important;
  background: white;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.mode-selector {
  order: 4 !important;
}

.sidebar-task .task-card {
  order: 5 !important;
}

.main-content {
  order: 6 !important;
}

/* Verbindung Exercise Card & Stepper Styling */
.verbindung-card {
  background: white;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.verbindung-progress-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.verbindung-progress-bar {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  margin-right: 12px;
  overflow: hidden;
  position: relative;
}

.verbindung-progress-fill {
  height: 100%;
  background: #10b981; /* Emerald green */
  border-radius: 3px;
  width: 0;
  transition: width 0.4s ease;
}

.verbindung-progress-text {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}

.verbindung-chinese-prompt {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.5;
  background: rgba(16, 185, 129, 0.03); /* Light emerald tint */
  border-left: 4px solid #10b981;
  padding: 10px 14px;
  border-radius: 4px 8px 8px 4px;
}

.verbindung-hints {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.6;
  background: #fcfdfd;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
}

.verbindung-input-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.verbindung-textarea {
  width: 100%;
  min-height: 80px;
  border-radius: 12px;
  border: 1.5px solid #cbd5e1;
  padding: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  transition: all 0.3s;
  resize: vertical;
  background: #fafafa;
}

.verbindung-textarea:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
  background: white;
}

/* Desktop Dual-Column Mode Override */
@media (min-width: 1024px) {
  body {
    overflow: hidden !important;
    padding: 0 !important;
    height: 100vh !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
  }

  .app-container {
    max-width: 1360px !important;
    width: 95vw !important;
    height: 90vh !important;
    border-radius: 24px !important;
    box-shadow: 0 20px 50px rgba(31, 38, 135, 0.15) !important;
    flex-direction: row !important;
    background: #ffffff !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    display: flex !important;
  }

  /* Left Sidebar Styling */
  .sidebar-task {
    display: flex !important;
    width: 380px !important;
    flex-shrink: 0 !important;
    height: 100% !important;
    background: #1e293b !important; /* Dark Slate Blue sidebar */
    color: #f1f5f9 !important;
    border-right: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-bottom: none !important;
    padding: 0 !important;
    flex-direction: column !important;
    order: unset !important;
  }

  .brand-branding {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    background: #0f172a !important; /* Darker navy header */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .brand-branding .brand-logo-small {
    width: 38px;
    height: 38px;
    border: 2px solid #38bdf8;
    background: white;
  }

  .brand-branding .brand-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-branding .brand-title {
    color: #f8fafc !important;
    font-size: 1.05rem !important;
    font-weight: 800;
    letter-spacing: 0.5px;
  }

  .brand-branding .brand-subtitle {
    display: block;
    font-size: 0.68rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
  }

  .sidebar-scroll-content {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 24px 20px !important;
    gap: 24px !important;
  }

  /* Settings panel in sidebar on desktop */
  #settings-panel {
    display: flex !important;
    flex-direction: column !important;
    max-height: none !important;
    height: auto !important;
    opacity: 1 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    pointer-events: auto !important;
    gap: 16px !important;
    order: unset !important;
    overflow: visible !important;
    transition: none !important;
  }

  .sidebar-task .settings-row {
    flex-direction: column !important;
    gap: 14px !important;
  }

  .sidebar-task .settings-label {
    color: #94a3b8 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase;
    letter-spacing: 1px;
  }

  .sidebar-task .level-selector,
  .sidebar-task .exam-selector {
    background: rgba(15, 23, 42, 0.6) !important;
    padding: 4px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
  }

  .sidebar-task .level-btn,
  .sidebar-task .exam-btn {
    color: #94a3b8 !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    font-weight: 600 !important;
    transition: all 0.2s;
  }

  .sidebar-task .level-btn.active {
    background: #38bdf8 !important; /* Sky blue active */
    color: #0f172a !important;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
  }

  .sidebar-task .exam-btn.active {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
  }

  .sidebar-task .custom-pill-btn {
    border-color: rgba(255,255,255,0.15) !important;
    background: rgba(255,255,255,0.05) !important;
    color: white !important;
  }

  .sidebar-task .custom-pill-btn:hover {
    background: rgba(255,255,255,0.12) !important;
    border-color: rgba(255,255,255,0.3) !important;
  }

  .sidebar-task .custom-pill-btn.ai-btn {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
    border: none !important;
  }

  .sidebar-task .custom-pill-btn.ai-btn:hover {
    opacity: 0.9 !important;
  }

  /* Account bar inside sidebar */
  .sidebar-task .account-bar {
    background: rgba(15, 23, 42, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 14px;
    padding: 12px !important;
    margin-top: 10px !important;
    gap: 10px !important;
  }

  .sidebar-task .pricing-btn {
    background: rgba(56, 189, 248, 0.1) !important;
    border-color: rgba(56, 189, 248, 0.2) !important;
    color: #38bdf8 !important;
  }

  .sidebar-task #passcode-container {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
    color: #fbbf24 !important;
  }

  /* Task nav pills in sidebar */
  .sidebar-task .sidebar-section {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 20px;
    order: unset !important;
    background: transparent !important;
  }

  .sidebar-task .task-nav-pills {
    background: rgba(15, 23, 42, 0.4) !important;
    border-radius: 12px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .sidebar-task .task-nav-btn {
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: #cbd5e1;
  }

  .sidebar-task .task-nav-btn.active {
    background: #38bdf8;
    color: #0f172a;
  }

  /* Task Card in sidebar */
  .sidebar-task .task-card {
    background: rgba(255,255,255,0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    box-shadow: none !important;
    padding: 20px !important;
    margin: 0 !important;
    max-height: none !important;
    overflow-y: visible !important;
    border-radius: 16px;
    order: unset !important;
  }

  .sidebar-task .task-card h2,
  .sidebar-task .task-card h3 {
    color: #f8fafc !important;
    font-size: 1.15rem;
    font-family: inherit;
    border-left: 3px solid #38bdf8;
    padding-left: 10px;
    margin-bottom: 12px;
    margin-top: 0;
  }

  .sidebar-task .task-card p {
    color: #cbd5e1 !important;
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .sidebar-task .task-card .task-scenario {
    background: rgba(15, 23, 42, 0.6) !important;
    color: #cbd5e1 !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
  }

  .sidebar-task .task-card .points-box {
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px;
    padding: 14px;
    color: #cbd5e1 !important;
  }

  .sidebar-task .task-card .points-label {
    color: #38bdf8 !important;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
  }

  .sidebar-task .task-card .points-box li {
    color: #cbd5e1 !important;
    font-size: 0.9rem;
    margin-bottom: 6px;
  }

  .sidebar-task .task-card .task-points {
    color: #cbd5e1 !important;
  }

  /* Right Workspace Styling */
  .main-workspace {
    display: flex !important;
    flex-direction: column !important;
    background: #f8fafc !important; /* Soft light gray background */
    overflow: hidden !important;
    order: unset !important;
    flex: 1 !important;
  }

  .workspace-header {
    height: 64px !important;
    padding: 0 30px !important;
    display: flex !important;
    align-items: center !important;
    background: white !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    order: unset !important;
  }

  .mobile-header-bar {
    display: none !important;
  }

  .desktop-header-bar {
    display: flex !important;
    width: 100%;
    justify-content: flex-start;
    align-items: center;
    background: transparent !important;
    padding: 0 !important;
    border-bottom: none !important;
  }

  .desktop-header-bar .header-actions-desktop {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100%;
    align-items: center;
  }

  .desktop-header-bar .header-action-btn {
    flex: unset !important;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 8px 16px;
    font-size: 0.85rem;
    border-radius: 10px;
    transition: all 0.2s ease;
  }

  .special-training-label {
    display: flex !important;
    width: auto !important;
    margin-bottom: 0 !important;
    font-size: 0.82rem !important;
  }

  .desktop-header-bar .header-action-btn:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
  }

  .desktop-header-bar #static-vocab-trigger.active {
    background: var(--brand-blue) !important;
    color: white !important;
    border-color: var(--brand-blue) !important;
    box-shadow: 0 4px 10px rgba(0, 102, 204, 0.15);
  }

  .desktop-header-bar #static-satzbau-trigger.active {
    background: #10b981 !important;
    color: white !important;
    border-color: #10b981 !important;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.15);
  }

  /* 静态特训内部选择按钮样式 */
  .static-level-btn, .static-lens-btn {
    cursor: pointer;
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: white;
    color: #475569;
    font-weight: 700;
    transition: all 0.2s;
  }

  .static-level-btn:hover, .static-lens-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
  }

  .static-level-btn.active {
    background: var(--brand-blue) !important;
    color: white !important;
    border-color: var(--brand-blue) !important;
  }

  .static-lens-btn.active {
    background: #10b981 !important;
    color: white !important;
    border-color: #10b981 !important;
  }

  /* Mode selector above editor area */
  .main-workspace .mode-selector {
    margin: 20px 30px 10px 30px !important;
    width: calc(100% - 60px) !important;
    background: #f1f5f9 !important;
    padding: 6px !important;
    border-radius: 14px !important;
    border: 1px solid #e2e8f0 !important;
    order: unset !important;
  }

  .main-workspace .mode-toggle-btn {
    padding: 10px !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    border-radius: 10px !important;
  }

  /* Main scroll area */
  .main-content {
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 10px 30px 30px 30px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    order: unset !important;
  }

  /* Text Editor Box in Desktop */
  .main-content #direct-mode-view {
    height: 100%;
  }

  .main-content .editor-container {
    height: 480px !important;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    padding: 24px;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
  }

  .main-content .text-editor {
    font-size: 1.15rem !important;
    line-height: 1.8 !important;
    margin-bottom: 20px !important;
  }

  .main-content .action-bar {
    margin-top: 10px !important;
    gap: 20px !important;
  }

  .main-content .primary-btn {
    padding: 16px 40px !important;
    font-size: 1.05rem !important;
    border-radius: 12px !important;
  }

  .main-content .secondary-btn {
    padding: 14px 24px !important;
    font-size: 0.95rem !important;
  }

  /* Coach step container */
  .main-content .coach-step-panel {
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    padding: 24px;
    border-radius: 16px;
    min-height: 380px;
  }

  /* Satzbau lens selector */
  .main-content .satzbau-lens-selector {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 12px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  }

  /* Satzbau exercise panel */
  .main-content .satzbau-exercise-panel {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    min-height: 350px;
  }

  /* Verbindung exercise panel */
  .main-content .verbindung-exercise-panel {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    min-height: 350px;
  }

  .footer {
    order: unset !important;
  }
  .legal-summary {
    display: none !important;
  }
}

/* Collapsible Task Card styles for mobile/tablet */
@media (max-width: 1023px) {
  .task-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(0, 102, 204, 0.06);
    border: 1px solid rgba(0, 102, 204, 0.15);
    color: var(--brand-blue);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    cursor: pointer;
    position: absolute;
    right: 16px;
    top: 16px;
    transition: all 0.25s ease;
    z-index: 10;
  }
  
  .task-toggle-btn:hover {
    background: rgba(0, 102, 204, 0.12);
  }
  
  .task-card.collapsed {
    padding-bottom: 12px !important;
  }
  
  .task-card.collapsed .task-scenario,
  .task-card.collapsed .points-box {
    display: none !important;
  }
  
  .task-card.collapsed h2 {
    margin-bottom: 0 !important;
    padding-right: 90px; /* Leave space for the absolute-positioned toggle button */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem !important;
  }
  
  .task-card.collapsed .category-tag {
    margin-bottom: 2px !important;
  }
}

/* 核心语块 Flashcard 样式 */
.chunk-flashcard-box:hover {
  border-color: #f59e0b !important;
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.15) !important;
  transform: translateY(-2px);
}

#chunk-goto-verbindung-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 184, 148, 0.4) !important;
}

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




