:root {
  --bg: #f3f4f7;
  --panel: #ffffff;
  --text: #17202e;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #eaecf0;
  --line-soft: #f0f1f4;
  --green: #0d6a53;
  --green-fill: #17936e;
  --green-deep: #0a5340;
  --blue: #175cd3;
  --amber: #b54708;
  --red: #b42318;
  --soft-green: #e3f5ee;
  --soft-blue: #e8f0fc;
  --soft-amber: #fdf0da;
  --soft-red: #fdeceb;
  --side: #16202e;
  --side-2: #263345;
  --side-line: rgba(255,255,255,.09);
  --side-text: #c3cbd6;
  --side-faint: #8794a5;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(16,24,40,.05);
  --shadow-sm: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-md: 0 2px 6px rgba(16,24,40,.05), 0 6px 16px rgba(16,24,40,.07);
  --shadow-lift: 0 4px 10px rgba(16,24,40,.07), 0 12px 26px rgba(16,24,40,.09);
  --ring: 0 0 0 3px rgba(23,147,110,.16);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(23,147,110,.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(23,147,110,.18); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(22px, 3vw, 27px); line-height: 1.18; font-weight: 600; letter-spacing: -.02em; }
h2 { font-size: 17px; margin-bottom: 14px; font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 15px; margin-bottom: 10px; font-weight: 600; letter-spacing: -.01em; }

/* ---------- 登录 / 注册 ---------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-box { width: min(940px, 100%); display: grid; grid-template-columns: 1fr 380px; gap: 18px; }
.auth-box .panel { box-shadow: var(--shadow-md); }
.auth-copy {
  padding: 36px; border-radius: var(--radius-lg); color: #e2e8f0;
  background: linear-gradient(155deg, #1e2a3a 0%, var(--side) 70%);
  box-shadow: var(--shadow-lift);
  position: relative; overflow: hidden;
}
.auth-copy::after { content: ""; position: absolute; top: -40px; right: -40px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(23,147,110,.28), transparent 70%); z-index: 0; }
.auth-copy > * { position: relative; z-index: 1; }
.auth-copy h1 { color: #fff; }
.auth-copy p { color: #cbd5e1; line-height: 1.7; }
.auth-copy .eyebrow { color: var(--green-fill); }
.auth-copy .note { background: #28344a; border-color: #3a4862; color: #cbd5e1; }
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 20px; }
.flow div { border-radius: 9px; background: #28344a; color: #e2e8f0; padding: 11px 8px; font-size: 13px; font-weight: 500; text-align: center; }

/* ---------- 卡片基础 ---------- */
.panel, .metric, .auth-box .panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
}
.panel { padding: 20px 22px; box-shadow: var(--shadow-sm); }
.auth-tabs, .tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tab { min-height: 34px; border: 1px solid var(--line); border-radius: 9px; background: #fff; padding: 0 14px; color: var(--muted); font-weight: 500; font-size: 13px; transition: .15s ease; }
.tab:hover { border-color: #d7dbe0; color: var(--text); }
.tab.active { border-color: transparent; background: var(--green); color: #fff; box-shadow: var(--shadow-xs); }

/* ---------- 应用骨架 ---------- */
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, #1a2534 0%, var(--side) 100%); padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; border-right: 1px solid rgba(0,0,0,.2); }
.brand { display: flex; gap: 11px; align-items: center; margin-bottom: 20px; padding: 4px 6px; }
.mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(145deg, var(--green-fill), var(--green)); color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 4px 10px rgba(23,147,110,.35); letter-spacing: .02em; }
.brand strong { color: #fff; font-size: 14px; font-weight: 600; display: block; letter-spacing: -.01em; }
.brand span { color: var(--side-faint); font-size: 12px; display: block; margin-top: 2px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button {
  display: flex; align-items: center; gap: 11px;
  min-height: 42px; border: 0; border-left: 2px solid transparent;
  border-radius: 9px; background: transparent; color: var(--side-text);
  text-align: left; padding: 0 12px; font-size: 14px; font-weight: 500; transition: .16s ease;
}
.nav button:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav button.active { background: rgba(23,147,110,.16); color: #fff; border-left-color: var(--green-fill); box-shadow: inset 0 0 0 1px rgba(23,147,110,.14); }
.nav button svg { width: 18px; height: 18px; flex-shrink: 0; opacity: .9; }
.nav button.active svg { color: #37c898; opacity: 1; }
.user-card { margin-top: auto; border-top: 0.5px solid var(--side-line); padding-top: 12px; }
.user-card strong { color: #e2e8f0; font-size: 13px; font-weight: 500; }
.user-card small { color: var(--side-faint); display: block; margin-top: 3px; font-size: 12px; }
.user-card .tags { margin-top: 8px; }
.user-card .btn { margin-top: 10px; width: 100%; background: var(--side-2); color: #e2e8f0; border-color: #475569; }
.user-card .btn:hover { background: #3f4d63; }

.main { min-width: 0; padding: 24px clamp(16px, 3vw, 38px); }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.eyebrow { margin: 0 0 4px; color: var(--faint); font-size: 12px; font-weight: 500; }
.badge { display: inline-flex; align-items: center; min-height: 30px; border-radius: 20px; background: var(--soft-green); color: var(--green); padding: 0 14px; font-size: 12px; font-weight: 550; white-space: nowrap; border: 1px solid rgba(13,106,83,.14); }

/* ---------- 网格 / 指标 ---------- */
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { padding: 15px 17px; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-xs); transition: .18s ease; }
.metric:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.metric span { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.metric strong { display: block; margin-top: 6px; font-size: 25px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- 首页工作流引导 ---------- */
.greet { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.greet h2 { margin: 4px 0 0; font-size: 19px; }
.guide { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.guide-title { font-size: 12px; color: var(--muted); margin-bottom: 12px; font-weight: 500; letter-spacing: .01em; }
.guide-steps { display: flex; align-items: stretch; gap: 10px; }
.guide-step { flex: 1; background: #f6f7f9; border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 12px 13px; min-width: 0; transition: .18s ease; }
.guide-step.active { background: var(--soft-green); border-color: rgba(23,147,110,.2); }
.guide-step h4 { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: #374151; }
.guide-step.active h4 { color: var(--green); }
.guide-step p { margin: 6px 0 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.guide-step.active p { color: var(--green); }
.guide-step svg { width: 16px; height: 16px; }
.guide-cta { display: inline-flex; align-items: center; gap: 5px; margin-top: 9px; background: var(--green-fill); color: #04342c; font-size: 12px; padding: 5px 11px; border: 0; border-radius: 7px; font-weight: 500; }
.guide-arrow { display: flex; align-items: center; color: #cbd5e1; }
.guide-arrow svg { width: 16px; height: 16px; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
label { color: #374151; font-size: 13px; font-weight: 500; }
input, select, textarea {
  width: 100%; border: 1px solid #d7dbe1; border-radius: 10px;
  background: #fff; color: var(--text); padding: 10px 12px; outline: none; transition: .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 150px; resize: vertical; line-height: 1.6; }
input:hover, select:hover, textarea:hover { border-color: #c4c9d1; }
input:focus, select:focus, textarea:focus { border-color: var(--green-fill); box-shadow: var(--ring); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn { min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); padding: 0 16px; font-weight: 550; font-size: 14px; transition: .15s ease; box-shadow: var(--shadow-xs); }
.btn:hover { border-color: #d0d5db; background: #fbfcfd; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn.primary { border-color: transparent; background: linear-gradient(145deg, var(--green-fill), var(--green)); color: #fff; box-shadow: 0 2px 6px rgba(13,106,83,.28); }
.btn.primary:hover { background: linear-gradient(145deg, #18a077, var(--green-deep)); box-shadow: 0 4px 12px rgba(13,106,83,.34); }
.btn.warn { border-color: #f0d5b5; color: var(--amber); background: #fff; }
.btn.warn:hover { background: #fdf7ef; border-color: #e6c199; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- 列表 / 行 / 标签 ---------- */
.list { display: grid; gap: 10px; }
.row { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-xs); transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease; }
.row:hover { box-shadow: var(--shadow-sm); border-color: #e0e3e8; }
button.row { display: block; width: 100%; }
button.row:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.row-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.row-title { font-weight: 600; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { display: inline-flex; align-items: center; min-height: 24px; border-radius: 8px; background: #f0f1f4; color: #4b5563; padding: 0 10px; font-size: 12px; font-weight: 550; letter-spacing: .01em; }
.tag.green { background: var(--soft-green); color: var(--green); }
.tag.blue { background: var(--soft-blue); color: var(--blue); }
.tag.amber { background: var(--soft-amber); color: var(--amber); }
.tag.red { background: var(--soft-red); color: var(--red); }
.empty { border: 1.5px dashed #d5dae0; border-radius: var(--radius); color: var(--faint); padding: 28px; text-align: center; line-height: 1.6; background: #fbfbfc; font-size: 13px; }
.ai-loading { border-color: var(--green-fill); border-style: solid; color: var(--green); background: var(--soft-green); }
.note { border: 1px solid var(--line); border-radius: var(--radius); background: #f8f9fb; color: #475467; padding: 13px 15px; line-height: 1.6; margin-bottom: 16px; }

/* ---------- 确认面板 / 时间线 ---------- */
.result-grid, .lesson-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.result, .lesson-block { border: 1px solid var(--line-soft); border-radius: 10px; background: #f8f9fb; padding: 12px 13px; }
.result.full, .lesson-block.full { grid-column: 1 / -1; }
.result span, .lesson-block span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 550; letter-spacing: .01em; }
.result strong, .lesson-block p { line-height: 1.55; white-space: pre-wrap; margin-bottom: 0; font-weight: 400; }
.confirm-section { border: 1px solid var(--line); border-radius: var(--radius); background: #f8f9fb; padding: 14px 15px; margin-bottom: 10px; }
.compact-textarea { min-height: 84px; background: #fff; }
.lesson-card { border: 1px solid var(--line); border-left: 3px solid var(--green-fill); border-radius: var(--radius); box-shadow: var(--shadow-xs); }

/* ---------- 手机端 ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; overflow-x: hidden; }
  .sidebar { position: static; height: auto; flex-direction: column; min-width: 0; }
  .main { min-width: 0; }
  .nav { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; min-width: 0; }
  .nav button { flex-direction: column; gap: 3px; min-width: 64px; font-size: 12px; min-height: auto; padding: 8px 6px; border-left: 0; border-bottom: 2px solid transparent; }
  .nav button.active { border-left: 0; border-bottom-color: var(--green-fill); }
  .user-card { margin-top: 14px; }
  .auth-box, .grid.two, .grid.three, .form-grid, .result-grid, .lesson-grid, .flow { grid-template-columns: 1fr; }
  .guide-steps { flex-direction: column; }
  .guide-arrow { transform: rotate(90deg); justify-content: center; }
  .topbar, .greet { flex-direction: column; }
  .metrics-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* —— 手机窄屏（≤560px）：更紧凑，避免挤 —— */
@media (max-width: 560px) {
  .main { padding: 16px 12px; }
  .panel { padding: 14px 14px; }
  .metrics-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .grid.four, .grid.three { grid-template-columns: 1fr !important; }
  .row-head { flex-wrap: wrap; gap: 6px; }
  .tags { flex-wrap: wrap; }
  h1 { font-size: 20px; }
  h2 { font-size: 17px; }
  .btn { padding: 0 12px; }
  input, select, textarea { font-size: 16px; } /* iOS 上 <16px 会自动放大页面 */
}

/* —— 待办提醒 / 消息中心 —— */
.nav button { position: relative; }
.nav-dot {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; line-height: 1;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.bell-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted); cursor: pointer; transition: .16s ease; box-shadow: var(--shadow-xs);
}
.bell-btn:hover { color: var(--green); border-color: #d0d5db; box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.bell-btn svg { width: 19px; height: 19px; }
.bell-dot {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; line-height: 1;
  border: 1.5px solid var(--bg);
}
.notif-panel h2 { display: flex; align-items: center; gap: 8px; }
.notif-panel h2 svg { width: 18px; height: 18px; color: var(--muted); }
.notif-count {
  margin-left: 4px; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--soft-red); color: var(--red); font-size: 12px;
}
.notif-list { display: grid; gap: 8px; margin-top: 10px; }
.notif-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 1px solid var(--line); border-left: 3px solid var(--faint);
  border-radius: var(--radius); background: var(--panel); padding: 12px 14px; cursor: pointer; transition: .16s ease; box-shadow: var(--shadow-xs);
}
.notif-item:hover { background: #fbfcfd; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.notif-item.urgent { border-left-color: var(--red); }
.notif-item.warn { border-left-color: var(--amber); }
.notif-item.info { border-left-color: var(--blue); }
.notif-ic {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; background: var(--soft-blue); color: var(--blue);
}
.notif-item.urgent .notif-ic { background: var(--soft-red); color: var(--red); }
.notif-item.warn .notif-ic { background: var(--soft-amber); color: var(--amber); }
.notif-ic svg { width: 18px; height: 18px; }
.notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-body strong { font-size: 14px; font-weight: 600; color: var(--text); }
.notif-body small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.notif-go { flex-shrink: 0; color: var(--faint); }
.notif-go svg { width: 18px; height: 18px; }

/* —— 页面切换的轻量转场（淡入 + 轻微上移）—— */
@keyframes viewEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
#app.view-enter { animation: viewEnter .65s cubic-bezier(.22, .61, .36, 1) both; }
/* 顶栏标题也跟着轻轻过渡，切换更有整体感 */
.topbar h1 { transition: opacity .65s ease; }

/* —— 图标 hover：鼠标划过可点击元素时，图标轻微浮起 + 柔和投影（克制、高级）—— */
svg { transition: filter .2s ease, transform .2s ease; }
button:hover svg, a:hover svg, .row:hover svg, .metric:hover svg, .guide-step:hover svg, .notif-item:hover svg {
  filter: drop-shadow(0 1px 2px rgba(16, 24, 40, .16));
  transform: translateY(-1px);
}
.nav button:hover svg, .nav button.active svg { filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .3)); }

/* —— 学生档案分区：统一分隔标题 + 折叠输入表单 —— */
.dsec { margin-top: 18px; padding-top: 14px; border-top: 0.5px solid var(--line); }
.dsec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.dsec-h > span:first-child { font-size: 14px; font-weight: 500; color: var(--text); }
.dsec-r { font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; }
summary.add-link { cursor: pointer; color: var(--green); font-size: 13px; list-style: none; padding: 3px 0; display: inline-block; }
summary.add-link::-webkit-details-marker { display: none; }
summary.add-link::before { content: "▸ "; }
details[open] > summary.add-link::before { content: "▾ "; }

/* —— 新保存的意向学员卡片：滚动到位后高亮闪一下 —— */
@keyframes flashHi {
  0%, 20% { box-shadow: 0 0 0 2px var(--green-fill); border-color: var(--green-fill); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.flash-new { animation: flashHi 2.2s ease; }
/* 导航高亮平滑一点 */
.nav button { transition: background .18s ease, color .18s ease, border-color .18s ease; }
/* 尊重系统「减弱动态效果」设置：关闭转场动画 */
@media (prefers-reduced-motion: reduce) {
  #app.view-enter { animation: none; }
}
