:root {
  --bg: #edf2ef;
  --surface: #ffffff;
  --surface-soft: #f7f9f7;
  --surface-warm: #fbfaf6;
  --ink: #17262a;
  --muted: #5d6e71;
  --line: #dfe6e2;
  --line-strong: #c9d5d0;
  --navy: #102a30;
  --teal: #0f766e;
  --teal-dark: #0a5f59;
  --green: #157c58;
  --amber: #a86108;
  --red: #b83d35;
  --blue: #2768a3;
  --shadow: 0 18px 48px rgba(16, 42, 48, 0.1);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 42, 48, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 42, 48, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 36px 36px;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.64;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

.staff-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.portal-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  color: #f5faf8;
  background: var(--navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
}

/* 图标本体自带深色底与圆角，这里只裁切不染色，否则两层圆角会错位 */
.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
}

.brand-copy small {
  color: #94abad;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.connection-state,
.header-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #a9bebf;
  font-size: 12px;
  white-space: nowrap;
}

.connection-state svg {
  width: 14px;
  height: 14px;
  color: #67d1a4;
}

/* 断线态：深色页头用浅红保证对比度，并提示可点击重连 */
.connection-state.is-offline {
  cursor: pointer;
  color: #f2b7b0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.connection-state.is-offline svg {
  color: #e8847a;
}

/* 静默刷新指示。切页签走的是「先用已渲染内容顶上、后台再拉最新」，
   不给信号员工无法判断屏幕上是不是旧数据。做成贴顶细条，不打断阅读。 */
body::after {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  width: 100%;
  height: 2px;
  content: "";
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, transparent, #4fd1b8, #7ce2d4, transparent);
  background-repeat: no-repeat;
  background-size: 45% 100%;
  transition: opacity 0.16s ease;
}

body.is-refreshing::after {
  opacity: 1;
  animation: qzy-refresh-sweep 1.05s ease-in-out infinite;
}

@keyframes qzy-refresh-sweep {
  from {
    background-position: -45% 0;
  }
  to {
    background-position: 145% 0;
  }
}

/* 进度条之外的第二信号：云端图标缓慢自转 */
.connection-state.is-syncing svg,
.mobile-app-bar-title span.is-syncing svg {
  color: #7ce2d4;
  animation: qzy-sync-spin 1.4s linear infinite;
}

@keyframes qzy-sync-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.is-refreshing::after {
    animation: none;
    background-position: 50% 0;
    opacity: 0.6;
  }

  .connection-state.is-syncing svg,
  .mobile-app-bar-title span.is-syncing svg {
    animation: none;
  }
}

.header-link {
  color: #d3e1df;
  border-bottom: 1px solid rgba(211, 225, 223, 0.3);
}

.header-link:hover {
  color: #ffffff;
  border-color: #77d8ca;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
}

.icon-button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.portal-header .icon-button {
  color: #c8d9d7;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
}

.portal-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  flex: 1;
}

.login-screen {
  min-height: calc(100vh - 150px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(370px, 0.72fr);
  align-items: center;
  gap: 80px;
  padding: 64px 0;
}

.login-intro {
  max-width: 650px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-intro h1,
.login-intro h2.panel-heading {
  max-width: 620px;
  margin: 0;
  color: var(--navy);
  font-size: clamp(36px, 4.8vw, 58px);
  font-weight: 600;
  line-height: 1.17;
  letter-spacing: 0;
}

.intro-copy {
  max-width: 580px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.intro-list {
  display: grid;
  gap: 12px;
  margin-top: 38px;
}

.intro-list div {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #405458;
  font-size: 13px;
}

.intro-list svg {
  width: 17px;
  height: 17px;
  color: var(--teal);
}

.login-card {
  padding: 34px;
  border: 1px solid rgba(16, 42, 48, 0.13);
  border-top: 3px solid var(--teal);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-card-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 28px;
}

.card-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--teal);
  background: #e9f4f1;
}

.card-icon svg {
  width: 20px;
  height: 20px;
}

.login-card h2 {
  margin: 0;
  color: var(--navy);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
}

.field {
  display: grid;
  gap: 7px;
}

.field > span,
.platform-choice legend {
  color: #405256;
  font-size: 12px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: 0;
  color: var(--ink);
  background: #fbfcfa;
  font: inherit;
  font-size: 14px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.field textarea {
  min-height: 82px;
  line-height: 1.65;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(15, 118, 110, 0.58);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.field select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  background-image: url("/chevron-down.svg?v=a89665de62");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 14px;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button,
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
  -webkit-appearance: none;
  appearance: none;
}

input[type="date"] {
  min-width: 0;
  color-scheme: light;
  font-variant-numeric: tabular-nums;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  width: 16px;
  height: 16px;
  margin-left: 6px;
  padding: 0;
  border: 0;
  opacity: 0.62;
  cursor: pointer;
  background-image: url("/calendar.svg?v=660e1a6479");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 0.95;
}

input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}

input[type="checkbox"] {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  display: inline-grid;
  flex: 0 0 auto;
  place-content: center;
  margin: 0;
  border: 1px solid #b9c8c4;
  border-radius: 5px;
  outline: 0;
  background: #ffffff;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

input[type="checkbox"]::before {
  content: "";
  width: 9px;
  height: 5px;
  border: 2px solid #ffffff;
  border-top: 0;
  border-right: 0;
  opacity: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0.65);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

input[type="checkbox"]:checked {
  border-color: var(--teal);
  background: var(--teal);
}

input[type="checkbox"]:checked::before {
  opacity: 1;
  transform: translateY(-1px) rotate(-45deg) scale(1);
}

input[type="checkbox"]:focus-visible {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

#staffLoginForm {
  display: grid;
  gap: 17px;
}

.form-error {
  min-height: 18px;
  margin: -3px 0;
  color: var(--red);
  font-size: 12px;
  line-height: 1.5;
}

.primary-button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  color: #ffffff;
  background: var(--teal);
  font-weight: 600;
  box-shadow: 0 9px 20px rgba(15, 118, 110, 0.16);
  transition: background 0.16s ease, transform 0.16s ease;
}

.primary-button:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
}

.primary-button svg {
  width: 17px;
  height: 17px;
}

.login-submit {
  width: 100%;
  margin-top: 3px;
}

.login-help {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.login-help svg {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--teal);
}

.staff-app {
  padding: 34px 0 60px;
}

.employee-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line-strong);
}

.employee-heading h1,
.employee-heading h2.panel-heading {
  margin: 0;
  color: var(--navy);
  font-size: 31px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0;
}

.employee-heading > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.employee-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 190px;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--navy);
  font-size: 16px;
  font-weight: 600;
}

.employee-identity div {
  display: grid;
  gap: 4px;
}

.employee-identity strong {
  font-size: 14px;
}

.employee-identity span {
  color: var(--muted);
  font-size: 12px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 24px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.summary-item {
  min-height: 92px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: var(--surface);
}

.summary-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--blue);
  background: #edf4fa;
}

.summary-icon svg {
  width: 18px;
  height: 18px;
}

.summary-item > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.summary-item span {
  color: var(--muted);
  font-size: 12px;
}

.summary-item strong {
  color: var(--navy);
  font-size: 26px;
  font-weight: 600;
}

.summary-warn .summary-icon {
  color: var(--amber);
  background: #fbf3e6;
}

.summary-good .summary-icon {
  color: var(--green);
  background: #eaf5ef;
}

.portal-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.portal-tab {
  min-height: 44px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}

.portal-tab svg {
  width: 15px;
  height: 15px;
}

.portal-tab.active {
  color: var(--teal);
}

.portal-tab.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  background: var(--teal);
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.75fr);
  gap: 24px;
  align-items: start;
}

.entry-panel,
.today-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.entry-panel {
  padding: 28px;
}

.today-panel {
  position: sticky;
  top: 20px;
  overflow: hidden;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-heading.compact {
  margin: 0;
  padding: 22px 22px 18px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2,
.history-heading h2 {
  margin: 0;
  color: var(--navy);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.text-button:hover {
  color: var(--ink);
}

.text-button svg {
  width: 14px;
  height: 14px;
}

.form-section {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.form-section:first-child {
  padding-top: 0;
  border-top: 0;
}

.form-section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 15px;
}

.form-section-title span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 20px;
  border-radius: 4px;
  color: var(--teal);
  background: #eaf4f2;
  font-size: 12px;
  font-weight: 700;
}

.form-section-title strong {
  color: #33484c;
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-wide {
  grid-column: 1 / -1;
}

.platform-choice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}

.platform-choice legend {
  margin-bottom: 8px;
}

.platform-choice label {
  position: relative;
  cursor: pointer;
}

.platform-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.platform-choice label > span {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  font-weight: 600;
}

.platform-choice label > span svg {
  width: 15px;
  height: 15px;
}

.platform-choice input:checked + span {
  color: var(--teal);
  border-color: rgba(15, 118, 110, 0.42);
  background: #eaf6f3;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.08);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.save-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.save-hint svg {
  width: 14px;
  height: 14px;
  color: var(--teal);
}

.count-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--teal);
  background: #eaf4f2;
  font-size: 12px;
  font-weight: 600;
}

.report-feed {
  display: grid;
  gap: 0;
  padding: 4px 18px 18px;
}

.report-card {
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
}

.report-card:last-child {
  border-bottom: 0;
}

.report-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.report-device {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.platform-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: var(--teal);
  background: #edf5f2;
}

.platform-mark.qq {
  color: var(--blue);
  background: #edf3fa;
}

.platform-mark.software {
  color: var(--amber);
  background: #fbf3e6;
}

.platform-mark svg {
  width: 16px;
  height: 16px;
}

.report-device strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-device small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.report-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  color: #526468;
  background: #f0f3f1;
  font-size: 12px;
  font-weight: 600;
}

.pill.status-normal,
.pill.review-approved {
  color: var(--green);
  background: #e9f5ef;
}

.pill.status-abnormal,
.pill.status-blocked {
  color: var(--red);
  background: #fbeeed;
}

.pill.status-pending,
.pill.review-pending {
  color: var(--amber);
  background: #fbf3e6;
}

.pill.review-supplement {
  color: var(--blue);
  background: #edf3fa;
}

.report-note {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.report-edit {
  margin-top: 11px;
  padding: 0;
  border: 0;
  color: var(--teal);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}

.report-edit:hover {
  text-decoration: underline;
}

.feed-empty {
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.feed-empty svg {
  width: 26px;
  height: 26px;
  margin: 0 auto 10px;
  color: #a5b7b4;
}

.history-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.search-control {
  min-width: 260px;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.search-control svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.search-control input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

.history-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.history-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
}

.history-date strong {
  color: #41555a;
  font-size: 12px;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(150px, 0.9fr) minmax(120px, 0.65fr) auto;
  align-items: center;
  gap: 18px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.history-row:last-child {
  border-bottom: 0;
}

.history-main {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.history-main strong,
.history-account strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-main span,
.history-account span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.history-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-time {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.portal-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 20px max(24px, calc((100vw - 1180px) / 2));
  border-top: 1px solid var(--line);
  color: #7d8b8d;
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 100;
  left: 50%;
  bottom: 28px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 7px;
  color: #ffffff;
  background: var(--navy);
  box-shadow: 0 12px 30px rgba(16, 42, 48, 0.2);
  font-size: 12px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: var(--red);
}

@media (max-width: 900px) {
  .login-screen {
    grid-template-columns: 1fr;
    gap: 38px;
    padding: 48px 0;
  }

  .login-intro h1,
  .login-intro h2.panel-heading {
    max-width: 680px;
    font-size: 42px;
  }

  .login-card {
    max-width: 560px;
  }

  .report-layout {
    grid-template-columns: 1fr;
  }

  .today-panel {
    position: static;
  }

  .history-row {
    grid-template-columns: minmax(160px, 1fr) minmax(140px, 0.8fr) auto;
  }

  .history-time {
    display: none;
  }
}

@media (max-width: 680px) {
  .portal-header {
    min-height: 62px;
    padding: 0 16px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .brand-copy small {
    font-size: 12px;
  }

  .connection-state,
  .header-link {
    display: none;
  }

  .portal-main {
    width: min(100% - 28px, 1180px);
  }

  .login-screen {
    min-height: auto;
    padding: 34px 0 44px;
  }

  .login-intro h1,
  .login-intro h2.panel-heading {
    font-size: 33px;
    line-height: 1.22;
  }

  .intro-copy {
    margin-top: 16px;
    font-size: 13px;
  }

  .intro-list {
    margin-top: 24px;
  }

  .login-card {
    padding: 24px 20px;
  }

  .login-card h2 {
    font-size: 21px;
  }

  .staff-app {
    padding: 22px 0 38px;
  }

  .employee-hero {
    display: grid;
    gap: 18px;
    padding-bottom: 20px;
  }

  .employee-heading h1,
  .employee-heading h2.panel-heading {
    font-size: 25px;
  }

  .employee-heading > p:last-child {
    line-height: 1.7;
  }

  .employee-identity {
    min-width: 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .summary-grid {
    grid-template-columns: 1fr;
    gap: 1px;
    margin: 18px 0;
  }

  .summary-item {
    min-height: 72px;
    padding: 13px 16px;
  }

  .summary-item strong {
    font-size: 22px;
  }

  .portal-tabs {
    margin-bottom: 16px;
  }

  .portal-tab {
    flex: 1;
    justify-content: center;
    padding: 0 8px;
  }

  .entry-panel {
    padding: 20px 16px;
  }

  .section-heading {
    margin-bottom: 20px;
  }

  .section-heading h2,
  .history-heading h2 {
    font-size: 18px;
  }

  .section-heading.compact {
    padding: 18px 16px 15px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .platform-choice {
    grid-template-columns: 1fr;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions .primary-button {
    width: 100%;
  }

  .save-hint {
    justify-content: center;
  }

  .report-feed {
    padding: 4px 14px 14px;
  }

  .history-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .search-control {
    width: 100%;
    min-width: 0;
  }

  .history-row {
    grid-template-columns: 1fr;
    gap: 11px;
    padding: 16px;
  }

  .history-status {
    padding-left: 43px;
  }

  .portal-footer {
    display: grid;
    gap: 5px;
    padding: 17px 16px 22px;
  }
}

@media (max-width: 390px) {
  .portal-main {
    width: calc(100% - 22px);
  }

  .login-intro h1,
  .login-intro h2.panel-heading {
    font-size: 30px;
  }

  .employee-heading h1,
  .employee-heading h2.panel-heading {
    font-size: 23px;
  }

  .entry-panel {
    padding: 18px 13px;
  }
}

.daily-panel {
  display: grid;
  gap: 16px;
}

.daily-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding: 26px 28px;
  border-radius: 8px;
  color: #ffffff;
  background: #12363c;
}

.daily-hero .eyebrow { color: #80d0c5; }
.daily-hero h1,
.daily-hero h2.panel-heading { margin: 0; font-size: 28px; letter-spacing: 0; }
.daily-hero p:last-child { margin: 7px 0 0; color: #c4d6d3; font-size: 12px; line-height: 1.7; }

.daily-status-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  color: #d9e8e5;
  background: rgba(255,255,255,.08);
  font-size: 12px;
  font-weight: 700;
}
.daily-status-pill.approved { color: #bff1d2; background: rgba(56, 174, 113, .2); }
.daily-status-pill.pending { color: #ffe4ac; background: rgba(214, 145, 36, .2); }
.daily-status-pill.supplement { color: #ffd1c9; background: rgba(204, 74, 56, .24); }
.daily-status-pill.rest { color: #cfe6ff; background: rgba(66, 133, 196, .22); }

.daily-window-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 20px;
  border: 1px solid #dbe6e1;
  border-radius: 8px;
  background: #ffffff;
}
.daily-window-copy { min-width: 0; }
.daily-window-copy strong { display: block; margin-top: 4px; color: var(--navy); font-size: 16px; }
.daily-window-copy small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.daily-window-state { color: var(--teal); font-size: 11px; font-weight: 700; }
.daily-window-times { display: flex; gap: 8px; }
.daily-window-times > span {
  min-width: 104px;
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f7faf8;
}
.daily-window-times strong { color: var(--navy); font-size: 13px; }
.daily-window-times small { color: var(--muted); font-size: 11px; }
.daily-window-times > span.active { border-color: #93c7bc; background: #eaf6f2; }
.daily-window-times > span.active strong { color: #0b6b62; }
.daily-submit-button { min-height: 44px; white-space: nowrap; }

.daily-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.daily-summary-grid article { padding: 16px 17px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.daily-summary-grid span { color: var(--muted); font-size: 11px; }
.daily-summary-grid strong { display: block; margin-top: 5px; color: var(--navy); font-size: 25px; line-height: 1; }
.daily-summary-grid small { display: block; margin-top: 5px; color: #69777a; font-size: 11px; }
.daily-summary-grid article.warn strong { color: var(--amber); }

.daily-notice-area { display: grid; gap: 9px; }
.daily-notice { display: flex; align-items: center; gap: 11px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.daily-notice > svg { width: 19px; height: 19px; flex: 0 0 auto; }
.daily-notice > div { min-width: 0; flex: 1; }
.daily-notice strong { display: block; color: var(--navy); font-size: 12px; }
.daily-notice span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.daily-notice button { min-height: 34px; padding: 0 12px; border: 0; border-radius: 7px; color: #fff; background: var(--teal); font-size: 11px; font-weight: 700; white-space: nowrap; }
.daily-notice.approved { color: #176247; border-color: #c9e6d7; background: #f2faf5; }
.daily-notice.pending { border-color: #eadab6; background: #fffaf0; }
.daily-notice.supplement { border-color: #efc7c0; background: #fff7f5; }
.daily-notice.supplement > svg { color: #bd4c3d; }

.daily-device-preview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 16px; background: #f7faf8; }
.daily-device-preview-card { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.daily-device-preview-card > header { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-bottom: 1px solid var(--line); }
.daily-device-icon { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; color: var(--teal); background: #eaf5f2; }
.daily-device-preview-card header > div { min-width: 0; flex: 1; }
.daily-device-preview-card header strong, .daily-device-preview-card header span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daily-device-preview-card header strong { color: var(--navy); font-size: 13px; }
.daily-device-preview-card header span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.daily-device-state { padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.daily-device-state.ok { color: #176247; background: #e8f5ee; }
.daily-device-state.warn { color: #9a5c0d; background: #fff1d8; }
.daily-device-accounts { display: flex; flex-wrap: wrap; gap: 6px; padding: 11px 14px; }
.daily-device-accounts > span { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 6px; color: #536562; background: #f1f5f3; font-size: 11px; }
.daily-device-accounts b { color: #176247; font-size: 11px; }
.daily-device-accounts b.warn { color: #a95e0a; }

.daily-history-list { display: grid; gap: 1px; background: var(--line); }
.daily-history-row { display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: #fff; }
.daily-history-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; color: var(--teal); background: #eaf5f2; }
.daily-history-icon.pending { color: #9a5c0d; background: #fff1d8; }
.daily-history-icon.supplement { color: #ad4336; background: #fff0ed; }
.daily-history-copy { min-width: 0; flex: 1; }
.daily-history-copy strong, .daily-history-copy span, .daily-history-copy small { display: block; }
.daily-history-copy strong { color: var(--navy); font-size: 12px; }
.daily-history-copy span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.daily-history-copy small { margin-top: 4px; color: #985843; font-size: 11px; }
.daily-history-status { padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.daily-history-status.approved { color: #176247; background: #e8f5ee; }
.daily-history-status.pending { color: #9a5c0d; background: #fff1d8; }
.daily-history-status.supplement { color: #ad4336; background: #fff0ed; }
.daily-history-status.rest { color: #235c81; background: #e9f3fb; }
.daily-history-status.idle { color: #5d6d70; background: #edf1f0; }

.daily-empty { grid-column: 1 / -1; padding: 28px 16px; text-align: center; color: var(--muted); background: #fff; }
.daily-empty svg { width: 27px; height: 27px; margin: 0 auto 8px; color: #7f9b95; }
.daily-empty strong, .daily-empty span { display: block; }
.daily-empty strong { color: var(--navy); font-size: 12px; }
.daily-empty span { margin-top: 4px; font-size: 11px; }
.daily-empty.compact { padding: 20px 12px; }

.attendance-profile-actions { display: flex; align-items: center; gap: 8px; }
.attendance-profile-actions .quiet-button { min-height: 38px; }

.attendance-profile .employee-profile-main h1,
.attendance-profile .employee-profile-main h2.panel-heading {
  white-space: nowrap;
}

@media (max-width: 760px) {
  .attendance-profile {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 13px;
  }

  .attendance-profile .employee-profile-main {
    width: 100%;
    align-items: flex-start;
  }

  .attendance-profile .employee-profile-main > div {
    min-width: 0;
    flex: 1;
  }

  .attendance-profile .employee-profile-main p {
    line-height: 1.5;
  }

  .attendance-profile .employee-profile-main small {
    display: block;
    margin-top: 6px;
    color: #bad0cd;
    line-height: 1.55;
    white-space: normal;
  }

  .attendance-profile-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attendance-profile-actions .quiet-button {
    width: 100%;
    min-height: 42px;
    justify-content: center;
    color: #165f58;
    border-color: rgba(255, 255, 255, 0.35);
    background: #f4fbf8;
    font-size: 12px;
  }
}

.app-nav-icon { position: relative; display: inline-grid; place-items: center; }
.app-nav-badge {
  min-width: 15px;
  height: 15px;
  position: absolute;
  top: -5px;
  right: -9px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #c54b3c;
  font-size: 12px;
  line-height: 1;
}

.daily-report-dialog { width: min(680px, calc(100vw - 28px)); }
.daily-dialog-window { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.daily-dialog-window > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 7px; background: #f7faf8; }
.daily-dialog-window span, .daily-dialog-window strong { display: block; }
.daily-dialog-window span { color: var(--muted); font-size: 11px; }
.daily-dialog-window strong { margin-top: 3px; color: var(--navy); font-size: 12px; }
.daily-select-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.daily-select-head strong, .daily-select-head span { display: block; }
.daily-select-head strong { color: var(--navy); font-size: 12px; }
.daily-select-head div span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.daily-select-all { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--teal); background: #f5faf8; font-size: 11px; font-weight: 700; }
.daily-select-all input { accent-color: var(--teal); }
.daily-device-checklist { display: grid; gap: 8px; }
.daily-check-card { display: flex; align-items: center; gap: 11px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.daily-check-card:has(input:checked) { border-color: #9bc9bf; background: #f3faf7; }
.daily-check-card input { position: absolute; opacity: 0; pointer-events: none; }
.daily-check-box { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #bdcbc6; border-radius: 6px; color: transparent; background: #fff; }
.daily-check-card input:checked + .daily-check-box { color: #fff; border-color: var(--teal); background: var(--teal); }
.daily-check-box svg { width: 14px; height: 14px; }
.daily-check-copy { min-width: 0; }
.daily-check-copy strong, .daily-check-copy small, .daily-check-copy em { display: block; }
.daily-check-copy strong { color: var(--navy); font-size: 12px; }
.daily-check-copy small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.daily-check-copy em { margin-top: 3px; color: #6a7a77; font-size: 11px; font-style: normal; }
.daily-note-field { margin: 0; }
.daily-submit-warning { display: flex; align-items: center; gap: 7px; margin: 0; padding: 10px 12px; border-radius: 7px; color: #48655f; background: #eef6f2; font-size: 11px; line-height: 1.55; }
.daily-submit-warning svg { width: 16px; height: 16px; flex: 0 0 auto; color: var(--teal); }

/* 仅供屏幕阅读器的文本，视觉上隐藏但不移出可访问性树 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── 键盘焦点可见性 ─────────────────────────────────────────────
   上方各控件用 outline:0 关掉默认环、改用 box-shadow 表达鼠标聚焦。
   这里只补 :focus-visible：特异性与元素规则相同、位置更靠后因此生效，
   既让键盘/助残用户看到明确焦点，又不改变鼠标点击时的既有观感。 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--teal, #0f766e);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 深色页头/侧栏上用浅色环，保证对比度 */
.admin-sidebar :focus-visible,
.admin-topbar :focus-visible,
.portal-header :focus-visible,
.topbar :focus-visible,
.mobile-app-bar :focus-visible {
  outline-color: #7fe3d4;
}

/* ── 动效降级与高对比度兜底 ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Windows 高对比度 / forced-colors 会剥离 box-shadow 并覆盖自定义颜色，
   而本项目的焦点环与状态标签大量依赖二者，这里给出兜底。 */
@media (forced-colors: active) {
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible,
  [tabindex]:focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 2px;
  }

  /* 状态标签不能只靠底色区分，强制补边框 */
  .status-pill,
  .pill,
  .review-approved,
  .review-pending,
  .status-normal,
  .status-abnormal,
  .status-blocked,
  .status-pending,
  .account-active,
  .account-inactive,
  .audit-type-update,
  .audit-type-create,
  .audit-type-review,
  .audit-type-delete,
  .audit-type-auth,
  .audit-type-system {
    border: 1px solid CanvasText;
    forced-color-adjust: none;
  }

  .live-dot {
    forced-color-adjust: none;
  }

  .data-table thead th {
    background: Canvas;
    color: CanvasText;
  }
}

/* ── 弹窗进出场 ───────────────────────────────────────────────
   原先 <dialog> 与其 ::backdrop 完全没有过渡，是全系统最突兀的动效。
   display/overlay 用 allow-discrete 才能参与过渡；不支持的浏览器会整条
   声明失效并退回瞬间显示，属于安全降级。 */
.modal {
  transition:
    display 180ms allow-discrete,
    overlay 180ms allow-discrete,
    opacity 180ms ease,
    transform 180ms ease;
}

.modal[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal:not([open]) {
  opacity: 0;
}

@starting-style {
  .modal[open] {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
}

.modal::backdrop {
  transition:
    display 180ms allow-discrete,
    overlay 180ms allow-discrete,
    background-color 180ms ease;
}

@starting-style {
  .modal[open]::backdrop {
    background-color: rgba(16, 42, 48, 0);
  }
}

/* 提交中的按钮：禁用态同时降透明度，避免「点了没反应」的错觉 */
button.is-busy,
button[disabled] {
  cursor: progress;
  opacity: 0.62;
}
