@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("assets/barlow-semi-condensed-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Semi Condensed";
  src: url("assets/barlow-semi-condensed-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Dorm Icons";
  src: url("assets/dorm-icons.woff") format("woff");
  font-display: block;
}

:root {
  color-scheme: light;
  --font-text: "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-numeric: "Barlow Semi Condensed", var(--font-text);
  --canvas: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --ink: #14233d;
  --text: #293b55;
  --muted: #536680;
  --line: #e2e9f2;
  --line-active: #ccd9eb;
  --line-upload: #91abed;
  --line-grant: #abc1f5;
  --navy: #142139;
  --navy-selected: #263b62;
  --navy-line: #2a3a55;
  --nav-text: #c2cee2;
  --nav-muted: #9cacc8;
  --nav-accent: #83aaff;
  --nav-active-icon: #a7c3ff;
  --focus-on-dark: #769fff;
  --blue: #2555cd;
  --blue-dark: #1a44b2;
  --blue-soft: #eaf0ff;
  --blue-pale: #f3f7ff;
  --green: #176445;
  --green-soft: #e8f6ed;
  --amber: #855015;
  --amber-soft: #fff2dd;
  --slate-soft: #eef2f7;
  --red: #a42d3c;
  --hero-start: #172f66;
  --hero-end: #1d459a;
  --hero-text: #e0eaff;
  --hero-image-left: rgba(24, 53, 116, .97);
  --hero-image-mid: rgba(23, 47, 104, .49);
  --hero-image-right: rgba(20, 37, 77, .12);
  --hero-image-bottom: rgba(15, 35, 82, .46);
  --hero-glass: rgba(244, 249, 255, .15);
  --hero-line: rgba(244, 249, 255, .27);
  --image-strip: rgba(17, 31, 56, .82);
  --backdrop: rgba(14, 27, 51, .58);
  --shadow-panel: 0 2px 4px rgba(35, 52, 85, .032);
  --shadow-float: 0 8px 28px rgba(21, 37, 69, .14);
  --shadow-dialog: 0 24px 80px rgba(14, 28, 55, .24);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 16px;
  --text-lg: 19px;
  --text-xl: 26px;
  --text-display: clamp(29px, 3vw, 44px);
  --rail: 224px;
  --topbar: 68px;
  --gutter: clamp(24px, 2.5vw, 40px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --duration-fast: 160ms;
  --duration-enter: 450ms;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

.login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 16px;
}
.login-card {
  width: min(100%, 464px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-float);
}
.login-hero {
  display: grid;
  align-content: end;
  justify-items: start;
  gap: 12px;
  min-height: 154px;
  padding: 23px;
  background: linear-gradient(90deg, var(--hero-start), var(--hero-image-mid) 82%),
    url("assets/campus.webp") center 42% / cover;
}
.login-hero h1 { color: var(--surface); font-size: clamp(21px, 5vw, 27px); }
.login-form { display: grid; gap: 14px; padding: 22px 23px 25px; }
.login-form h2 { font-size: var(--text-lg); }
.login-form .button { margin-top: 3px; }
.login-status { color: var(--muted); font-size: var(--text-sm); }
.login-status.error { color: var(--red); }
.sync-alert {
  margin-bottom: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: var(--amber);
  font-size: var(--text-sm);
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font: var(--text-base)/1.65 var(--font-text);
  letter-spacing: .02em;
}

h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { color: var(--ink); line-height: 1.38; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.sidebar :focus-visible, .hero :focus-visible { outline-color: var(--focus-on-dark); }
.view h1:focus, .detail-title:focus { outline: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  z-index: 12;
  top: var(--space-3);
  left: var(--space-3);
  padding: var(--space-2) var(--space-4);
  transform: translateY(-160%);
  background: var(--surface);
  border-radius: var(--radius-sm);
}
.skip-link:focus { transform: none; }

.icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  font: normal 20px/1 "Dorm Icons";
  font-variant-ligatures: none;
  letter-spacing: 0;
  speak: never;
}
.icon::before { display: block; }

.numeric {
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
  letter-spacing: .005em;
}

.sidebar {
  position: fixed;
  z-index: 5;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: var(--rail);
  padding: 0 var(--space-4);
  color: var(--nav-text);
  background: var(--navy);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 91px;
  padding-inline: var(--space-2);
  border-bottom: 1px solid var(--navy-line);
}

.brand-icon {
  width: 43px;
  height: 43px;
  border: 1px solid var(--hero-line);
  border-radius: 11px;
  background: var(--blue);
  color: var(--surface);
  font-size: 25px;
}

.brand-copy { display: grid; line-height: 1.35; white-space: nowrap; }
.brand-copy strong { color: var(--surface); font-size: var(--text-lg); letter-spacing: .1em; }
.brand-copy small { color: var(--nav-muted); margin-top: 4px; font-size: var(--text-xs); }
.navigation { display: grid; gap: 25px; padding-top: 26px; }
.nav-group { display: grid; gap: 5px; }
.nav-label { color: var(--nav-muted); font-size: var(--text-xs); padding: 0 var(--space-3) 5px; }

.nav-button {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  position: relative;
  width: 100%;
  min-height: 46px;
  padding: 0 var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  text-align: left;
  white-space: nowrap;
}
.nav-button .icon { font-size: 19px; }
.nav-button:hover { background: var(--navy-line); color: var(--surface); }
.nav-button[aria-current="page"] { background: var(--navy-selected); color: var(--surface); font-weight: 700; }
.nav-button[aria-current="page"]::before {
  position: absolute;
  left: 0;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: var(--nav-accent);
  content: "";
}
.nav-button[aria-current="page"] .icon { color: var(--nav-active-icon); }

.sidebar-footer {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: auto;
  padding: 19px 9px 24px;
  border-top: 1px solid var(--navy-line);
}
.sidebar-footer strong, .sidebar-footer small { display: block; }
.sidebar-footer strong { color: var(--nav-text); font-size: var(--text-sm); font-weight: 600; }
.sidebar-footer small { margin-top: 2px; color: var(--nav-muted); font-size: var(--text-xs); }
.demo-dot {
  width: 7px;
  height: 7px;
  margin-top: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--nav-accent);
  box-shadow: 0 0 0 4px var(--navy-line);
}

.page-shell { min-width: 0; margin-inline-start: var(--rail); }

.topbar {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--topbar);
  padding-inline: var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.breadcrumb { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: var(--text-sm); font-weight: 700; }
.breadcrumb-root { color: var(--muted); font-weight: 400; }
.breadcrumb .icon { color: var(--muted); font-size: 12px; }

.role-switch { position: relative; }
.role-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 3px 8px 3px 5px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 700;
}
.role-trigger:hover, .role-trigger[aria-expanded="true"] { background: var(--surface-soft); border-color: var(--line); }
.role-trigger > .icon { color: var(--muted); font-size: 15px; }
.role-avatar, .person-avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-size: var(--text-sm);
  font-weight: 700;
}
.role-avatar.member, .person-avatar.member { background: var(--green-soft); color: var(--green); }
.role-avatar.staff, .person-avatar.staff { background: var(--slate-soft); color: var(--text); }
.role-options {
  position: absolute;
  z-index: 8;
  top: calc(100% + 7px);
  right: 0;
  width: min(257px, calc(100vw - 28px));
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-float);
}
.role-options-title { padding: 6px 10px 7px; color: var(--muted); font-size: var(--text-xs); }
.role-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 53px;
  padding: 5px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.role-option:hover { background: var(--surface-soft); }
.role-option[aria-pressed="true"] { background: var(--blue-pale); }
.role-option > .icon { margin-inline-start: auto; color: var(--blue); font-size: 16px; }
.role-option strong, .role-option small { display: block; }
.role-option small { color: var(--muted); font-size: var(--text-xs); }

.workspace {
  width: 100%;
  max-width: 1550px;
  min-width: 0;
  margin-inline: auto;
  padding: 26px var(--gutter) 42px;
}
.workspace:focus { outline: none; }

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  overflow: hidden;
  min-height: 182px;
  padding: 26px 30px 27px;
  border-radius: var(--radius-lg);
  background: linear-gradient(112deg, var(--hero-start), var(--hero-end));
}
.hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: repeating-linear-gradient(119deg, transparent 0 40px, var(--hero-glass) 40px 41px);
  opacity: .19;
  mask-image: linear-gradient(90deg, transparent, var(--surface) 33%, transparent 65%);
  content: "";
  pointer-events: none;
}
.hero-photo {
  position: absolute;
  z-index: -2;
  inset: 0 0 0 28%;
  mask-image: linear-gradient(90deg, transparent, var(--surface) 24%);
  background:
    linear-gradient(0deg, var(--hero-image-bottom), transparent 58%),
    linear-gradient(90deg, var(--hero-image-left), var(--hero-image-mid) 38%, var(--hero-image-right) 76%),
    url("assets/campus.webp") center 39% / cover no-repeat;
}
.hero-copy { align-self: center; }
.hero-location {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 1px 9px;
  border: 1px solid var(--hero-line);
  border-radius: 6px;
  background: var(--hero-glass);
  color: var(--surface);
  font-size: var(--text-xs);
  font-weight: 600;
}
.hero-location .icon { font-size: 14px; }
.hero h1 { margin-block: 8px 6px; color: var(--surface); font-size: var(--text-display); letter-spacing: .035em; }
.hero-description { color: var(--hero-text); font-size: var(--text-base); }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 6px 14px;
  border: 1px solid var(--line-active);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 700;
  white-space: nowrap;
}
.button .icon { font-size: 17px; }
.button:hover { border-color: var(--blue); color: var(--blue-dark); background: var(--blue-pale); }
.button.primary { border-color: var(--blue); background: var(--blue); color: var(--surface); }
.button.primary:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.button:disabled { border-color: var(--line); background: var(--surface-soft); color: var(--muted); }
.hero-action { flex: none; border-color: var(--surface); color: var(--blue-dark); box-shadow: var(--shadow-float); }
.hero-action:hover { border-color: var(--blue-soft); }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-block: 20px 22px;
  padding-block: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}
.metric {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  padding: 0 clamp(12px, 1.65vw, 24px);
}
.metric + .metric { border-left: 1px solid var(--line); }
.metric-icon, .detail-symbol, .banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 23px;
}
.metric-icon.green { background: var(--green-soft); color: var(--green); }
.metric-icon.amber { background: var(--amber-soft); color: var(--amber); }
.metric-icon.slate { background: var(--slate-soft); color: var(--muted); }
.metric-label { color: var(--muted); font-size: var(--text-sm); line-height: 1.35; }
.metric-value { display: block; color: var(--ink); font-size: 32px; font-weight: 700; line-height: 1.02; }
.metric-unit { margin-left: 4px; color: var(--muted); font: var(--text-xs)/1.3 var(--font-text); }

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.21fr) minmax(0, 1fr);
  align-items: start;
  gap: 22px;
}
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}
.panel-heading { padding: 18px 20px 12px; }
.panel-heading h2 { font-size: var(--text-lg); font-weight: 700; }
.directory-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.caption { color: var(--muted); font-size: var(--text-xs); }
.filter-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 0 20px 16px;
}
.search-field, .select-field {
  display: flex;
  position: relative;
  align-items: center;
  height: 44px;
  min-width: 0;
  border: 1px solid var(--line-active);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
}
.search-field { flex: 1; gap: 8px; padding-inline: 11px 3px; }
.search-field .icon, .select-field .icon { font-size: 17px; }
.search-field:focus-within, .select-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
.search-field input, .select-field select {
  width: 100%;
  min-width: 0;
  height: 100%;
  outline: none;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--ink);
  font-size: var(--text-sm);
}
.search-field input::placeholder { color: var(--muted); opacity: 1; }
.search-field input::-webkit-search-cancel-button { margin-right: 8px; }
.select-field select { min-width: 108px; padding-inline: 12px 34px; appearance: none; cursor: pointer; }
.filter-bar select { min-width: 0; text-overflow: ellipsis; }
.select-field .icon { position: absolute; right: 10px; pointer-events: none; }

.directory-table, .data-table { width: 100%; border-collapse: collapse; text-align: left; }
.directory-table { table-layout: fixed; }
.col-room { width: 43%; }
.col-photo { width: 17%; }
.col-score { width: 15%; }
.col-status { width: 25%; }
.directory-table th, .data-table th {
  padding: 9px 12px;
  border-block: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
}
.directory-table th:first-child { padding-left: 20px; }
.directory-table th:not(:first-child) { padding-inline: 0; }
.directory-table td { height: 51px; padding: 0; border-bottom: 1px solid var(--line); }
.directory-table tr.room-row { cursor: pointer; }
.room-row:hover { background: var(--surface-soft); }
.room-row.selected { background: var(--blue-pale); }
.room-row.selected > :first-child { box-shadow: inset 3px 0 var(--blue); }
.room-row.selected .room-symbol { background: var(--blue-soft); color: var(--blue); }
.room-row.selected .room-label { color: var(--blue-dark); }

.room-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 3px 5px 3px 20px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.room-button:focus-visible { outline-offset: -3px; }
.room-symbol {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: var(--slate-soft);
  color: var(--muted);
}
.room-symbol .icon { font-size: 17px; }
.room-label { display: block; font-size: var(--text-sm); font-weight: 700; line-height: 1.15; white-space: nowrap; }
.room-label .numeric { font-size: var(--text-md); }
.room-subtitle { display: block; margin-top: 3px; color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }
.photo-count { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.photo-count .icon { font-size: 16px; }
.photo-count .numeric { font-size: var(--text-md); font-weight: 600; }
.room-score { color: var(--ink); font-size: 17px; font-weight: 700; }
.muted { color: var(--muted); }
.status-cell { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding-right: 16px; }
.status-cell > .icon { color: var(--muted); font-size: 14px; }
.selected .status-cell > .icon { color: var(--blue); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  padding: 3px 8px;
  border-radius: 20px;
  background: var(--slate-soft);
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.48;
  white-space: nowrap;
}
.chip::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.chip.rated { background: var(--green-soft); color: var(--green); }
.chip.pending { background: var(--amber-soft); color: var(--amber); }

.panel-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 60px;
  padding: 7px 20px;
}
.pages { display: flex; align-items: center; gap: var(--space-1); }
.page-button {
  display: grid;
  place-items: center;
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-numeric);
  font-size: var(--text-md);
  font-weight: 700;
}
.page-button .icon { font-size: 15px; }
.page-button:hover { background: var(--surface-soft); color: var(--blue); }
.page-button[aria-current="page"] { background: var(--blue-soft); color: var(--blue-dark); }
.page-button:disabled { background: transparent; color: var(--line-active); }

.detail { scroll-margin-top: 14px; }
.detail-head {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 20px 14px;
}
.detail-head .chip { align-self: flex-start; margin: 1px 0 0 auto; }
.detail-symbol { width: 48px; height: 48px; font-size: 25px; }
.detail-title { font-size: var(--text-md); line-height: 1.03; }
.detail-title .numeric { margin-right: 3px; font-size: 35px; font-weight: 700; }
.detail-location { margin-top: 3px; color: var(--muted); font-size: var(--text-xs); }
.resident-roster { margin: 0 20px 15px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.resident-roster h3 { display: flex; align-items: baseline; gap: 8px; margin: 0 0 9px; font-size: var(--text-sm); }
.resident-roster h3 span { color: var(--muted); font-size: var(--text-xs); font-weight: 500; }
.resident-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }
.resident-row { display: flex; min-width: 0; justify-content: space-between; gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); }
.resident-row strong { overflow: hidden; font-size: var(--text-xs); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.resident-id { color: var(--muted); font-family: var(--font-numeric); font-size: 10px; text-align: right; white-space: nowrap; }

.detail-tabs {
  display: flex;
  align-items: stretch;
  gap: var(--space-5);
  padding-inline: 20px;
  border-bottom: 1px solid var(--line);
}
.tab-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  margin-bottom: -1px;
  padding: 0 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  white-space: nowrap;
}
.tab-button:not([aria-selected="true"]):hover { color: var(--blue); }
.tab-button[aria-selected="true"] { border-color: var(--blue); color: var(--blue-dark); }
.tab-count { padding: 0 6px; border-radius: 5px; background: var(--blue-soft); color: var(--blue-dark); font-size: var(--text-xs); }
.detail-body { padding: 16px 20px 20px; }
.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.photo-tile {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--slate-soft);
  text-align: left;
  aspect-ratio: 1.63;
}
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile:hover img { transform: scale(1.045); }
.photo-caption {
  display: flex;
  position: absolute;
  inset: auto 0 0;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
  padding: 15px 9px 7px;
  background: linear-gradient(0deg, var(--image-strip) 46%, transparent);
  color: var(--surface);
  font-size: var(--text-xs);
  font-weight: 600;
  text-shadow: 0 1px 4px var(--ink);
}
.photo-caption span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-caption .icon { font-size: 14px; }
.upload-zone {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 71px;
  margin-top: var(--space-3);
  padding: 9px 11px;
  border: 1px dashed var(--line-active);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.upload-zone.available {
  border-color: var(--line-upload);
  background: var(--blue-pale);
}
.upload-zone.available.drag-over {
  border-color: var(--blue);
  background: var(--blue-soft);
}
.upload-symbol, .review-symbol {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--slate-soft);
  color: var(--muted);
  font-size: 19px;
}
.upload-zone.available .upload-symbol { background: var(--blue-soft); color: var(--blue); }
.upload-title { display: block; color: var(--ink); font-size: var(--text-sm); }
.upload-help { display: block; color: var(--muted); font-size: var(--text-xs); }
.upload-lock, .upload-zone .button { margin-inline-start: auto; }
.upload-lock { color: var(--muted); font-size: 16px; }
.upload-zone .button { padding-inline: 8px; }

.review-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  margin-top: var(--space-3);
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.review-symbol { background: var(--blue-soft); color: var(--blue); }
.review-preview strong, .review-preview small { display: block; }
.review-preview strong { color: var(--ink); font-size: var(--text-sm); }
.review-preview small { color: var(--muted); font-size: var(--text-xs); }
.review-preview .preview-score {
  margin-left: auto;
  color: var(--blue-dark);
  font-size: 27px;
  font-weight: 700;
  white-space: nowrap;
}
.preview-score small { display: inline; margin-inline-start: 3px; font: var(--text-xs) var(--font-text); }

.empty-state {
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: var(--space-6) var(--space-4);
  color: var(--muted);
  text-align: center;
}
.empty-state .icon { width: 40px; height: 40px; margin-bottom: 3px; border-radius: 10px; background: var(--slate-soft); color: var(--muted); }
.empty-state strong { color: var(--ink); }
.empty-state small { font-size: var(--text-xs); }
.photo-empty { min-height: 116px; border-radius: var(--radius-sm); background: var(--surface-soft); }
.detail-empty { min-height: 200px; align-content: center; }
.directory-table td.empty-cell { height: 158px; }

.latest-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  background: var(--blue-pale);
}
.latest-card h3 { font-size: var(--text-sm); }
.latest-card p { margin-top: 4px; color: var(--muted); font-size: var(--text-xs); }
.latest-score { color: var(--blue-dark); font-size: 36px; font-weight: 700; line-height: 1; white-space: nowrap; }
.latest-score small { padding-left: 3px; color: var(--muted); font: var(--text-xs) var(--font-text); }
.score-breakdown { margin: 13px 0 0; padding: 0; display: grid; gap: 9px; }
.score-breakdown > div { display: grid; grid-template-columns: 4.4em 1fr 37px; gap: 10px; align-items: center; }
.score-breakdown dt { font-size: var(--text-sm); }
.score-breakdown dd { margin: 0; }
.score-breakdown strong { color: var(--ink); font-size: var(--text-md); }
.score-breakdown .track { height: 6px; overflow: hidden; border-radius: 8px; background: var(--slate-soft); }
.score-breakdown .track span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.review-note { margin-top: 12px; color: var(--text); font-size: var(--text-sm); overflow-wrap: anywhere; white-space: pre-wrap; }
.score-locked {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  padding: 9px;
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: var(--text-xs);
}
.score-locked .icon { font-size: 17px; }

.score-form { margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
.score-form header { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 10px; }
.score-form h3 { font-size: var(--text-md); }
.score-form header output { color: var(--blue-dark); font-size: var(--text-sm); font-weight: 700; }
.score-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.form-label { display: grid; gap: 4px; color: var(--ink); font-size: var(--text-xs); font-weight: 700; }
.form-label span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 3px; }
.form-label small { color: var(--muted); font-size: var(--text-xs); font-weight: 400; }
.form-input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 7px 8px;
  border: 1px solid var(--line-active);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-sm);
}
.review-comment { margin-block: 9px; }
.review-comment textarea { min-height: 68px; resize: vertical; }
.score-evidence {
  margin-block: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.score-evidence-heading, .score-evidence-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.score-evidence-heading { justify-content: space-between; margin-bottom: 8px; font-size: var(--text-sm); }
.score-evidence-heading output { color: var(--muted); font-size: var(--text-xs); }
.score-photo-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(65px, 1fr));
  gap: 8px;
  margin: 0 0 9px;
  padding: 0;
  list-style: none;
}
.score-photo-list li { position: relative; }
.score-photo-list img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--slate-soft); }
.score-photo-list button {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}
.score-photo-list button:disabled { opacity: .6; }
.latest-evidence { margin-top: 10px; }

.section-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(106deg, var(--blue-soft), var(--surface) 73%);
}
.banner-icon { width: 48px; height: 48px; background: var(--surface); box-shadow: var(--shadow-panel); }
.section-banner h1 { font-size: var(--text-xl); }
.section-banner p { margin-top: 3px; color: var(--muted); font-size: var(--text-sm); }
.resource-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 17px; }
.resource-heading .caption { margin-top: 4px; }
.resource-search { max-width: 270px; }
.resource-table { overflow: hidden; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.data-table th, .data-table td { padding-inline: 15px; }
.data-table th:first-child, .data-table td:first-child { padding-left: 20px; }
.data-table td { padding-block: 12px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td:last-child { padding-right: 20px; }
.data-table .caption { line-height: 1.55; }
.data-table .action-cell { width: 1%; white-space: nowrap; }
.record-room-button {
  min-height: 44px;
  padding: 3px 4px;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font-size: var(--text-sm);
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}
.record-room-button:hover { text-decoration: underline; }
.record-score { color: var(--blue-dark); font-size: 21px; font-weight: 700; white-space: nowrap; }

.staff-person { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.staff-person strong, .staff-person small { display: block; }
.staff-person small { color: var(--muted); font-size: var(--text-xs); }
.permission-range { min-width: 130px; }

dialog {
  width: min(540px, calc(100% - 26px));
  max-height: calc(100% - 26px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-dialog);
}
dialog:is([data-kind="photo"], [data-kind="review-evidence"]) { width: min(760px, calc(100% - 26px)); }
dialog::backdrop { background: var(--backdrop); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 17px 19px 10px; }
.dialog-header h2 { padding-block: 6px; font-size: var(--text-lg); overflow-wrap: anywhere; }
.dialog-close {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}
.dialog-close:hover { color: var(--blue); background: var(--blue-soft); }
.dialog-body { padding: 0 19px 18px; }
.dialog-body p + p { margin-top: 10px; }
.dialog-label { margin-bottom: var(--space-2); color: var(--ink); font-size: var(--text-sm); font-weight: 700; }
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 19px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}
.dialog-photo { width: 100%; max-height: min(65vh, 700px); border-radius: var(--radius-sm); object-fit: contain; background: var(--slate-soft); }
.photo-meta { margin-top: 8px; color: var(--muted); font-size: var(--text-xs); }
.review-evidence-gallery { display: grid; gap: 14px; margin-top: 10px; }
.review-evidence-gallery figure { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.field-summary { margin-top: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.grants-toolbar { display: flex; align-items: center; gap: 7px; margin-block: 8px; }
.grants-toolbar output { margin-right: auto; color: var(--blue-dark); font-size: var(--text-sm); font-weight: 700; }
.grant-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.grant-groups { max-height: min(43vh, 410px); overflow: auto; padding: 4px; margin-top: 9px; }
.grant-group + .grant-group { margin-top: 13px; }
.grant-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.grant-choice:has(input:checked) { border-color: var(--line-grant); background: var(--blue-soft); color: var(--blue-dark); }
.grant-choice:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.grant-choice input:focus-visible { outline: none; }

.dialog-error {
  margin-top: 11px;
  color: var(--red);
  font-size: var(--text-sm);
}
.grant-choice input { margin: 0; accent-color: var(--blue); cursor: pointer; }

.notification {
  position: fixed;
  z-index: 9;
  right: var(--gutter);
  bottom: 22px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: min(410px, calc(100% - var(--gutter) * 2));
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-float);
  font-size: var(--text-sm);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}
.notification.show { opacity: 1; transform: none; }
.notification .icon { margin-top: 2px; color: var(--green); font-size: 17px; }
.notification.error .icon { color: var(--red); }
.notification:empty { padding: 0; border: 0; }

@media (prefers-reduced-motion: no-preference) {
  .appear { animation: arrive var(--duration-enter) var(--ease-out) both; }
  .metrics.appear { animation-delay: 70ms; }
  .overview-grid.appear { animation-delay: 140ms; }
  .button, .nav-button, .role-trigger, .photo-tile img { transition: background-color var(--duration-fast), color var(--duration-fast), transform var(--duration-fast); }
  .notification { transition: opacity var(--duration-fast), transform var(--duration-fast); }
  @keyframes arrive {
    from { opacity: 0; transform: translateY(9px); }
    to { opacity: 1; transform: none; }
  }
}

@media (min-width: 701px) and (max-width: 1180px) {
  :root { --rail: 72px; }
  .sidebar { padding-inline: 8px; }
  .brand { justify-content: center; min-height: 83px; padding-inline: 0; }
  .brand-copy, .nav-label, .sidebar-footer div { display: none; }
  .navigation { padding-top: 20px; gap: 15px; }
  .nav-button { justify-content: center; padding-inline: 0; font-size: 0; gap: 0; }
  .nav-button .icon { font-size: 21px; }
  .sidebar-footer { justify-content: center; padding-bottom: 28px; }
}

@media (max-width: 980px) {
  .overview-grid { grid-template-columns: 1fr; gap: 16px; }
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-tile { aspect-ratio: 2; }
}

@media (max-width: 700px) {
  :root { --rail: 0px; --gutter: 15px; }
  .sidebar { position: relative; inset: auto; width: 100%; padding-inline: 13px; }
  .brand { width: max-content; min-height: 66px; padding-inline: 0; border-bottom: 0; }
  .brand-icon { width: 38px; height: 38px; font-size: 22px; }
  .brand-copy { gap: 0; }
  .brand-copy strong { font-size: var(--text-md); }
  .brand-copy small { margin-top: 1px; font-size: 11px; }
  .navigation { display: flex; gap: 6px; padding: 0 0 10px; }
  .nav-group { display: contents; }
  .nav-group[hidden] { display: none !important; }
  .nav-label, .sidebar-footer { display: none; }
  .nav-button { justify-content: center; gap: 6px; min-height: 44px; padding-inline: 6px; font-size: var(--text-xs); }
  .nav-button .icon { font-size: 16px; }
  .nav-button[aria-current="page"]::before { display: none; }
  .topbar { position: static; height: 0; padding: 0; border: 0; }
  .breadcrumb { display: none; }
  .role-switch { position: absolute; z-index: 7; top: 10px; right: 12px; }
  .role-trigger { padding-inline: 5px; color: var(--surface); font-size: var(--text-xs); }
  .role-trigger:hover, .role-trigger[aria-expanded="true"] { background: var(--navy-line); border-color: var(--navy-line); }
  .role-trigger:focus-visible { outline-color: var(--focus-on-dark); }
  .role-trigger > .icon { color: var(--nav-text); }
  .role-avatar { width: 29px; height: 29px; border-radius: 7px; }
  .workspace { padding-top: 15px; padding-bottom: 27px; }
  .hero { min-height: 162px; padding: 17px 13px 17px 16px; gap: 9px; }
  .hero-photo { left: 17%; background-position: center, center, 54% center; }
  .hero-description { font-size: var(--text-xs); }
  .hero h1 { margin-block: 6px; }
  .hero-action { gap: 4px; padding-inline: 7px; font-size: var(--text-xs); }
  .hero-action .icon { font-size: 15px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-block: 13px 15px; padding: 0; }
  .metric { min-height: 63px; gap: 8px; padding: 7px 11px; }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
  .metric-icon { width: 34px; height: 34px; border-radius: 8px; font-size: 18px; }
  .metric-label { font-size: var(--text-xs); }
  .metric-value { font-size: 26px; }
  .panel-heading { padding-inline: 13px; }
  .filter-bar { padding-inline: 13px; padding-bottom: 12px; }
  .search-field { padding-inline-start: 8px; gap: 5px; }
  .search-field input, .select-field select { font-size: var(--text-xs); }
  .select-field select { padding-inline: 8px 24px; }
  .select-field .icon { right: 5px; }
  .directory-table th:first-child, .room-button { padding-left: 13px; }
  .room-button { gap: 6px; }
  .room-symbol { width: 29px; height: 29px; }
  .room-symbol .icon { font-size: 15px; }
  .status-cell { padding-right: 6px; }
  .status-cell > .icon { display: none; }
  .photo-count { gap: 3px; }
  .photo-count .icon { font-size: 13px; }
  .directory-footer { padding-inline: 7px; justify-content: space-between; gap: 3px; }
  .directory-footer > .caption { white-space: nowrap; }
  .pages { gap: 1px; }
  .detail-head, .detail-body, .detail-tabs { padding-inline: 13px; }
  .resident-roster { margin-inline: 13px; }
  .resident-list { grid-template-columns: 1fr; }
  .photo-tile { aspect-ratio: 1.55; }
  .review-preview { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
  .review-preview .preview-score { margin-left: 0; }
  .review-preview > .button { grid-column: 2 / -1; justify-self: end; }
  .section-banner { padding: 15px 13px; gap: 10px; }
  .section-banner h1 { font-size: 22px; }
  .section-banner p { font-size: var(--text-xs); }
  .banner-icon { width: 41px; height: 41px; }
  .resource-heading { align-items: stretch; flex-direction: column; }
  .resource-search { max-width: none; flex: auto; }
  .data-table, .data-table tbody { display: block; }
  .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .data-table tr { display: grid; gap: 5px; padding: 10px 13px; border-top: 1px solid var(--line); }
  .data-table td, .data-table td:first-child, .data-table td:last-child {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 0;
    border: 0;
  }
  .data-table td[data-label]::before { flex: 0 0 4em; color: var(--muted); font-size: var(--text-xs); content: attr(data-label); }
  .data-table td.action-cell { width: auto; margin-top: 5px; }
  .record-room-button { padding-inline: 0; }
  .permission-range { min-width: 0; }
}

@media (max-width: 374px) {
  .directory-footer { flex-wrap: wrap; justify-content: center; }
  .directory-footer > .caption { width: 100%; text-align: center; }
}

@media (max-width: 355px) {
  .hero { flex-wrap: wrap; }
  .hero-photo { left: 13%; }
  .col-room { width: 40%; }
  .col-status { width: 28%; }
  .upload-zone { flex-wrap: wrap; }
}

/* 本地图标库使用界面所需的字形子集。 */
.i-alert-circle::before { content: "\ea05"; }
.i-bed::before { content: "\eb5c"; }
.i-building::before { content: "\ea4f"; }
.i-building-community::before { content: "\ebf6"; }
.i-chart-bar::before { content: "\ea59"; }
.i-check::before { content: "\ea5e"; }
.i-chevron-down::before { content: "\ea5f"; }
.i-chevron-left::before { content: "\ea60"; }
.i-chevron-right::before { content: "\ea61"; }
.i-circle-check::before { content: "\ea67"; }
.i-clipboard-check::before { content: "\ea6c"; }
.i-clock::before { content: "\ea70"; }
.i-cloud-upload::before { content: "\ea75"; }
.i-download::before { content: "\ea96"; }
.i-file-upload::before { content: "\ec91"; }
.i-key::before { content: "\eac7"; }
.i-layout-dashboard::before { content: "\f02c"; }
.i-lock::before { content: "\eae2"; }
.i-map-pin::before { content: "\eae8"; }
.i-maximize::before { content: "\eaea"; }
.i-photo::before { content: "\eb0a"; }
.i-camera::before { content: "\ea54"; }
.i-search::before { content: "\eb1c"; }
.i-shield-check::before { content: "\eb22"; }
.i-x::before { content: "\eb55"; }
