    :root {
      color-scheme: light;
      --ink: #152b35;
      --muted: #647780;
      --line: #dce5e8;
      --canvas: #f3f6f7;
      --paper: #fff;
      --blue: #1e5c75;
      --blue-strong: #164b62;
      --blue-soft: #e8f2f5;
      --mint: #e5f4ed;
      --mint-ink: #236548;
      --amber: #a56e24;
      --amber-soft: #fff3dc;
      --shadow: 0 12px 32px rgba(23, 53, 66, .06);
      font-family: "Inter", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
    }
    * { box-sizing: border-box; }
    body { margin: 0; background: var(--canvas); color: var(--ink); }
    button, input, select { font: inherit; }
    button { color: inherit; }
    a { color: inherit; }
    .layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); }
    .sidebar { display: contents; }
    .brand { grid-row: 1; display: flex; align-items: center; gap: 12px; margin: 22px clamp(20px, 4vw, 58px) 24px; }
    .brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: white; background: var(--blue); }
    .brand-mark svg { width: 23px; height: 23px; }
    .brand-name { font-weight: 800; letter-spacing: .02em; }
    .brand-caption { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
    .field { margin: 0 0 21px; padding: 0; border: 0; min-width: 0; }
    .field-label { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 750; }
    .field-help { color: var(--muted); font-size: 11px; line-height: 1.6; }
    .day-grid { display: flex; flex-flow: row nowrap; gap: 3px; padding: 0 1rem; }
    .day-button, .period-button { border: 1px solid var(--line); background: white; cursor: pointer; transition: .16s ease; }
    .day-button { flex: 1 1 0; min-width: 28px; min-height: 38px; padding: 0; border-radius: 10px; color: #49616b; font-size: 12px; }
    .day-button:hover, .period-button:hover { border-color: #89b4c4; color: var(--blue); }
    .day-button[aria-pressed="true"] { border-color: var(--blue); background: var(--blue); color: white; box-shadow: 0 5px 12px rgba(30, 92, 117, .18); }
    .period-groups { display: block; }
    .period-group-title { margin: 0 0 6px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; }
    .period-grid { display: flex; flex-flow: row nowrap; gap: 1px; overflow-x: auto; padding: 0 1px 5px; scrollbar-width: thin; }
    .period-button { flex: 1 0 18px; min-width: 18px; height: 34px; padding: 0 1px; border-radius: 8px; font-size: 11px; font-weight: 700; }
    .period-button:disabled { cursor: not-allowed; opacity: .55; }
    .period-button[aria-checked="true"] { border-color: #a9d4c1; background: var(--mint); color: var(--mint-ink); }
    .logic-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 10px 11px; border-radius: 10px; background: #f2f7f8; color: #4f6771; font-size: 11px; line-height: 1.55; }
    .logic-note svg { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 1px; color: var(--blue); }
    .control-wrap { position: relative; }
    .control-wrap select, .control-wrap input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: white; color: var(--ink); font-size: 13px; }
    .control-wrap select:focus, .control-wrap input:focus { border-color: #6ea6bb; box-shadow: 0 0 0 3px rgba(30, 92, 117, .1); }
    .two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .advanced-search { position: relative; grid-row: 5; width: 100%; padding: 0 clamp(20px, 4vw, 58px); }
    .advanced-search summary { position: absolute; top: -32px; left: clamp(20px, 4vw, 58px); display: flex; align-items: center; gap: 7px; width: max-content; padding: 10px 0; color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 750; list-style: none; }
    .advanced-search summary::-webkit-details-marker { display: none; }
    .advanced-search summary::after { content: '+'; font-size: 16px; line-height: 1; }
    .advanced-search[open] summary::after { content: '−'; }
    .advanced-search > .field { margin: 12px 0; }
    .text-button { border: 0; padding: 0; background: none; color: var(--blue); cursor: pointer; font-size: 12px; font-weight: 700; }
    .text-button:hover { color: var(--blue-strong); text-decoration: underline; }
    .reset-row { display: flex; justify-content: flex-end; margin-top: -9px; }
    .sidebar-note { margin-top: 26px; padding-top: 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.7; }
    .sidebar-note strong { color: #3f5963; }
    .filter-content { grid-row: 4; padding: 22px clamp(20px, 4vw, 58px) 4px; background: #fff; border-block: 1px solid var(--line); }
    .sidebar-note { grid-row: 6; margin: 0 clamp(20px, 4vw, 58px); }
    .main { display: contents; }
    .main > section[aria-live] { grid-row: 7; min-width: 0; padding: 12px clamp(20px, 4vw, 58px) 0; }
    .topbar { grid-row: 2; display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 0.6rem; padding: 0 clamp(20px, 4vw, 58px); }
    .breadcrumb { color: var(--muted); font-size: 12px; }
    .topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
    .source-link { display: inline-flex; align-items: center; gap: 7px; color: var(--blue); text-decoration: none; font-size: 12px; font-weight: 700; }
    .source-link:hover { text-decoration: underline; }
    .source-link svg { width: 15px; height: 15px; }
    .intro { grid-row: 3; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 0; padding: 0 clamp(20px, 4vw, 58px) 12px; }
    .eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
    h1 { margin: 0; font-size: clamp(27px, 3vw, 39px); line-height: 1.2; letter-spacing: -.035em; }
    .intro p { max-width: 540px; margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
    .term-pill { flex: 0 0 auto; padding: 9px 12px; border: 1px solid #d3e4e9; border-radius: 11px; background: #f9fcfc; color: var(--blue); font-size: 11px; font-weight: 800; }
    .topbar-actions .term-pill { margin: 0; }
    .result-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px;  padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.77); }
    .result-title { margin: 0; font-size: 14px; font-weight: 800; }
    .result-count { min-width: 78px; text-align: right; color: var(--blue); font-size: 21px; font-weight: 850; letter-spacing: -.04em; }
    .result-count small { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: 0; }
    .room-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .room-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); box-shadow: 0 3px 12px rgba(23, 53, 66, .025); cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
    .room-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
    .room-card:focus-visible { outline: 3px solid #6ea6bb; outline-offset: 2px; }
    .building-heading { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 9px; margin: 8px 0 0; padding: 0 2px 9px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 17px; line-height: 1.3; }
    .building-heading small { color: var(--muted); font-size: 11px; font-weight: 600; }
    .room-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
    .capacity { flex: 0 0 auto; color: var(--muted); font-size: 11px; white-space: nowrap; }
    .room-name { min-width: 0; margin: 0; font-size: 19px; letter-spacing: -.02em; line-height: 1.3; }
    .slots { display: grid; grid-template-columns: repeat(14, minmax(18px, 1fr)); gap: 3px; margin-top: 13px; }
    .slot { display: grid; place-items: center; min-height: 24px; border-radius: 5px; background: #f0f3f4; color: #789099; font-size: 9px; font-weight: 700; }
    .slot.is-free { background: var(--mint); color: var(--mint-ink); }
    .slot.is-busy { background: #fde8e9; color: #a6424a; }
    .slot.is-selected { outline: 2px solid #64aa89; outline-offset: 1px; z-index: 1; }
    .week-details { display: none; margin-top: 13px; overflow-x: auto; }
    .week-details.is-open { display: block; }
    .week-table { width: 100%; border-collapse: collapse; font-size: 10px; white-space: nowrap; }
    .week-table th, .week-table td { padding: 6px 5px; border: 1px solid #e6ecee; text-align: center; }
    .week-table th { background: #f7f9fa; color: #526a73; font-weight: 700; }
    .week-table td.free-cell { background: #eff8f3; color: var(--mint-ink); }
    .week-table td.busy-cell { background: #fde8e9; color: #a6424a; }
    .load-more-sentinel { min-height: 1px; }
    .empty-state, .load-state { padding: 46px 20px; border: 1px dashed #c6d7dc; border-radius: 14px; background: rgba(255,255,255,.6); text-align: center; }
    .empty-state.no-results { border-color: #edb8bb; background: #fff7f7; }
    .empty-state.no-results .empty-icon { background: #fde8e9; color: #b4232f; }
    .empty-state.no-results h3, .result-count.is-empty { color: #b4232f; }
    .empty-icon { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 14px; background: var(--blue-soft); color: var(--blue); }
    .empty-icon svg { width: 22px; height: 22px; }
    .empty-state h3, .load-state h3 { margin: 0; font-size: 15px; }
    .empty-state p, .load-state p { max-width: 440px; margin: 7px auto 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
    .warning { grid-row: 8; display: flex; gap: 10px; align-items: flex-start; margin: 25px clamp(20px, 4vw, 58px) 0; padding: 13px 15px; border: 1px solid #f0dfbc; border-radius: 12px; background: var(--amber-soft); color: #78541f; font-size: 11px; line-height: 1.65; }
    .warning svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; }
    .footer { grid-row: 9; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; margin: 18px clamp(20px, 4vw, 58px) 34px; color: var(--muted); font-size: 10px; line-height: 1.6; }
    .footer a { color: var(--blue); text-decoration: none; }
    .footer a:hover { text-decoration: underline; }
    .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
    @media (max-width: 1050px) {
      .layout { grid-template-columns: minmax(0, 1fr); }
      .brand { margin-inline: 17px; }
      .main { padding-inline: 25px; }
      .room-grid { grid-template-columns: 1fr; }
    }
    @media (max-width: 720px) {
      .layout { grid-template-columns: minmax(0, 1fr); }
      .brand { margin: 15px 17px 14px; }
      .brand-mark { width: 36px; height: 36px; }
      .filter-content { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
      .filter-content > .reset-row { grid-column: 1 / -1; }
      .field { margin-bottom: 15px; }
      .field.period-field { grid-column: 1 / -1; }
      .sidebar-note { display: none; }
      .main { padding: 20px 16px 28px; }
      /* .topbar { margin-bottom: 25px; } */
      .intro { align-items: flex-start; }
      .term-pill { margin-top: 7px; font-size: 10px; }
      .result-toolbar { margin-top: 0; padding: 13px 14px; }
    }
    @media (max-width: 480px) {
      .filter-content { grid-template-columns: 1fr; }
      .field.period-field { grid-column: auto; }
      .topbar { align-items: flex-start; }
      .topbar-actions { gap: 8px; }
      .source-link { font-size: 0; gap: 0; }
      .source-link svg { width: 19px; height: 19px; }
      .intro { display: block; }
      .term-pill { display: inline-block; margin-top: 12px; }
      .room-card { padding: 12px 15px; }
      .slots { grid-template-columns: repeat(14, minmax(17px,1fr)); gap: 2px; }
      .slot { min-height: 22px; font-size: 8px; }
    }
