:root {
  --bg: #0f141e;
  --surface: #171e2c;
  --surface-hover: #1e2738;
  --border: rgba(255, 255, 255, 0.1);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #d97706;
  --accent-light: #fbbf24;
  --green: #10b981;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.hidden { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(15, 20, 30, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

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

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #e5b869, #b45309);
  display: grid;
  place-items: center;
}

.brand-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.search-wrap {
  position: relative;
  flex: 1 1 240px;
  max-width: 380px;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 8px 32px 8px 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent-light);
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
}

.progress-pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.btn-ghost-sm {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.btn-ghost-sm:hover { background: var(--surface-hover); }

.btn-play-link {
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.btn-play-link:hover { filter: brightness(1.08); }

.chipbar-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 12px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.chip {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background: rgba(217, 119, 6, 0.2);
  border-color: var(--accent-light);
  color: var(--accent-light);
}

.main-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 20px 60px;
}

.resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 24px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.16), rgba(30, 41, 59, 0.9));
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.resume-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.resume-badge {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #e1b462;
  color: #1e293b;
  font-weight: 800;
  font-size: 14px;
  display: grid;
  place-items: center;
}

.resume-kicker {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-light);
}

.resume-title {
  font-size: 16px;
  font-weight: 800;
}

.resume-sub {
  font-size: 12.5px;
  color: var(--muted);
}

.btn-primary {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}

.stage-section {
  margin-bottom: 30px;
}

.stage-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.stage-level {
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.15);
  color: var(--accent-light);
  font-size: 11.5px;
  font-weight: 700;
}

.stage-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.stage-desc {
  margin: 0 0 14px;
  font-size: 13px;
  color: var(--muted);
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.lesson-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.lesson-card:hover {
  transform: translateY(-2px);
  background: var(--surface-hover);
  border-color: rgba(251, 191, 36, 0.45);
}

.lesson-card.is-done {
  border-color: rgba(16, 185, 129, 0.4);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.board-pill {
  padding: 2px 8px;
  border-radius: 6px;
  background: #e1b462;
  color: #1e293b;
  font-size: 11px;
  font-weight: 800;
}

.done-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.card-summary {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 11px;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.65);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-panel {
  width: min(560px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.modal-kicker {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-light);
}

.modal-title {
  margin: 2px 0 0;
  font-size: 18px;
}

.modal-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}

.modal-body {
  font-size: 13.5px;
  color: #cbd5e1;
}

.modal-body pre {
  background: #0b0f17;
  padding: 10px 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 12px;
}
