:root {
  color-scheme: dark;
  --background: #091424;
  --surface: #101e31;
  --surface-deep: #0b1829;
  --line: #22354c;
  --text: #ebf4fb;
  --muted: #9aafc5;
  --soft: #b9cddd;
  --mint: #6aebcb;
  --aqua: #5fcbeb;
  --amber: #f4b86a;
  --danger: #ffb0a9;
  --numeric: Geist, "DIN Alternate", "Segoe UI", sans-serif;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; min-height: 100vh; color: var(--text); background: radial-gradient(70rem 24rem at 52% -3rem, #15344a 0%, transparent 83%), var(--background); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
h1, h2, h3, p, ul { margin: 0; }
ul { list-style: none; padding: 0; }
svg { display: block; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }

.masthead { background: linear-gradient(90deg, #0d1b2e 0%, #101f32 55%, #0d1b2d 100%); border-bottom: 1px solid #2a4357; }
.masthead-inner, .shell { width: min(100% - 64px, 1780px); margin-inline: auto; }
.masthead-inner { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 14px; }
.brand, .masthead-meta { display: flex; align-items: center; gap: clamp(12px, 2vw, 28px); }
.brand-mark { width: 52px; height: 52px; flex: 0 0 52px; border: 1px solid #366075; border-radius: 13px; color: var(--mint); background: linear-gradient(145deg, #174659, #11243a); display: grid; place-items: center; }
.brand-mark svg { width: 39px; height: 39px; }
.brand-location { font-size: 11px; line-height: 1.5; color: var(--mint); letter-spacing: .23em; }
h1 { margin-top: 3px; font-size: clamp(18px, 2.28vw, 38px); line-height: 1.25; letter-spacing: .075em; font-weight: 740; }
.clock { display: grid; justify-items: end; gap: 2px; white-space: nowrap; color: var(--muted); font-size: 11px; }
.clock time { font-family: var(--numeric); font-size: 23px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .045em; color: var(--text); }
.button { min-height: 35px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 7px; padding: 5px 12px; color: var(--text); white-space: nowrap; }
.button .icon { width: 16px; height: 16px; }
.button-outline { border-color: #37536d; background: #142940; }
.button-outline:hover:not(:disabled), .icon-button:hover:not(:disabled) { border-color: var(--mint); color: var(--mint); }
.button-primary { color: #062521; background: var(--mint); font-weight: 700; }
.button-primary:hover:not(:disabled) { background: #a4f6e2; }
.icon-button { width: 35px; height: 35px; flex: 0 0 35px; background: #13263b; border: 1px solid #35516c; border-radius: 7px; color: var(--soft); display: grid; place-items: center; padding: 0; }
.icon-button .icon { width: 16px; height: 16px; }

.shell { padding-block: 22px 16px; }
.overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.overview-heading h2 { font-size: 16px; letter-spacing: .09em; }
.data-controls, .data-status { display: flex; align-items: center; gap: 7px; }
.data-controls { gap: 10px; }
.data-status { font-size: 12px; color: var(--muted); text-align: right; }
.data-status[data-state="good"] { color: var(--mint); }
.data-status[data-state="error"] { color: var(--amber); }
.status-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.refresh-button { width: 28px; height: 28px; flex-basis: 28px; }
.refresh-button .icon { width: 13px; height: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 154px), 1fr)); gap: 10px; }
.metric-card { position: relative; overflow: hidden; min-width: 0; min-height: 74px; padding: 11px 16px 12px 18px; border: 1px solid var(--line); border-radius: 8px; background: linear-gradient(110deg, #14283d, #101d30 88%); }
.metric-card::before { content: ""; position: absolute; width: 2px; inset: 13px auto 13px 0; border-radius: 0 2px 2px 0; background: var(--metric-color, var(--aqua)); }
.metric-label { font-size: 12px; line-height: 1.4; color: var(--soft); }
.metric-value { margin-top: 3px; display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; color: var(--metric-color, var(--aqua)); }
.metric-value strong { font: 650 clamp(22px, 2.3vw, 35px)/1 var(--numeric); font-variant-numeric: tabular-nums; }
.metric-value small { font-size: 11px; color: var(--muted); }
.metric-message { min-height: 74px; display: grid; place-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #101f31; }

.dashboard-grid { display: grid; grid-template-columns: minmax(224px, .91fr) minmax(360px, 2.5fr) minmax(250px, 1.05fr); grid-template-areas: "analytics map services"; align-items: start; gap: 14px; margin-top: 15px; }
.rail { min-width: 0; display: grid; gap: 14px; }
.analytics-rail { grid-area: analytics; }
.service-rail { grid-area: services; }
.map-panel { grid-area: map; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: linear-gradient(155deg, #142439, var(--surface) 65%); box-shadow: 0 8px 20px #060d1866; }
.panel-heading { min-height: 52px; padding: 13px 15px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.heading-group { min-width: 0; display: flex; align-items: center; gap: 8px; }
.panel h2, .dialog h2 { font-size: 16px; font-weight: 680; line-height: 1.4; letter-spacing: .055em; }
.section-icon { color: var(--mint); }
.panel-caption { margin-top: 3px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.heading-count { color: var(--muted); font-size: 11px; white-space: nowrap; }
.chart-body { padding: 0 14px 14px; }
.empty-text { display: grid; place-items: center; min-height: 65px; padding: 10px; color: var(--muted); font-size: 12px; line-height: 1.6; text-align: center; }
.empty-chart { border: 1px dashed #30455b; border-radius: 6px; background: linear-gradient(145deg, #102034, #0f1b2c); }
.bars { display: grid; gap: 8px; }
.bars { max-height: 245px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #37556c transparent; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 24px; align-items: center; column-gap: 7px; row-gap: 3px; }
.bar-label { color: var(--soft); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.bar-track { grid-column: 1; height: 4px; overflow: hidden; border-radius: 10px; background: #25374e; }
.bar-fill { display: block; height: 100%; border-radius: inherit; background: var(--series-color); }
.bar-count { grid-area: 1 / 2 / 3 / 3; text-align: right; color: var(--soft); font: 550 12px/1 var(--numeric); font-variant-numeric: tabular-nums; }

.map-heading { min-height: 69px; padding: 13px 17px; }
.map-heading h2 { font-size: 17px; }
.map-heading .heading-group { gap: 10px; }
.map-heading .section-icon { width: 22px; height: 22px; }
.map-frame { height: clamp(390px, calc(100vh - 402px), 730px); isolation: isolate; position: relative; background: #0a1a2b; border-block: 1px solid var(--line); overflow: hidden; touch-action: none; }
.map-canvas, .map-placeholder, .map-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-placeholder { z-index: 2; display: grid; place-items: center; background: radial-gradient(ellipse at center, #18425785 0, #102d4666 35%, #08162775 90%), repeating-linear-gradient(0deg, #2b536b36 0, #2b536b36 1px, transparent 1px, transparent 28px), repeating-linear-gradient(90deg, #2b536b36 0, #2b536b36 1px, transparent 1px, transparent 28px), #0c2033; }
.map-placeholder-copy { z-index: 1; color: var(--muted); line-height: 1.7; font-size: 12px; text-align: center; padding: 14px 20px; background: radial-gradient(ellipse, #0f263bec, #0f263b70 70%, transparent); }
.map-placeholder-icon { width: 47px; height: 47px; margin: 0 auto 10px; display: grid; place-items: center; color: var(--mint); border: 1px solid #58d5bb70; border-radius: 50%; background: #16475a; box-shadow: 0 0 20px #65dfc838; }
.map-placeholder-icon .icon { width: 23px; height: 23px; }
.map-placeholder-title { color: var(--text); font-size: 16px; font-weight: 650; }
.map-buttons { position: absolute; z-index: 3; top: 11px; right: 11px; display: grid; gap: 6px; }
.map-buttons .icon-button { box-shadow: 0 1px 8px #05101acc; }
.map-footer { display: flex; min-height: 40px; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 14px; padding: 9px 14px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.map-indicator { display: flex; align-items: center; gap: 7px; }
.map-indicator > span:first-child { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--mint); }
#map-feedback { color: var(--amber); }
.map-marker { appearance: none; display: grid; place-items: center; width: 29px; height: 29px; padding: 0; border: 2px solid var(--marker-color, var(--mint)); border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: #0e263a; color: var(--marker-color, var(--mint)); box-shadow: 0 1px 5px #071323, 0 0 10px #071323; }
.map-marker .icon { width: 13px; height: 13px; transform: rotate(45deg); }
.map-marker:hover { background: #203b4d; }
.map-marker[aria-pressed="true"] { background: #f4b86a; border-color: #ffe0ae; color: #132338; }

.filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(86px, 37%); gap: 6px; margin: 0 13px 8px; }
.search-field { min-width: 0; display: flex; align-items: center; gap: 5px; border: 1px solid #334964; border-radius: 6px; background: var(--surface-deep); padding-inline: 6px; color: var(--muted); }
.search-field .icon { width: 15px; height: 15px; }
.search-field:focus-within { border-color: var(--mint); }
.search-field input { background: transparent; border: 0; outline: none; padding: 0; }
input, select { min-width: 0; min-height: 33px; width: 100%; padding: 4px 7px; border-radius: 6px; border: 1px solid #334964; background: var(--surface-deep); color: var(--soft); font-size: 11px; }
input::placeholder { color: #91a7bd; opacity: 1; }
.resource-list, .activity-list { overflow-y: auto; scrollbar-width: thin; scrollbar-color: #37556c transparent; margin: 0 13px 13px; }
.resource-list, .activity-list { touch-action: pan-y; }
.point-feedback { margin: 4px 13px 8px; color: var(--amber); font-size: 12px; }
.point-feedback:empty { display: none; }
.resource-item[aria-pressed="true"] { background: #1a3547; }
.dragging-page { cursor: grabbing; user-select: none; }
.resource-list { min-height: 110px; max-height: clamp(164px, 24vh, 290px); }
.activity-list { min-height: 110px; max-height: clamp(193px, 32vh, 365px); }
.resource-list > li + li, .activity-list > li + li { border-top: 1px solid var(--line); }
.resource-item { width: 100%; min-width: 0; display: grid; grid-template-columns: 9px minmax(0, 1fr) 15px; gap: 8px; align-items: center; padding: 9px 3px 9px 1px; border: 0; background: transparent; color: var(--text); text-align: left; }
.resource-item:hover { background: #20364b; }
.resource-item:focus-visible { outline-offset: -2px; }
.resource-item i { width: 7px; height: 7px; border-radius: 50%; background: var(--series-color); }
.resource-item .icon { width: 14px; height: 14px; color: var(--muted); }
.resource-item-copy { min-width: 0; display: grid; gap: 2px; }
.resource-item strong { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.resource-item small { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity { display: grid; align-items: start; grid-template-columns: 36px minmax(0, 1fr); gap: 9px; padding: 9px 0; }
.activity-date { display: grid; justify-items: center; align-content: center; min-height: 43px; padding: 3px 0; border: 1px solid #405164; border-radius: 6px; color: var(--amber); background: #202938; }
.activity-date strong { font: 650 18px/1 var(--numeric); }
.activity-date small { margin-top: 3px; font-size: 9px; color: #d8ba93; }
.activity-content { min-width: 0; }
.activity-content h3 { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.activity-when, .activity-description, .activity-location { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.activity-actions { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px; }
.activity-status { color: var(--muted); font-size: 10px; line-height: 1.4; }
.activity-status.is-open { color: var(--mint); }
.activity-status.is-full { color: var(--amber); }
.activity-actions .button { min-height: 27px; padding: 3px 7px; font-size: 11px; }

.dialog { width: min(100% - 30px, 480px); max-height: min(90vh, 630px); border: 1px solid #416780; border-radius: 12px; padding: 0; color: var(--text); background: #112136; box-shadow: 0 20px 85px #01050cd9; }
.dialog::backdrop { background: #050d1acb; }
.dialog-top { min-height: 57px; padding: 10px 15px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid #2b4059; }
.dialog-body { padding: 16px; overflow-wrap: anywhere; }
.dialog-body h3 { font-size: 17px; }
.detail-data { margin: 15px 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px 14px; color: var(--soft); }
.detail-data dt { color: var(--muted); }
.detail-data dd { margin: 0; white-space: pre-wrap; }
.reservation-form { display: grid; gap: 7px; }
.reservation-form label { color: var(--soft); font-size: 12px; }
.reservation-form-row { display: flex; gap: 8px; }
.reservation-form input { min-height: 35px; font-size: 14px; }
.reservation-note { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.reservation-result { display: grid; gap: 8px; }
.reservation-result .detail-data { margin-top: 4px; }
.reservation-code { font: 650 19px/1.15 var(--numeric); letter-spacing: .035em; color: var(--mint); }
.reservation-actions { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 7px; }
.form-message { margin-top: 11px; font-size: 12px; color: var(--soft); }
.form-message[data-state="error"] { color: var(--danger); }

@media (max-width: 1120px) {
  .masthead-inner, .shell { width: calc(100% - 40px); }
  .dashboard-grid { grid-template-columns: minmax(181px, .86fr) minmax(270px, 1.91fr) minmax(217px, 1.05fr); gap: 10px; }
  .rail { gap: 10px; }
}

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "map map" "analytics services"; }
  .map-frame { min-height: 355px; height: 52vw; max-height: 550px; }
  .resource-list, .activity-list { max-height: 310px; }
}

@media (orientation: portrait) and (min-width: 601px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "map map" "analytics services";
  }
  .map-frame { height: clamp(380px, 52dvh, 1200px); max-height: none; }
  .resource-list, .activity-list { max-height: clamp(280px, 31dvh, 500px); }
  .button, .map-buttons .icon-button { min-height: 44px; }
  .map-buttons .icon-button { width: 44px; flex-basis: 44px; }
  .resource-item { min-height: 49px; }
}

@media (max-width: 600px) {
  .masthead-inner, .shell { width: calc(100% - 26px); }
  .masthead-inner { min-height: 75px; gap: 8px; }
  .masthead-meta { gap: 7px; }
  .masthead-meta .button { min-height: 30px; font-size: 11px; padding-inline: 7px; }
  .masthead-meta .button .icon { display: none; }
  .clock { display: none; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; border-radius: 8px; }
  .brand-mark svg { width: 29px; height: 29px; }
  .brand { gap: 7px; }
  h1 { font-size: clamp(16px, 4.1vw, 23px); letter-spacing: .02em; overflow-wrap: anywhere; }
  .brand-location { font-size: 9px; }
  .shell { padding-top: 14px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .metric-grid .metric-message, .metric-grid .metric-card:only-child { grid-column: 1 / -1; }
  .metric-card { padding-inline: 11px; min-height: 63px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "map" "services" "analytics"; margin-top: 10px; }
  .map-heading { min-height: 59px; }
  .map-frame { min-height: 320px; height: 49dvh; max-height: 480px; }
  .panel-heading, .map-heading { padding-inline: 11px; }
  input, select { font-size: 16px; }
  #resource-category { font-size: 12px; }
  .search-field input { font-size: 14px; }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .icon-button, .resource-item { transition: background-color .16s, border-color .16s, color .16s; }
}
