:root {
  color-scheme: light;
  --bg: #f5faf7;
  --bg-2: #eef6ff;
  --surface: #ffffff;
  --surface-soft: #edf8f2;
  --surface-warm: #fff7ef;
  --text: #10211a;
  --muted: #68746f;
  --line: #dbe6df;
  --line-strong: #b8d7cb;
  --primary: #08765a;
  --primary-dark: #075640;
  --accent: #e0564a;
  --gold: #f0b64a;
  --warning: #b96a12;
  --danger: #bd2f25;
  --shadow: 0 22px 70px rgba(18, 46, 35, 0.11);
  --shadow-soft: 0 12px 34px rgba(18, 46, 35, 0.08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 80% 8%, rgba(26, 164, 217, 0.14), transparent 26%),
    linear-gradient(130deg, rgba(8, 118, 90, 0.13), transparent 28%),
    linear-gradient(235deg, rgba(224, 86, 74, 0.12), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 54%, var(--bg-2) 100%);
  color: var(--text);
  animation: pageIn 420ms ease both;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(8, 118, 90, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 118, 90, 0.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.72), transparent 82%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(105deg, transparent 0%, rgba(26, 164, 217, 0.11) 46%, transparent 58%);
  transform: translateX(-45%);
  animation: scanWash 9s ease-in-out infinite;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.brand-strip {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  margin-bottom: 24px;
}

.brand-photo {
  width: 108px;
  height: 108px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  box-shadow: var(--shadow);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.brand-photo:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 78px rgba(18, 46, 35, 0.16);
}

.corner-logo {
  width: 76px;
  height: 76px;
  justify-self: end;
  object-fit: cover;
  border: 1px solid rgba(26, 164, 217, 0.34);
  border-radius: 8px;
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.72),
    0 16px 38px rgba(26, 164, 217, 0.2);
  animation: pulseLogo 3.8s ease-in-out infinite;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 68px;
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.eyebrow,
.section-kicker,
.metric-label,
.result-title {
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.small {
  font-size: 11px;
}

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

.panel {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(219, 230, 223, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--gold), var(--accent));
  opacity: 0.86;
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.28) 46%, transparent 54%);
  transform: translateX(-130%);
  animation: panelSheen 7s ease-in-out infinite;
}

.login-panel,
.app-panel {
  padding: 28px;
  animation: liftIn 360ms ease both;
}

.login-panel > *,
.app-panel > * {
  position: relative;
  z-index: 1;
}

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

.app-panel {
  min-height: 640px;
}

.panel-head {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 20px;
}

.panel-head-split {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.compact {
  margin-bottom: 14px;
}

.login-form,
.stack-form {
  display: grid;
  gap: 14px;
}

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

.field span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

input,
select {
  min-height: 50px;
  padding: 0 15px;
}

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

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(8, 118, 90, 0.14);
}

.primary-btn,
.ghost-btn,
.mini-btn,
.tab-btn,
.filter-chip,
.provider-card {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 42px;
  padding: 0 17px;
  font-weight: 850;
  letter-spacing: 0;
  transition:
    transform 170ms ease,
    box-shadow 170ms ease,
    border-color 170ms ease,
    background 170ms ease,
    color 170ms ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), #0a8769);
  color: #fff;
  box-shadow: 0 12px 24px rgba(8, 118, 90, 0.24);
}

.primary-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: linear-gradient(135deg, var(--primary-dark), #08765a);
  box-shadow: 0 18px 30px rgba(8, 118, 90, 0.28);
}

.ghost-btn,
.mini-btn,
.filter-chip {
  background: rgba(255, 255, 255, 0.84);
  border-color: var(--line);
  color: var(--text);
}

.ghost-btn:hover:not(:disabled),
.mini-btn:hover:not(:disabled),
.filter-chip:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
  box-shadow: var(--shadow-soft);
}

.mini-btn {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

.mini-btn.warn {
  color: var(--warning);
}

.mini-btn.danger {
  color: var(--danger);
}

.error-text {
  min-height: 22px;
  margin-top: 12px;
  color: var(--danger);
  font-weight: 750;
}

.tab-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 24px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.tab-btn {
  min-width: 100px;
  background: transparent;
  color: var(--muted);
}

.tab-btn.active {
  background: var(--text);
  color: #fff;
  box-shadow: 0 10px 22px rgba(16, 33, 26, 0.16);
}

.tab-panel {
  display: block;
  animation: liftIn 260ms ease both;
}

.verify-panel {
  display: grid;
  gap: 18px;
}

.verify-intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  padding-bottom: 2px;
}

.verify-intro .muted {
  max-width: 420px;
  text-align: right;
  line-height: 1.7;
}

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

.provider-card {
  display: grid;
  align-content: center;
  gap: 5px;
  min-height: 92px;
  background: rgba(255, 255, 255, 0.76);
  border-color: var(--line);
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.provider-card:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
}

.provider-card.active {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(237, 248, 242, 0.96), rgba(255, 255, 255, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(8, 118, 90, 0.32),
    0 16px 34px rgba(8, 118, 90, 0.12),
    0 0 0 4px rgba(8, 118, 90, 0.055);
}

.provider-title {
  font-size: 22px;
  color: var(--text);
}

.provider-copy {
  min-height: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.provider-copy:empty {
  display: none;
}

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

.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.action-row-front {
  margin-top: 4px;
}

.action-row-front .primary-btn {
  min-width: 168px;
}

.action-row-front .ghost-btn {
  min-width: 220px;
}

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

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 136px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 253, 251, 0.94));
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), rgba(26, 164, 217, 0.82), transparent);
  opacity: 0.72;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 18px 46px rgba(18, 46, 35, 0.11);
}

.metric-card-primary {
  grid-column: span 2;
}

.accent-card {
  border-color: rgba(224, 86, 74, 0.32);
}

.metric-card-compact {
  min-height: 112px;
}

.metric-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-height: 32px;
}

.metric-value {
  margin-top: 14px;
  overflow-wrap: anywhere;
  font-size: 42px;
  font-weight: 900;
  line-height: 1.04;
  animation: valueIn 260ms ease both;
}

.metric-secondary {
  margin-top: 14px;
  overflow-wrap: anywhere;
  font-size: 22px;
  font-weight: 850;
}

.metric-help {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.notice-box,
.history-block,
.guide-shell {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(237, 248, 242, 0.76);
}

.notice-box {
  border-left: 3px solid var(--primary);
  line-height: 1.7;
}

.history-list,
.admin-list,
.qa-list,
.guide-grid {
  display: grid;
  gap: 14px;
}

.history-item,
.guide-card,
.admin-item,
.result-box,
.admin-meta-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.history-item,
.guide-card,
.admin-item {
  padding: 16px;
}

.history-item,
.guide-card,
.admin-item,
.result-box {
  animation: liftIn 260ms ease both;
}

.history-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.history-status,
.badge,
.admin-role-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
}

.badge.warn {
  color: var(--warning);
}

.badge.danger {
  color: var(--danger);
}

.guide-accordion summary {
  cursor: pointer;
  list-style-position: inside;
}

.guide-accordion summary::marker {
  color: var(--primary);
}

.guide-content {
  margin-top: 12px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.guide-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding-left: 22px;
}

.qa-head {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  align-items: start;
}

.qa-index {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  font-weight: 900;
}

.qa-answer {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  line-height: 1.75;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(360px, 1.15fr);
  gap: 18px;
}

.inset-panel {
  padding: 18px;
  box-shadow: none;
}

.admin-toolbar {
  display: grid;
  gap: 12px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip.active {
  background: var(--primary);
  color: #fff;
}

.result-box {
  margin-top: 14px;
  padding: 12px;
}

pre {
  margin: 8px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.result-head {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.admin-item-head,
.admin-code-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.admin-meta-card {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.admin-meta-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.admin-note,
.admin-actions,
.history-collapse {
  margin-top: 12px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toast-stack {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 20;
  display: grid;
  gap: 10px;
}

.toast {
  max-width: 340px;
  transform: translateY(-8px);
  opacity: 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  box-shadow: var(--shadow);
  transition: 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

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

.toast-success {
  background: var(--primary);
}

@keyframes pageIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes liftIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes valueIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scanWash {
  0%,
  100% {
    transform: translateX(-48%);
    opacity: 0.38;
  }
  50% {
    transform: translateX(28%);
    opacity: 0.72;
  }
}

@keyframes panelSheen {
  0%,
  42%,
  100% {
    transform: translateX(-130%);
  }
  58% {
    transform: translateX(130%);
  }
}

@keyframes pulseLogo {
  0%,
  100% {
    box-shadow:
      0 0 0 6px rgba(255, 255, 255, 0.72),
      0 16px 38px rgba(26, 164, 217, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(255, 255, 255, 0.86),
      0 18px 46px rgba(8, 118, 90, 0.2),
      0 0 28px rgba(26, 164, 217, 0.22);
  }
}

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

@media (max-width: 820px) {
  .shell {
    width: min(100% - 22px, 1180px);
    padding-top: 18px;
  }

  .brand-strip {
    grid-template-columns: 76px 1fr 54px;
    gap: 14px;
  }

  .brand-photo {
    width: 76px;
    height: 76px;
  }

  .corner-logo {
    width: 54px;
    height: 54px;
    box-shadow:
      0 0 0 4px rgba(255, 255, 255, 0.72),
      0 12px 28px rgba(26, 164, 217, 0.18);
  }

  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 24px;
  }

  h3 {
    font-size: 19px;
  }

  .login-panel,
  .app-panel {
    padding: 16px;
  }

  .panel-head-split,
  .verify-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .verify-intro .muted {
    max-width: none;
    text-align: left;
  }

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

  .provider-switch,
  .hero-config,
  .status-grid,
  .admin-grid,
  .admin-summary,
  .search-row {
    grid-template-columns: 1fr;
  }

  .metric-card-primary {
    grid-column: auto;
  }

  .metric-value {
    font-size: 32px;
  }

  .metric-secondary {
    font-size: 19px;
  }

  .action-row-front .primary-btn,
  .action-row-front .ghost-btn {
    width: 100%;
  }
}
