:root {
  --primary: #12a06a;
  --primary-dark: #0b7d52;
  --primary-light: #e6f6ef;
  --accent: #ff8a1f;
  --accent-light: #fff3e6;
  --danger: #f04438;
  --danger-light: #feeceb;
  --info: #2f6bff;
  --info-light: #eaf0ff;
  --text: #1d2939;
  --text-2: #475467;
  --text-3: #98a2b3;
  --border: #eaecf0;
  --bg: #f4f6f8;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.row { display: flex; align-items: center; gap: 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.muted { color: var(--text-3); font-size: 12px; }
.sub { color: var(--text-2); font-size: 13px; }
.bold { font-weight: 600; }
.title { font-size: 16px; font-weight: 600; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: var(--primary); color: #fff; transition: .15s;
}
.btn:hover { filter: brightness(.94); }
.btn.ghost { background: var(--primary-light); color: var(--primary-dark); }
.btn.line { background: #fff; color: var(--text-2); border: 1px solid var(--border); }
.btn.danger { background: var(--danger-light); color: var(--danger); }
.btn.sm { padding: 4px 12px; font-size: 12px; }
.btn.block { width: 100%; padding: 11px; }
.btn.square { border-radius: 8px; }

.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 500; }
.tag.green { background: var(--primary-light); color: var(--primary-dark); }
.tag.orange { background: var(--accent-light); color: #c25e00; }
.tag.red { background: var(--danger-light); color: var(--danger); }
.tag.blue { background: var(--info-light); color: var(--info); }
.tag.gray { background: #f2f4f7; color: var(--text-2); }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; background: linear-gradient(135deg, #34c38f, #12a06a);
}
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.orange { background: linear-gradient(135deg, #ffb35c, #ff8a1f); }
.avatar.blue { background: linear-gradient(135deg, #6e98ff, #2f6bff); }
.avatar.purple { background: linear-gradient(135deg, #b18cff, #7a4dff); }

.phase { font-size: 10px; padding: 0 6px; border-radius: 4px; background: #7a4dff; color: #fff; margin-left: 4px; vertical-align: middle; }

/* ---------- 手机框 ---------- */
.stage {
  min-height: 100vh; display: flex; gap: 40px; align-items: flex-start; justify-content: center;
  padding: 30px 20px; background: radial-gradient(circle at 20% 10%, #dff5ea, transparent 40%), var(--bg);
}
.stage-side { width: 280px; position: sticky; top: 30px; }
.stage-side h1 { font-size: 22px; margin-bottom: 6px; }
.stage-side .nav-list { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.stage-side .nav-list button {
  text-align: left; padding: 10px 12px; border-radius: 10px; background: #fff; box-shadow: var(--shadow); font-size: 13px;
}
.stage-side .nav-list button.on { background: var(--primary); color: #fff; }
.stage-side a { color: var(--primary-dark); text-decoration: none; font-size: 13px; }

.phone {
  width: 390px; height: 800px; border-radius: 48px; background: #111; padding: 12px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .18); flex-shrink: 0;
}
.screen { width: 100%; height: 100%; border-radius: 38px; overflow: hidden; background: var(--bg); position: relative; display: flex; flex-direction: column; }
.statusbar { height: 44px; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; background: #fff; flex-shrink: 0; }
.navbar { height: 44px; display: flex; align-items: center; justify-content: center; position: relative; background: #fff; font-weight: 600; font-size: 16px; flex-shrink: 0; }
.navbar .back { position: absolute; left: 14px; font-size: 20px; }
.navbar .capsule {
  position: absolute; right: 10px; width: 80px; height: 30px; border-radius: 15px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-around; font-size: 14px; color: var(--text-2);
}
.page { flex: 1; overflow-y: auto; padding: 12px; display: none; flex-direction: column; gap: 12px; }
.page.on { display: flex; }
.page::-webkit-scrollbar { width: 0; }

.tabbar { height: 64px; background: #fff; border-top: 1px solid var(--border); display: flex; flex-shrink: 0; padding-bottom: 8px; }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--text-3); }
.tabbar button .ico { font-size: 20px; line-height: 1; filter: grayscale(1); opacity: .6; }
.tabbar button.on { color: var(--primary); }
.tabbar button.on .ico { filter: none; opacity: 1; }

.hero {
  border-radius: var(--radius); padding: 16px; color: #fff;
  background: linear-gradient(135deg, #17b57a 0%, #0b7d52 100%); position: relative; overflow: hidden;
}
.hero::after { content: "🏸"; position: absolute; right: -6px; bottom: -14px; font-size: 90px; opacity: .15; transform: rotate(-20deg); }
.hero .muted { color: rgba(255, 255, 255, .8); }

.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.grid4 .ent { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); }
.grid4 .ent .ic { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: var(--primary-light); }

.list-item { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: none; }

.seg { display: flex; background: #eef1f4; border-radius: 10px; padding: 3px; }
.seg button { flex: 1; padding: 6px 0; border-radius: 8px; font-size: 13px; color: var(--text-2); }
.seg button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: var(--shadow); }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.week button { padding: 6px 0; border-radius: 10px; font-size: 12px; color: var(--text-2); position: relative; }
.week button b { display: block; font-size: 16px; color: var(--text); }
.week button.on { background: var(--primary); color: #fff; }
.week button.on b { color: #fff; }
.week button.dot::after { content: ""; position: absolute; bottom: 3px; left: 50%; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--accent); }

.lesson { display: flex; gap: 12px; }
.lesson .time { width: 48px; text-align: right; font-weight: 600; font-size: 13px; }
.lesson .time .muted { font-weight: 400; }
.lesson .body { flex: 1; border-left: 3px solid var(--primary); padding-left: 10px; }
.lesson.orange .body { border-color: var(--accent); }
.lesson.blue .body { border-color: var(--info); }

.video-thumb {
  height: 96px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 28px; position: relative;
  background: linear-gradient(135deg, #1f2937, #065f46);
}
.video-thumb span { position: absolute; right: 6px; bottom: 4px; font-size: 11px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.chips { display: flex; gap: 6px; overflow-x: auto; }
.chips::-webkit-scrollbar { height: 0; }
.chips button { white-space: nowrap; padding: 5px 12px; border-radius: 999px; background: #fff; font-size: 12px; color: var(--text-2); }
.chips button.on { background: var(--primary); color: #fff; }

/* 浮动 AI 按钮 */
.fab {
  position: absolute; right: 14px; bottom: 80px; width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #2f6bff); color: #fff; font-size: 22px;
  box-shadow: 0 8px 20px rgba(79, 70, 229, .35); display: flex; align-items: center; justify-content: center; z-index: 5;
}

/* 底部弹层 */
.mask { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); z-index: 10; display: none; align-items: flex-end; }
.mask.on { display: flex; }
.sheet { width: 100%; background: #fff; border-radius: 20px 20px 0 0; padding: 18px 16px 24px; max-height: 85%; overflow-y: auto; animation: up .2s ease; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.toast {
  position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, .8); color: #fff;
  padding: 12px 20px; border-radius: 10px; z-index: 999; font-size: 14px; display: none; max-width: 300px; text-align: center;
}
.toast.on { display: block; }

.form-item { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-item label { font-size: 13px; color: var(--text-2); }
.input { border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; outline: none; width: 100%; background: #fff; }
.input:focus { border-color: var(--primary); }

/* 聊天 */
.chat { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 8px; max-width: 100%; }
.msg .bubble { padding: 10px 12px; border-radius: 14px; background: #fff; box-shadow: var(--shadow); max-width: 80%; font-size: 14px; }
.msg.me { flex-direction: row-reverse; }
.msg.me .bubble { background: var(--primary); color: #fff; }
.msg .bubble .card-in { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: #fafbfc; color: var(--text); }
.chat-input { display: flex; gap: 8px; padding: 10px 12px 18px; background: #fff; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; border: none; background: var(--bg); border-radius: 999px; padding: 9px 14px; outline: none; }
.ai-tip { font-size: 11px; color: var(--text-3); text-align: center; }

.progress { height: 6px; background: #eef1f4; border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
