/* ==========================================================================
   星月屿云错题 · 样式表
   设计参考：星月屿MC  /  主色 #165DFF · 浅蓝 #E8F3FF · 简约圆角卡片
   背景：static/img/bg.jpg（可在设置中替换）
   ========================================================================== */

:root {
  /* 主色板 */
  --main-blue: #165dff;
  --light-blue: #e8f3ff;
  --deep-blue: #0e42bc;
  --blue-grad: linear-gradient(135deg, #165dff, #4080ff);
  --blue-grad-soft: linear-gradient(135deg, #eef5ff, #f7fbff);

  /* 文本 */
  --text-dark: #1d2129;
  --text-grey: #4e5969;
  --soft-grey: #86909c;
  --border-color: #e5e8ef;

  /* 语义色（统一低饱和） */
  --ok: #00b42a;
  --warn: #ff9a2e;
  --danger: #f53f3f;

  /* 面板 */
  --white: #ffffff;
  --panel: rgba(255, 255, 255, .92);
  --panel-solid: #ffffff;
  --panel-soft: #f7faff;

  /* 别名（沿用旧变量名，兼容既有组件） */
  --brand: var(--main-blue);
  --brand-2: #4080ff;
  --brand-soft: var(--light-blue);
  --bg: #f0f6ff;
  --bg-2: #eef4fd;
  --card: var(--panel-solid);
  --card-2: var(--panel-soft);
  --ink: var(--text-dark);
  --ink-2: var(--text-grey);
  --muted: #6b7785;
  --faint: var(--soft-grey);
  --line: var(--border-color);
  --line-2: #dfe5ef;
  --radius: 14px;
  --radius-sm: 10px;
  --card-shadow: 0 4px 18px rgba(22, 93, 255, .07);
  --hover-shadow: 0 8px 24px rgba(22, 93, 255, .13);
  --shadow: var(--card-shadow);
  --shadow-lg: 0 12px 34px rgba(22, 93, 255, .16);
  --sidebar: 236px;
  --ease: cubic-bezier(.22, .8, .3, 1);
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei UI",
    "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

/* ---------------------------- 深色模式 ---------------------------- */
[data-theme="dark"] {
  --main-blue: #4c8dff;
  --light-blue: rgba(76, 141, 255, .16);
  --deep-blue: #99c0ff;
  --text-dark: #eaf0fb;
  --text-grey: #b6c2d6;
  --soft-grey: #7d8aa0;
  --border-color: #232b3a;
  --white: #141a25;
  --panel: rgba(20, 26, 37, .90);
  --panel-solid: #141a25;
  --panel-soft: #19212f;
  --brand: var(--main-blue);
  --brand-2: #7aa9ff;
  --brand-soft: rgba(76, 141, 255, .16);
  --bg: #0a0f18;
  --bg-2: #131a26;
  --card: var(--panel-solid);
  --card-2: var(--panel-soft);
  --ink: var(--text-dark);
  --ink-2: var(--text-grey);
  --muted: #93a1b5;
  --faint: var(--soft-grey);
  --line: var(--border-color);
  --line-2: #2a3446;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, .35);
  --hover-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  --shadow: var(--card-shadow);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

/* 关键：带 hidden 属性的容器必须完全不占位，否则 #authRoot 与 .app 各占一屏导致页面多出空白 */
[hidden] { display: none !important; }

/* ---------------------------- 背景 ---------------------------- */
html {
  height: 100%;
  /* 渐变兜底，图片加载前不会突兀 */
  background: linear-gradient(160deg, #f3f9ff 0%, #e8f2ff 50%, #dce9ff 100%);
  background-color: #eaf2ff;
}
[data-theme="dark"] html {
  background: linear-gradient(160deg, #0a1220 0%, #070b12 100%);
  background-color: #070b12;
}

/* 背景图层：小图先显示，大图加载后淡入 */
#bgLayer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  pointer-events: none;
  opacity: 0;
  transition: opacity .8s cubic-bezier(.4,0,.2,1);
}
#bgLayer.is-loaded { opacity: 1; }

[data-theme="dark"] #bgLayer { filter: brightness(.32) saturate(1.2); }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--sans);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(240, 246, 255, .82) 0%, rgba(247, 250, 255, .90) 38%, rgba(247, 249, 252, .94) 100%);
}
[data-theme="dark"] body {
  background:
    linear-gradient(180deg, rgba(8, 13, 22, .84) 0%, rgba(10, 15, 24, .92) 40%, rgba(10, 15, 24, .95) 100%);
}

::selection { background: rgba(22, 93, 255, .18); }

a { color: var(--main-blue); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; line-height: 1.4; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cfdcf0; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b3c6e3; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2c374a; background-clip: content-box; }

/* ============================ 布局 ============================ */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--panel);
  backdrop-filter: blur(18px) saturate(140%);
  border-right: 1px solid rgba(229, 232, 239, .9);
  box-shadow: 2px 0 18px rgba(22, 93, 255, .05);
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.brand__logo {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 10px;
  background: var(--blue-grad);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(22, 93, 255, .28);
}
.brand__logo svg { width: 21px; height: 21px; }
.brand__text { min-width: 0; }
.brand__title {
  font-size: 17px; font-weight: 700; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--blue-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand__sub { font-size: 11px; color: var(--soft-grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__label {
  font-size: 11px; color: var(--soft-grey); font-weight: 600;
  padding: 14px 12px 5px; letter-spacing: .04em;
}
.nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--text-grey);
  font-weight: 500;
  font-size: 13.5px;
  border: 0;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav__item svg { width: 17px; height: 17px; flex: 0 0 17px; opacity: .75; }
.nav__item:hover { background: rgba(22, 93, 255, .06); color: var(--main-blue); }
.nav__item.is-active { background: var(--light-blue); color: var(--main-blue); font-weight: 600; }
.nav__item.is-active svg { opacity: 1; }
.nav__badge {
  margin-left: auto;
  background: var(--main-blue); color: #fff;
  font-size: 10.5px; font-weight: 600;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; display: grid; place-items: center;
}
.nav__item.is-active .nav__badge { background: var(--main-blue); }
.nav__badge[hidden], 

.sidebar__foot { margin-top: auto; padding-top: 10px; }

.userchip {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid var(--line);
  width: 100%;
  text-align: left;
  transition: all .18s var(--ease);
}
.userchip:hover { border-color: rgba(22, 93, 255, .35); background: var(--light-blue); }
.userchip__avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--light-blue);
  display: grid; place-items: center; font-size: 16px;
  flex: 0 0 30px;
}
.userchip__name { font-weight: 600; font-size: 13px; line-height: 1.25; }
.userchip__meta { font-size: 11px; color: var(--soft-grey); }

.main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 20px 20px;
  max-width: none;
  width: 100%;
}

/* 首页全宽无内边距 */
.main.main--full { padding: 14px 18px 14px; }

.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.topbar__grow { flex: 1 1 auto; min-width: 0; }
.topbar h1 { font-size: 23px; letter-spacing: -.025em; }
.topbar__desc { color: var(--text-grey); font-size: 13px; margin-top: 2px; }

.page { animation: fadeUp .3s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============================ 通用组件 ============================ */
.card {
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(229, 232, 239, .85);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 20px;
  transition: box-shadow .24s var(--ease);
}
.card:hover { box-shadow: var(--hover-shadow); }
.card--pad0 { padding: 0; }
.card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card__title {
  font-size: 14.5px; font-weight: 600; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 8px;
}
.card__title::before {
  content: ""; width: 4px; height: 15px; border-radius: 2px;
  background: var(--blue-grad); flex: 0 0 4px;
}
.card__sub { font-size: 12px; color: var(--soft-grey); }

.grid { display: grid; gap: 16px; }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 10px; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1 1 auto; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--text-grey);
  font-weight: 500; font-size: 13px;
  transition: all .2s var(--ease);
  white-space: nowrap;
  user-select: none;
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { color: var(--main-blue); border-color: rgba(22, 93, 255, .4); background: #fbfdff; }
.btn:active { transform: translateY(-1px); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn--primary {
  background: var(--blue-grad);
  border-color: transparent; color: #fff;
  box-shadow: 0 3px 10px rgba(22, 93, 255, .22);
}
.btn--primary:hover { color: #fff; background: var(--blue-grad); filter: brightness(1.05); box-shadow: 0 5px 16px rgba(22, 93, 255, .3); transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--soft-grey); }
.btn--ghost:hover { background: rgba(22, 93, 255, .07); color: var(--main-blue); border-color: transparent; }
.btn--soft { background: var(--light-blue); border-color: transparent; color: var(--main-blue); }
.btn--soft:hover { background: #dbeaff; color: var(--main-blue); border-color: transparent; }
.btn--danger { color: var(--danger); border-color: rgba(245, 63, 63, .3); background: #fff; }
.btn--danger:hover { background: rgba(245, 63, 63, .06); border-color: var(--danger); color: var(--danger); }
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn--sm svg { width: 14px; height: 14px; }
.btn--lg { height: 44px; padding: 0 20px; font-size: 14.5px; border-radius: 9px; }
.btn--block { width: 100%; }
.btn--icon { width: 36px; padding: 0; }
.btn--sm.btn--icon { width: 30px; }

/* 表单 */
.input, .select, .textarea {
  width: 100%;
  background: #fbfdff;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  padding: 9px 11px;
  outline: none;
  transition: all .2s var(--ease);
  font-size: 13.5px;
  color: var(--ink);
}
.input::placeholder, .textarea::placeholder { color: #a9b4c4; }
.input:hover, .select:hover, .textarea:hover { border-color: #c9d8ee; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--main-blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(22, 93, 255, .1);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.7; }
.select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2386909c' stroke-width='2.2' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
  padding-right: 30px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12.5px; font-weight: 500; color: var(--text-grey); display: flex; align-items: center; gap: 6px; }
.field__hint { font-size: 11.5px; color: var(--soft-grey); font-weight: 400; }
.field__label .req { color: var(--danger); }

/* 标签 */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11.5px; font-weight: 500;
  background: var(--light-blue); color: var(--main-blue);
  white-space: nowrap;
}
.tag--muted { background: #f2f4f8; color: var(--text-grey); }
.tag--ok { background: rgba(0, 180, 42, .1); color: var(--ok); }
.tag--warn { background: rgba(255, 154, 46, .13); color: #c26a00; }
.tag--danger { background: rgba(245, 63, 63, .09); color: var(--danger); }
[data-theme="dark"] .tag--muted { background: #1d2634; color: var(--text-grey); }
[data-theme="dark"] .tag--ok { color: #4ade80; }
[data-theme="dark"] .tag--warn { color: #fbbf24; }
[data-theme="dark"] .tag--danger { color: #f87171; }

/* 胶囊筛选 */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, .75);
  color: var(--text-grey);
  font-size: 12.5px; font-weight: 500;
  transition: all .2s var(--ease);
  white-space: nowrap;
}
.pill:hover { border-color: rgba(22, 93, 255, .45); color: var(--main-blue); background: #fff; }
.pill.is-on { background: var(--main-blue); border-color: var(--main-blue); color: #fff; box-shadow: 0 3px 10px rgba(22, 93, 255, .22); }
.pill.is-on:hover { color: #fff; }

/* 进度条 */
.bar { height: 5px; border-radius: 99px; background: rgba(22, 93, 255, .1); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 99px; background: var(--blue-grad); transition: width .5s var(--ease); }
.bar__fill.is-weak { background: linear-gradient(90deg, #ff9a2e, #f53f3f); }
.bar__fill.is-mid { background: linear-gradient(90deg, #ffc53d, #ff9a2e); }
.bar__fill.is-ok { background: linear-gradient(90deg, #23c343, #00b42a); }

/* 空状态 */
.empty { text-align: center; padding: 50px 20px; color: var(--text-grey); }
.empty__icon { font-size: 40px; margin-bottom: 10px; opacity: .95; }
.empty__title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.empty__desc { font-size: 13px; margin-bottom: 16px; color: var(--soft-grey); }

/* 骨架 */
.skeleton { background: linear-gradient(90deg, #eef3fa 25%, #f8fbff 37%, #eef3fa 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #171f2b 25%, #1e2836 37%, #171f2b 63%); background-size: 400% 100%; }

/* ============================ 仪表盘 ============================ */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  padding: 26px 28px;
  background: linear-gradient(135deg, #e8f3ff 0%, #f3f9ff 52%, #ffffff 100%);
  border: 1px solid rgba(22, 93, 255, .14);
  box-shadow: 0 6px 24px rgba(22, 93, 255, .09);
  margin-bottom: 16px;
}
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, rgba(22, 93, 255, .18) 0%, rgba(20, 26, 37, .9) 60%);
  border-color: rgba(76, 141, 255, .2);
}
.hero::after {
  content: "";
  position: absolute; right: -120px; top: -130px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(22, 93, 255, .10), transparent 70%);
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.hero__text { flex: 1 1 320px; min-width: 240px; }
.hero__eyebrow { font-size: 12px; color: var(--main-blue); font-weight: 600; letter-spacing: .02em; }
.hero__title { font-size: 22px; margin: 5px 0 7px; letter-spacing: -.02em; color: var(--text-dark); }
.hero__desc { font-size: 13.5px; color: var(--text-grey); max-width: 560px; line-height: 1.75; }
.hero__desc b { color: var(--main-blue); }
.hero__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 15px; }
.hero .btn { background: #fff; border-color: rgba(22, 93, 255, .2); color: var(--main-blue); }
.hero .btn:hover { background: #fff; border-color: rgba(22, 93, 255, .45); color: var(--main-blue); }
.hero .btn--white {
  background: var(--blue-grad); border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 4px 14px rgba(22, 93, 255, .26);
}
.hero .btn--white:hover { background: var(--blue-grad); color: #fff; filter: brightness(1.06); }
.hero__ring { display: flex; align-items: center; flex: 0 0 auto; }
.ring { position: relative; width: 96px; height: 96px; flex: 0 0 96px; }
.ring svg { display: block; width: 96px; height: 96px; transform: rotate(-90deg); }
.ring__label {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; text-align: center; pointer-events: none;
}
.ring__num { font-size: 19px; font-weight: 700; line-height: 1; color: var(--text-dark); letter-spacing: -.02em; }
.ring__cap { font-size: 9.5px; color: var(--soft-grey); line-height: 1; white-space: nowrap; }

.stat {
  display: flex; flex-direction: column; gap: 3px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(229, 232, 239, .85);
  box-shadow: var(--card-shadow);
  position: relative;
  overflow: hidden;
  transition: all .24s var(--ease);
}
.stat:hover { box-shadow: var(--hover-shadow); transform: translateY(-2px); }
.stat__top { display: flex; align-items: center; gap: 8px; }
.stat__icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; font-size: 15px;
  background: var(--light-blue);
}
.stat__label { font-size: 12.5px; color: var(--text-grey); font-weight: 500; }
.stat__num { font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; color: var(--text-dark); }
.stat__num small { font-size: 12.5px; font-weight: 500; color: var(--soft-grey); margin-left: 3px; }
.stat__foot { font-size: 11.5px; color: var(--soft-grey); }
.stat--due .stat__icon { background: rgba(245, 63, 63, .09); }
.stat--ok .stat__icon { background: rgba(0, 180, 42, .1); }
.stat--streak .stat__icon { background: rgba(255, 154, 46, .12); }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--soft-grey); }
.legend__dot { width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-right: 5px; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(229, 232, 239, .7); }
.list-row:last-child { border-bottom: 0; }
.list-row__main { min-width: 0; flex: 1 1 auto; }
.list-row__title { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.list-row__meta { font-size: 11.5px; color: var(--soft-grey); }
.list-row:hover { background: rgba(22, 93, 255, .03); border-radius: 8px; }

.kn-chip { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 9px; background: var(--card-2); border: 1px solid var(--line); }
.kn-chip:hover { border-color: rgba(22, 93, 255, .4); }

/* ============================ 列表 ============================ */
.toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(229, 232, 239, .85);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  margin-bottom: 16px;
}
.search { position: relative; flex: 1 1 260px; min-width: 190px; max-width: 400px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--soft-grey); }
.search input { padding-left: 32px; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; }

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

.mcard {
  position: relative;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(229, 232, 239, .85);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  box-shadow: var(--card-shadow);
  display: flex; flex-direction: column; gap: 9px;
  transition: all .24s var(--ease);
  overflow: hidden;
  cursor: pointer;
}
.mcard:hover { transform: translateY(-2px); box-shadow: var(--hover-shadow); border-color: rgba(22, 93, 255, .28); }
.mcard__stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--main-blue); }
.mcard__head { display: flex; align-items: flex-start; gap: 8px; }
.mcard__title { font-size: 14px; font-weight: 600; line-height: 1.5; flex: 1 1 auto; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mcard__q { font-size: 12.5px; color: var(--text-grey); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mcard__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.mcard__foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 4px; }
.mcard__thumb { width: 44px; height: 44px; border-radius: 7px; object-fit: cover; border: 1px solid var(--line); }
.mcard__stat { font-size: 11.5px; color: var(--soft-grey); display: inline-flex; align-items: center; gap: 3px; }
.mcard__stat svg { width: 12px; height: 12px; }
.mcard__check { position: absolute; top: 12px; right: 12px; }

.mastery { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--soft-grey); }
.mastery .bar { flex: 1 1 auto; }

/* ============================ 复习 ============================ */
.study-wrap { max-width: 820px; margin: 0 auto; }
.study-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.study-bar .bar { flex: 1 1 auto; height: 6px; }

.flash {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(229, 232, 239, .9);
  border-radius: var(--radius);
  box-shadow: 0 10px 34px rgba(22, 93, 255, .1);
  overflow: hidden;
  animation: fadeUp .28s var(--ease);
}
.flash__head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 13px 20px;
  border-bottom: 1px solid rgba(229, 232, 239, .8);
  background: rgba(247, 250, 255, .8);
}
.flash__body { padding: 22px 24px; }
.flash__q { font-size: 16px; line-height: 1.85; font-weight: 500; white-space: pre-wrap; word-break: break-word; }
.flash__img { margin: 14px 0; border-radius: 9px; border: 1px solid var(--line); overflow: hidden; cursor: zoom-in; }
.flash__img img { width: 100%; max-height: 400px; object-fit: contain; background: var(--card-2); }

.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.answer-box { padding: 13px 15px; border-radius: 9px; border: 1px solid var(--line); background: #fbfdff; }
.answer-box--bad { border-color: rgba(245, 63, 63, .22); background: rgba(245, 63, 63, .035); }
.answer-box--good { border-color: rgba(0, 180, 42, .24); background: rgba(0, 180, 42, .04); }
.answer-box__label { font-size: 11.5px; font-weight: 600; margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }
.answer-box--bad .answer-box__label { color: var(--danger); }
.answer-box--good .answer-box__label { color: #009a25; }
.answer-box__text { font-size: 13.5px; white-space: pre-wrap; word-break: break-word; line-height: 1.75; color: var(--ink); }

.analysis {
  margin-top: 14px; padding: 15px 17px; border-radius: 9px;
  background: var(--light-blue);
  border: 1px solid rgba(22, 93, 255, .12);
}
.analysis__label { font-size: 12px; font-weight: 600; color: var(--main-blue); margin-bottom: 6px; display: flex; align-items: center; gap: 5px; }
.analysis__body { font-size: 13.5px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; color: var(--text-grey); }

.grade-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px;
  padding: 15px 20px 18px; border-top: 1px solid rgba(229, 232, 239, .8);
  background: rgba(247, 250, 255, .8);
}
.grade-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 11px 6px;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: #fff;
  transition: all .2s var(--ease);
  font-weight: 500;
}
.grade-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(22, 93, 255, .12); border-color: var(--main-blue); }
.grade-btn__key { font-size: 10.5px; color: var(--soft-grey); }
.grade-btn__label { font-size: 13px; }
.grade-btn__hint { font-size: 10.5px; color: var(--soft-grey); }
.grade-btn--0:hover { border-color: var(--danger); color: var(--danger); }
.grade-btn--1:hover { border-color: var(--warn); color: #c26a00; }
.grade-btn--2:hover { border-color: var(--main-blue); color: var(--main-blue); }
.grade-btn--3:hover { border-color: var(--ok); color: #009a25; }

.reveal-hint { text-align: center; padding: 20px; }
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 4px; border: 1px solid var(--line-2);
  background: #fff; font-family: var(--mono); font-size: 11px; color: var(--text-grey);
}

.done-card { text-align: center; padding: 36px 22px; }
.done-emoji { font-size: 48px; margin-bottom: 8px; }
.done-stats { display: flex; justify-content: center; gap: 32px; margin: 22px 0 24px; flex-wrap: wrap; }
.done-stat__num { font-size: 24px; font-weight: 700; letter-spacing: -.03em; color: var(--text-dark); }
.done-stat__label { font-size: 12px; color: var(--soft-grey); }

/* ============================ 编辑器 ============================ */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 306px; gap: 16px; align-items: start; }
.editor__main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.editor__side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 18px; }

.dropzone {
  border: 1.5px dashed #c3d6f0;
  border-radius: 9px;
  padding: 18px;
  text-align: center;
  color: var(--text-grey);
  background: #fbfdff;
  transition: all .2s var(--ease);
  cursor: pointer;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--main-blue); background: var(--light-blue); color: var(--main-blue); }
.dropzone__icon { font-size: 22px; margin-bottom: 4px; }
.dropzone__text { font-size: 12.5px; }
.dropzone__hint { font-size: 11px; color: var(--soft-grey); margin-top: 3px; }

.img-preview { position: relative; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }
.img-preview img { width: 100%; max-height: 280px; object-fit: contain; background: var(--card-2); }
.img-preview__del { position: absolute; top: 8px; right: 8px; }

.stars { display: flex; gap: 3px; }
.star { font-size: 19px; line-height: 1; color: #dfe5ef; background: none; border: 0; padding: 0; transition: transform .14s; }
.star:hover { transform: scale(1.15); }
.star.is-on { color: #ff9a2e; }

.smart-panel {
  border: 1px solid rgba(22, 93, 255, .18);
  background: linear-gradient(160deg, #eef5ff, #ffffff 75%);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--card-shadow);
}
[data-theme="dark"] .smart-panel { background: linear-gradient(160deg, rgba(22, 93, 255, .14), rgba(20, 26, 37, .9)); }
.smart-panel__head { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; color: var(--main-blue); margin-bottom: 9px; }
.smart-panel__head svg { width: 15px; height: 15px; }
.smart-line { display: flex; align-items: flex-start; gap: 7px; font-size: 12.5px; padding: 5px 0; color: var(--text-grey); }
.smart-line b { color: var(--ink); font-weight: 600; }
.smart-line svg { width: 14px; height: 14px; flex: 0 0 14px; margin-top: 2px; color: var(--main-blue); }
.smart-similar {
  display: flex; align-items: center; gap: 7px; padding: 6px 8px;
  border-radius: 7px; background: #fff; border: 1px solid var(--line);
  font-size: 12px; margin-top: 5px; color: var(--text-grey);
}
.smart-similar:hover { border-color: var(--main-blue); color: var(--main-blue); }

/* ============================ 知识图谱 ============================ */
.kn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.kn-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(229, 232, 239, .9);
  background: var(--panel);
  backdrop-filter: blur(8px);
  box-shadow: var(--card-shadow);
  display: flex; flex-direction: column; gap: 8px;
  cursor: pointer;
  transition: all .22s var(--ease);
}
.kn-card:hover { transform: translateY(-2px); box-shadow: var(--hover-shadow); border-color: rgba(22, 93, 255, .3); }
.kn-card__head { display: flex; align-items: center; gap: 7px; }
.kn-card__name { font-weight: 600; font-size: 13.5px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kn-card__num { font-size: 21px; font-weight: 700; letter-spacing: -.03em; color: var(--text-dark); }
.kn-card__num small { font-size: 11px; color: var(--soft-grey); font-weight: 400; margin-left: 2px; }

.subject-section { margin-bottom: 20px; }
.subject-section__head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.subject-section__name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.subject-section__name::before {
  content: ""; width: 4px; height: 15px; border-radius: 2px; background: var(--blue-grad);
}
.subject-section__count { font-size: 12px; color: var(--soft-grey); }

/* ============================ 统计 ============================ */
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; overflow-x: auto; padding-bottom: 2px; }
.heat__cell { width: 10px; height: 10px; border-radius: 2px; background: rgba(22, 93, 255, .07); transition: transform .1s; }
.heat__cell:hover { transform: scale(1.4); outline: 1px solid var(--main-blue); }
.heat__cell[data-l="1"] { background: rgba(22, 93, 255, .22); }
.heat__cell[data-l="2"] { background: rgba(22, 93, 255, .42); }
.heat__cell[data-l="3"] { background: rgba(22, 93, 255, .65); }
.heat__cell[data-l="4"] { background: var(--main-blue); }

.report {
  white-space: pre-wrap;
  font-size: 13px; line-height: 1.9; color: var(--text-grey);
  font-family: var(--sans);
  background: #fbfdff;
  border: 1px dashed #cbdcf3;
  border-radius: 9px;
  padding: 15px 17px;
  max-height: 400px; overflow: auto;
}

/* ============================ 设置 ============================ */
.setting-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(229, 232, 239, .7); }
.setting-row:last-child { border-bottom: 0; }
.setting-row__main { flex: 1 1 auto; min-width: 0; }
.setting-row__title { font-size: 13.5px; font-weight: 500; }
.setting-row__desc { font-size: 12px; color: var(--soft-grey); }

.switch { position: relative; width: 42px; height: 24px; flex: 0 0 42px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #dde3ec; transition: background .2s; cursor: pointer; }
.switch span::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: transform .2s var(--ease);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.switch input:checked + span { background: var(--main-blue); }
.switch input:checked + span::after { transform: translateX(18px); }

.subj-list { display: flex; flex-direction: column; gap: 7px; }
.subj-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: #fbfdff;
}
.subj-dot { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; flex: 0 0 22px; }

/* ============================ 弹层 ============================ */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(14, 33, 66, .34);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn .18s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(10, 34, 76, .22);
  width: 100%; max-width: 440px;
  max-height: 86vh; overflow: auto;
  animation: popIn .22s var(--ease);
  border: 1px solid rgba(229, 232, 239, .9);
}
[data-theme="dark"] .modal { background: #141a25; }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal--wide { max-width: 720px; }
.modal__head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.modal__title { font-size: 16px; font-weight: 600; }
.modal__body { padding: 15px 20px; }
.modal__foot { display: flex; justify-content: flex-end; gap: 9px; padding: 0 20px 18px; }

.toast-wrap { position: fixed; z-index: 200; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 15px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 10px 28px rgba(22, 93, 255, .15);
  font-size: 13px; font-weight: 500;
  animation: toastIn .26s var(--ease);
  max-width: 380px;
}
.toast--ok { border-color: rgba(0, 180, 42, .28); }
.toast--err { border-color: rgba(245, 63, 63, .3); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: all .2s; }

.lightbox { position: fixed; inset: 0; z-index: 150; background: rgba(6, 14, 28, .9); display: grid; place-items: center; padding: 28px; animation: fadeIn .18s; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 8px; }



.menu {
  position: absolute; z-index: 120;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 30px rgba(22, 93, 255, .16);
  padding: 5px; min-width: 164px;
  animation: popIn .16s var(--ease);
}
.menu__item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 7px; border: 0; background: none; text-align: left; font-size: 13px; font-weight: 500; color: var(--text-grey); }
.menu__item:hover { background: var(--light-blue); color: var(--main-blue); }
.menu__item svg { width: 14px; height: 14px; }
.menu__sep { height: 1px; background: var(--line); margin: 4px; }

/* ============================ 响应式 ============================ */
@media (max-width: 1180px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor__side { position: static; }
}

@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { padding: 16px 14px 86px; }
  .grid--3, .grid--2 { grid-template-columns: minmax(0, 1fr); }
  .topbar h1 { font-size: 20px; }
  .answer-grid { grid-template-columns: 1fr; }
  .grade-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 18px; }
  .hero__title { font-size: 19px; }
  .hero__ring { display: none; }
  .flash__body { padding: 16px; }
  .toast-wrap { left: 12px; right: 12px; bottom: 78px; }
  .toast { max-width: none; }
  
  [data-theme="dark"] 
  
  
  
  
  .mgrid { grid-template-columns: minmax(0, 1fr); }
  .stat__num { font-size: 22px; }
}

@media (max-width: 560px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 14px; border-radius: 12px; }
  .topbar { flex-wrap: wrap; }
  .toolbar { padding: 10px; }
  .grade-grid { padding: 12px 14px 15px; }
  .stat { padding: 13px 14px; }
}

@media print {
  html { background: #fff; }
  body { background: #fff; }
  .sidebar { display: none !important; }
  .main { padding: 0; }
  .card, .stat { box-shadow: none; border: 1px solid #e0e6ef; background: #fff; backdrop-filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ==========================================================================
   1.1 新增：登录页 / 试卷 / 专注计时
   ========================================================================== */

/* ---------------------------- 登录页 ---------------------------- */
#authRoot {
  height: 100vh; height: 100dvh; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 20px 18px;
}
/* 登录页不产生滚动 */
html.auth-mode { overflow: hidden; }
@media (max-height: 620px) {
  #authRoot { height: auto; min-height: 100vh; overflow: auto; align-items: flex-start; }
  html.auth-mode { overflow: auto; }
}
#authRoot[hidden] { display: none !important; }
.auth { width: 100%; max-width: 920px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        background: var(--panel); backdrop-filter: blur(16px); border: 1px solid rgba(229,232,239,.9);
        border-radius: 20px; box-shadow: 0 24px 60px rgba(22,93,255,.14); overflow: hidden; animation: fadeUp .34s var(--ease); }
.auth__panel { padding: 34px 36px; }
.auth__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth__title { font-size: 19px; font-weight: 700; letter-spacing: -.02em;
               background: var(--blue-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth__sub { font-size: 12.5px; color: var(--soft-grey); }
.auth__tabs { display: flex; gap: 4px; padding: 4px; background: var(--panel-soft);
              border: 1px solid var(--line); border-radius: 10px; margin-bottom: 22px; }
.auth__tab { flex: 1 1 0; height: 34px; border: 0; border-radius: 7px; background: transparent;
             color: var(--text-grey); font-size: 13.5px; font-weight: 500; transition: all .2s var(--ease); }
.auth__tab.is-on { background: #fff; color: var(--main-blue); font-weight: 600; box-shadow: 0 2px 8px rgba(22,93,255,.12); }
.auth__foot { margin-top: 16px; text-align: center; }
.auth__side { padding: 40px 36px; background: linear-gradient(150deg, #165dff, #2f7bff 55%, #40a9ff);
              color: #fff; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth__side::after { content: ""; position: absolute; right: -90px; bottom: -110px; width: 300px; height: 300px;
                     border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 68%); }
.auth__hero-title { font-size: 26px; font-weight: 700; line-height: 1.45; letter-spacing: -.02em;
                    margin-bottom: 22px; position: relative; z-index: 1; }
.auth__feat { display: flex; flex-direction: column; gap: 13px; font-size: 13px; line-height: 1.7;
              position: relative; z-index: 1; color: rgba(255,255,255,.92); }
.auth__feat b { color: #fff; font-weight: 600; }
@media (max-width: 820px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__side { display: none; }
  .auth__panel { padding: 26px 22px; }
}

/* ---------------------------- 试卷 ---------------------------- */
.quiz-card { transition: all .22s var(--ease); }
.quiz-card:hover { box-shadow: var(--hover-shadow); border-color: rgba(22,93,255,.28); transform: translateY(-2px); }
.ic { width: 13px; height: 13px; vertical-align: -2px; }

/* ---------------------------- 专注计时 ---------------------------- */
.focus-ring { position: relative; width: 240px; height: 240px; margin: 0 auto; }
.focus-ring svg { width: 240px; height: 240px; display: block; }
.focus-ring__label { position: absolute; inset: 0; display: flex; flex-direction: column;
                     align-items: center; justify-content: center; gap: 4px; }
.focus-ring__time { font-size: 44px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--text-dark); }
.focus-ring__status { font-size: 12.5px; color: var(--soft-grey); }
@media (max-width: 560px) {
  .focus-ring, .focus-ring svg { width: 200px; height: 200px; }
  .focus-ring__time { font-size: 36px; }
}
/* ==========================================================================
   登录成功 · 平滑下拉展开动画
   ========================================================================== */

/* 1) 登录卡片淡出并轻微上移 */
.auth--leaving {
  animation: authLeave .42s cubic-bezier(.4, 0, 1, 1) forwards;
  pointer-events: none;
}
@keyframes authLeave {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-28px) scale(.97); }
}

/* 2) 主界面从顶部像帘幕一样向下展开 */
.app--entering {
  animation: curtainDrop .72s cubic-bezier(.22, .9, .24, 1) both;
  transform-origin: top center;
}
@keyframes curtainDrop {
  0% {
    clip-path: inset(0 0 100% 0 round 0 0 20px 20px);
    opacity: 0;
    transform: translateY(-12px) scaleY(.985);
  }
  55% {
    clip-path: inset(0 0 22% 0 round 0 0 10px 10px);
    opacity: 1;
  }
  100% {
    clip-path: inset(0 0 0 0 round 0);
    opacity: 1;
    transform: none;
  }
}

/* 3) 侧边栏自左滑入 */
.app--entering .sidebar {
  animation: sidebarSlide .58s cubic-bezier(.22, .9, .24, 1) both;
  animation-delay: .12s;
}
@keyframes sidebarSlide {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: none; }
}

/* 4) 顶栏与内容整体下移淡入 */
.app--entering .main > #view > .page {
  animation: contentSettle .62s cubic-bezier(.22, .9, .24, 1) both;
  animation-delay: .18s;
}
@keyframes contentSettle {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: none; }
}

/* 5) 卡片逐层浮现 */
.reveal-item {
  animation: cardRise .62s cubic-bezier(.22, .9, .24, 1) both;
  animation-fill-mode: both;
}
/* 兜底：任何情况下内容都必须可见 */
.main .card, .main .stat, .main .hero, .main .dash-hero, .main .dash-kpi {
  opacity: 1;
}
@keyframes cardRise {
  from { opacity: 0; transform: translateY(18px) scale(.988); }
  to   { opacity: 1; transform: none; }
}

/* 6) 登录中锁定滚动，避免动画期间页面抖动 */
/* 动画期间不再锁滚动，避免动画未结束导致整页无法滚动 */

/* 7) 动画期间让壁纸做轻微视差放大，增强"展开"的纵深感 */
html.is-entering {
  background-size: 104% auto;
  transition: background-size .8s cubic-bezier(.22, .9, .24, 1);
}

/* 移动端底部标签栏一并升起 */
.app--entering ~ 
@keyframes tabbarRise {
  from { opacity: 0; transform: translateY(100%); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .app--entering, .app--entering .sidebar,
  .app--entering .main > #view > .page,
  .reveal-item, .auth--leaving { animation: none !important; }
}
/* ==========================================================================
   1.2 页面差异化：概览 / 错题本 / 试卷模式 各自独立的视觉语言
   ========================================================================== */

/* ---------- 概览页：仪表盘 · 深色数据条 + 网格 ---------- */
.dash-hero {
  position: relative;
  border-radius: 18px;
  padding: 26px 28px;
  background: linear-gradient(120deg, #0b2a6f 0%, #165dff 48%, #3d8bff 100%);
  color: #fff;
  overflow: hidden;
  box-shadow: 0 18px 42px -22px rgba(11, 42, 111, .9);
  margin-bottom: 14px;
}
.dash-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(120deg, #000 20%, transparent 85%);
  pointer-events: none;
}
.dash-hero::after {
  content: ""; position: absolute; right: -80px; top: -100px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.26), transparent 66%);
  pointer-events: none;
}
.dash-hero__in { position: relative; z-index: 1; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.dash-hero__main { flex: 1 1 340px; min-width: 260px; }
.dash-hero__eyebrow { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; opacity: .78; font-weight: 600; }
.dash-hero__title { font-size: 26px; font-weight: 700; margin: 6px 0 8px; letter-spacing: -.03em; line-height: 1.3; }
.dash-hero__desc { font-size: 13px; opacity: .9; max-width: 500px; line-height: 1.75; }
.dash-hero__desc b { color: #fff; background: rgba(255,255,255,.22); padding: 1px 7px; border-radius: 5px; }
.dash-hero__acts { display: flex; gap: 9px; margin-top: 18px; flex-wrap: wrap; }
.dash-hero__acts .btn { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #fff; backdrop-filter: blur(8px); }
.dash-hero__acts .btn:hover { background: rgba(255,255,255,.24); color: #fff; border-color: rgba(255,255,255,.55); }
.dash-hero__acts .btn--solid { background: #fff; color: #0b2a6f; border-color: #fff; font-weight: 700; }
.dash-hero__acts .btn--solid:hover { background: #f2f7ff; color: #0b2a6f; }
.dash-hero__gauge { display: flex; align-items: center; gap: 22px; flex: 0 0 auto; }

.dash-kpi { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 0;
            background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
            overflow: hidden; box-shadow: var(--card-shadow); margin-bottom: 16px; }
.dash-kpi__cell { padding: 18px 20px; position: relative; border-right: 1px solid var(--line); }
.dash-kpi__cell:last-child { border-right: 0; }
.dash-kpi__cell::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px;
                          border-radius: 0 3px 3px 0; background: var(--accent, var(--main-blue)); }
.dash-kpi__label { font-size: 11.5px; color: var(--soft-grey); letter-spacing: .04em; text-transform: uppercase; font-weight: 600; }
.dash-kpi__val { font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1.15; margin-top: 2px; color: var(--accent, var(--text-dark)); }
.dash-kpi__val small { font-size: 12px; font-weight: 600; color: var(--soft-grey); margin-left: 3px; }
.dash-kpi__foot { font-size: 11.5px; color: var(--soft-grey); margin-top: 3px; }

/* ---------- 错题本：列表化 · 左侧色条 + 紧凑行 ---------- */
.lb-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px;
           background: var(--panel); border: 1px solid var(--line); border-bottom: 0;
           border-radius: 16px 16px 0 0; }
.lb-head__title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.lb-head__count { font-size: 12px; color: var(--soft-grey); }
.lb-filters { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 18px;
              background: var(--panel); border: 1px solid var(--line); border-top: 0; border-bottom: 0; }
.lb-list { background: var(--panel); border: 1px solid var(--line); border-radius: 0 0 16px 16px;
           overflow: hidden; box-shadow: var(--card-shadow); }
.lb-row { display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px 14px 15px;
          border-bottom: 1px solid var(--line); position: relative; cursor: pointer;
          transition: background .16s var(--ease); }
.lb-row:last-child { border-bottom: 0; }
.lb-row:hover { background: rgba(22,93,255,.035); }
.lb-row__bar { width: 3px; border-radius: 2px; align-self: stretch; flex: 0 0 3px; background: var(--main-blue); }
.lb-row__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.lb-row__title { font-size: 13.5px; font-weight: 600; color: var(--text-dark); line-height: 1.5;
                 display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.lb-row__q { font-size: 12.5px; color: var(--text-grey); display: -webkit-box; -webkit-line-clamp: 1;
             -webkit-box-orient: vertical; overflow: hidden; }
.lb-row__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--soft-grey); }
.lb-row__side { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; flex: 0 0 auto; width: 118px; }
.lb-row__thumb { width: 38px; height: 38px; border-radius: 7px; object-fit: cover; border: 1px solid var(--line); flex: 0 0 38px; }
.lb-empty { padding: 46px 20px; text-align: center; color: var(--soft-grey); }

/* ---------- 试卷模式：卡片墙 · 顶部大标题区 ---------- */
.qz-band { display: flex; align-items: center; gap: 16px; padding: 18px 22px; margin-bottom: 16px;
           border-radius: 16px; background: linear-gradient(100deg, #eef5ff, #ffffff 62%);
           border: 1px solid #d8e6ff; box-shadow: var(--card-shadow); }
.qz-band__icon { width: 44px; height: 44px; border-radius: 12px; flex: 0 0 44px; display: grid; place-items: center;
                 background: var(--blue-grad); color: #fff; box-shadow: 0 6px 16px -8px var(--main-blue); }
.qz-band__title { font-size: 16px; font-weight: 700; }
.qz-band__desc { font-size: 12.5px; color: var(--text-grey); margin-top: 2px; }
.qz-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(286px, 1fr)); gap: 14px; }
.qz-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
           box-shadow: var(--card-shadow); transition: all .22s var(--ease); cursor: pointer;
           display: flex; flex-direction: column; position: relative; padding-top: 4px; }
.qz-tile::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
                   background: var(--tile-accent, var(--main-blue)); }
.qz-tile:hover { transform: translateY(-3px); box-shadow: var(--hover-shadow); border-color: rgba(22,93,255,.3); }
.qz-tile__body { padding: 18px 16px 14px; flex: 1 1 auto; }
.qz-tile__name { font-size: 15px; font-weight: 700; line-height: 1.45; margin-bottom: 8px;
                 display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qz-tile__note { font-size: 12px; color: var(--soft-grey); margin-bottom: 12px; min-height: 18px;
                 display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.qz-tile__stat { display: flex; align-items: baseline; gap: 6px; }
.qz-tile__num { font-size: 28px; font-weight: 800; letter-spacing: -.04em; color: var(--text-dark); line-height: 1; }
.qz-tile__unit { font-size: 12px; color: var(--soft-grey); }
.qz-tile__foot { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line);
                 background: rgba(247,250,255,.55); }

@media (max-width: 760px) {
  .dash-kpi { grid-template-columns: repeat(2, 1fr); }
  .dash-kpi__cell:nth-child(2) { border-right: 0; }
  .dash-kpi__cell:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .dash-hero__title { font-size: 21px; }
  .dash-hero__gauge { display: none; }
  .lb-row__side { width: 84px; }
  .qz-wall { grid-template-columns: 1fr; }
}
/* 内联图标（替换原 emoji） */
.ic-inline {
  width: 15px; height: 15px;
  display: inline-block;
  vertical-align: -2.5px;
  margin-right: 4px;
  opacity: .85;
  flex: 0 0 auto;
}
.card__title .ic-inline { width: 16px; height: 16px; color: var(--main-blue); opacity: 1; }
.btn .ic-inline, .pill .ic-inline { margin-right: 3px; }
.field__label .ic-inline { width: 13px; height: 13px; }
.field__label svg { width: 13px; height: 13px; flex: 0 0 13px; }
.answer-box__label .ic-inline { width: 13px; height: 13px; }
.analysis__label .ic-inline { width: 13px; height: 13px; }
.auth__feat .ic-inline { width: 15px; height: 15px; opacity: .95; }
.hero .ic-inline, .dash-hero .ic-inline { color: currentColor; opacity: 1; }
/* 空状态 / 数据卡 / 头像中的内联图标尺寸修正 */
.empty__icon {
  display: flex; align-items: center; justify-content: center;
  color: var(--main-blue);
}
.empty__icon .ic-inline { width: 42px; height: 42px; margin: 0; opacity: .9; }

.stat__icon .ic-inline { width: 16px; height: 16px; margin: 0; opacity: .95; }
.stat--due .stat__icon .ic-inline { color: var(--danger); }
.stat--ok .stat__icon .ic-inline { color: var(--ok); }
.stat--streak .stat__icon .ic-inline { color: #ff9a2e; }
.stat__icon { color: var(--main-blue); }

.userchip__avatar .ic-inline { width: 16px; height: 16px; margin: 0; }

/* select / option 中不能放 SVG，已改为纯文本，这里无需处理 */

/* ============================ 会员中心 / OCR ============================ */
.member-card {
  border: 1px solid;
  border-radius: 16px;
  padding: 20px 22px;
  backdrop-filter: blur(8px);
}
.member-avatar {
  width: 58px; height: 58px; flex: 0 0 58px;
  border-radius: 16px;
  background: rgba(255,255,255,.75);
  display: grid; place-items: center;
  font-size: 28px;
  box-shadow: 0 4px 14px rgba(22,93,255,.12);
}
.ocr-tip { text-align: center; padding: 20px 10px; }
.ocr-progress { padding: 4px 0; }
.ocr-error {
  padding: 16px; border-radius: 10px;
  background: rgba(245,63,63,.06);
  border: 1px solid rgba(245,63,63,.22);
  text-align: center; font-size: 13px; color: var(--text-grey);
}
.ocr-result { padding: 4px 0; }
.tag--admin { background: rgba(255,154,46,.14); color: #c26a00; }

/* OCR 加载动画 */
.ocr-spin {
  width: 32px; height: 32px; margin: 0 auto;
  border: 3px solid rgba(22,93,255,.15);
  border-top-color: var(--main-blue);
  border-radius: 50%;
  animation: ocrSpin .8s linear infinite;
}
@keyframes ocrSpin { to { transform: rotate(360deg); } }
/* ============================ 复习页：答题输入 + 草稿纸 ============================ */
.answer-input-area {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--card-2);
  border: 1px solid var(--line);
}

.scratch-wrap {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: repeating-linear-gradient(
    0deg,
    #fdfefe,
    #fdfefe 27px,
    #eef3fa 27px,
    #eef3fa 28px
  );
}
.scratch-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: rgba(247, 250, 255, .92);
  border-bottom: 1px solid var(--line);
}
.scratch-title {
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
}
.scratch-title svg { width: 14px; height: 14px; color: var(--main-blue); }
.scratch-canvas {
  display: block;
  width: 100%;
  height: 280px;
  cursor: crosshair;
  touch-action: none;
}

.scratch-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: rgba(247, 250, 255, .7);
  flex-wrap: wrap;
}
.scratch-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: all .16s var(--ease);
}
.scratch-dot.is-on {
  border-color: var(--main-blue);
  transform: scale(1.15);
  box-shadow: 0 0 0 2px rgba(22,93,255,.18);
}
.scratch-size {
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-size: 11.5px;
  color: var(--text-grey);
  cursor: pointer;
  transition: all .16s;
}
.scratch-size.is-on {
  background: var(--main-blue);
  border-color: var(--main-blue);
  color: #fff;
}

@media (max-width: 720px) {
  .scratch-canvas { height: 220px; }
  .answer-input-area { padding: 12px 14px; }
}

/* ============================ KaTeX 公式样式微调 ============================ */
.katex { font-size: 1.06em; }
.katex-display {
  margin: 12px 0;
  padding: 10px 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.flash__q .katex-display { text-align: left; }
.mcard__q .katex { font-size: 1em; }
.answer-box__text .katex { font-size: 1.02em; }
.analysis__body .katex { font-size: 1.02em; }


/* ============================ DeepSeek 分析大按钮 ============================ */
.ai-analyze-box { margin-bottom: 14px; }

.btn-ai {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(120deg, #6366f1 0%, #8b5cf6 45%, #a855f7 100%);
  color: #fff;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 24px -10px rgba(124, 58, 237, .75);
  transition: all .24s cubic-bezier(.22,.8,.3,1);
  overflow: hidden;
}
.btn-ai::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -30%;
  width: 60%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  transform: rotate(20deg);
  transition: left .6s ease;
  pointer-events: none;
}
.btn-ai:hover::after { left: 110%; }
.btn-ai:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -12px rgba(124, 58, 237, .9);
}
.btn-ai:active { transform: translateY(0); }
.btn-ai:disabled {
  opacity: .75;
  cursor: wait;
  transform: none;
}

.btn-ai__icon {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .18);
  display: grid; place-items: center;
}
.btn-ai__icon svg { width: 22px; height: 22px; margin: 0; }

.btn-ai__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.btn-ai__text b {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  display: block;
}
.btn-ai__text small {
  font-size: 11.5px;
  opacity: .82;
  font-weight: 400;
}

.btn-ai__arrow {
  font-size: 20px;
  opacity: .7;
  transition: transform .24s cubic-bezier(.22,.8,.3,1);
}
.btn-ai:hover .btn-ai__arrow { transform: translateX(4px); opacity: 1; }

@media (max-width: 560px) {
  .btn-ai { padding: 14px 16px; gap: 11px; }
  .btn-ai__icon { width: 36px; height: 36px; flex: 0 0 36px; }
  .btn-ai__icon svg { width: 19px; height: 19px; }
  .btn-ai__text b { font-size: 14.5px; }
  .btn-ai__text small { font-size: 11px; }
}


/* ============================ 科目选择区 ============================ */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  line-height: 1;
}
.subject-chips {
  gap: 7px;
  padding: 2px 0 4px;
}
.pill--subject {
  height: 32px;
  padding: 0 12px;
  gap: 5px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.pill__ico {
  font-size: 14px;
  line-height: 1;
  display: inline-block;
}
.pill--subject.is-on .pill__ico {
  filter: brightness(1.15);
}


/* ==================== 侧栏移动端滚动修复 ==================== */
.sidebar {
  overflow-y: auto !important;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 5px; }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(22,93,255,.2);
  border-radius: 3px;
}
.sidebar .nav { flex: 0 0 auto; }
@media (max-width: 900px) {
  .sidebar {
    max-height: 100vh;
    padding-bottom: 24px;
  }
  .sidebar__foot { position: sticky; bottom: 0; background: inherit;
    padding-top: 10px; z-index: 2; }
}

/* ==================== 全局加载动画 ==================== */
#globalLoader {
  position: fixed; inset: 0; z-index: 99999;
  display: none; place-items: center;
  background: rgba(245, 249, 255, .82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .22s ease;
}
#globalLoader.is-on { display: grid; opacity: 1; }
#globalLoader.is-out { opacity: 0; pointer-events: none; }

.ldr {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.ldr__ring {
  width: 46px; height: 46px; position: relative;
}
.ldr__ring::before,
.ldr__ring::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
}
.ldr__ring::before {
  border: 3px solid rgba(22, 93, 255, .14);
}
.ldr__ring::after {
  border: 3px solid transparent;
  border-top-color: #165dff;
  border-right-color: #4080ff;
  animation: ldrSpin .72s linear infinite;
}
@keyframes ldrSpin { to { transform: rotate(360deg); } }

.ldr__text {
  font-size: 12.5px; color: #4e5969; font-weight: 500;
  letter-spacing: .02em;
  animation: ldrPulse 1.6s ease-in-out infinite;
}
@keyframes ldrPulse {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

/* 顶部细进度条 */
#topProgress {
  position: fixed; top: 0; left: 0; height: 2.5px; width: 0;
  background: linear-gradient(90deg, #165dff, #6aa1ff);
  z-index: 100000; opacity: 0;
  transition: width .3s ease, opacity .3s ease;
  box-shadow: 0 0 8px rgba(22, 93, 255, .6);
  border-radius: 0 2px 2px 0;
}
#topProgress.is-on { opacity: 1; }

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #eef3fa 25%, #f7faff 50%, #eef3fa 75%);
  background-size: 200% 100%;
  animation: skelMove 1.4s ease-in-out infinite;
  border-radius: 8px;
}
@keyframes skelMove {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}


/* ==================== Toast 提示 ==================== */
.toast__ico {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}
.toast__ico svg {
  width: 15px; height: 15px;
  margin: 0;
}
.toast__label {
  font-weight: 700;
  flex: 0 0 auto;
  margin-right: 2px;
}
.toast__msg {
  flex: 1 1 auto;
  min-width: 0;
}
.toast--err .toast__label { color: #f53f3f; }
.toast--ok .toast__label { color: #00b42a; }
.toast--info .toast__label { color: #165dff; }


/* 额度消耗提示 */
.toast--credit {
  border-color: rgba(22, 93, 255, .28) !important;
  background: linear-gradient(135deg, #f0f7ff, #e8f2ff) !important;
}
.toast--credit .toast__label { color: #165dff; }
.toast--credit .toast__msg { color: #4e5969; }
.toast--credit .toast__msg b { color: #165dff; font-weight: 700; }


/* ==================== 解析空状态 ==================== */
.analysis--empty {
  background: linear-gradient(135deg, #f7fbff, #eef5ff);
  border: 1.5px dashed rgba(22, 93, 255, .28);
  border-radius: 14px;
}
.analysis__label {
  display: flex;
  align-items: center;
  gap: 6px;
}
.analysis__label > span {
  margin-left: auto;
}


/* ==================== 长题干 ==================== */
.flash__q {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}
.flash__q::-webkit-scrollbar { width: 5px; }
.flash__q::-webkit-scrollbar-thumb {
  background: rgba(22,93,255,.22);
  border-radius: 3px;
}

/* 题目过长时提示可滚动 */
.flash__q--long::after {
  content: "↓ 可滚动查看更多";
  display: block;
  text-align: center;
  font-size: 11px;
  color: var(--faint);
  padding: 8px 0 2px;
}


/* ==========================================================================
   顶部横栏
   ========================================================================== */

/* 返回按钮 */
.appbar__back {
  width: 36px; height: 36px;
  flex: 0 0 36px;
  border: 1px solid #e6eefa;
  border-radius: 10px;
  background: #fff;
  color: #4e5969;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all .15s;
  margin-right: 2px;
}
.appbar__back:hover { background: #f2f7ff; color: #1677ff; border-color: rgba(22,119,255,.3); }
.appbar__back svg { width: 18px; height: 18px; }
.appbar__back[hidden] { display: none; }

.appbar {
  flex: 0 0 auto;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid rgba(229, 232, 239, .9);
  box-shadow: 0 2px 14px -8px rgba(22, 93, 255, .16);
  z-index: 50;
  position: relative;
  overflow: visible;
}

.appbar__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  flex: 0 0 auto;
  padding-right: 12px;
  border-right: 1px solid rgba(229, 232, 239, .9);
  min-width: 0;
}

.appbar__logo {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, #1677ff, #4096ff);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 4px 12px -4px rgba(22, 119, 255, .55);
  flex: 0 0 32px;
}
.appbar__logo svg { width: 18px; height: 18px; }

.appbar__title {
  font-size: 15px; font-weight: 850; letter-spacing: -.02em;
  white-space: nowrap; color: var(--ink, #1d2129);
  flex: 0 0 auto;
}

.appbar__spacer { flex: 1 1 auto; min-width: 8px; }

/* 用户胶囊 */
.appbar .userchip {
  display: flex !important;
  align-items: center;
  gap: 8px;
  height: 40px !important;
  padding: 0 12px 0 5px !important;
  border-radius: 99px !important;
  background: #f2f7ff !important;
  border: 1px solid #e6eefa !important;
  cursor: pointer;
  transition: all .16s;
  flex: 0 0 auto;
  font-family: inherit;
  box-shadow: none !important;
  width: auto !important;
}
.appbar .userchip:hover { background: #e8f3ff !important; border-color: rgba(22, 119, 255, .32) !important; }

.appbar .userchip__avatar {
  width: 30px !important; height: 30px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #dcebff, #c4ddff) !important;
  display: grid !important; place-items: center;
  font-size: 16px;
  flex: 0 0 30px;
  box-shadow: none !important;
}

.appbar .userchip__info {
  display: flex; flex-direction: column; min-width: 0; text-align: left;
}
.appbar .userchip__name {
  font-size: 12.5px; font-weight: 800; line-height: 1.2;
  white-space: nowrap; color: var(--ink, #1d2129); display: block;
}
.appbar .userchip__meta {
  font-size: 10px; color: #86909c; white-space: nowrap; margin-top: 1px; display: block;
}

/* 导航：绝对定位居中 */
.appbar .nav {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 3px !important;
  width: auto !important;
  height: 40px !important;
  max-width: calc(100% - 520px) !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  scrollbar-width: none;
  z-index: 2;
  margin: 0 !important;
}
.appbar .nav::-webkit-scrollbar { display: none; }

.appbar .nav__item {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 36px !important;
  padding: 0 11px !important;
  border-radius: 9px !important;
  border: 0 !important;
  background: transparent !important;
  color: #4e5969 !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  flex: 0 0 auto !important;
  width: auto !important;
  box-shadow: none !important;
}
.appbar .nav__item:hover { background: #f2f7ff !important; color: #1677ff !important; }
.appbar .nav__item.is-active {
  background: linear-gradient(135deg, #1677ff, #4096ff) !important;
  color: #fff !important;
  box-shadow: 0 4px 13px -5px rgba(22, 119, 255, .62) !important;
}
.appbar .nav__item svg { width: 15px !important; height: 15px !important; flex: 0 0 15px; }

/* 右侧动作按钮 */
.appbar__acts {
  margin-left: auto;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex: 0 0 auto !important;
  width: auto !important;
  position: relative;
  z-index: 3;
}

.appbar__btn {
  position: relative;
  height: 38px !important;
  min-width: 38px !important;
  padding: 0 11px !important;
  border: 1px solid #e6eefa !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: #4e5969 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit !important;
  font-size: 12.5px !important;
  font-weight: 700 !important;
  white-space: nowrap;
  flex: 0 0 auto !important;
  width: auto !important;
  box-shadow: none !important;
}
.appbar__btn:hover { background: #f2f7ff !important; color: #1677ff !important; border-color: rgba(22, 119, 255, .3) !important; }
.appbar__btn svg { width: 16px !important; height: 16px !important; flex: 0 0 16px; }

.appbar__btn--primary {
  background: linear-gradient(135deg, #1677ff, #4096ff) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: 0 5px 16px -6px rgba(22, 119, 255, .62) !important;
}
.appbar__btn--primary:hover { color: #fff !important; filter: brightness(1.06); }

/* 响应式 */
@media (max-width: 1280px) {
  .appbar .nav { max-width: calc(100% - 460px) !important; }
  .appbar .nav__item { padding: 0 9px !important; font-size: 12px !important; }
}
@media (max-width: 1080px) {
  .appbar__title { display: none; }
  .appbar__brand { border-right: 0; padding-right: 0; }
  .appbar .nav__item span { display: none; }
  .appbar .nav__item { padding: 0 10px !important; }
  .appbar .nav { max-width: calc(100% - 320px) !important; }
}
@media (max-width: 720px) {
  .appbar { height: 54px; padding: 0 10px; gap: 6px; }
  .appbar .userchip__info { display: none !important; }
  .appbar .userchip { padding: 0 8px 0 4px !important; }
  .appbar .nav { max-width: calc(100% - 240px) !important; left: 54% !important; }
}


/* 旧侧边栏与底部标签栏：新版布局下隐藏 */
.sidebar { display: none !important; }



/* ==========================================================================
   学生端首页自带顶部栏：隐藏全局 appbar，让首页占满整屏
   ========================================================================== */
.app:has(.sh) .appbar {
  display: none !important;
}

.app:has(.sh) .main {
  padding: 12px 16px !important;
  height: 100vh !important;
  overflow: hidden !important;
}

/* 不支持 :has() 的浏览器兜底：首页时 body 加类 */
body.sh-home .appbar { display: none !important; }
body.sh-home .main {
  padding: 12px 16px !important;
  height: 100vh !important;
  overflow: hidden !important;
}
