:root {
  --bg-0: #f0f2f5;
  --bg-1: #f7f8fa;
  --bg-2: #e9edf3;
  --surface-0: #ffffff;
  --surface-1: #f7f8fa;
  --surface-2: #eef2f7;
  --surface-soft: #edf3ff;
  --border-0: rgba(218, 221, 225, 0.92);
  --border-1: rgba(208, 212, 218, 0.96);
  --border-strong: rgba(24, 119, 242, 0.34);
  --text-0: #1c1e21;
  --text-1: #3a3f47;
  --text-2: #65676b;
  --accent-blue: #1877f2;
  --accent-blue-strong: #1666cf;
  --success: #1877f2;
  --warning: #f0b24f;
  --danger: #e1465a;
  --shadow-card: 0 8px 24px rgba(29, 33, 41, 0.08);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --toolbar-height: 54px;
  --nav-height: 74px;
  --page-x: 12px;
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --toolbar-top-offset: max(calc(var(--safe-top) + 24px), 34px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: var(--text-0);
  background: linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
}

body.is-fullscreen {
  --toolbar-top-offset: max(calc(var(--safe-top) + 32px), 42px);
}

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

button {
  border: 0;
  background: transparent;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.page-eyebrow,
.card-kicker,
.page-subtitle,
.auth-copy {
  display: none !important;
}

.glass-panel,
.data-card {
  background: var(--surface-0);
  border: 1px solid var(--border-0);
  box-shadow: var(--shadow-card);
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(240, 242, 245, 0.94);
}

.screen.is-active {
  display: flex;
}

.auth-card {
  width: min(100%, 340px);
  padding: 22px 18px 18px;
  border-radius: var(--radius-xl);
  text-align: center;
}

.auth-status-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-0);
}

.auth-actions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.message {
  min-height: 20px;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--text-2);
}

.message.error {
  color: var(--danger);
}

.app-shell {
  display: none;
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  flex-direction: column;
}

.app-shell.is-active {
  display: flex;
}

.shell-toolbar {
  position: fixed;
  inset: var(--toolbar-top-offset) var(--page-x) auto;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.shell-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fullscreen-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border-1);
  color: var(--text-1);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, color 120ms ease;
}

.fullscreen-toggle-btn .fullscreen-icon {
  width: 17px;
  height: 17px;
}

.fullscreen-toggle-btn .fullscreen-icon-exit {
  display: none;
}

.fullscreen-toggle-btn.is-active .fullscreen-icon-enter {
  display: none;
}

.fullscreen-toggle-btn.is-active .fullscreen-icon-exit {
  display: block;
}

.fullscreen-toggle-btn.is-active {
  color: var(--accent-blue);
  border-color: var(--border-strong);
  background: var(--surface-soft);
}

.fullscreen-toggle-btn:active {
  transform: scale(0.96);
}

.view-container {
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding:
    calc(var(--toolbar-height) + var(--toolbar-top-offset) + 10px)
    var(--page-x)
    calc(var(--nav-height) + var(--safe-bottom) + 14px);
  scroll-behavior: smooth;
}

.view-pane,
.view-pane--swipe {
  min-height: 100%;
}

.bottom-nav {
  position: fixed;
  inset: auto var(--page-x) max(calc(var(--safe-bottom) + 8px), 10px);
  z-index: 90;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-card);
}

.nav-item {
  min-height: 56px;
  border-radius: 14px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  color: var(--text-2);
  cursor: pointer;
  transition: transform 120ms ease, color 120ms ease, background-color 120ms ease;
}

.nav-item.is-active {
  color: var(--accent-blue);
  background: rgba(24, 119, 242, 0.12);
}

.nav-item:active {
  transform: scale(0.98);
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
}

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

.nav-label {
  font-size: 0.66rem;
  font-weight: 700;
}

.page {
  display: grid;
  gap: 10px;
  padding-bottom: 4px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
}

.page-title {
  font-size: 1.12rem;
  line-height: 1.1;
  font-weight: 700;
}

.page-footnote {
  font-size: 0.74rem;
  color: var(--text-2);
  padding: 0 2px;
}

.data-card {
  display: grid;
  gap: 12px;
  padding: 13px;
  border-radius: var(--radius-lg);
}

.hero-card {
  gap: 12px;
  padding: 14px;
}

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

.card-header h3 {
  font-size: 0.94rem;
  font-weight: 700;
}

.hero-chip-row,
.chip-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border-0);
  background: var(--surface-soft);
  color: var(--text-1);
  font-size: 0.72rem;
  font-weight: 700;
}

.chip.success {
  color: var(--accent-blue);
  border-color: rgba(24, 119, 242, 0.2);
}

.chip.warn {
  color: #ffd17c;
  border-color: rgba(240, 178, 79, 0.18);
}

.chip.critical {
  color: var(--danger);
  border-color: rgba(225, 70, 90, 0.18);
}

.chip-button {
  cursor: pointer;
}

.btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  cursor: default;
  opacity: 0.52;
}

.btn-primary {
  color: #f6f9ff;
  background: var(--accent-blue);
  border: 1px solid var(--accent-blue);
}

.btn-secondary {
  color: var(--text-0);
  background: var(--surface-1);
  border: 1px solid var(--border-1);
}

.btn-ghost {
  color: var(--text-1);
  background: transparent;
  border: 1px dashed var(--border-1);
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.78rem;
}

.btn-lg {
  min-height: 44px;
  padding: 0 18px;
  font-size: 0.92rem;
}

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

.field-label {
  font-size: 0.75rem;
  color: var(--text-2);
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border-0);
  border-radius: 12px;
  background: var(--surface-1);
  color: var(--text-0);
  outline: none;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

input,
select {
  min-height: 40px;
  padding: 0 12px;
}

textarea {
  min-height: 132px;
  resize: vertical;
  padding: 12px;
  line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
  color: rgba(101, 103, 107, 0.66);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 1px rgba(47, 125, 255, 0.16);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  color: var(--text-1);
  font-size: 0.82rem;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--accent-blue);
}

.detail-section {
  display: grid;
  gap: 6px;
}

.detail-section-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-2);
}

.detail-section-body {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-1);
  word-break: break-word;
}

.empty-state,
.empty-hint {
  display: grid;
  gap: 8px;
  place-items: center;
  text-align: center;
  color: var(--text-1);
}

.empty-state {
  min-height: 220px;
  padding: 20px;
}

.empty-state--tall {
  min-height: 320px;
}

.empty-state-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-0);
}

.empty-state-text,
.empty-hint {
  font-size: 0.82rem;
  line-height: 1.55;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-direction: column;
  background: rgba(240, 242, 245, 0.72);
}

.loading-overlay.is-active {
  display: flex;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid rgba(24, 119, 242, 0.12);
  border-top-color: var(--accent-blue);
  animation: spin 800ms linear infinite;
}

.loading-text {
  font-size: 0.8rem;
  color: var(--text-1);
}

.toast-container {
  position: fixed;
  inset: auto 14px calc(var(--nav-height) + var(--safe-bottom) + 16px) 14px;
  z-index: 130;
  display: grid;
  gap: 8px;
}

.toast {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border-1);
  box-shadow: var(--shadow-card);
  font-size: 0.8rem;
  color: var(--text-0);
  animation: toast-in 160ms ease;
}

.toast.success {
  border-color: rgba(34, 194, 138, 0.24);
}

.toast.warning {
  border-color: rgba(240, 178, 79, 0.24);
}

.toast.error {
  border-color: rgba(255, 96, 123, 0.24);
}

.toast.is-closing {
  animation: toast-out 160ms ease forwards;
}

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

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(6px);
  }
}

@media (max-width: 420px) {
  .hero-card-head,
  .card-header {
    flex-direction: column;
  }

  .bottom-nav {
    gap: 3px;
    padding: 5px;
  }

  .nav-item {
    min-height: 54px;
  }

  .nav-label {
    font-size: 0.62rem;
  }
}
