:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #63706d;
  --line: #d9dfdc;
  --paper: #f5f7f5;
  --panel: #ffffff;
  --green: #176f68;
  --green-dark: #102b2a;
  --yellow: #e0ad3d;
  --red: #c9544d;
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e7efed;
  --muted: #9aacaa;
  --line: #2a3d39;
  --paper: #0c1514;
  --panel: #12201e;
  --green: #58b9aa;
  --green-dark: #071918;
  --yellow: #e0b84f;
  --red: #e47670;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); letter-spacing: 0; }
button, input { font: inherit; letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template: 4.25rem minmax(0, 1fr) / 5.5rem minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
  padding: 0 1.4rem;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.brand__mark { display: grid; place-items: center; width: 3.35rem; height: 3.85rem; overflow: hidden; }
.brand__logo { width: 100%; height: 100%; object-fit: contain; }
.brand__logo--dark { display: none; }
:root[data-theme="dark"] .brand__logo--light { display: none; }
:root[data-theme="dark"] .brand__logo--dark { display: block; }
.brand__copy { min-width: 0; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 0.9rem; }
.brand small { margin-top: 0.14rem; color: var(--muted); font-size: 0.66rem; }
.topbar__actions { display: flex; align-items: center; gap: 0.8rem; }
.access-state { display: flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.72rem; }
.access-state i { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #3e9d72; box-shadow: 0 0 0 3px rgb(62 157 114 / 14%); }
.icon-button { display: grid; place-items: center; width: 2.15rem; height: 2.15rem; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }

.sidebar {
  position: sticky;
  top: 4.25rem;
  height: calc(100vh - 4.25rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.75rem 0.5rem;
  border-right: 1px solid var(--line);
  background: var(--panel);
}
.sidebar nav { display: grid; gap: 0.35rem; }
.sidebar nav a { display: grid; place-items: center; gap: 0.28rem; min-height: 3.65rem; padding: 0.4rem 0.2rem; color: var(--muted); }
.sidebar nav a:hover, .sidebar nav a:focus-visible { background: #e8efec; color: var(--green); outline: none; }
.sidebar nav span { display: grid; place-items: center; }
.sidebar nav strong { max-width: 100%; overflow: hidden; font-size: 0.64rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__meta { margin: 0; color: #9aa5a1; font: 0.52rem/1.45 ui-monospace, monospace; text-align: center; }

.workspace { width: 100%; max-width: 94rem; margin: 0 auto; padding: 1.2rem 1.4rem 5rem; }
.office-stage { position: relative; min-height: clamp(22rem, 48vh, 34rem); overflow: hidden; background: var(--green-dark); color: white; }
.office-stage > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 52%; }
.office-stage__shade { position: absolute; inset: 0; background: rgb(7 26 25 / 48%); }
.office-stage__content { position: absolute; z-index: 2; left: clamp(1.4rem, 4vw, 4rem); bottom: clamp(2.2rem, 7vh, 4.5rem); max-width: 31rem; }
.eyebrow { color: var(--yellow); font: 700 0.65rem/1.2 ui-monospace, monospace; text-transform: uppercase; }
.office-stage h1 { margin: 0.5rem 0 0.5rem; font-size: clamp(2.2rem, 5vw, 4.8rem); line-height: 1; }
.office-stage p { margin: 0 0 1.35rem; color: rgb(255 255 255 / 74%); font-size: 0.9rem; }
.primary-action { display: inline-flex; align-items: center; gap: 1.6rem; min-height: 2.7rem; padding: 0 1rem; background: var(--yellow); color: #20241f; font-size: 0.78rem; font-weight: 750; }
.office-stage__signals { position: absolute; z-index: 2; right: 1rem; bottom: 1rem; display: flex; margin: 0; background: rgb(8 30 28 / 82%); backdrop-filter: blur(10px); }
.office-stage__signals div { min-width: 5.2rem; padding: 0.65rem 0.8rem; border-left: 1px solid rgb(255 255 255 / 12%); }
.office-stage__signals dt { color: rgb(255 255 255 / 48%); font-size: 0.56rem; }
.office-stage__signals dd { margin: 0.14rem 0 0; font: 700 0.75rem/1 ui-monospace, monospace; }

.module-section { padding: 2rem 0 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.section-heading h2 { margin: 0.2rem 0 0; font-size: 1.35rem; }
.text-action { color: var(--green); font-size: 0.72rem; font-weight: 750; }
.text-action:hover, .text-action:focus-visible { text-decoration: underline; outline: none; }
.team-section { padding: 1.7rem 0 0; }
.team-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--panel); }
.team-summary > div { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; min-width: 0; padding: 0.8rem 1rem; border-right: 1px solid var(--line); }
.team-summary > div:last-child { border-right: 0; }
.team-summary span { overflow: hidden; color: var(--muted); font-size: 0.65rem; text-overflow: ellipsis; white-space: nowrap; }
.team-summary strong { color: var(--green); font-size: 1rem; }
.team-pulse { display: grid; gap: 0.55rem; padding: 0.75rem 1rem; border: 1px solid var(--line); border-top: 0; background: var(--panel); }
.team-pulse__track { display: flex; width: 100%; height: 0.38rem; overflow: hidden; background: color-mix(in srgb, var(--line) 62%, transparent); }
.team-pulse__track i { display: block; width: 0; min-width: 0; transition: width 320ms ease; }
.team-pulse .is-working { background: #3e9d72; }
.team-pulse .is-waiting { background: var(--yellow); }
.team-pulse .is-online { background: #6688b5; }
.team-pulse__legend { display: flex; align-items: center; gap: 1rem; color: var(--muted); font-size: 0.6rem; }
.team-pulse__legend span { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.team-pulse__legend i { width: 0.42rem; height: 0.42rem; flex: 0 0 auto; }
.team-pulse__legend b { color: var(--ink); font: 700 0.62rem/1 ui-monospace, monospace; }
.team-members { margin-top: 0.65rem; border-top: 1px solid var(--line); }
.team-member { display: grid; grid-template-columns: 2.3rem minmax(8rem, 0.8fr) minmax(10rem, 1.5fr) 6rem; align-items: center; gap: 0.75rem; min-height: 3.8rem; border-bottom: 1px solid var(--line); }
.team-member:hover, .team-member:focus-visible { background: #eaf0ed; outline: none; }
.team-member__avatar { display: grid; place-items: center; width: 2.15rem; height: 2.15rem; background: var(--green-dark); color: #f7d984; font-size: 0.75rem; font-weight: 800; }
.team-member__identity { min-width: 0; }
.team-member__identity strong, .team-member__identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-member__identity strong { font-size: 0.78rem; }
.team-member__identity small { margin-top: 0.18rem; color: var(--muted); font-size: 0.62rem; }
.team-member__task { overflow: hidden; color: var(--muted); font-size: 0.68rem; text-overflow: ellipsis; white-space: nowrap; }
.team-member__state { display: flex; align-items: center; justify-content: flex-end; gap: 0.4rem; color: var(--muted); font-size: 0.64rem; }
.team-member__state i { width: 0.42rem; height: 0.42rem; border-radius: 50%; background: #98a39f; }
.team-member__state.is-working i, .team-member__state.is-online i { background: #3e9d72; }
.team-member__state.is-waiting i, .team-member__state.is-wrapping i { background: var(--yellow); }
.team-member__state.is-queued i { background: #6688b5; }
.team-empty { margin: 0; padding: 1.25rem 0; color: var(--muted); font-size: 0.7rem; }
.search { display: flex; align-items: center; width: min(18rem, 42vw); min-height: 2.35rem; border-bottom: 1px solid #aeb9b5; color: var(--muted); }
.search input { width: 100%; border: 0; outline: 0; background: transparent; padding: 0.5rem; color: var(--ink); }
.module-list { border-top: 1px solid var(--line); }
.module-row { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) 6rem 2rem; align-items: center; gap: 0.75rem; min-height: 4.4rem; border-bottom: 1px solid var(--line); transition: background 160ms ease; }
.module-row:hover, .module-row:focus-visible { background: #eaf0ed; outline: none; }
.module-row__icon { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border: 1px solid #cad4d0; color: var(--green); }
.module-row__copy strong, .module-row__copy small { display: block; }
.module-row__copy strong { font-size: 0.86rem; }
.module-row__copy small { margin-top: 0.2rem; color: var(--muted); font-size: 0.68rem; }
.module-row__group { color: var(--muted); font-size: 0.68rem; }
.module-row__arrow { font-size: 1rem; text-align: right; }
.load-error { padding: 2rem 0; color: var(--red); }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin-top: 2.5rem;
  padding: 1.2rem 0 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
}
.site-footer a { transition: color 160ms ease; }
.site-footer a:hover, .site-footer a:focus-visible { color: var(--green); outline: none; text-decoration: underline; }
.public-security-record { display: inline-flex; align-items: center; gap: 0.35rem; }
.public-security-record img { width: 1.25rem; height: 1.25rem; object-fit: contain; }

.office-dock { position: fixed; z-index: 30; right: 1rem; bottom: 1rem; display: grid; grid-template-columns: 4.5rem minmax(7rem, 1fr) 2.5rem; align-items: center; width: 18.5rem; min-height: 4.5rem; overflow: hidden; border: 1px solid rgb(255 255 255 / 18%); background: #102b2a; color: white; box-shadow: 0 0.8rem 2rem rgb(13 30 28 / 24%); }
.office-dock > img { width: 100%; height: 4.5rem; object-fit: cover; }
.office-dock div { min-width: 0; padding: 0.55rem 0.7rem; }
.office-dock span, .office-dock strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.office-dock span { color: #a5bcb6; font-size: 0.58rem; }
.office-dock strong { margin-top: 0.18rem; font-size: 0.72rem; }
.office-dock > a { display: grid; place-items: center; align-self: stretch; background: var(--yellow); color: #17211f; font-weight: 800; }
.office-dock__toggle { position: absolute; top: 0; right: 0; z-index: 2; width: 1.35rem; height: 1.35rem; border: 0; background: rgb(0 0 0 / 48%); color: white; cursor: pointer; }
.office-dock.is-collapsed { display: none; }
.mobile-dock { display: none; }

@media (max-width: 760px) {
  .app-shell { display: block; padding-bottom: calc(4.3rem + env(safe-area-inset-bottom)); }
  .topbar { height: 3.75rem; padding: 0 0.8rem; }
  .brand__mark { width: 2.55rem; height: 3.2rem; }
  .brand__copy strong { font-size: 0.78rem; }
  .brand__copy small { font-size: 0.58rem; }
  :is(button, a, input, select, textarea, [role="button"]) { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  :is(input, select, textarea) { font-size: 16px !important; }
  .access-state { display: none; }
  .sidebar, .office-dock { display: none; }
  .workspace { padding: 0 0 1.5rem; }
  .office-stage { min-height: min(30rem, calc(100svh - 8rem)); }
  .office-stage > img { object-position: 56% center; }
  .office-stage__shade { background: rgb(7 26 25 / 58%); }
  .office-stage__content { left: 1rem; right: 1rem; bottom: 5.2rem; }
  .office-stage h1 { font-size: 2.5rem; }
  .office-stage__signals { left: 1rem; right: 1rem; bottom: 0.8rem; }
  .office-stage__signals div { flex: 1; min-width: 0; }
  .module-section { padding: 1.3rem 1rem 0; }
  .team-section { padding: 1.3rem 1rem 0; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .team-section .section-heading { align-items: end; flex-direction: row; }
  .team-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .team-summary > div:nth-child(2) { border-right: 0; }
  .team-summary > div:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .team-pulse { padding: 0.7rem 0.8rem; }
  .team-pulse__legend { justify-content: space-between; gap: 0.35rem; }
  .team-member { grid-template-columns: 2.3rem minmax(0, 1fr) auto; min-height: 4.2rem; }
  .team-member__task { grid-column: 2 / -1; margin-top: -0.55rem; padding: 0 0 0.55rem; white-space: normal; line-height: 1.35; }
  .team-member__state { grid-column: 3; grid-row: 1; }
  .search { width: 100%; }
  .module-row { grid-template-columns: 2.5rem minmax(0, 1fr) 1.5rem; min-height: 4.7rem; }
  .module-row__group { display: none; }
  .module-row__copy small { white-space: normal; line-height: 1.35; }
  .site-footer { margin: 2rem 1rem 0; padding-bottom: 0.75rem; }
  .mobile-dock { position: fixed; z-index: 40; right: 0; bottom: 0; left: 0; display: flex; align-items: stretch; height: calc(4rem + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgb(255 255 255 / 96%); backdrop-filter: blur(14px); }
  .mobile-dock a { flex: 1; display: grid; place-items: center; align-content: center; gap: 0.2rem; min-width: 0; color: var(--muted); }
  .mobile-dock a:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
  .mobile-dock span { display: grid; }
  .mobile-dock svg { width: 1.1rem; height: 1.1rem; }
  .mobile-dock strong { max-width: 100%; overflow: hidden; font-size: 0.58rem; text-overflow: ellipsis; white-space: nowrap; }
}

:root[data-theme="dark"] .topbar { background: rgb(12 21 20 / 94%); }
:root[data-theme="dark"] .sidebar { background: var(--panel); }
:root[data-theme="dark"] .sidebar nav a:hover,
:root[data-theme="dark"] .sidebar nav a:focus-visible,
:root[data-theme="dark"] .module-row:hover,
:root[data-theme="dark"] .module-row:focus-visible,
:root[data-theme="dark"] .team-member:hover,
:root[data-theme="dark"] .team-member:focus-visible { background: #182a27; }
:root[data-theme="dark"] .module-row__icon { border-color: #35504a; }
:root[data-theme="dark"] .mobile-dock { background: rgb(12 21 20 / 96%); }

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