/* ==========================================================================
   Glass — iOS 玻璃材质设计系统
   材质只给「漂浮的界面层」：侧边栏、工具栏、灵动岛、抽屉、弹出菜单。
   内容（列表、卡片、课表）放在更不透明的分组底上，保证可读。
   ========================================================================== */

:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, "PingFang SC", sans-serif;

  /* iOS 系统色（浅色） */
  --blue: #007AFF; --green: #34C759; --orange: #FF9500; --red: #FF3B30; --yellow: #FFCC00;
  --purple: #AF52DE; --pink: #FF2D55; --teal: #30B0C7; --indigo: #5856D6; --mint: #00C7BE; --gray: #8E8E93;

  --accent: var(--blue);
  --accent-ink: #fff;

  /* 墙纸与材质 */
  --wall-1: #dfe9ff; --wall-2: #fbe3f1; --wall-3: #dff7ef; --wall-base: #f2f2f7;
  --mat-thick: rgba(255, 255, 255, .72);
  --mat-sheet: rgba(249, 249, 251, .9);
  --mat-regular: rgba(255, 255, 255, .56);
  --mat-thin: rgba(255, 255, 255, .38);
  --mat-stroke: rgba(255, 255, 255, .7);
  --mat-edge: rgba(0, 0, 0, .06);
  --blur: saturate(180%) blur(28px);

  /* 内容层 */
  --bg-grouped: rgba(255, 255, 255, .82);
  --bg-row-hover: rgba(0, 0, 0, .035);
  --bg-fill: rgba(120, 120, 128, .12);
  --bg-fill-2: rgba(120, 120, 128, .08);
  --sep: rgba(60, 60, 67, .13);

  /* 文字 */
  --label: #000;
  --label-2: rgba(60, 60, 67, .78);
  --label-3: rgba(60, 60, 67, .55);
  --label-4: rgba(60, 60, 67, .3);

  --shadow-float: 0 1px 1px rgba(0, 0, 0, .04), 0 8px 24px -6px rgba(15, 23, 42, .14), 0 24px 56px -16px rgba(15, 23, 42, .18);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 12px -4px rgba(15, 23, 42, .08);

  --r-xs: 8px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 26px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.32, .72, 0, 1);
  --sidebar-w: 248px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --blue: #0A84FF; --green: #30D158; --orange: #FF9F0A; --red: #FF453A; --yellow: #FFD60A;
    --purple: #BF5AF2; --pink: #FF375F; --teal: #40C8E0; --indigo: #5E5CE6; --mint: #63E6E2; --gray: #98989D;
    --wall-1: #0d1b3d; --wall-2: #2b0f2a; --wall-3: #08251f; --wall-base: #000;
    --mat-thick: rgba(30, 30, 32, .72); --mat-sheet: rgba(30, 30, 32, .9); --mat-regular: rgba(36, 36, 40, .55); --mat-thin: rgba(44, 44, 48, .4);
    --mat-stroke: rgba(255, 255, 255, .1); --mat-edge: rgba(0, 0, 0, .4);
    --bg-grouped: rgba(28, 28, 30, .82); --bg-row-hover: rgba(255, 255, 255, .05);
    --bg-fill: rgba(120, 120, 128, .32); --bg-fill-2: rgba(120, 120, 128, .2); --sep: rgba(84, 84, 88, .5);
    --label: #fff; --label-2: rgba(235, 235, 245, .75); --label-3: rgba(235, 235, 245, .52); --label-4: rgba(235, 235, 245, .26);
    --shadow-float: 0 1px 1px rgba(0, 0, 0, .3), 0 12px 32px -8px rgba(0, 0, 0, .6);
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --blue: #0A84FF; --green: #30D158; --orange: #FF9F0A; --red: #FF453A; --yellow: #FFD60A;
  --purple: #BF5AF2; --pink: #FF375F; --teal: #40C8E0; --indigo: #5E5CE6; --mint: #63E6E2; --gray: #98989D;
  --wall-1: #0d1b3d; --wall-2: #2b0f2a; --wall-3: #08251f; --wall-base: #000;
  --mat-thick: rgba(30, 30, 32, .72); --mat-sheet: rgba(30, 30, 32, .9); --mat-regular: rgba(36, 36, 40, .55); --mat-thin: rgba(44, 44, 48, .4);
  --mat-stroke: rgba(255, 255, 255, .1); --mat-edge: rgba(0, 0, 0, .4);
  --bg-grouped: rgba(28, 28, 30, .82); --bg-row-hover: rgba(255, 255, 255, .05);
  --bg-fill: rgba(120, 120, 128, .32); --bg-fill-2: rgba(120, 120, 128, .2); --sep: rgba(84, 84, 88, .5);
  --label: #fff; --label-2: rgba(235, 235, 245, .75); --label-3: rgba(235, 235, 245, .52); --label-4: rgba(235, 235, 245, .26);
  --shadow-float: 0 1px 1px rgba(0, 0, 0, .3), 0 12px 32px -8px rgba(0, 0, 0, .6);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .4);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh;
  font: 15px/1.45 var(--font); letter-spacing: -.01em;
  color: var(--label); background: var(--wall-base);
  -webkit-font-smoothing: antialiased;
}
.wallpaper {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vmax 50vmax at 8% 10%, var(--wall-1), transparent 60%),
    radial-gradient(55vmax 45vmax at 95% 20%, var(--wall-2), transparent 60%),
    radial-gradient(60vmax 55vmax at 60% 105%, var(--wall-3), transparent 60%),
    var(--wall-base);
}
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
input, textarea, select, button { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--label-2); }
.faint { color: var(--label-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.i.sm { width: 15px; height: 15px; }
svg.i.lg { width: 22px; height: 22px; }

* { scrollbar-width: thin; scrollbar-color: var(--label-4) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--label-4); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

/* ---------- material ---------- */
.glass {
  background: var(--mat-regular);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--mat-stroke);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 0 0 .5px var(--mat-edge);
}
.glass.thick { background: var(--mat-thick); }
.glass.thin { background: var(--mat-thin); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 999px; border: 0; cursor: pointer;
  font-weight: 590; font-size: 14px; white-space: nowrap;
  background: var(--bg-fill); color: var(--label);
  transition: transform .18s var(--ease), background-color .18s var(--ease), opacity .18s;
}
.btn:hover { background: color-mix(in srgb, var(--bg-fill) 100%, var(--label) 6%); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.tinted { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.btn.danger { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.btn.plain { background: transparent; color: var(--accent); padding: 0 8px; }
.btn.plain:hover { background: var(--bg-fill-2); }
.btn.icon { width: 34px; padding: 0; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.icon.sm { width: 28px; padding: 0; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
.btn.is-loading { pointer-events: none; opacity: .7; }

/* ---------- segmented control ---------- */
.seg {
  display: inline-flex; padding: 2px; border-radius: 10px; background: var(--bg-fill); position: relative; gap: 0;
}
.seg button {
  position: relative; z-index: 1; border: 0; background: transparent; cursor: pointer;
  height: 28px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 510; color: var(--label);
  display: inline-flex; align-items: center; gap: 5px; transition: background-color .2s var(--ease), box-shadow .2s;
}
.seg button[aria-pressed="true"] { background: var(--bg-grouped); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); font-weight: 600; }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: #636366; } }

/* ---------- form ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--label-2); letter-spacing: .01em; }
.input, .select, .textarea {
  width: 100%; min-height: 38px; padding: 8px 12px; border-radius: 11px; border: 0;
  background: var(--bg-fill-2); color: var(--label); outline: none;
  box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .18s, background-color .18s;
}
.input::placeholder, .textarea::placeholder { color: var(--label-3); }
.input:focus, .select:focus, .textarea:focus { background: var(--bg-grouped); box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.select { appearance: none; padding-right: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 15 5 5 5-5M7 9l5-5 5 5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.input.bare { background: transparent; padding: 4px 0; min-height: 0; border-radius: 6px; }
.input.bare:focus { box-shadow: none; background: transparent; }
.title-input { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--bg-fill); transition: background-color .25s var(--ease); pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .3s var(--spring); }
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }

/* ---------- grouped list (iOS Settings) ---------- */
.group { background: var(--bg-grouped); border-radius: var(--r-md); box-shadow: var(--shadow-card); overflow: hidden; }
.group-title { margin: 22px 4px 8px; font-size: 13px; font-weight: 600; color: var(--label-2); display: flex; align-items: center; gap: 8px; }
.group-title .count { color: var(--label-3); font-weight: 500; }
.row {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 14px;
  cursor: default; transition: background-color .15s;
}
.row + .row::before { content: ""; position: absolute; top: 0; right: 0; left: var(--sep-inset, 46px); border-top: .5px solid var(--sep); }
.row.click { cursor: pointer; }
.row.click:hover { background: var(--bg-row-hover); }
.row .grow { flex: 1; min-width: 0; }
.row .title { display: block; font-weight: 510; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row .sub { font-size: 12.5px; color: var(--label-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 1px; }

/* ---------- chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 560; background: var(--bg-fill-2); color: var(--label-2); white-space: nowrap; border: 0;
}
button.chip { cursor: pointer; }
button.chip:hover { background: var(--bg-fill); }
.chip .dot, .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--gray)); flex: none; }
.chip.tint { background: color-mix(in srgb, var(--c) 15%, transparent); color: color-mix(in srgb, var(--c) 82%, var(--label)); }
.tag-ident { font: 600 12px/1 var(--font); color: var(--label-3); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.avatar {
  --c: var(--blue); width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c));
  box-shadow: 0 0 0 1.5px var(--bg-grouped);
}
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -6px; }
.course-swatch { width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center; color: #fff;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 72%, #fff), var(--c)); box-shadow: inset 0 0 0 .5px rgba(0,0,0,.08); }
.course-swatch svg.i { width: 16px; height: 16px; stroke-width: 2; }

/* 状态组图标（Plane 风格） */
.state-ic { width: 16px; height: 16px; flex: none; color: var(--c, var(--gray)); }
.prio-ic { width: 16px; height: 16px; flex: none; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; padding: 14px 10px 12px; display: flex; flex-direction: column; gap: 4px;
  border-width: 0 1px 0 0; border-radius: 0; overflow-y: auto; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; }
.brand .me { flex: 1; min-width: 0; }
.brand .me b { display: block; font-size: 15px; letter-spacing: -.02em; }
.brand .me small { color: var(--label-3); font-size: 12px; }
.nav-label { margin: 14px 10px 4px; font-size: 12px; font-weight: 600; color: var(--label-3); display: flex; align-items: center; justify-content: space-between; }
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 9px;
  color: var(--label); font-weight: 510; font-size: 14px; cursor: pointer; text-decoration: none !important;
  transition: background-color .15s;
}
.nav-item:hover { background: var(--bg-fill-2); }
.nav-item[aria-current="page"] { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }
.nav-item[aria-current="page"] svg.i { color: var(--accent); }
.nav-item svg.i { color: var(--label-2); }
.nav-item .badge { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--label-3); font-variant-numeric: tabular-nums; }
.nav-item .badge.hot { color: #fff; background: var(--red); border-radius: 99px; padding: 1px 7px; }
.nav-item .swatch { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; margin: 0 4px; }
.nav-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot { margin-top: auto; display: flex; gap: 6px; padding: 8px 4px 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 10px 28px; border-width: 0 0 1px; border-radius: 0;
}
.topbar h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.025em; display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar h1 .crumb { color: var(--label-3); font-weight: 600; }
.topbar .spacer { flex: 1; }
.content { padding: 22px 28px 120px; width: 100%; max-width: 1280px; margin: 0 auto; }
.content.wide { max-width: none; }
.subbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.subbar .spacer { flex: 1; }

/* ---------- 灵动岛：下一个 DDL ---------- */
.island {
  display: flex; align-items: center; gap: 10px; margin: 2px 2px 8px; padding: 10px 12px; border-radius: 18px;
  background: #0b0b0d; color: #fff; cursor: pointer; text-decoration: none !important;
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .55), inset 0 0 0 .5px rgba(255, 255, 255, .08);
  transition: transform .3s var(--spring);
}
.island:hover { transform: scale(1.02); }
:root[data-theme="dark"] .island { background: #2c2c2e; box-shadow: 0 10px 24px -10px rgba(0,0,0,.8), inset 0 0 0 .5px rgba(255,255,255,.14); }
:root[data-theme="dark"] .island .ring::after { background: #2c2c2e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .island { background: #2c2c2e; box-shadow: 0 10px 24px -10px rgba(0,0,0,.8), inset 0 0 0 .5px rgba(255,255,255,.14); }
  :root:not([data-theme="light"]) .island .ring::after { background: #2c2c2e; }
}
.island .ring { --p: 0; --c: var(--blue); width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), rgba(255,255,255,.14) 0); }
.island .ring::after { content: ""; width: 26px; height: 26px; border-radius: 50%; background: #0b0b0d; grid-area: 1/1; }
.island .ring svg.i { grid-area: 1/1; z-index: 1; width: 14px; height: 14px; color: var(--c); stroke-width: 2.25; }
.island .txt { min-width: 0; flex: 1; }
.island .txt b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.island .txt span { font-size: 12px; color: rgba(255, 255, 255, .6); }
.island .cd { font: 700 15px/1 var(--font-round); font-variant-numeric: tabular-nums; color: var(--c); white-space: nowrap; }
.island.empty .cd { color: var(--green); }

/* ---------- DDL list ---------- */
.ddl-row { --c: var(--blue); }
.ddl-row .check {
  width: 24px; height: 24px; border-radius: 50%; border: 1.75px solid var(--label-4); background: transparent; flex: none; cursor: pointer;
  display: grid; place-items: center; color: transparent; transition: all .2s var(--ease);
}
.ddl-row .check:hover { border-color: var(--green); color: var(--green); }
.ddl-row .check.done { background: var(--green); border-color: var(--green); color: #fff; }
.ddl-row .check svg.i { width: 13px; height: 13px; stroke-width: 3; }
.countdown { text-align: right; flex: none; min-width: 84px; }
.countdown b { display: block; font: 700 17px/1.1 var(--font-round); font-variant-numeric: tabular-nums; color: var(--c); letter-spacing: -.01em; }
.countdown small { font-size: 11.5px; color: var(--label-3); }
.urg-over { --c: var(--red); } .urg-today { --c: var(--orange); } .urg-soon { --c: var(--yellow); } .urg-later { --c: var(--blue); }
:root .urg-soon .countdown b { color: color-mix(in srgb, var(--orange) 60%, var(--yellow)); }
.ddl-row.leaving { opacity: 0; transform: translateX(24px); transition: opacity .35s var(--ease), transform .35s var(--ease); }

/* ---------- kanban ---------- */
.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 12px; min-height: 60vh; scroll-snap-type: x proximity; }
.col { flex: 0 0 292px; display: flex; flex-direction: column; gap: 8px; scroll-snap-align: start; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px; font-weight: 650; font-size: 14px; }
.col-head .count { color: var(--label-3); font-weight: 500; font-variant-numeric: tabular-nums; }
.col-head .btn { margin-left: auto; }
.col-body { display: flex; flex-direction: column; gap: 8px; min-height: 80px; padding: 6px; border-radius: var(--r-md); background: var(--bg-fill-2); }
.card {
  background: var(--bg-grouped); border-radius: 12px; padding: 11px 12px; box-shadow: var(--shadow-card); cursor: grab;
  display: grid; gap: 8px; transition: transform .2s var(--ease), box-shadow .2s;
}
.card:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow-card); }
.card .ct { font-weight: 560; font-size: 14px; line-height: 1.35; }
.card .meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.sortable-ghost { opacity: .35; }
.sortable-chosen { transform: rotate(1.2deg) scale(1.02); box-shadow: var(--shadow-float); }

/* ---------- list view ---------- */
.ilist .row { --sep-inset: 14px; min-height: 44px; }
.ilist .row .title { font-weight: 500; }
.ilist .props { display: flex; align-items: center; gap: 6px; flex: none; }
.ilist .subhead { padding: 10px 14px 6px; font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 8px; background: var(--bg-fill-2); }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--sep); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-card); }
.cal .dow { background: var(--bg-grouped); padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--label-3); }
.cal .day { background: var(--bg-grouped); min-height: 112px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal .day.out { background: color-mix(in srgb, var(--bg-grouped) 55%, transparent); }
.cal .day .dn { font-size: 13px; font-weight: 600; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; font-variant-numeric: tabular-nums; }
.cal .day.out .dn { color: var(--label-4); }
.cal .day.today .dn { background: var(--red); color: #fff; }
.cal .ev { --c: var(--blue); font-size: 12px; padding: 2px 6px; border-radius: 5px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--label)); font-weight: 560; border: 0; text-align: left; }
.cal .ev.done { text-decoration: line-through; opacity: .55; }

/* ---------- timetable 周课表 ---------- */
.tt { --hour: 56px; display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); background: var(--bg-grouped); border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.tt .hd { padding: 10px 6px; text-align: center; font-size: 12px; font-weight: 600; color: var(--label-3); border-bottom: .5px solid var(--sep); background: var(--bg-grouped); }
.tt .hd b { display: block; font-size: 18px; color: var(--label); font-weight: 650; font-variant-numeric: tabular-nums; }
.tt .hd.today b { color: #fff; background: var(--red); width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; margin: 2px auto 0; }
.tt .gutter { position: relative; }
.tt .gutter span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.tt .daycol { position: relative; border-left: .5px solid var(--sep); background-image: repeating-linear-gradient(to bottom, var(--sep) 0 .5px, transparent .5px var(--hour)); }
.tt .daycol.today { background-color: color-mix(in srgb, var(--accent) 4%, transparent); }
.tt .blk {
  --c: var(--blue); position: absolute; left: 3px; right: 3px; border-radius: 10px; padding: 6px 8px; overflow: hidden; cursor: pointer;
  background: color-mix(in srgb, var(--c) 18%, var(--bg-grouped)); color: color-mix(in srgb, var(--c) 70%, var(--label));
  box-shadow: inset 3px 0 0 var(--c); font-size: 12px; line-height: 1.3; border: 0; text-align: left;
  transition: transform .2s var(--ease);
}
.tt .blk:hover { transform: scale(1.02); z-index: 1; }
.tt .blk b { display: block; font-size: 12.5px; font-weight: 650; }
.tt .blk.alt { background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--c) 10%, transparent) 6px 12px); }
.tt .now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 3; pointer-events: none; }
.tt .now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }

/* ---------- drawer / sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .22); opacity: 0; transition: opacity .25s var(--ease); }
.scrim.open { opacity: 1; }
.drawer {
  position: fixed; z-index: 51; top: 10px; right: 10px; bottom: 10px; width: min(640px, calc(100vw - 20px));
  border-radius: var(--r-xl); box-shadow: var(--shadow-float); display: flex; flex-direction: column; overflow: hidden;
  transform: translateX(calc(100% + 20px)); transition: transform .38s var(--ease);
  background: var(--mat-sheet);
  -webkit-backdrop-filter: saturate(180%) blur(40px); backdrop-filter: saturate(180%) blur(40px);
}
.drawer.open { transform: none; }
.drawer.full { width: calc(100vw - 20px); }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: .5px solid var(--sep); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 40px; }
.dialog {
  position: fixed; z-index: 61; left: 50%; top: 12vh; width: min(560px, calc(100vw - 24px)); transform: translate(-50%, 10px) scale(.98); opacity: 0;
  border-radius: var(--r-xl); box-shadow: var(--shadow-float); transition: transform .3s var(--spring), opacity .2s; background: var(--mat-sheet); -webkit-backdrop-filter: saturate(180%) blur(40px); backdrop-filter: saturate(180%) blur(40px);
  max-height: 78vh; display: flex; flex-direction: column;
}
.dialog.open { transform: translate(-50%, 0) scale(1); opacity: 1; }
.dialog-body { padding: 20px 22px; overflow-y: auto; display: grid; gap: 14px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; }
.dialog h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.scrim.dim { background: rgba(0, 0, 0, .28); z-index: 60; }

/* 属性面板 */
.props-grid { display: grid; grid-template-columns: 96px 1fr; gap: 4px 12px; align-items: center; margin: 16px 0 6px; }
.props-grid > label { font-size: 13px; color: var(--label-3); display: flex; align-items: center; gap: 6px; min-height: 34px; }
.prop-btn {
  display: inline-flex; align-items: center; gap: 7px; min-height: 32px; padding: 4px 10px; border-radius: 9px; border: 0; background: transparent;
  cursor: pointer; font-size: 14px; text-align: left; max-width: 100%; color: var(--label);
}
.prop-btn:hover { background: var(--bg-fill-2); }
.prop-btn.empty { color: var(--label-3); }
input.prop-btn { font-variant-numeric: tabular-nums; }

/* 弹出菜单 */
.menu {
  position: fixed; z-index: 80; min-width: 220px; max-width: 300px; max-height: 340px; overflow-y: auto; padding: 6px;
  border-radius: 14px; box-shadow: var(--shadow-float); background: var(--mat-sheet); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  transform-origin: top left; animation: pop .22s var(--spring);
}
@keyframes pop { from { opacity: 0; transform: scale(.94); } }
.menu .mi { display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 9px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font-size: 14px; text-align: left; color: var(--label); }
.menu .mi:hover, .menu .mi.active { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.menu .mi .ck { margin-left: auto; color: var(--accent); }
.menu .mi.danger { color: var(--red); }
.menu input.input { margin-bottom: 4px; min-height: 32px; padding: 6px 10px; }
.menu hr { border: 0; border-top: .5px solid var(--sep); margin: 5px 6px; }

/* ⌘K */
.palette { position: fixed; z-index: 90; left: 50%; top: 14vh; width: min(620px, calc(100vw - 24px)); transform: translateX(-50%); border-radius: 20px; box-shadow: var(--shadow-float); background: var(--mat-sheet); -webkit-backdrop-filter: saturate(180%) blur(40px); backdrop-filter: saturate(180%) blur(40px); overflow: hidden; animation: pop .22s var(--spring); }
.palette .pin { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: .5px solid var(--sep); }
.palette .pin input { flex: 1; border: 0; background: transparent; outline: none; font-size: 17px; }
.palette .res { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette .res .mi { padding: 9px 12px; }
kbd { font: 600 11px/1 var(--font); padding: 3px 6px; border-radius: 5px; background: var(--bg-fill); color: var(--label-2); }

/* toast */
.toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: rgba(28, 28, 30, .9); color: #fff; font-size: 14px; font-weight: 520; box-shadow: var(--shadow-float); animation: toastIn .35s var(--spring); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.toast button { border: 0; background: none; color: #64D2FF; font-weight: 650; cursor: pointer; padding: 0 0 0 6px; }
.toast.err { background: rgba(255, 59, 48, .92); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.95); } }

/* misc */
.empty-state { text-align: center; padding: 56px 20px; color: var(--label-2); display: grid; justify-items: center; gap: 10px; }
.empty-state .art { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.empty-state .art svg.i { width: 30px; height: 30px; }
.empty-state h3 { margin: 4px 0 0; color: var(--label); font-size: 17px; }
.empty-state p { margin: 0; max-width: 40ch; font-size: 14px; }
.progress { height: 6px; border-radius: 99px; background: var(--bg-fill); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--green)); }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.panel { background: var(--bg-grouped); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 16px 18px; }
.panel h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.panel h3 .btn { margin-left: auto; }
.skeleton { background: linear-gradient(90deg, var(--bg-fill-2), var(--bg-fill), var(--bg-fill-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.md { line-height: 1.7; font-size: 15px; max-width: 72ch; }
.md h1, .md h2, .md h3 { letter-spacing: -.02em; line-height: 1.3; margin: 1.4em 0 .5em; }
.md h1 { font-size: 26px; } .md h2 { font-size: 21px; } .md h3 { font-size: 17px; }
.md p, .md ul, .md ol { margin: 0 0 .9em; }
.md code { font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; background: var(--bg-fill-2); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--bg-fill-2); padding: 12px 14px; border-radius: 12px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 0 0 1em; padding: 2px 14px; border-left: 1px solid var(--label-4); color: var(--label-2); }
.md a.issue-ref { display: inline-flex; padding: 0 6px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 12%, transparent); font-weight: 600; font-size: .92em; }
.md img { max-width: 100%; border-radius: 12px; }
.md input[type=checkbox] { accent-color: var(--green); }

.activity { display: grid; gap: 12px; margin-top: 8px; }
.activity .act { display: flex; gap: 10px; font-size: 13px; color: var(--label-2); align-items: flex-start; }
.activity .act .when { color: var(--label-3); margin-left: 4px; }
.activity .comment { background: var(--bg-grouped); border-radius: 12px; padding: 10px 12px; color: var(--label); font-size: 14px; flex: 1; box-shadow: var(--shadow-card); }

/* Gantt 覆写 */
.gantt-wrap { background: var(--bg-grouped); border-radius: var(--r-lg); box-shadow: var(--shadow-card); overflow: hidden; }
.gantt-wrap .gantt-container { --g-arrow-color: var(--label-3); --g-bar-color: color-mix(in srgb, var(--accent) 22%, var(--bg-grouped)); --g-bar-border: transparent;
  --g-tick-color-thick: var(--sep); --g-tick-color: color-mix(in srgb, var(--sep) 50%, transparent); --g-actions-background: var(--bg-fill-2);
  --g-border-color: var(--sep); --g-text-muted: var(--label-3); --g-text-light: #fff; --g-text-dark: var(--label); --g-progress-color: var(--accent);
  --g-handle-color: var(--accent); --g-weekend-label-color: var(--label-3); --g-expected-progress: var(--bg-fill); --g-header-background: var(--bg-grouped);
  --g-row-color: transparent; --g-row-border-color: var(--sep); --g-today-highlight: var(--red); --g-popup-actions: var(--bg-fill-2); --g-weekend-highlight-color: var(--bg-fill-2);
  font-family: var(--font); border-radius: var(--r-lg); }
.gantt-wrap .gantt .bar-label { font-weight: 600; fill: var(--label); }
.gantt-wrap .gantt .bar-wrapper .bar { rx: 7px; }

/* ---------- responsive ---------- */
.tabbar { display: none; }
.show-sm { display: none !important; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-105%); transition: transform .35s var(--ease); background: var(--mat-thick); border-width: 0 1px 0 0; box-shadow: var(--shadow-float); }
  .sidebar.open { transform: none; }
  .topbar { padding: 10px 16px; }
  .topbar h1 { font-size: 18px; }
  .content { padding: 16px 16px 120px; }
  .tabbar {
    display: flex; position: fixed; z-index: 30; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: 62px; border-radius: 26px; padding: 6px; justify-content: space-around;
  }
  .tabbar a { flex: 1; display: grid; justify-items: center; align-content: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--label-2); border-radius: 20px; text-decoration: none !important; }
  .tabbar a[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
  .tabbar svg.i { width: 22px; height: 22px; }
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: 92dvh; border-radius: 26px 26px 0 0; transform: translateY(100%); }
  .drawer.open { transform: none; }
  .props-grid { grid-template-columns: 84px 1fr; }
  .col { flex-basis: 82vw; }
  .tt { grid-template-columns: 40px minmax(0, 1fr); }
  .tt .hd:not(.focus):not(.corner), .tt .daycol:not(.focus) { display: none; }
  .hide-sm { display: none !important; }
  .show-sm { display: flex !important; }
  .toasts { bottom: 90px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
