/* 学时 · 视觉皮肤：只改样式，不改布局与顺序 */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f3f3f1;
  --surface-3: #ececea;
  --fg: #14161a;
  --fg-2: #565b64;
  --fg-3: #8b8f97;
  --line: rgba(20, 22, 26, 0.08);
  --line-strong: rgba(20, 22, 26, 0.16);
  --accent: #0f9d6e;
  --accent-2: #0b8a60;
  --accent-ink: #ffffff;
  --accent-soft: rgba(15, 157, 110, 0.1);
  --danger: #c34837;
  --danger-soft: rgba(195, 72, 55, 0.1);
  --inv: #14161a;
  --inv-fg: #fafaf9;
  --glass: rgba(250, 250, 249, 0.76);
  --glass-line: rgba(20, 22, 26, 0.08);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.1);
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.4, 0, 1, 1);
  --nav-h: 64px;
}
html[data-theme="dark"] {
  --bg: #0e0f11;
  --surface: #15171a;
  --surface-2: #1c1f23;
  --surface-3: #23272c;
  --fg: #f2f3f5;
  --fg-2: #b3b7be;
  --fg-3: #858a92;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #7fd8b4;
  --accent-2: #9be6c6;
  --accent-ink: #0d2a20;
  --accent-soft: rgba(127, 216, 180, 0.12);
  --glass: rgba(14, 15, 17, 0.72);
  --inv: #f2f3f5;
  --inv-fg: #0e0f11;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

/* 标题：更大、更紧的字距 */
.h1 {
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 740;
}
.h2 { font-size: 18px; letter-spacing: -0.02em; font-weight: 650; }
.h3 { font-size: 15px; letter-spacing: -0.01em; font-weight: 600; }
.eyebrow { font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-3); }

/* 卡片：统一 16 圆角、发丝线、轻阴影 */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: none;
  transition: box-shadow 240ms var(--ease-soft), border-color 240ms var(--ease-soft);
}
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }

/* 按钮：胶囊、按压反馈 */
.btn {
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 140ms var(--ease-soft), box-shadow 240ms var(--ease-soft), background 240ms var(--ease-soft);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

/* 输入：12 圆角、聚焦描边 */
input, textarea, select {
  border-radius: var(--radius-sm);
  transition: border-color 200ms var(--ease-soft), box-shadow 200ms var(--ease-soft);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* 筛选 chip */
.chip {
  border-radius: 999px;
  transition: background 200ms var(--ease-soft), color 200ms var(--ease-soft), border-color 200ms var(--ease-soft);
}

/* 底栏：悬浮胶囊 + 模糊 + 轻阴影 */
.tabbar {
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.fab {
  border-radius: 999px;
  box-shadow: var(--shadow);
}

/* 列表行：发丝分隔 */
.li { border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }

/* 页面入场：轻微上移 */
.page { animation: xs-page 320ms var(--ease-soft) both; }
@keyframes xs-page { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 纸纹质感，极轻 */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 999; pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='120' height='120' filter='url(%23n)'/></svg>");
}
html[data-theme="dark"] body::after { opacity: 0.05; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- 登录页 ---------- */
.auth { padding: 48px 20px 40px; min-height: 100dvh; display: flex; align-items: center; justify-content: center; }
.auth-card {
  width: 100%; max-width: 420px;
  padding: 28px 24px 24px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-card .brand { gap: 12px; }
.auth-card .brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--ink); color: var(--bg); display: grid; place-items: center; }
.auth-card .brand-name { font-size: 24px; font-weight: 760; letter-spacing: -0.02em; line-height: 1.1; }
.auth-card .brand-sub { font-size: 9.5px; letter-spacing: 0.18em; color: var(--fg-3); margin-top: 2px; }
.auth-card .tabs {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface-2); border-radius: 999px; border: 0;
}
.auth-card .tabs button {
  flex: 1; height: 36px; border-radius: 999px;
  font-size: 13px; color: var(--fg-3); background: transparent;
  transition: background 200ms var(--ease-soft), color 200ms var(--ease-soft);
}
.auth-card .tabs button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.auth-card .field { margin-top: 16px; }
.auth-card .input, .auth-card input { height: 48px; background: var(--surface-2); border-color: transparent; }
.auth-card .input:focus, .auth-card input:focus { background: var(--surface); border-color: var(--accent); }
.auth-card .btn-primary { width: 100%; height: 48px; margin-top: 20px; font-size: 15px; }

/* ---------- 设置页 ---------- */
.wrap .topbar { margin-bottom: 8px; }
.wrap .card { animation: xs-page 320ms var(--ease-soft) both; }
.wrap .li { border-bottom: 1px solid var(--line); }
.wrap .btn { border-radius: 999px; }
.wrap .select, .wrap .input { border-radius: var(--radius-sm); }

/* ---------- 加载态：细线条流光，替代大灰块 ---------- */
.skeleton, .sk, .skeleton-block, [class*="skeleton"] {
  height: 10px !important;
  margin: 10px 0 !important;
  border-radius: 6px !important;
  background: linear-gradient(90deg, var(--surface-2) 20%, var(--surface-3) 40%, var(--surface-2) 60%) !important;
  background-size: 220% 100% !important;
  animation: xs-shimmer 1.25s ease-in-out infinite !important;
  opacity: 0.9;
}
.skeleton:nth-of-type(2n) { width: 82% !important; }
.skeleton:nth-of-type(3n) { width: 64% !important; }
@keyframes xs-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) {
  .skeleton, .sk, .skeleton-block, [class*="skeleton"] { animation: none !important; }
}

/* 登录页：班级码字段永远不显示（含切换 tab 的瞬间） */
.auth .field:has(input[autocomplete="organization"]),
.auth label:has(input[autocomplete="organization"]) { display: none !important; }

/* 登录页品牌图标放大 */
.auth-card .brand-mark { width: 48px !important; height: 48px !important; border-radius: 14px !important; }
.auth-card .brand-mark svg { width: 26px !important; height: 26px !important; }
.auth-card .brand-name { font-size: 27px !important; }

/* 修复：页面容器不能有 transform，否则内部 fixed 弹层会错位 */
.page, .shell, .main { transform: none !important; }
.page { animation: xs-fade-in 260ms var(--ease-soft) both !important; }
@keyframes xs-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* 登录图标再放大，文字尺寸不变 */
.auth-card .brand-mark { width: 56px !important; height: 56px !important; border-radius: 16px !important; }
.auth-card .brand-mark svg { width: 32px !important; height: 32px !important; }
.auth-card .brand-name { font-size: 24px !important; }

/* 弹层打开时，页面容器一律不允许 transform（防止 fixed 被降级为相对定位） */
html.sheet-open .page,
html.sheet-open .shell,
html.sheet-open .main,
html.sheet-open .view,
html.sheet-open .content { transform: none !important; animation: none !important; }

/* 彻底关闭会留下 identity transform 的页面动画（它会让 fixed 弹层错位） */
.page, .page-enter-active, .page-leave-active, .page-enter-from, .page-leave-to,
.view, .main, .shell {
  animation: none !important;
  transform: none !important;
}

/* 高优先级：覆盖旧版 scoped 动画，避免 fixed 弹层错位 */
html body #app .page,
html body #app .page[class],
html body #app .view,
html body #app .main { animation: none !important; transform: none !important; }
