/* KJ云学习 —— 界面样式
   设计取向：星系银河 × 极简高级。深空底色 + 星点 + 星云光晕，
   强调色走蓝→紫的银河渐变，靠留白与层级而非阴影营造层次。 */

/* ------------------------------------------------------------ 设计令牌 */
:root {
  color-scheme: light;

  --bg: #f6f6f7; /* 页面底色 */
  --bg-elv: #ffffff; /* 卡片、输入框 */
  --bg-soft: #f6f6f7; /* 卡片内的次级分组 */
  --bg-mute: #f1f1f2; /* 更浅的填充 */
  --glass: rgba(246, 246, 247, 0.82);

  --divider: #e2e2e3;
  --divider-soft: #ededef;

  --t1: rgba(60, 60, 67, 1);
  --t2: rgba(60, 60, 67, 0.78);
  --t3: rgba(60, 60, 67, 0.56);

  --brand-1: #4f46e5; /* 主色：星蓝，用于强调文字与描边 */
  --brand-2: #6366f1;
  --brand-3: #8b5cf6;
  --brand-solid: #5b5bd6; /* 实心按钮底色 */
  --on-brand: #ffffff;
  --brand-soft: rgba(99, 102, 241, 0.14);

  --green: #18794e;
  --green-soft: rgba(16, 185, 129, 0.14);
  --yellow: #915930;
  --yellow-soft: rgba(234, 179, 8, 0.16);
  --red: #b8272c;
  --red-soft: rgba(244, 63, 94, 0.12);
  --gray: #565a5f;
  --gray-soft: rgba(142, 150, 170, 0.16);

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-lift: 0 8px 24px -14px rgba(0, 0, 0, 0.24);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;

  --font:
    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    sans-serif;
  --mono:
    ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --sidebar-w: 228px;

  /* 旧名兼容：图表由 JS 直接内联这些变量 */
  --accent: var(--brand-2);
  --accent-2: var(--brand-3);
  --accent-soft: var(--brand-soft);
  --line: var(--divider);
  --muted: var(--t3);
  --ahead: var(--green);
  --ontrack: var(--brand-2);
  --behind: var(--red);
  --untimed: var(--gray);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --bg: #0a0d1c; /* 深空底色 */
    --bg-elv: rgba(23, 27, 48, 0.78); /* 玻璃卡片 */
    --bg-soft: rgba(40, 45, 74, 0.55);
    --bg-mute: rgba(50, 56, 90, 0.6);
    --glass: rgba(12, 15, 30, 0.82);

    --divider: rgba(255, 255, 255, 0.1);
    --divider-soft: rgba(255, 255, 255, 0.07);

    --t1: rgba(238, 240, 255, 0.9);
    --t2: rgba(226, 229, 250, 0.62);
    --t3: rgba(226, 229, 250, 0.4);

    --brand-1: #a5b4fc;
    --brand-2: #8b9bff;
    --brand-3: #b69bff;
    --brand-solid: #6d6cf0;
    --on-brand: #ffffff;
    --brand-soft: rgba(139, 155, 255, 0.18);

    --green: #4ade80;
    --green-soft: rgba(74, 222, 128, 0.16);
    --yellow: #fbbf24;
    --yellow-soft: rgba(251, 191, 36, 0.16);
    --red: #fb7185;
    --red-soft: rgba(251, 113, 133, 0.16);
    --gray: #a4a8b8;
    --gray-soft: rgba(142, 150, 170, 0.16);

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.03);
    --shadow-lift: 0 12px 32px -14px rgba(0, 0, 0, 0.7);
  }
}

/* ------------------------------------------------------------ 基础 */
* {
  box-sizing: border-box;
}
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-thumb {
  background: var(--divider);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--t3);
  background-clip: padding-box;
}
::-webkit-scrollbar-track {
  background: transparent;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--t1);
  background:
    /* 星云光晕：蓝 → 紫，营造银河纵深 */
    radial-gradient(
      900px 600px at 12% 6%,
      rgba(99, 102, 241, 0.16),
      transparent 62%
    ),
    radial-gradient(
      1000px 700px at 88% 14%,
      rgba(139, 92, 246, 0.14),
      transparent 60%
    ),
    radial-gradient(
      720px 560px at 55% 96%,
      rgba(59, 130, 246, 0.1),
      transparent 60%
    ),
    /* 星点 */
    radial-gradient(
        1.5px 1.5px at 22% 32%,
        rgba(255, 255, 255, 0.55),
        transparent 100%
      ),
    radial-gradient(
      1px 1px at 68% 18%,
      rgba(255, 255, 255, 0.45),
      transparent 100%
    ),
    radial-gradient(
      1.5px 1.5px at 82% 44%,
      rgba(255, 255, 255, 0.4),
      transparent 100%
    ),
    radial-gradient(
      1px 1px at 34% 64%,
      rgba(255, 255, 255, 0.42),
      transparent 100%
    ),
    radial-gradient(
      1.5px 1.5px at 56% 12%,
      rgba(255, 255, 255, 0.38),
      transparent 100%
    ),
    radial-gradient(
      1px 1px at 92% 76%,
      rgba(255, 255, 255, 0.4),
      transparent 100%
    ),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.011em;
  color: var(--t1);
}
p {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  flex: none;
}
.sprite {
  display: none;
}
.muted {
  color: var(--t3);
}
.pos {
  color: var(--green);
}
.neg {
  color: var(--red);
}
.hidden {
  display: none !important;
}
/* 验证码输入行：输入框 + 「获取验证码」按钮并排 */
.code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.code-row input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
}
.code-row .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 13px;
  color: var(--t2);
  background: var(--bg-soft);
}
.code-row .btn:hover {
  color: var(--t1);
  border-color: var(--t3);
}
.code-row .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
code {
  background: var(--bg-mute);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 12px;
  font-family: var(--mono);
}

/* ------------------------------------------------------------ 登录 */
.login-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.login-card {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 30px 26px 24px;
  text-align: center;
  background: var(--bg-elv);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.brand-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto 2px;
  display: grid;
  place-items: center;
  padding: 4px;
  border-radius: 14px;
  overflow: hidden;
  /* 头像 PNG 是透明底：统一垫浅色底板，深色模式下也清晰可读 */
  background: #ffffff;
  border: 1px solid var(--divider);
}
.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 10px;
}
.err {
  min-height: 20px;
  font-size: 13px;
  color: var(--red);
}

/* ------------------------------------------------------------ 骨架 */
.app {
  display: flex;
  min-height: 100%;
}

/* 侧栏 */
.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  width: var(--sidebar-w);
  height: 100vh;
  flex: none;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  background: var(--bg-elv);
  border-right: 1px solid var(--divider);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 16px;
}
.brand .dot {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 3px;
  overflow: hidden;
  border-radius: 10px;
  /* 与登录卡一致：透明头像垫浅色底板，两种主题下都可读 */
  background: #ffffff;
  border: 1px solid var(--divider);
  box-shadow: 0 2px 8px -3px rgba(0, 0, 0, 0.28);
}
.brand .dot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand small {
  display: block;
  font-size: 10.5px;
  color: var(--t3);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--t2);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.nav a:hover {
  background: var(--bg-soft);
  color: var(--t1);
}
.nav a.active {
  background: linear-gradient(
    135deg,
    var(--brand-soft),
    rgba(139, 92, 246, 0.16)
  );
  color: var(--brand-1);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.28);
}
.nav a svg {
  width: 16px;
  height: 16px;
  opacity: 0.9;
}

.side-foot {
  margin-top: auto;
  display: grid;
  gap: 7px;
  padding: 10px 6px 2px;
}
.side-foot small {
  font-size: 10.5px;
  color: var(--t3);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  padding: 4px 10px;
  font-size: 11.5px;
  color: var(--t2);
  background: var(--bg-soft);
  border-radius: 999px;
}
.pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--t3);
}
.pill.ok i {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.pill.bad i {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-soft);
}

/* 主区 */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px max(26px, calc((100% - 1440px) / 2));
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--divider);
}
.topbar .titles {
  flex: 1;
  min-width: 0;
}
.topbar h2 {
  font-size: 17px;
  font-weight: 600;
}
.topbar .muted {
  font-size: 12px;
}
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.view {
  display: grid;
  gap: 16px;
  padding: 22px max(26px, calc((100% - 1440px) / 2)) 64px;
}
.date-input {
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--t1);
  background: var(--bg-elv);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
}

/* ------------------------------------------------------------ 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  color: var(--t1);
  background: var(--bg-elv);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.btn:hover {
  border-color: var(--brand-3);
  color: var(--brand-1);
}
.btn.primary {
  color: var(--on-brand);
  background: linear-gradient(135deg, var(--brand-2), var(--brand-3));
  border-color: transparent;
  box-shadow: 0 6px 18px -6px rgba(99, 102, 241, 0.55);
}
.btn.primary:hover {
  color: var(--on-brand);
  filter: brightness(1.08);
  box-shadow: 0 8px 22px -6px rgba(99, 102, 241, 0.7);
}
.btn.ghost {
  color: var(--t3);
  background: transparent;
  border-color: transparent;
}
.btn.ghost:hover {
  color: var(--red);
  background: var(--bg-soft);
}
.btn.block {
  width: 100%;
  justify-content: center;
}
.btn.mini {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: var(--radius-xs);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--t2);
  background: var(--bg-elv);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.icon-btn:hover {
  color: var(--brand-1);
  background: var(--bg-soft);
}

/* ------------------------------------------------------------ 卡片 */
.card {
  padding: 18px;
  background: var(--bg-elv);
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition:
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    transform 0.22s ease;
}
.card:hover {
  border-color: rgba(99, 102, 241, 0.28);
  box-shadow: var(--shadow-lift);
}
.card-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.card-head h3 {
  flex: 1 1 160px;
  min-width: 0;
  font-size: 14.5px;
  font-weight: 600;
}
.card-head .muted {
  flex: none;
  font-size: 11.5px;
}
.card-head > .btn,
.card-head > input,
.card-head > select,
.card-head > .icon-btn {
  flex: none;
}

/* ------------------------------------------------------------ 栅格 */
.grid {
  display: grid;
  gap: 14px;
}
.grid.cols {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.grid.stats {
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
}
.grid.three {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.stat {
  display: grid;
  gap: 1px;
}
.stat .k {
  font-size: 11.5px;
  color: var(--t3);
}
.stat .v {
  font-size: 23px;
  font-weight: 680;
  letter-spacing: -0.022em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(120deg, var(--brand-2), var(--brand-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat .v small {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--t3);
}
.stat .d {
  font-size: 11.5px;
  color: var(--t3);
}

/* ------------------------------------------------------------ 标签 */
.tag {
  display: inline-block;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(127, 127, 160, 0.14);
}
.tag.ahead {
  color: var(--green);
  background: var(--green-soft);
}
.tag.ontrack {
  color: var(--brand-1);
  background: var(--brand-soft);
}
.tag.behind {
  color: var(--red);
  background: var(--red-soft);
}
.tag.done {
  color: var(--yellow);
  background: var(--yellow-soft);
}
.tag.untimed {
  color: var(--gray);
  background: var(--gray-soft);
}

/* ------------------------------------------------------------ 进度环与条 */
.ring {
  position: relative;
  width: 66px;
  height: 66px;
  flex: none;
}
.ring svg {
  width: 66px;
  height: 66px;
  transform: rotate(-90deg);
}
.ring .bg {
  stroke: var(--bg-mute);
}
.ring .pct {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  font-size: 15.5px;
  font-weight: 640;
  letter-spacing: -0.03em;
  color: var(--t1);
}
.ring .pct small {
  font-size: 10px;
  font-weight: 500;
  color: var(--t3);
}
.bar {
  height: 6px;
  overflow: hidden;
  background: var(--bg-mute);
  border-radius: 999px;
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-2), var(--brand-3));
  transition: width 0.4s ease;
}

/* 任务卡 */
.task-card {
  display: grid;
  /* 1fr 的最小值默认是 min-content，长文本会把卡片撑出容器；
     改成 minmax(0, 1fr) 后窄屏才能正常收缩。 */
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.task-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}
/* 栅格子项默认 min-width:auto，长文本（如「当前进度 55 / 253」）会把卡片撑出容器；
   显式归零后配合换行，窄屏（390px）才不会横向溢出。 */
.task-body > * {
  min-width: 0;
}
.task-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.task-title strong {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kv {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 14px;
  font-size: 12.5px;
  color: var(--t2);
}
.kv b {
  font-weight: 600;
  color: var(--t1);
  font-variant-numeric: tabular-nums;
}

/* 长条统计 */
.rows {
  display: grid;
  gap: 11px;
}
.row {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  gap: 12px;
  align-items: center;
}
.row .name {
  font-size: 12.5px;
  color: var(--t2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .num {
  font-size: 12px;
  color: var(--t3);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------ 表格 */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  min-width: 720px;
}
.table-scroll table.wide {
  min-width: 1080px;
}
/* 大类表很窄，别撑满整行 */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--divider-soft);
  vertical-align: middle;
}
th {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--t3);
  white-space: nowrap;
}
tbody tr:last-child td {
  border-bottom: none;
}
tbody tr {
  transition: background 0.15s;
}
tbody tr:hover {
  background: var(--brand-soft);
}
td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 进度明细表：固定列宽按比例分配（否则浏览器自动布局会让
   「任务名称」独占大宽度、数字列挤在右边），对齐风格与配置中心一致 */
table.progress-table {
  table-layout: fixed;
  min-width: 960px;
}
table.progress-table th:nth-child(1) {
  width: 24%;
}
table.progress-table th:nth-child(2) {
  width: 11%;
}
table.progress-table th:nth-child(3) {
  width: 11%;
}
table.progress-table th:nth-child(4) {
  width: 11%;
}
table.progress-table th:nth-child(5) {
  width: 11%;
}
table.progress-table th:nth-child(6) {
  width: 9%;
}
table.progress-table th:nth-child(7) {
  width: 23%;
}
/* 固定列宽下快捷按钮组放不下时整齐换行，不溢出 */
table.progress-table .quick {
  flex-wrap: wrap;
  row-gap: 5px;
}

/* ------------------------------------------------------------ 表单 */
.form {
  display: grid;
  gap: 14px;
}

/* 字段行：用 grid 保证「标签对齐、控件对齐」，
   有 hint 的字段只是往下延长，不会把整行带偏 */
.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(186px, 1fr));
  gap: 12px 16px;
  align-items: start;
}
/* 推算与排课：五个字段排一行 */
.fields.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px 14px;
}
@media (max-width: 980px) {
  .fields.five {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.field {
  display: grid;
  gap: 5px;
  align-content: start;
  min-width: 0;
}
.field > label {
  font-size: 12px;
  font-weight: 550;
  color: var(--t2);
  line-height: 1.5;
}
.field .hint {
  font-size: 11px;
  line-height: 1.45;
  color: var(--t3);
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 7px 11px;
  font: inherit;
  font-size: 13px;
  color: var(--t1);
  background: var(--bg-elv);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
input::placeholder,
textarea::placeholder {
  color: var(--t3);
}
input:hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus) {
  border-color: var(--brand-2);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-3);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
select {
  appearance: none;
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    right 13px center,
    right 8px center;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}
textarea {
  min-height: 190px;
  line-height: 1.65;
  resize: vertical;
}
input[type="checkbox"] {
  accent-color: var(--brand-2);
}

/* 工具条（按钮行） */
.inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.inline.end {
  justify-content: flex-end;
}
.hint {
  font-size: 11px;
  color: var(--t3);
}
/* 登录卡底部切换入口（注册 / 找回密码）：两个都可点，做高亮 */
.login-card .hint {
  font-size: 12.5px;
  color: var(--t3);
  margin-top: 2px;
}
.login-card .hint a {
  color: var(--brand-1);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  cursor: pointer;
  padding: 0 2px;
}
.login-card .hint a:hover {
  color: var(--brand-3);
  border-bottom-color: currentColor;
}
/* 操作成功提示（绑定邮箱 / 修改密码）：只做一行文字提示，不回填敏感值 */
.hint.ok {
  color: var(--green);
  font-weight: 600;
}
/* 「我的账号」两排布局：左边两个输入框，右边一个动作按钮 */
.row-line {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.row-line .row-fields {
  flex: 1 1 420px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  min-width: 0;
}
.row-line .row-act {
  flex: 0 0 auto;
  padding-bottom: 1px;
}
@media (max-width: 640px) {
  .row-line .row-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .row-line .row-act,
  .row-line .row-act .btn {
    width: 100%;
  }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 6px;
  font-size: 12.5px;
  color: var(--t2);
  background: var(--bg-elv);
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  cursor: grab;
}
.chip:active {
  cursor: grabbing;
}
.chip.dragging {
  opacity: 0.45;
}
.chip .grip {
  color: var(--t3);
  font-size: 13px;
  line-height: 1;
  padding: 0 2px;
  user-select: none;
  cursor: grab;
}
.chip .chip-name {
  flex: 1;
}
.chip button {
  padding: 0 3px;
  font-size: 14px;
  line-height: 1;
  color: var(--t3);
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.chip button:hover {
  color: var(--red);
}

/* 快捷记一笔 */
.quick {
  display: flex;
  align-items: center;
  gap: 5px;
}
.quick input {
  width: 76px;
  padding: 6px 8px;
  text-align: center;
}

/* ------------------------------------------------------------ 每日执行 */
.lesson {
  padding: 13px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--divider-soft);
  border-radius: var(--radius-sm);
}
.lesson h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 9px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-1);
}
.lesson h4 .muted {
  font-size: 11px;
  font-weight: 500;
}
.lesson ol {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 20px;
}
.lesson li {
  font-size: 12.5px;
  color: var(--t2);
}
.lesson .slot + .slot {
  margin-top: 5px;
}
.lesson-extra {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--t3);
}

/* 时间段：勾选 + 序号 + 科目 + 时长 + 记录 */
.slot {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) minmax(0, 1.6fr);
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--bg-elv);
  border: 1px solid var(--divider-soft);
  border-radius: var(--radius-sm);
  transition:
    background 0.15s,
    border-color 0.15s;
}
.slot.done {
  background: var(--green-soft);
  border-color: transparent;
}
.slot.done .slot-sub {
  color: var(--t3);
}
.slot.done .slot-no {
  color: var(--green);
}
.slot-no {
  font-size: 11.5px;
  color: var(--t3);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.slot-sub {
  font-size: 12.5px;
  color: var(--t1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot-note {
  padding: 5px 9px;
  font-size: 12.5px;
}

/* ------------------------------------------------------------ 列表 / 日志 */
.list {
  display: grid;
  gap: 7px;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}
.list-item .grow {
  flex: 1;
  min-width: 0;
}
.list-item strong {
  font-size: 12.5px;
  font-weight: 550;
}
.list-item .sub {
  font-size: 11.5px;
  color: var(--t3);
}
.list-item .acts {
  display: flex;
  gap: 6px;
}

/* ------------------------------------------------------------ 文本块 */

/* ------------------------------------------------------------ 提示 */
.empty {
  padding: 26px 10px;
  font-size: 12.5px;
  color: var(--t3);
  text-align: center;
}
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  z-index: 120;
  padding: 9px 17px;
  font-size: 12.5px;
  color: #fff;
  background: rgba(28, 28, 32, 0.94);
  border-radius: 999px;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transform: translate(-50%, 16px);
  transition:
    opacity 0.25s,
    transform 0.25s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.err {
  background: #b8272c;
}

/* ------------------------------------------------------------ 折叠块 */
/* 低频设置默认收起，页面只呈现常用项 */

/* ------------------------------------------------------------ 周视图 */
.week-nav {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.week-head,
.week-row {
  display: grid;
  grid-template-columns: 82px repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.week-head {
  padding-bottom: 6px;
}
.wk-corner {
  align-self: end;
  padding-bottom: 4px;
  font-size: 11.5px;
  color: var(--t3);
}
.wk-day {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 6px 2px;
  font-size: 10.5px;
  color: var(--t3);
  background: var(--bg-soft);
  border-radius: var(--radius-xs);
}
.wk-day b {
  font-size: 12px;
  font-weight: 600;
  color: var(--t2);
}
.wk-day i,
.wk-day em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.wk-day.today {
  color: var(--brand-1);
  background: var(--brand-soft);
}
.wk-day.today b,
.wk-day.today em {
  color: var(--brand-1);
}
.week-row {
  margin-top: 6px;
}
.wk-label {
  align-self: center;
  font-size: 11.5px;
  color: var(--t3);
}
.wk-cell {
  display: grid;
  gap: 3px;
  align-content: center;
  justify-items: center;
  min-height: 50px;
  padding: 6px 4px;
  font: inherit;
  color: var(--t2);
  background: transparent;
  border: 1px solid var(--divider-soft);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.wk-cell:hover {
  border-color: var(--brand-3);
}
.wk-num {
  font-size: 10.5px;
  color: var(--t3);
  font-variant-numeric: tabular-nums;
}
.wk-cell.full .wk-num {
  color: var(--green);
}
.wk-cell.full {
  background: var(--green-soft);
  border-color: transparent;
}
.wk-sub {
  max-width: 100%;
  overflow: hidden;
  font-size: 11px;
  color: var(--t2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wk-card {
  display: none;
}

/* ------------------------------------------------------------ 图表 */
.chart-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-width: 0;
}
.chart-block > :not(h4) {
  flex: 1;
  min-height: 0;
}
.chart-rows {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.chart-rows.dense .row {
  grid-template-columns: 44px 1fr 22px;
  gap: 6px;
  font-size: 10.5px;
}
.chart-rows.dense .name,
.chart-rows.dense .num {
  font-size: 10.5px;
}
.chart {
  display: block;
  width: 100%;
  height: auto;
  margin: auto;
}
.chart-block h4 {
  font-size: 11.5px;
  font-weight: 550;
  color: var(--t3);
}
/* 热力图：CSS 网格自适应列宽，右侧不会留白 */
.heat-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
}
.heat-grid .hc {
  aspect-ratio: 1;
  border-radius: 2.5px;
  background: var(--bg-mute);
}
.heat-grid .h1 {
  background: var(--brand-3);
}
.heat-grid .h2 {
  background: var(--brand-2);
}
.heat-grid .h3 {
  background: var(--brand-1);
}

/* 今日汇总（番茄Todo 那种「环 + 一句话」） */
.today-sum {
  display: flex;
  align-items: center;
  gap: 18px;
}
.today-kv {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.today-kv b {
  font-size: 24px;
  font-weight: 640;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--t1);
}
.today-kv span {
  font-size: 12px;
  color: var(--t2);
}
.today-kv .muted {
  color: var(--t3);
}

/* ------------------------------------------------------------ 底部标签栏（移动端） */
.tabbar {
  display: none;
}

/* ------------------------------------------------------------ 响应式：移动端按一等公民对待 */
@media (max-width: 900px) {
  /* 侧栏换底部标签栏：拇指可达，且不用先开抽屉再点一次 */
  .sidebar {
    display: none;
  }
  .tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    padding: 5px 4px calc(5px + env(safe-area-inset-bottom, 0px));
    background: var(--glass);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--divider);
  }
  .tabbar a {
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 6px 0;
    font-size: 10.5px;
    font-weight: 500;
    color: var(--t3);
    border-radius: var(--radius-sm);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar a svg {
    width: 20px;
    height: 20px;
  }
  .tabbar a.active {
    color: var(--brand-1);
    font-weight: 600;
  }
  .tabbar a:active {
    background: var(--bg-soft);
  }

  .topbar {
    padding: 11px max(15px, calc((100% - 1440px) / 2));
  }
  .topbar h2 {
    font-size: 16px;
  }
  .topbar .muted {
    font-size: 11.5px;
  }
  .view {
    gap: 12px;
    padding: 14px max(15px, calc((100% - 1440px) / 2)) 98px;
  }
  .card {
    padding: 15px 14px;
    border-radius: var(--radius-sm);
  }
  .card-head {
    margin-bottom: 12px;
  }
  .card-head h3 {
    flex: 1 1 100%;
  }

  /* 触控目标放宽；输入框 ≥16px 可避免 iOS 聚焦时自动放大页面 */
  .btn {
    padding: 9px 14px;
  }
  .btn.mini {
    padding: 7px 10px;
  }
  .icon-btn {
    width: 38px;
    height: 38px;
  }
  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="email"],
  input[type="date"],
  select,
  textarea {
    padding: 9px 11px;
    font-size: 16px;
  }
  .date-input {
    padding: 9px 10px;
    font-size: 16px;
  }

  /* 表单与操作区：窄屏下铺满整行 */
  .fields {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
  }
  .inline.end {
    justify-content: stretch;
  }
  .inline.end > .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
  .grid.stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .grid.three {
    grid-template-columns: minmax(0, 1fr);
  }
  .today-sum {
    gap: 14px;
  }
  .today-kv b {
    font-size: 20px;
  }
  .stat .v {
    font-size: 20px;
  }
  .row {
    grid-template-columns: 84px minmax(0, 1fr) auto;
    gap: 10px;
  }

  /* 每日执行 */
  .lesson {
    padding: 11px;
  }
  .slot {
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 8px 10px;
  }
  .slot-note {
    grid-column: 1 / -1;
  }

  .task-card {
    gap: 13px;
  }
  .ring,
  .ring svg {
    width: 66px;
    height: 66px;
  }
  .ring .pct {
    font-size: 13.5px;
  }
  .list-item {
    align-items: flex-start;
  }
  .toast {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }

  /* 周视图：网格换成按天竖排，不做横向滚动 */
  .week-grid {
    display: none;
  }
  .wk-card {
    display: grid;
    gap: 9px;
    padding: 12px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
  }
  .wk-card + .wk-card {
    margin-top: 10px;
  }
  .wk-card.today {
    box-shadow: inset 0 0 0 1.5px var(--brand-3);
  }
  .wk-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: var(--t3);
  }
  .wk-card-head b {
    font-size: 13px;
    color: var(--t1);
  }
  .wk-card-head i {
    font-style: normal;
    font-variant-numeric: tabular-nums;
  }
  .wk-card-head em {
    font-style: normal;
    font-variant-numeric: tabular-nums;
  }
  .wk-card-head .btn {
    margin-left: auto;
  }
  .wk-card-row {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid var(--divider-soft);
  }
  .wk-card-row .wk-label {
    align-self: center;
  }

  /* 窄屏表格 → 卡片：不再横向滚动 */
  .table-scroll.stack {
    overflow: visible;
  }
  .table-scroll.stack table {
    display: block;
    min-width: 0;
  }
  .table-scroll.stack thead {
    display: none;
  }
  .table-scroll.stack tbody {
    display: grid;
    gap: 10px;
  }
  .table-scroll.stack tr {
    display: grid;
    gap: 9px;
    padding: 12px;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
  }
  .table-scroll.stack td {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 0;
    border: none;
  }
  .table-scroll.stack td::before {
    content: attr(data-label);
    font-size: 11.5px;
    color: var(--t3);
  }
  .table-scroll.stack td:not([data-label]) {
    grid-template-columns: minmax(0, 1fr);
  }
  .table-scroll.stack td:not([data-label])::before {
    content: none;
  }
  .table-scroll.stack td.num {
    text-align: right;
  }
  .table-scroll.stack td:empty {
    display: none;
  }
}

/* ---- 手机端：登录卡底部「注册一个 / 忘记密码？」的点击热区 ----
   这两条是登录页唯一的次要动作，字号 12.5px、行内链接只有 16px 高，
   手机上不好点。用 min-height + 负 margin 把热区抬到 32px，视觉行高不变。 */
@media (max-width: 640px) {
  .login-card .hint {
    line-height: 1.9;
  }
  .login-card .hint a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 6px;
    margin: -8px -4px;
  }
}
