:root {
    --bg: #0f1419;
    --card: #1a2332;
    --line: #2c3a4d;
    --text: #e8eef6;
    --muted: #8fa3b8;
    --accent: #3d9cf0;
    --ok: #2ecc71;
    --warn: #f0b429;
    --err: #e85d5d;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang HK", "Noto Sans TC", sans-serif;
    background: radial-gradient(1200px 600px at 10% -10%, #1d3557 0%, var(--bg) 55%);
    color: var(--text);
}
.wrap { max-width: 1280px; margin: 0 auto; padding: 16px 12px 32px; }
.wrap.no-filter { max-width: 860px; }
.wrap.no-filter .prose { max-width: none; }
.wrap.no-filter .card { padding: 18px 20px; }
.wrap.no-filter .site-nav a { flex: 1 1 auto; }
.ad-wrap {
    margin: 12px 0;
    width: 100%;
    min-width: 250px;
    min-height: 90px;
    overflow: hidden;
    background: #121a24;
    border: 1px solid var(--line);
    border-radius: 10px;
    box-sizing: border-box;
}
h1 { font-size: 20px; font-weight: 700; margin: 0 0 4px; }
h2 { font-size: 14px; margin: 0 0 10px; }
.sub { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.layout {
    display: grid;
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
}
.results { padding: 12px; }
.filters { position: sticky; top: 8px; }
.stack { display: grid; gap: 10px; }
.stack-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.date-range {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.date-row {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 8px;
    align-items: center;
}
.date-row span { color: var(--muted); font-size: 12px; }
.hint { margin: 4px 0 0; font-size: 11px; color: var(--muted); }
.adv-search {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #121a24;
}
.adv-search summary {
    cursor: pointer;
    padding: 8px 10px;
    color: var(--muted);
    font-size: 13px;
    list-style: none;
}
.adv-search summary::-webkit-details-marker { display: none; }
.adv-search[open] summary { border-bottom: 1px solid var(--line); color: var(--text); }
.adv-body { padding: 10px; }
.heat-panel summary { cursor: pointer; color: var(--muted); font-size: 12px; padding: 6px 0; list-style: none; }
.heat-panel summary::-webkit-details-marker { display: none; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
input, select, button {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #121a24;
    color: var(--text);
    font-size: 15px;
}
input[type="date"], input[type="datetime-local"] {
    display: block;
    line-height: 1.3;
}
input:focus, select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
button {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
button:disabled { opacity: 0.55; cursor: wait; }
button.ghost { background: #121a24; color: var(--text); }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.lang-switch { display: flex; gap: 6px; flex-shrink: 0; }
.lang-switch button {
    width: auto; padding: 6px 10px; font-size: 12px; font-weight: 600;
    background: #121a24; color: var(--muted);
}
.lang-switch button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.book-btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: #1f9d55; border-color: #1f9d55; color: #fff; text-decoration: none;
    font-weight: 700; padding: 10px 12px; border-radius: 8px; width: 100%;
}
.book-btn:hover { filter: brightness(1.08); }
.book-btn.sm { width: auto; padding: 6px 10px; font-size: 12px; }
.tips { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.tips h2 { margin-bottom: 8px; }
.tips ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.tips li { margin-bottom: 6px; }
.map-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; min-height: 56px; padding: 16px 18px;
    background: #2563eb; border: 1px solid #2563eb; color: #fff;
    border-radius: 12px; text-decoration: none; font-weight: 800; font-size: 18px;
    letter-spacing: 0.02em;
}
.map-btn:hover { filter: brightness(1.08); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.tab-btn {
    background: #121a24; color: var(--muted); border: 1px solid var(--line);
    min-height: 48px; font-size: 13px; padding: 8px 6px;
}
.tab-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tab-panel[hidden] { display: none; }
.alt-item {
    background: #121a24; border: 1px solid var(--line); border-radius: 12px;
    padding: 14px; margin-bottom: 12px;
}
.alt-item b { display: block; font-size: 16px; margin-bottom: 6px; }
.alt-item p { margin: 0 0 10px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.north-alert {
    background: #2a1f12; border: 1px solid var(--warn); border-radius: 10px;
    padding: 12px; font-size: 13px; line-height: 1.55; margin: 0 0 14px;
}
.north-sec { margin: 0 0 16px; }
.north-sec h3 { font-size: 14px; margin: 0 0 8px; }
.north-sec ol, .north-sec ul {
    margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.55;
}
.north-sec li { margin-bottom: 6px; }
.north-links { display: grid; gap: 8px; }
.north-links a {
    display: flex; align-items: center; justify-content: center; text-align: center;
    min-height: 44px; padding: 10px 12px; border-radius: 8px; text-decoration: none;
    background: #121a24; border: 1px solid var(--line); color: var(--text);
    font-size: 13px; font-weight: 600;
}
.north-links a:hover { border-color: var(--accent); color: #fff; }
.row-actions { display: flex; gap: 10px; align-items: end; }
.field-gap { margin-top: 4px; }
.check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text);
    margin: 0;
}
.check input { width: auto; margin: 0; }
.morning-on { outline: 1px solid rgba(61, 156, 240, 0.45); }
.heat tr.morning td.time { color: var(--accent); font-weight: 700; }
.heat tr.dim { opacity: 0.28; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 8px; }
.stat { background: #121a24; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.stat .k { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.stat .v { font-size: 16px; font-weight: 700; }
.status { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
.status.err { color: var(--err); }
.ranges { display: flex; flex-direction: column; gap: 6px; }
.range {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 8px;
    align-items: center;
    background: #121a24;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
}
.range b { font-size: 14px; }
.range small { color: var(--muted); display: block; margin-top: 3px; }
.range .spaces { color: var(--ok); font-weight: 700; }
.range button { width: auto; padding: 8px 12px; font-size: 13px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
tr.full td { color: var(--err); }
tr.ok td { color: var(--text); }
.use-btn { width: auto; padding: 6px 10px; font-size: 12px; }
.heat-wrap { overflow: auto; max-height: 260px; border: 1px solid var(--line); border-radius: 8px; }
.heat { border-collapse: separate; border-spacing: 2px; font-size: 11px; }
.heat th, .heat td { padding: 0; border: 0; text-align: center; }
.heat th { color: var(--muted); padding: 4px; position: sticky; top: 0; background: #1a2332; z-index: 1; }
.heat td.time { padding: 0 6px; color: var(--muted); white-space: nowrap; }
.cell {
    width: 28px; height: 18px; border-radius: 3px; display: block; cursor: pointer;
}
.c-green { background: #1f9d55; }
.c-yellow { background: #d4a017; }
.c-orange { background: #d97706; }
.c-red { background: #c53030; }
.c-gray { background: #3a4658; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 11px; margin: 6px 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.empty { color: var(--muted); padding: 8px 0; font-size: 13px; }
.calc-block { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .filters { position: static; }
    .stats, .range, .stack-2 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .grid, .stats, .range, .stack-2 { grid-template-columns: 1fr; }
    .row-actions { flex-direction: column; align-items: stretch; }
}
.site-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.site-nav a {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 10px; min-height: 40px; border-radius: 8px; text-decoration: none;
    background: #121a24; color: var(--muted); border: 1px solid var(--line);
    font-size: 13px; font-weight: 600;
}
.site-nav a.active, .site-nav a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.prose { max-width: 860px; }
.prose h1 { margin-bottom: 6px; }
.prose h2 { font-size: 16px; margin: 18px 0 8px; }
.prose h3 { font-size: 14px; margin: 14px 0 6px; }
.prose p, .prose li { color: var(--muted); font-size: 14px; line-height: 1.65; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 18px; }
.prose a { color: var(--accent); }
.cta-row { display: grid; gap: 8px; margin: 14px 0; }
.cta-row .book-btn, .cta-row .map-btn { width: 100%; }
.rate-table { width: 100%; font-size: 13px; margin: 8px 0 14px; }
.rate-table th { white-space: nowrap; }
.crumb { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.crumb a { color: var(--accent); text-decoration: none; }
.page-card { margin-bottom: 12px; }
.lang-switch a {
    display: inline-flex; align-items: center; justify-content: center;
    width: auto; padding: 6px 10px; font-size: 12px; font-weight: 600;
    background: #121a24; color: var(--muted); border: 1px solid var(--line);
    border-radius: 8px; text-decoration: none;
}
.lang-switch a.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tabs a.tab-btn { display: flex; align-items: center; justify-content: center; text-decoration: none; }
