/* ══════════════════════════════════════════════════════════════
   Neuma 灵知AI · 课程中心设计系统 (Center Stylesheet)
   遵循灵知设计规范：暖白底色、可可文字、撞色圆角、杂志质感
   ══════════════════════════════════════════════════════════════ */

:root {
  /* 品牌核心色板 */
  --bg: #FDFBF7;
  --bg-warm: #F9F5EE;
  --surface: #FFFFFF;
  --surface-muted: #F8F4EE;
  --surface-card: #FFFFFF;
  --ink: #3D2C29;
  --ink-soft: #8A7A72;
  --ink-light: #B8ACA5;
  --line: #EFE9E2;
  --line-strong: #E2D7CB;

  --primary: #E86FA4;
  --primary-deep: #D9538E;
  --primary-soft: #FDF0F6;
  --accent: #F08C5A;
  --accent-soft: #FDF1EA;
  --leaf: #8BA84E;
  --leaf-soft: #F2F7E9;
  --sky: #7EC8E3;
  --sky-soft: #ECF7FB;
  --violet: #8B5FBF;
  --violet-soft: #EDE4F7;
  --gold: #D9822B;
  --gold-soft: #FEF6EB;

  --grad-primary: linear-gradient(135deg, #F08C5A 0%, #E86FA4 100%);
  --grad-badge: linear-gradient(160deg, #A98BE0, #E86FA4);
  --grad-gold: linear-gradient(135deg, #E6963B 0%, #E86FA4 100%);
  --grad-leaf: linear-gradient(135deg, #7A9A4A 0%, #3D8B6E 100%);
  --grad-violet: linear-gradient(135deg, #8B5FBF 0%, #6E4FA0 100%);

  --r-card: 22px;
  --r-pill: 9999px;
  --r-btn: 14px;
  --shadow-sm: 0 2px 8px rgba(61, 44, 41, 0.05);
  --shadow-md: 0 6px 20px rgba(61, 44, 41, 0.08);
  --shadow-lg: 0 14px 36px rgba(61, 44, 41, 0.12);
  --shadow-glow: 0 8px 24px rgba(232, 111, 164, 0.25);

  --font-serif: 'Noto Serif SC', 'Songti SC', 'Source Han Serif SC', Georgia, serif;
  --font-sans: 'PingFang SC', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --phone-w: 390px;
  --phone-h: 844px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: #E7E0D6;
  -webkit-font-smoothing: antialiased;
}

/* ═══════════ 桌面舞台包装器 (Desktop Stage) ═══════════ */
.desktop-stage {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(circle at 15% 15%, #F5ECE0 0%, #E8DFD3 50%, #D8CFC2 100%);
  overflow: hidden;
  padding-top: 50px;
  padding-bottom: 16px;
}

/* 桌面顶部控制栏 (Desktop Top Toolbar) */
.desktop-toolbar {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 7px 18px;
  border-radius: var(--r-pill);
  box-shadow: 0 4px 20px rgba(61, 44, 41, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.7);
  z-index: 100;
  font-size: 13px;
  color: var(--ink);
}

.toolbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.toolbar-brand-dot {
  width: 8px;
  height: 8px;
  background: var(--leaf);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--leaf);
}

.toolbar-divider {
  width: 1px;
  height: 16px;
  background: var(--line-strong);
}

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

.tool-select, .tool-btn {
  font-family: inherit;
  font-size: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.tool-select:hover, .tool-btn:hover {
  background: #FFF;
  border-color: var(--primary);
}

.tool-dropdown {
  position: relative;
}

.direct-links-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #FFF;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  padding: 6px;
  min-width: 220px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 200;
}

.direct-links-menu.is-open {
  display: flex;
}

.direct-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink);
  font-size: 12px;
  transition: background 0.15s;
}

.direct-link-item:hover {
  background: var(--surface-muted);
  color: var(--primary-deep);
}

/* ═══════════ 手机外壳与自适应缩放 (Phone Mockup) ═══════════ */
.phone-fit {
  position: relative;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-shell {
  width: var(--phone-w);
  height: var(--phone-h);
  background: var(--bg);
  border-radius: 50px;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 0 0 10px #1E1A1A,
    0 0 0 12px #3D3535,
    0 25px 60px rgba(40, 25, 20, 0.35),
    0 8px 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

/* 无外壳模式切换 */
.phone-shell.no-bezel {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--line);
  border-radius: 36px;
}

/* 顶部状态栏与灵动岛 */
.phone-statusbar {
  height: 48px;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 60;
  pointer-events: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.status-time {
  letter-spacing: -0.2px;
}

.phone-island {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 32px;
  background: #000;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #FFF;
  font-size: 11px;
  padding: 0 10px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
  cursor: pointer;
}

.phone-island:hover {
  width: 140px;
}

.island-dot {
  width: 7px;
  height: 7px;
  background: var(--leaf);
  border-radius: 50%;
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

.status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.status-battery {
  display: inline-block;
  width: 22px;
  height: 11px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  position: relative;
  padding: 1px;
}

.status-battery::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 2px;
  width: 2px;
  height: 4px;
  background: var(--ink);
  border-radius: 0 1px 1px 0;
}

.status-battery-level {
  width: 80%;
  height: 100%;
  background: var(--ink);
  border-radius: 1px;
}

/* 底部安全横条 (Home Indicator) */
.home-indicator {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 136px;
  height: 5px;
  background: var(--ink);
  opacity: 0.3;
  border-radius: 3px;
  z-index: 60;
  pointer-events: none;
}

/* ═══════════ 手机屏幕内核心应用视口 ═══════════ */
.app-viewport {
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.app-scroll-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-top: 52px;
  padding-bottom: 90px;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* ═══════════ 页面顶部导航与搜索 ═══════════ */
.app-header {
  padding: 10px 20px 14px;
}

.header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-deep);
  box-shadow: var(--shadow-sm);
}

.brand-badge span {
  color: var(--ink-soft);
  font-weight: 400;
}

.streak-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gold-soft);
  color: #B4651A;
  border: 1px solid rgba(217, 130, 43, 0.2);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
}

.header-title-group {
  margin-bottom: 14px;
}

.header-kicker {
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.header-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
}

/* 搜索框 */
.search-box {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px 14px;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 111, 164, 0.15);
}

.search-icon {
  font-size: 14px;
  opacity: 0.5;
}

.search-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
  width: 100%;
}

.search-input::placeholder {
  color: var(--ink-light);
}

.search-clear {
  background: none;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 12px;
  display: none;
}

.search-clear.is-visible {
  display: block;
}

/* ═══════════ 分类横滑栏 (Category Filter Pills) ═══════════ */
.category-filter-wrap {
  position: sticky;
  top: 0;
  background: rgba(253, 251, 247, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 20;
  padding: 10px 0;
  border-bottom: 1px solid rgba(239, 233, 226, 0.6);
}

.category-pills {
  display: flex;
  gap: 8px;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.cat-pill:hover {
  background: var(--surface-muted);
}

.cat-pill.is-active {
  background: var(--ink);
  color: #FFF;
  border-color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* ═══════════ 主推置顶卡片 (Featured Hero Banner) ═══════════ */
.featured-hero-section {
  padding: 14px 20px 6px;
}

.hero-card {
  position: relative;
  background: #FFF;
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
}

.hero-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.hero-cover-wrap {
  height: 180px;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.hero-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.hero-card:hover .hero-cover-img {
  transform: scale(1.04);
}

.hero-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(61,44,41,0.75) 100%);
}

.hero-floating-badge {
  position: absolute;
  top: 12px;
  left: 14px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  color: var(--primary-deep);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 4px;
}

.hero-duration-badge {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  color: #FFF;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--r-pill);
}

.hero-cover-info {
  position: absolute;
  bottom: 12px;
  left: 16px;
  right: 16px;
  color: #FFF;
}

.hero-cover-kicker {
  font-size: 11px;
  letter-spacing: 0.5px;
  opacity: 0.9;
  margin-bottom: 2px;
}

.hero-cover-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.hero-body {
  padding: 14px 16px 16px;
}

.hero-slogan {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}

.hero-desc {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.tag-badge {
  font-size: 11px;
  color: var(--ink-soft);
  background: var(--surface-muted);
  padding: 3px 8px;
  border-radius: 6px;
}

.hero-actions {
  display: flex;
  gap: 8px;
}

/* ═══════════ 按钮通用样式 (Buttons) ═══════════ */
.btn-primary {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--grad-primary);
  color: #FFF;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--r-btn);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(232, 111, 164, 0.3);
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(232, 111, 164, 0.4);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: var(--r-btn);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-secondary:hover {
  background: #FFF;
  border-color: var(--primary);
  color: var(--primary-deep);
}

.btn-icon-only {
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-icon-only:hover {
  background: #FFF;
  color: var(--primary);
  border-color: var(--primary);
}

/* ═══════════ 生活医学四大基石微组件 (Pillars Grid) ═══════════ */
.pillars-section {
  padding: 12px 20px 4px;
}

.section-label-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.section-label {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.section-sublink {
  font-size: 12px;
  color: var(--primary-deep);
  cursor: pointer;
  text-decoration: none;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.pillar-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.pillar-item:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.pillar-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.pillar-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.pillar-tag {
  font-size: 10px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* ═══════════ 课程列表卡片流 (Course List Cards) ═══════════ */
.courses-stream-section {
  padding: 14px 20px 20px;
}

.courses-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.course-card {
  background: var(--surface);
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}

.course-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--line-strong);
}

.course-card-top {
  display: flex;
  position: relative;
}

.course-thumb-wrap {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.course-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.course-card:hover .course-thumb {
  transform: scale(1.05);
}

.course-thumb-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-deep);
}

.course-info-wrap {
  flex: 1;
  padding: 12px 14px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.course-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.course-cat-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-deep);
  display: flex;
  align-items: center;
  gap: 3px;
}

.course-duration-tag {
  font-size: 11px;
  color: var(--ink-soft);
  background: var(--surface-muted);
  padding: 2px 6px;
  border-radius: 4px;
}

.course-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 4px;
}

.course-slogan {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-stats-line {
  font-size: 11px;
  color: var(--ink-light);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.course-card-body {
  padding: 0 14px 14px;
}

.course-desc-snip {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* ═══════════ Tab 2: 体系飞轮路线 (Roadmap View) ═══════════ */
.roadmap-view {
  padding: 16px 20px;
  display: none;
}

.roadmap-view.is-active {
  display: block;
}

.roadmap-intro-card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 16px;
  border: 1px solid var(--line);
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.roadmap-intro-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
}

.roadmap-intro-text {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.6;
}

.roadmap-timeline {
  position: relative;
  padding-left: 24px;
}

.roadmap-timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 14px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--primary) 50%, var(--violet) 100%);
  border-radius: 1px;
}

.roadmap-step-item {
  position: relative;
  margin-bottom: 20px;
}

.roadmap-node-dot {
  position: absolute;
  left: -24px;
  top: 10px;
  width: 20px;
  height: 20px;
  background: #FFF;
  border: 3px solid var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(232, 111, 164, 0.2);
}

.roadmap-step-card {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.roadmap-step-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.roadmap-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.roadmap-phase-kicker {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-deep);
}

.roadmap-phase-duration {
  font-size: 11px;
  color: var(--ink-soft);
  background: var(--surface-muted);
  padding: 2px 6px;
  border-radius: 4px;
}

.roadmap-step-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.roadmap-step-why {
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 8px;
}

/* ═══════════ Tab 3: 我的与工具箱 (Profile View) ═══════════ */
.profile-view {
  padding: 16px 20px;
  display: none;
}

.profile-view.is-active {
  display: block;
}

.profile-user-card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 18px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 2px solid var(--primary-soft);
}

.profile-info h3 {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.profile-info p {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.badge-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
}

.badge-emoji {
  font-size: 24px;
  margin-bottom: 4px;
}

.badge-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
}

.dev-tools-card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: 16px;
  border: 1px solid var(--line);
}

.dev-tools-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.dev-link-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.dev-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--surface-muted);
  border-radius: 8px;
  font-size: 12px;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s;
}

.dev-link-row:hover {
  background: #FFF;
  color: var(--primary);
}

/* ═══════════ 底部导航栏 (Bottom Nav Bar) ═══════════ */
.app-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 16px 14px;
  z-index: 50;
}

.nav-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--ink-light);
  cursor: pointer;
  padding: 6px 16px;
  border-radius: 12px;
  transition: all 0.2s;
  font-family: inherit;
}

.nav-tab-btn:hover {
  color: var(--ink-soft);
}

.nav-tab-btn.is-active {
  color: var(--primary-deep);
}

.nav-tab-icon {
  font-size: 20px;
}

.nav-tab-label {
  font-size: 11px;
  font-weight: 600;
}

/* ═══════════ 课程详情抽屉 (Bottom Sheet Drawer) ═══════════ */
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(40, 28, 25, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.detail-drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88%;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  z-index: 85;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-drawer.is-open {
  transform: translateY(0);
}

.drawer-drag-pill {
  width: 40px;
  height: 5px;
  background: var(--line-strong);
  border-radius: 3px;
  margin: 10px auto 4px;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px 20px 24px;
  -webkit-overflow-scrolling: touch;
}

.drawer-cover-wrap {
  width: 100%;
  height: 160px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  margin-bottom: 14px;
}

.drawer-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawer-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 4px;
}

.drawer-subtitle {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.drawer-specs-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.drawer-spec-pill {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--ink-soft);
}

.drawer-spec-pill strong {
  color: var(--ink);
}

.drawer-section-title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 16px 0 8px;
}

.drawer-science-card {
  background: var(--surface);
  border-left: 3px solid var(--primary);
  border-radius: 0 12px 12px 0;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.drawer-modules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.drawer-module-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.module-day-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-deep);
  background: var(--primary-soft);
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.module-text-wrap h5 {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.module-text-wrap p {
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.4;
}

.drawer-footer-actions {
  padding: 12px 20px 20px;
  background: var(--bg);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
}

/* ═══════════ 沉浸式模拟器运行器 (Embedded Demo Runner) ═══════════ */
.demo-runner-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 95;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.demo-runner-overlay.is-active {
  transform: translateX(0);
}

.runner-header {
  height: 94px;
  padding: 46px 14px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(253, 251, 247, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  z-index: 10;
  flex-shrink: 0;
}

.runner-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-deep);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
}

.runner-back-btn:hover {
  background: var(--surface-muted);
}

.runner-title-badge {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.runner-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.runner-tool-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--surface-muted);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.runner-tool-btn:hover {
  background: #FFF;
  color: var(--primary);
  border-color: var(--primary);
}

.runner-frame-wrap {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
  background: #FFF;
}

.runner-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
}

.runner-loading-indicator {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 13px;
  gap: 12px;
  transition: opacity 0.25s;
  pointer-events: none;
}

.runner-loading-indicator.is-hidden {
  opacity: 0;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line-strong);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ═══════════ 移动端直接打开自适应 (<500px) ═══════════ */
@media (max-width: 500px) {
  html, body {
    overflow: auto;
    background: var(--bg);
  }

  .desktop-stage {
    background: var(--bg);
    padding: 0;
    justify-content: flex-start;
  }

  .desktop-toolbar {
    display: none;
  }

  .phone-fit {
    width: 100vw;
    height: 100dvh;
    transform: none !important;
  }

  .phone-shell {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
    border: none;
  }

  .phone-statusbar {
    display: none;
  }

  .runner-header {
    height: 52px;
    padding: 6px 12px;
  }

  .home-indicator {
    display: none;
  }

  .app-scroll-content {
    padding-top: 10px;
    padding-bottom: 80px;
  }
}
