/* 场景：新来的国际学生在阳光下的校园里边走边用 iPhone 看下一节课在哪；晚上在笔记本上排一周。
   所以默认浅色、高对比、数字大；系统切暗色时跟随。颜色只给课程，界面本身保持安静。 */

:root {
  --bg: oklch(97.6% 0.006 85);
  --panel: oklch(99.2% 0.003 85);
  --sunken: oklch(94.8% 0.007 85);
  --line: oklch(90.5% 0.008 85);
  --line-2: oklch(84% 0.01 85);
  --ink: oklch(22% 0.012 265);
  --ink-2: oklch(41% 0.012 265);
  --ink-3: oklch(57% 0.01 265);
  --now: oklch(61% 0.2 33);
  --warn: oklch(52% 0.13 65);
  --warn-bg: oklch(95% 0.045 85);
  --focus: oklch(58% 0.16 255);
  --press: oklch(22% 0.012 265 / .06);

  --hour: 58px;
  --side: 248px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "PingFang SC", system-ui, sans-serif;

  --py:  oklch(52% 0.14 255); --py-bg:  oklch(95.4% 0.028 255); --py-ln:  oklch(84% 0.06 255);
  --ms:  oklch(52% 0.15 300); --ms-bg:  oklch(95.4% 0.03 300);  --ms-ln:  oklch(84% 0.06 300);
  --fds: oklch(52% 0.12 158); --fds-bg: oklch(95.4% 0.035 158); --fds-ln: oklch(84% 0.07 158);
  --de:  oklch(52% 0.1 210);  --de-bg:  oklch(95.4% 0.03 210);  --de-ln:  oklch(84% 0.06 210);
  --bda: oklch(55% 0.14 52);  --bda-bg: oklch(95.4% 0.035 60);  --bda-ln: oklch(85% 0.07 55);
  --viz: oklch(53% 0.16 10);  --viz-bg: oklch(95.4% 0.03 10);   --viz-ln: oklch(84% 0.065 10);
  --gaa: oklch(50% 0.09 100); --gaa-bg: oklch(95% 0.035 100);   --gaa-ln: oklch(84% 0.06 100);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: oklch(17.5% 0.006 265);
    --panel: oklch(20.5% 0.007 265);
    --sunken: oklch(15.5% 0.006 265);
    --line: oklch(27.5% 0.008 265);
    --line-2: oklch(34% 0.009 265);
    --ink: oklch(95% 0.005 85);
    --ink-2: oklch(79% 0.006 85);
    --ink-3: oklch(63% 0.007 265);
    --now: oklch(70% 0.18 33);
    --warn: oklch(80% 0.12 75);
    --warn-bg: oklch(28% 0.04 75);
    --focus: oklch(72% 0.13 255);
    --press: oklch(95% 0.005 85 / .07);

    --py:  oklch(80% 0.1 255); --py-bg:  oklch(28% 0.05 255); --py-ln:  oklch(40% 0.07 255);
    --ms:  oklch(80% 0.1 300); --ms-bg:  oklch(28% 0.05 300); --ms-ln:  oklch(40% 0.07 300);
    --fds: oklch(81% 0.1 158); --fds-bg: oklch(28% 0.045 158); --fds-ln: oklch(40% 0.06 158);
    --de:  oklch(81% 0.08 210); --de-bg:  oklch(28% 0.04 210); --de-ln:  oklch(40% 0.06 210);
    --bda: oklch(82% 0.1 60);  --bda-bg: oklch(29% 0.05 55);  --bda-ln: oklch(41% 0.07 55);
    --viz: oklch(80% 0.1 10);  --viz-bg: oklch(28% 0.05 10);  --viz-ln: oklch(40% 0.07 10);
    --gaa: oklch(83% 0.08 100); --gaa-bg: oklch(28% 0.035 100); --gaa-ln: oklch(40% 0.05 100);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font); font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; }
button, select { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 60; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }
.eyebrow { font-size: 12.5px; color: var(--ink-3); letter-spacing: .01em; }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

[data-c] { --c: var(--ink-2); --c-bg: var(--sunken); --c-ln: var(--line-2); }
[data-c="py"]  { --c: var(--py);  --c-bg: var(--py-bg);  --c-ln: var(--py-ln); }
[data-c="ms"]  { --c: var(--ms);  --c-bg: var(--ms-bg);  --c-ln: var(--ms-ln); }
[data-c="fds"] { --c: var(--fds); --c-bg: var(--fds-bg); --c-ln: var(--fds-ln); }
[data-c="de"]  { --c: var(--de);  --c-bg: var(--de-bg);  --c-ln: var(--de-ln); }
[data-c="bda"] { --c: var(--bda); --c-bg: var(--bda-bg); --c-ln: var(--bda-ln); }
[data-c="viz"] { --c: var(--viz); --c-bg: var(--viz-bg); --c-ln: var(--viz-ln); }
[data-c="gaa"] { --c: var(--gaa); --c-bg: var(--gaa-bg); --c-ln: var(--gaa-ln); }

/* ---------- 按钮 ---------- */
.btn, .ghost-btn, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 15px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 560; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s var(--ease), transform .1s var(--ease), border-color .15s var(--ease);
}
.btn:active, .ghost-btn:active, .icon-btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: color-mix(in oklch, var(--ink) 86%, var(--bg)); }
.btn.quiet { background: color-mix(in oklch, var(--c, var(--ink)) 10%, transparent); color: var(--ink); }
.btn.quiet:hover { background: color-mix(in oklch, var(--c, var(--ink)) 17%, transparent); }
.ghost-btn { background: transparent; border-color: var(--line-2); }
.ghost-btn:hover, .icon-btn:hover { background: var(--press); }
.icon-btn { width: 38px; padding: 0; border-color: var(--line-2); background: transparent; }
button:disabled { opacity: .38; cursor: default; }
button:disabled:active { transform: none; }
select {
  min-height: 38px; border-radius: 10px; border: 1px solid var(--line-2); background-color: transparent;
  padding: 0 30px 0 12px; font-size: 14px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 16px, calc(100% - 11px) 16px; background-size: 5px 5px; background-repeat: no-repeat;
}
.tag { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 620; white-space: nowrap; }
.tag.live { background: var(--now); color: oklch(99% 0.01 33); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--now); display: inline-block; animation: pulse 2s var(--ease) infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklch, var(--now) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 7px transparent; } }

/* ---------- 外框 ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh; overflow: auto;
  display: flex; flex-direction: column; gap: 26px;
  padding: 22px 16px 18px; background: var(--sunken); border-right: 1px solid var(--line);
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); position: relative; overflow: hidden; flex: none; }
.mark::before, .mark::after { content: ""; position: absolute; left: 7px; right: 7px; height: 3px; border-radius: 2px; background: var(--bg); }
.mark::before { top: 9px; }
.mark::after { top: 16px; right: 13px; background: var(--now); }
.side-title { font-size: 17px; font-weight: 680; letter-spacing: -.01em; line-height: 1.2; }
.nav { display: grid; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px;
  color: var(--ink-2); text-decoration: none; font-size: 14.5px; font-weight: 520;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.nav a:hover { background: var(--press); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line), 0 1px 2px oklch(20% 0.01 265 / .05); }
.side-next { padding: 0 6px; display: grid; gap: 8px; }
.side-next .lbl { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 7px; }
.side-next button {
  all: unset; box-sizing: border-box; cursor: pointer; display: grid; gap: 2px; padding: 11px 12px; border-radius: 11px;
  background: var(--c-bg); border: 1px solid var(--c-ln); transition: transform .1s var(--ease);
}
.side-next button:active { transform: scale(.98); }
.side-next button:focus-visible { outline: 2px solid var(--focus); }
.side-next .t { font-size: 21px; font-weight: 680; line-height: 1.15; }
.side-next .n { font-size: 13.5px; font-weight: 620; color: var(--ink); }
.side-next .r { font-size: 12.5px; color: var(--c); font-weight: 620; }
.side-foot { margin-top: auto; padding: 0 6px; font-size: 12px; color: var(--ink-3); display: grid; gap: 6px; line-height: 1.45; }
.side-foot a { color: var(--ink-2); text-underline-offset: 3px; text-decoration-color: var(--line-2); }

main { min-width: 0; padding: 34px clamp(20px, 4vw, 52px) 64px; outline: none; }
.view { max-width: 1120px; }
.page-head { display: grid; gap: 4px; margin-bottom: 24px; }
.page-head.row { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--display); font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.022em; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sec-head h2 { font-size: 15px; font-weight: 650; }
.sec-head span { font-size: 12.5px; color: var(--ink-3); text-align: right; }
.split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; margin-top: 38px; align-items: start; }
.view > section { margin-top: 40px; }

/* ---------- 下一节 ---------- */
.up { background: var(--c-bg); border: 1px solid var(--c-ln); border-radius: 18px; padding: 24px 28px 22px; display: grid; gap: 20px; }
.up-top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 640; color: var(--c); }
.up-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 36px; align-items: end; }
.up-time { font-size: 66px; line-height: .95; font-weight: 680; }
.up-time small { display: block; font-size: 17px; font-weight: 520; color: var(--ink-2); letter-spacing: 0; margin-top: 10px; }
.up-name { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.18; letter-spacing: -.018em; }
.up-en { color: var(--ink-2); font-size: 14px; margin-top: 3px; }
.up-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 14px; font-size: 14px; color: var(--ink-2); align-items: center; }
.up-facts b { color: var(--ink); font-weight: 650; }
.up-facts .room { color: var(--c); }
.up-bar { height: 4px; border-radius: 4px; background: color-mix(in oklch, var(--c) 18%, transparent); overflow: hidden; }
.up-bar i { display: block; height: 100%; background: var(--c); border-radius: inherit; transition: width .6s var(--ease); }
.up-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.up-actions .when { margin-left: auto; font-size: 13.5px; color: var(--ink-2); }
.up-actions .when b { font-size: 16px; color: var(--ink); font-weight: 680; }
.up.empty-state { --c: var(--ink-2); --c-bg: var(--panel); --c-ln: var(--line); }

/* ---------- 一天的时间条 ---------- */
.strip { position: relative; height: 40px; margin: 2px 0 26px; border-radius: 10px; background: var(--sunken); }
.strip .blk { position: absolute; top: 6px; bottom: 6px; border-radius: 6px; background: var(--c-bg); border: 1px solid var(--c-ln); }
.strip .blk.done { opacity: .45; }
.strip .tick { position: absolute; bottom: -19px; font-size: 10.5px; color: var(--ink-3); transform: translateX(-50%); }
.strip .nowmark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--now); border-radius: 2px; }

/* ---------- 行列表 ---------- */
.rows { display: grid; }
.rows > li + li { border-top: 1px solid var(--line); }
.rows .empty { padding: 20px 0; color: var(--ink-3); font-size: 14px; }
.row {
  all: unset; box-sizing: border-box; cursor: pointer; width: calc(100% + 20px);
  display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 13px 10px; margin: 0 -10px; border-radius: 10px;
  transition: background-color .15s var(--ease);
}
.row:hover { background: var(--press); }
.row:focus-visible { outline: 2px solid var(--focus); }
.row.done .rt, .row.done .rn, .row.done .rr { color: var(--ink-3); }
.row.done .rn i { opacity: .45; }
.row.now { background: var(--c-bg); }
.rt { font-size: 17px; font-weight: 650; line-height: 1.15; }
.rt small { display: block; font-size: 12px; font-weight: 450; color: var(--ink-3); letter-spacing: 0; margin-top: 2px; }
.rn { font-weight: 620; display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.rn i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; }
.rm { font-size: 13px; color: var(--ink-3); margin-top: 2px; padding-left: 17px; }
.rr { text-align: right; font-size: 14px; font-weight: 650; color: var(--c); white-space: nowrap; }
.rr small { display: block; font-size: 12px; color: var(--ink-3); font-weight: 450; }

/* ---------- 学期甘特图 ---------- */
.gantt { display: grid; --gl: 150px; }
.g-axis { display: grid; grid-template-columns: var(--gl) minmax(0, 1fr); margin-bottom: 4px; }
.g-axis .track { height: 20px; }
.g-axis .lab { position: absolute; top: 0; font-size: 11px; color: var(--ink-3); white-space: nowrap; transform: translateX(-50%); }
.g-row {
  all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: var(--gl) minmax(0, 1fr);
  align-items: center; padding: 7px 0; border-radius: 8px; transition: background-color .15s var(--ease);
}
.g-row:hover { background: var(--press); }
.g-row:focus-visible { outline: 2px solid var(--focus); }
.g-name { font-size: 13.5px; font-weight: 580; color: var(--ink-2); display: flex; align-items: center; gap: 8px; padding: 0 12px 0 4px; min-width: 0; }
.g-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-name i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; }
.g-name em { font-style: normal; font-size: 11.5px; font-weight: 520; color: var(--ink-3); margin-left: auto; }
.g-row.cur .g-name { color: var(--ink); font-weight: 650; }
.track { position: relative; height: 18px; margin-right: 6px; }
.track .span { position: absolute; top: 7px; height: 4px; border-radius: 4px; background: var(--c-ln); }
.track .s { position: absolute; top: 3px; width: 5px; height: 12px; border-radius: 2px; background: var(--c); transform: translateX(-50%); }
.track .s.done { opacity: .32; }
.track .wk { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--line); }
.track .today { position: absolute; top: -8px; bottom: -8px; width: 2px; background: var(--now); border-radius: 2px; z-index: 2; }
.gantt.compact { --gl: 148px; }
.gantt.compact .g-row { padding: 5px 0; }

/* ---------- 周视图 ---------- */
.seg { display: flex; gap: 6px; align-items: center; }
.callout { background: var(--warn-bg); color: var(--ink); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 16px; }
.callout b { color: var(--warn); font-weight: 680; margin-right: 8px; }
.cal { display: grid; grid-template-columns: 56px repeat(5, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: clip; }
.ch {
  position: sticky; top: 0; z-index: 3; height: 62px; padding: 0 12px;
  display: flex; flex-direction: column; justify-content: center; gap: 1px;
  background: color-mix(in oklch, var(--panel) 90%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); border-left: 1px solid var(--line);
}
.ch:first-child { border-left: 0; }
.ch .d { font-size: 22px; font-weight: 680; line-height: 1.1; }
.ch .w { font-size: 12px; color: var(--ink-3); }
.ch.today .d, .ch.today .w { color: var(--now); }
.ch.today .w { font-weight: 620; }
.axis { position: relative; height: calc(var(--hour) * 9); }
.axis span { position: absolute; right: 9px; font-size: 11px; color: var(--ink-3); transform: translateY(-50%); }
.axis span:first-child { transform: none; top: 5px !important; }
.col { position: relative; border-left: 1px solid var(--line); height: calc(var(--hour) * 9); }
.col .hl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.col.off { background: repeating-linear-gradient(135deg, transparent 0 7px, color-mix(in oklch, var(--line) 55%, transparent) 7px 8px); }
.ev {
  all: unset; box-sizing: border-box; cursor: pointer;
  position: absolute; left: 5px; right: 5px; top: var(--t); height: var(--h);
  background: var(--c-bg); border: 1px solid var(--c-ln); border-radius: 10px;
  padding: 8px 10px; display: flex; flex-direction: column; gap: 1px; overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.ev:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -10px color-mix(in oklch, var(--c) 55%, transparent); }
.ev:active { transform: scale(.985); }
.ev:focus-visible { outline: 2px solid var(--focus); }
.ev .n { font-size: 13.5px; font-weight: 650; line-height: 1.25; color: var(--ink); }
.ev .t { font-size: 12px; color: var(--ink-2); }
.ev .r { font-size: 12.5px; font-weight: 650; color: var(--c); margin-top: auto; white-space: nowrap; }
.ev.short { padding: 6px 10px 5px; }
.ev.short .n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.short .t { display: none; }
.ev.done { opacity: .5; }
.ev .flag { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--c-bg); }
.ev.chg .n { padding-right: 12px; }
.col .off-label { position: absolute; top: 42%; left: 0; right: 0; text-align: center; font-size: 12.5px; color: var(--ink-3); }
.col .off-label b { display: block; color: var(--ink-2); font-weight: 620; font-size: 13.5px; }
.nowline { position: absolute; left: -1px; right: 0; border-top: 2px solid var(--now); z-index: 2; pointer-events: none; }
.nowline::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--now); }
.chips, .only-phone { display: none; }

/* ---------- 课程 ---------- */
.course-list { margin-top: 34px; border-top: 1px solid var(--line); }
.cr { border-bottom: 1px solid var(--line); }
.cr summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto 12px; gap: 16px; align-items: center; padding: 16px 4px; border-radius: 10px; }
.cr summary::-webkit-details-marker { display: none; }
.cr summary:hover .t1 { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.cr summary > i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.cr .t1 { font-size: 16px; font-weight: 650; }
.cr .t2 { font-size: 13px; color: var(--ink-3); }
.cr .when { font-size: 13.5px; color: var(--ink-2); text-align: right; }
.cr .state { font-size: 12px; font-weight: 620; padding: 3px 9px; border-radius: 7px; background: var(--sunken); color: var(--ink-3); min-width: 58px; text-align: center; }
.cr .state.on { background: var(--c-bg); color: var(--c); }
.cr summary::after { content: ""; width: 7px; height: 7px; border-right: 1.6px solid var(--ink-3); border-bottom: 1.6px solid var(--ink-3); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s var(--ease); }
.cr[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.cr-body { padding: 2px 4px 24px 32px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px 32px; }
.kv { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 9px 14px; font-size: 14px; align-content: start; }
.kv dt { color: var(--ink-3); }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.kv dd a { text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.pending { color: var(--ink-3); }
.days { display: flex; flex-wrap: wrap; gap: 6px; align-content: start; }
.days button {
  all: unset; cursor: pointer; font-size: 12.5px; font-variant-numeric: tabular-nums; padding: 5px 9px; border-radius: 7px;
  background: var(--sunken); color: var(--ink-2); transition: background-color .15s var(--ease);
}
.days button:hover { background: var(--c-bg); }
.days button:focus-visible { outline: 2px solid var(--focus); }
.days button.done { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.days button.next { background: var(--c); color: var(--bg); font-weight: 650; }
.days button.chg { box-shadow: inset 0 0 0 1.5px var(--warn); }
.cr-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.aside-note { margin-top: 22px; font-size: 13.5px; color: var(--ink-3); }
.aside-note a { color: var(--ink-2); text-underline-offset: 3px; }

/* ---------- 地点 ---------- */
.place { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--panel); }
.map { position: relative; min-height: 340px; background: var(--sunken); }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (prefers-color-scheme: dark) { .map iframe { filter: invert(.92) hue-rotate(180deg) saturate(.55) brightness(.95); } }
.place-body { padding: 24px 26px; display: grid; gap: 18px; align-content: start; }
.place-body h2 { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -.012em; line-height: 1.25; }
.place-body .addr { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.place-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rooms li { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); align-items: baseline; }
.rooms .rnum { font-size: 17px; font-weight: 700; }
.rooms .rdesc { font-size: 13.5px; color: var(--ink-2); }
.facts { display: grid; gap: 5px; font-size: 13.5px; color: var(--ink-2); }
.facts b { color: var(--ink); font-weight: 620; }
.dates-kv { grid-template-columns: 104px minmax(0, 1fr); gap: 10px 14px; }
.dates-kv dt { color: var(--ink); font-weight: 640; }
.dates-kv dd { color: var(--ink-2); }
.sub p { font-size: 14px; color: var(--ink-2); margin-bottom: 14px; max-width: 58ch; }
.sub .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.sub .links { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.sub .links a { color: var(--ink-2); text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); column-gap: 40px; }
.ct { display: grid; gap: 2px; padding: 13px 0; border-bottom: 1px solid var(--line); align-content: start; }
.ct .role { font-size: 12px; color: var(--ink-3); }
.ct .who { font-weight: 650; }
.ct .ways { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 14px; }
.ct .ways a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--line-2); overflow-wrap: anywhere; }
.ct .note { font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }

/* ---------- 详情抽屉 ---------- */
.drawer {
  margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(440px, 100vw); max-width: 100vw;
  padding: 0; border: 0; background: var(--panel); color: var(--ink);
  border-left: 1px solid var(--line); box-shadow: -24px 0 60px -30px oklch(15% 0.01 265 / .35);
}
.drawer::backdrop { background: oklch(15% 0.01 265 / .28); }
.drawer[open] { animation: in-right .26s var(--ease); }
.drawer[open]::backdrop { animation: fade .26s var(--ease); }
@keyframes in-right { from { transform: translateX(28px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer-in { padding: 22px 24px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 20px; align-content: start; }
.dh { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.dh .eyebrow { display: flex; align-items: center; gap: 7px; }
.dh .eyebrow i { width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.dh h2 { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -.015em; line-height: 1.2; margin-top: 4px; }
.dh .en { color: var(--ink-3); font-size: 13.5px; margin-top: 2px; }
.dtime { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 16px 18px; border-radius: 14px; background: var(--c-bg); border: 1px solid var(--c-ln); }
.dtime .big { font-size: 34px; font-weight: 700; line-height: 1; }
.dtime .sub2 { font-size: 13.5px; color: var(--ink-2); }
.dacts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dacts .btn, .dacts .ghost-btn { width: 100%; }
.dacts .wide { grid-column: 1 / -1; }
.drawer .rows .row { width: 100%; margin: 0; }

.noscript { padding: 24px; text-align: center; }
.tabbar { display: none; }

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

/* ---------- 平板 ---------- */
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .place { grid-template-columns: minmax(0, 1fr); }
  .map { min-height: 240px; }
  .cr-body { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 手机 ---------- */
@media (max-width: 760px) {
  body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .shell { display: block; }
  .side { display: none; }
  main { padding: calc(20px + env(safe-area-inset-top)) 18px 28px; }
  .page-head { margin-bottom: 18px; }
  .page-head h1 { font-size: 27px; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in oklch, var(--bg) 86%, transparent); backdrop-filter: saturate(1.5) blur(18px); -webkit-backdrop-filter: saturate(1.5) blur(18px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 5px 0; text-decoration: none; color: var(--ink-3); font-size: 10.5px; font-weight: 560; border-radius: 10px; }
  .tabbar svg { width: 24px; height: 24px; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a:active { background: var(--press); }

  .up { padding: 20px 18px 18px; border-radius: 16px; gap: 16px; }
  .up-main { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .up-time { font-size: 50px; display: flex; align-items: baseline; gap: 10px; }
  .up-time small { display: inline; font-size: 16px; margin: 0; }
  .up-name { font-size: 23px; }
  .up-facts { margin-top: 10px; gap: 4px 16px; }
  .up-actions .btn { flex: 1 1 auto; }
  .up-actions .btn.primary { flex-basis: 100%; min-height: 46px; font-size: 15px; }
  .up-actions .when { margin: 0; width: 100%; order: -1; }

  .row { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; padding: 13px 8px; margin: 0 -8px; width: calc(100% + 16px); }
  .rr { grid-column: 2; text-align: left; padding-left: 17px; }
  .rr small { display: inline; margin-left: 6px; }

  .gantt, .gantt.compact { --gl: 110px; }
  .g-name { font-size: 12.5px; padding-right: 8px; }
  .g-name em { display: none; }

  .page-head.row { align-items: stretch; }
  .seg { width: 100%; }
  .seg select { flex: 1; min-width: 0; }
  .cal { display: none; }
  .chips {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0 -4px 6px;
    position: sticky; top: 0; z-index: 5; padding: calc(8px + env(safe-area-inset-top)) 4px 8px; background: var(--bg);
  }
  .chip { all: unset; cursor: pointer; display: grid; justify-items: center; gap: 2px; padding: 8px 0 7px; border-radius: 12px; }
  .chip .w { font-size: 11.5px; color: var(--ink-3); }
  .chip .d { font-size: 19px; font-weight: 680; }
  .chip .dots { display: flex; gap: 3px; height: 5px; }
  .chip .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
  .chip.today .w, .chip.today .d { color: var(--now); }
  .chip[aria-selected="true"] { background: var(--ink); }
  .chip[aria-selected="true"] .w, .chip[aria-selected="true"] .d { color: var(--bg); }
  .chip:focus-visible { outline: 2px solid var(--focus); }
  .only-phone { display: grid; }

  .cr summary { grid-template-columns: 12px minmax(0, 1fr) auto 12px; gap: 12px; }
  .cr .when { display: none; }
  .cr-body { padding-left: 4px; }
  .kv { grid-template-columns: 62px minmax(0, 1fr); }
  .place-body { padding: 20px 18px; }
  .contacts { grid-template-columns: minmax(0, 1fr); }

  .drawer {
    margin: auto 0 0; width: 100vw; height: auto; max-height: 90dvh; border-left: 0; border-top: 1px solid var(--line);
    border-radius: 20px 20px 0 0; box-shadow: 0 -20px 60px -30px oklch(15% 0.01 265 / .4);
  }
  .drawer[open] { animation: in-up .28s var(--ease); }
  @keyframes in-up { from { transform: translateY(36px); opacity: .4; } }
  .drawer-in { padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); }
  .drawer-in::before { content: ""; justify-self: center; width: 38px; height: 5px; border-radius: 3px; background: var(--line-2); }
}

@media print {
  .side, .tabbar, .seg, .up-actions { display: none !important; }
  .shell { display: block; }
}
