:root {
  --bg: #f4f8fb;
  --surface: #ffffff;
  --surface-soft: #eef7fb;
  --text: #102033;
  --muted: #5e7086;
  --line: #d9e4ef;
  --brand: #0f8a72;
  --blue: #2563eb;
  --blue-soft: #eaf2ff;
  --warning: #b45309;
  --shadow: 0 8px 24px rgba(16, 32, 51, 0.07);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, #f8fbfd 0%, var(--bg) 100%);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.entry-shell {
  min-height: 100vh;
}

.entry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 18px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
}

.brand-lockup {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
  object-fit: contain;
}

.brand-lockup strong {
  display: block;
  font-size: 17px;
}

.brand-lockup span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.entry-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.entry-nav a,
.entry-back,
.entry-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
}

.entry-back {
  cursor: pointer;
}

.entry-nav a.is-current {
  color: var(--blue);
  border-color: rgba(37, 99, 235, 0.28);
  background: var(--blue-soft);
}

.entry-action.primary {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--blue));
}

.entry-main {
  padding: clamp(24px, 5vw, 64px);
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  max-width: 1180px;
  margin: 0 auto 32px;
}

.hero-copy {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 14px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.08;
}

.hero-copy > p:not(.eyebrow) {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.status-panel {
  padding: 24px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.status-panel h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.status-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.status-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.step-no {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 800;
}

.status-list strong {
  display: block;
  margin-bottom: 4px;
}

.status-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.section-band {
  max-width: 1180px;
  margin: 0 auto 24px;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title h2 {
  margin: 0;
  font-size: 24px;
}

.section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.entry-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.entry-card {
  min-height: 158px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: none;
}

.entry-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 17px;
}

.entry-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.entry-card.is-paused {
  border-color: rgba(180, 83, 9, 0.25);
  background: #fffaf1;
}

.entry-card.is-paused strong {
  color: var(--warning);
}

.report-details {
  grid-column: 1 / -1;
  margin: 0;
}

.report-details summary {
  min-height: 48px;
  padding: 13px 16px;
  border: 1px solid rgba(15, 138, 114, 0.24);
  border-radius: 8px;
  color: var(--brand-strong);
  font-weight: 800;
  background: var(--brand-soft);
  cursor: pointer;
}

.report-details[open] summary {
  margin-bottom: 12px;
}

.report-section-details {
  min-height: 0;
  padding: 0;
}

.report-section-details summary {
  padding: 14px 16px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.report-section-details[open] {
  padding: 16px;
}

.report-section-details[open] summary {
  padding: 0 0 10px;
}

.core-status-band {
  padding: 24px;
  border: 1px solid rgba(15, 138, 114, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.family-login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
  gap: 16px;
  align-items: end;
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  background: #fbfdff;
}

.family-login-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
}

.family-login-form label,
.elder-select-wrap {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.family-login-form input,
.elder-select-wrap select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.password-field input {
  min-width: 0;
}

.password-toggle {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--brand);
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.password-toggle[aria-pressed="true"] {
  border-color: rgba(15, 138, 114, 0.35);
  background: #eaf7f4;
}

.family-login-state {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.elder-select-wrap[hidden] {
  display: none;
}

.core-status-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.core-status-card {
  min-height: 176px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.core-status-card strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 17px;
}

.core-status-card p {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
}

.core-status-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.family-device-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.family-device-summary article {
  min-height: 116px;
  padding: 16px;
  border: 1px solid rgba(15, 138, 114, 0.18);
  border-radius: 8px;
  background: #f7fcfa;
}

.family-device-summary span,
.family-device-summary small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.family-device-summary strong {
  display: block;
  margin: 8px 0;
  color: #0f6a50;
  font-size: 18px;
  line-height: 1.35;
}

.core-closure-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.core-closure-summary article {
  min-height: 132px;
  padding: 16px;
  border: 1px solid rgba(30, 64, 175, 0.14);
  border-radius: 8px;
  background: #fbfcff;
}

.core-closure-summary span,
.core-closure-summary small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.core-closure-summary strong {
  display: block;
  margin: 8px 0;
  color: #173f76;
  font-size: 17px;
  line-height: 1.4;
}

.tcm-model-guidance {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 8px;
  background: #f7fbff;
}

.tcm-model-guidance strong {
  display: block;
  color: #174a82;
  font-size: 17px;
}

.tcm-model-guidance p {
  margin: 8px 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
}

.tcm-model-guidance small {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
}

.status-chip.is-ok {
  color: #0f6a50;
  background: #e8f7f0;
}

.status-chip.is-attention {
  color: #9a4f00;
  background: #fff3dc;
}

.status-chip.is-waiting {
  color: #31506f;
  background: #eef5fb;
}

.core-status-detail {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdff;
  font-size: 14px;
  line-height: 1.65;
}

.notice-band {
  max-width: 1180px;
  margin: 28px auto 0;
  padding: 16px;
  border: 1px solid rgba(15, 138, 114, 0.2);
  border-radius: 8px;
  color: #28584f;
  background: #edf8f4;
  font-size: 14px;
  line-height: 1.65;
}

.notice-band.compact {
  margin-top: 14px;
}

.role-workbench-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.role-login-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 18px;
}

.role-login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.role-login-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.role-metric,
.role-capability {
  min-height: 96px;
}

.role-metric p {
  color: #0f6a50;
  font-size: 26px;
  font-weight: 800;
}

.role-queues {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.role-queue {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.role-queue-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.role-queue-head h3 {
  margin: 0;
  font-size: 18px;
}

.role-queue-head span {
  min-width: 36px;
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--brand);
  background: #eaf7f4;
  font-weight: 800;
  text-align: center;
}

.role-queue-list {
  display: grid;
  gap: 8px;
}

.role-queue-item,
.role-empty {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.role-queue-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
}

.role-queue-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.role-queue-item span {
  color: var(--brand);
  font-weight: 800;
}

.role-queue-item small {
  grid-column: 1 / -1;
  color: var(--muted);
  line-height: 1.55;
}

.role-inline-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.role-inline-actions button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.role-inline-actions button:hover,
.role-inline-actions button:focus {
  border-color: #0f8f72;
  color: #076b56;
}

.role-inline-actions button:disabled {
  cursor: wait;
  opacity: .6;
}

.role-empty {
  color: var(--muted);
}

.site-footer {
  margin-top: 32px;
  padding: 28px clamp(18px, 5vw, 64px);
  border-top: 1px solid var(--line);
  background: #ffffff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 1fr;
  gap: 22px;
  max-width: 1180px;
  margin: 0 auto;
}

.footer-grid strong {
  display: block;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 16px;
}

.footer-grid p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.footer-grid a {
  color: #1e4f8f;
  font-weight: 700;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  max-width: 1180px;
  margin: 22px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .entry-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .entry-nav {
    justify-content: flex-start;
    width: 100%;
  }

  .hero-band {
    grid-template-columns: 1fr;
  }

  .entry-grid,
  .entry-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .core-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .family-device-summary,
  .core-closure-summary {
    grid-template-columns: 1fr;
  }

  .family-login-panel,
  .family-login-form,
  .role-login-form {
    grid-template-columns: 1fr;
  }

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

  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .entry-main {
    padding: 16px 16px 32px;
  }

  .entry-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .entry-nav a,
  .entry-back {
    flex: 0 0 auto;
  }

  .hero-copy > p:not(.eyebrow) {
    font-size: 16px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .entry-action {
    width: 100%;
  }

  .password-field {
    grid-template-columns: 1fr;
  }

  .password-toggle {
    width: 100%;
  }

  .entry-nav a,
  .entry-back {
    min-width: 104px;
  }

  .family-login-panel {
    padding: 16px;
  }

  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .entry-grid,
  .entry-grid.three {
    grid-template-columns: 1fr;
  }

  .core-status-grid {
    grid-template-columns: 1fr;
  }
}
