:root {
  --primary: #4A90D9;
  --primary-light: #EBF3FC;
  --primary-dark: #2E6DB3;
  --accent: #F5A623;
  --accent-light: #FFF4E0;
  --success: #52C41A;
  --success-light: #E8F8E0;
  --danger: #FF6B6B;
  --text: #333;
  --text-sec: #888;
  --border: #E5E5E5;
  --bg: #F0F2F5;
  --card: #FFF;
  --panel-w: 420px;
  --a4-w: 794px;
  --a4-h: 1123px;
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

/* ===== WEEKLY SUMMARY CARDS & SVG DIAGRAM ===== */
.weekly-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}
.summary-card {
  position: relative;
  background: #FFF;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 10px 10px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 125px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.summary-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.summary-card.conquered {
  border-color: #D3F261;
  background: linear-gradient(135deg, #FCFFE6 0%, #FFF 100%);
}
.summary-card.pending {
  border-color: #FFE7BA;
  background: linear-gradient(135deg, #FFFBE6 0%, #FFF 100%);
}
.summary-card.new-discovered {
  border-color: #FFD8BF;
  background: linear-gradient(135deg, #FFF0F6 0%, #FFF 100%);
}
.card-badge {
  position: absolute;
  top: -8px;
  left: 8px;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  color: #FFF;
  letter-spacing: 0.5px;
}
.card-badge.green { background: var(--success); }
.card-badge.yellow { background: var(--accent); }
.card-badge.red { background: var(--danger); }

.card-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 16px;
  opacity: 0.85;
}
.card-stat {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-top: 4px;
}
.card-num {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}
.conquered .card-num { color: var(--success); }
.pending .card-num { color: #E08E00; }
.new-discovered .card-num { color: var(--danger); }
.card-unit {
  font-size: 10px;
  color: var(--text-sec);
  font-weight: 600;
}
.card-trend {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sparkline-wrapper {
  height: 22px;
  width: 100%;
}
.sparkline {
  width: 100%;
  height: 100%;
}
.trend-text {
  font-size: 8.5px;
  font-weight: 700;
  white-space: nowrap;
}
.trend-text.green { color: var(--success); }
.card-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-list li {
  font-size: 9.5px;
  color: #555;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
}
.dot.yellow { background: #FFC069; }
.badge-new {
  background: var(--danger);
  color: #FFF;
  font-size: 8px;
  font-weight: 700;
  padding: 0px 3px;
  border-radius: 3px;
  transform: scale(0.85);
}

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  height: 100vh;
}

/* ===== LEFT PANEL ===== */
.left-panel {
  width: var(--panel-w);
  min-width: var(--panel-w);
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  z-index: 10;
}
.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.panel-header h1 {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-header h1 .logo {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
}
.panel-header h1 .logo img {
  width: 28px; height: 28px;
  border-radius: 7px;
  object-fit: contain;
}
.panel-header .subtitle {
  font-size: 12px; color: var(--text-sec); margin-top: 2px;
}
.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: #FAFAFA;
}
.panel-tab {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sec);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  background: none;
  border-top: none; border-left: none; border-right: none;
}
.panel-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: #fff;
}
.panel-tab:hover:not(.active) { color: var(--text); background: #F5F5F5; }
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.panel-body::-webkit-scrollbar { width: 4px; }
.panel-body::-webkit-scrollbar-thumb { background: #DDD; border-radius: 2px; }
.panel-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #FAFAFA;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== RIGHT PANEL — A4 PREVIEW ===== */
.right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.preview-toolbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.95);
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 5;
  font-size: 12px;
  color: var(--text-sec);
}
.preview-toolbar .page-info { font-weight: 500; color: var(--text); }
.toolbar-btn {
  width: 28px; height: 28px;
  border: none; background: none;
  border-radius: 6px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-sec);
  transition: all 0.15s;
}
.toolbar-btn:hover { background: #F0F0F0; color: var(--text); }
.toolbar-divider { width: 1px; height: 20px; background: var(--border); }

.a4-scroll-area {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 24px 24px;
  gap: 24px;
}
.a4-scroll-area::-webkit-scrollbar { width: 6px; }
.a4-scroll-area::-webkit-scrollbar-thumb { background: #CCC; border-radius: 3px; }

/* A4 Paper */
.a4-paper {
  width: var(--a4-w);
  min-height: var(--a4-h);
  background: #fff;
  box-shadow: 0 2px 20px rgba(0,0,0,0.12), 0 0 0 1px rgba(0,0,0,0.04);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.a4-content {
  padding: 48px 56px;
  font-size: 14px;
  line-height: 1.75;
}

/* ===== COVER STYLES (A4) ===== */
.a4-cover {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  min-height: var(--a4-h);
  padding: 80px 72px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #faf9f6;
  color: #1c1917;
  --border-color: rgba(28, 25, 23, 0.1);
  --border-color-active: #b45309;
  --text-primary: #1c1917;
  --text-secondary: #78716c;
  --accent-color: #b45309;
  --badge-bg: rgba(180, 83, 9, 0.05);
  --badge-border: rgba(180, 83, 9, 0.3);
  --card-bg: #ffffff;
}
.a4-cover .cover-grid-overlay {
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(180, 83, 9, 0.15);
  pointer-events: none;
}
.a4-cover .cover-huge-week-bg {
  color: rgba(28, 25, 23, 0.02);
  -webkit-text-stroke: 1.5px rgba(180, 83, 9, 0.04);
}
.a4-cover .cover-logo-a4 img {
  filter: none;
}

/* --- 细节排版元素 --- */
.cover-huge-week-bg {
  position: absolute;
  right: -40px;
  top: 15%;
  font-size: 320px;
  font-weight: 900;
  line-height: 1;
  font-family: 'Outfit', -apple-system, sans-serif;
  user-select: none;
  z-index: 1;
  transition: all 0.3s ease;
}

.cover-header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 24px;
  z-index: 2;
  width: 100%;
}
.cover-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cover-logo-a4 {
  width: 40px;
  height: 40px;
}
.cover-logo-a4 img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: all 0.3s ease;
}
.cover-brand-a4 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  font-family: "PingFang SC", sans-serif;
  color: var(--text-primary);
}
.cover-sub-a4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--accent-color);
  border: 1px solid var(--badge-border);
  background: var(--badge-bg);
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
}

.cover-main-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  margin: 80px 0;
  z-index: 2;
}
.cover-category-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--accent-color);
  margin-bottom: 12px;
  text-transform: uppercase;
  font-family: 'Outfit', sans-serif;
}
.cover-week-a4 {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 24px;
}
.cover-line {
  width: 80px;
  height: 3px;
  background: var(--accent-color);
  margin-bottom: 24px;
  border-radius: 2px;
}
.cover-slogan-a4 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 6px;
  color: var(--text-secondary);
}

.cover-footer-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
  z-index: 2;
  width: 100%;
}
.cover-specs-table {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  border-top: 1px solid var(--border-color);
  padding-top: 32px;
  text-align: left;
}
.spec-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 16px;
  background: var(--card-bg);
  border-left: 3px solid var(--border-color);
  transition: all 0.2s ease;
}
.spec-cell:hover {
  border-left-color: var(--border-color-active);
}
.cell-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-family: 'Outfit', sans-serif;
}
.cell-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.cover-badge-premium {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--text-secondary);
  text-transform: uppercase;
  opacity: 0.6;
  text-align: center;
  border-top: 1px dotted var(--border-color);
  padding-top: 24px;
}

/* --- 雅致拆姐封面样式 (Chic/Chaijie Centered Style) --- */
.a4-cover.style-chaijie {
  background: radial-gradient(circle at center, #FDFCFB 0%, #F5EFEB 100%);
  --border-color: rgba(180, 83, 9, 0.12);
  --border-color-active: #b45309;
  --text-primary: #1c1917;
  --text-secondary: #7c2d12;
  --accent-color: #b45309;
  --badge-bg: rgba(180, 83, 9, 0.04);
  --badge-border: rgba(180, 83, 9, 0.2);
  --card-bg: rgba(255, 255, 255, 0.85);
}

.a4-cover.style-chaijie .cover-grid-overlay {
  border: 1px solid rgba(180, 83, 9, 0.12);
  box-shadow: inset 0 0 40px rgba(180, 83, 9, 0.02);
}

.cover-chaijie-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 32px;
  z-index: 2;
  margin: 40px 0;
}

.chaijie-image-frame {
  position: relative;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: #ffffff;
  padding: 6px;
  box-shadow: 0 16px 36px rgba(180, 83, 9, 0.12), 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(180, 83, 9, 0.15);
  animation: floatDeco 6s ease-in-out infinite;
}

.chaijie-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(180, 83, 9, 0.08);
}

.frame-deco-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(180, 83, 9, 0.25);
  pointer-events: none;
  animation: rotateRing 25s linear infinite;
}

.chaijie-title-group {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.style-chaijie .cover-huge-week-bg {
  color: rgba(180, 83, 9, 0.01);
  -webkit-text-stroke: 1px rgba(180, 83, 9, 0.02);
}

@keyframes floatDeco {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes rotateRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== CONTENT STYLES (A4) ===== */
.a4-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 20px;
}
.a4-header-left { display: flex; align-items: center; gap: 10px; }
.a4-logo-sm {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.a4-logo-sm img {
  width: 32px; height: 32px;
  object-fit: contain;
  border-radius: 8px;
}
.a4-title { font-size: 18px; font-weight: 700; }
.a4-subtitle { font-size: 11px; color: var(--text-sec); }

.a4-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin: 20px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--primary-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.a4-question {
  margin-bottom: 16px;
  page-break-inside: avoid;
}
.a4-q-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.a4-q-num {
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
  white-space: nowrap;
}
.a4-q-text {
  font-size: 14px;
  line-height: 1.8;
}
.a4-q-img {
  width: 100%;
  height: 56px;
  background: #F5F7FA;
  border: 1px dashed #D0D7E2;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #AAA;
  margin: 6px 0;
}
.a4-q-answer {
  margin-top: 8px;
  border: 1px solid #E0E0E0;
  border-radius: 4px;
  min-height: 48px;
  background: #FAFAFA;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #CCC;
}
.a4-q-meta {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.a4-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: #F0F0F0;
  color: #888;
}
.a4-tag.kn { background: var(--primary-light); color: var(--primary); }
.a4-tag.err { background: #FFF0F0; color: var(--danger); }
.a4-tag.star { background: var(--accent-light); color: var(--accent); font-weight: 600; }

.a4-footer {
  position: absolute;
  bottom: 20px;
  left: 56px;
  right: 56px;
  border-top: 1px dashed #E5E5E5;
  padding-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: #BBB;
  pointer-events: none;
  z-index: 5;
}

/* ===== MODULE TOGGLE THEMES ===== */
.module-toggle#mod-sync.active { border-color: var(--primary) !important; background: var(--primary-light) !important; }
.module-toggle#mod-review.active { border-color: var(--success) !important; background: var(--success-light) !important; }
.module-toggle#mod-stuck.active { border-color: var(--accent) !important; background: var(--accent-light) !important; }
.module-toggle#mod-advanced.active { border-color: var(--danger) !important; background: #FFF0F0 !important; }

.toggle-switch.on#toggle-sync { background: var(--primary) !important; }
.toggle-switch.on#toggle-review { background: var(--success) !important; }
.toggle-switch.on#toggle-stuck { background: var(--accent) !important; }
.toggle-switch.on#toggle-advanced { background: var(--danger) !important; }

/* ===== LEFT PANEL COMPONENTS ===== */
.section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

/* Cover config */
.config-card {
  background: #FAFAFA;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}
.config-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.config-row:last-child { margin-bottom: 0; }
.config-label {
  font-size: 12px;
  color: var(--text-sec);
  min-width: 60px;
  flex-shrink: 0;
}
.config-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.config-input:focus { border-color: var(--primary); }

/* Module toggles */
.module-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #FAFAFA;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.module-toggle:hover { border-color: var(--primary); }
.module-toggle.active { border-color: var(--primary); background: var(--primary-light); }
.module-toggle-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.module-toggle-left .icon {
  font-size: 18px;
}
.module-toggle-left .name {
  font-size: 13px;
  font-weight: 600;
}
.module-toggle-left .count {
  font-size: 11px;
  color: var(--text-sec);
}
.toggle-switch {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: #DDD;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-switch.on { background: var(--primary); }
.toggle-switch::after {
  content: '';
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px; left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch.on::after { transform: translateX(16px); }

/* Question list */
.q-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fff;
}
.q-item:hover { border-color: var(--primary); }
.q-item.selected { border-color: var(--primary); background: var(--primary-light); }
.q-item-check {
  width: 18px; height: 18px;
  border: 2px solid #CCC;
  border-radius: 4px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff;
  transition: all 0.15s;
  margin-top: 2px;
}
.q-item.selected .q-item-check {
  background: var(--primary);
  border-color: var(--primary);
}
.q-item-info { flex: 1; min-width: 0; }
.q-item-title { font-size: 13px; font-weight: 500; line-height: 1.4; }
.q-item-meta { display: flex; gap: 4px; margin-top: 3px; flex-wrap: wrap; }
.q-item-tag {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #F0F0F0;
  color: #999;
}
.q-item-tag.err { background: #FFF0F0; color: var(--danger); }
.q-item-stars {
  font-size: 11px;
  color: #DDD;
  flex-shrink: 0;
  margin-top: 2px;
}
.q-item-stars .on { color: var(--accent); }

/* Select all */
.select-all-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: 6px;
}
.select-all-btn {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}
.select-all-btn:hover { text-decoration: underline; }

/* Action buttons */
.action-primary {
  flex: 1;
  padding: 9px 14px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.action-primary.blue { background: var(--primary); color: #fff; }
.action-primary.blue:hover { background: var(--primary-dark); }
.action-primary.outline { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.action-primary.outline:hover { background: var(--primary-light); }
.action-primary.accent { background: var(--accent); color: #fff; }
.action-primary.accent:hover { background: #E8991E; }
.action-primary:disabled { background: #E8E8E8; color: #BBB; cursor: not-allowed; }

/* Stats inline */
.stats-inline {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.stat-mini {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  background: #FAFAFA;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.stat-mini .val { font-size: 20px; font-weight: 700; color: var(--primary); }
.stat-mini:nth-child(2) .val { color: var(--success); }
.stat-mini:nth-child(3) .val { color: var(--accent); }
.stat-mini .lbl { font-size: 10px; color: var(--text-sec); }

/* Print specs */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.spec-btn {
  padding: 8px 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  background: #fff;
  font-family: inherit;
}
.spec-btn:hover { border-color: var(--primary); }
.spec-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; }
.spec-btn .sp-val { font-size: 13px; display: block; }
.spec-btn .sp-lbl { font-size: 10px; color: var(--text-sec); }
.spec-btn.active .sp-lbl { color: var(--primary); }

/* Collapsible */
.collapse-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
}
.collapse-trigger .title { font-size: 13px; font-weight: 600; }
.collapse-trigger .arrow { font-size: 12px; color: var(--text-sec); transition: transform 0.2s; }
.collapse-trigger.open .arrow { transform: rotate(90deg); }
.collapse-body { display: none; padding-top: 4px; }
.collapse-body.open { display: block; }

/* Divider */
.divider { height: 1px; background: var(--border); margin: 12px 0; }

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  animation: modalIn 0.25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 16px; }
.modal-close {
  width: 28px; height: 28px;
  border: none; background: #F5F5F5;
  border-radius: 50%; cursor: pointer;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.modal-body { padding: 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Success check animation */
.success-circle {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--success-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px;
  animation: popIn 0.4s ease;
}
@keyframes popIn {
  0% { transform: scale(0); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

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

/* Responsive: hide left panel, show toggle */
@media (max-width: 900px) {
  .left-panel { display: none; }
  .left-panel.mobile-show {
    display: flex;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 100%;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(0,0,0,0.2);
  }
  .mobile-toggle {
    display: flex !important;
  }
  .a4-paper {
    width: 100%;
    min-height: auto;
    border-radius: 0;
    box-shadow: 0 0 20px rgba(0,0,0,0.1);
  }
  .a4-content { padding: 32px 24px; }
  .a4-cover { padding: 40px 24px; min-height: 100vh; }
}
.mobile-toggle {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 16px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(74,144,217,0.4);
  align-items: center;
  justify-content: center;
}


