:root {
  --bg: #f2f6f8;
  --card: #ffffff;
  --text: #1b2430;
  --muted: #7f8c99;
  --line: #e2e8ef;
  --brand: #2a7bdc;
  --brand-dark: #1f5fb2;
  --success: #17a870;
  --accent: #0e6b59;
  --shadow: 0 10px 30px rgba(17, 40, 75, 0.12);
}

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

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: radial-gradient(120% 120% at 20% 0%, #e7f2ff 0%, #f2f6f8 40%, #f4f7f9 100%);
}

.screen {
  max-width: 430px;
  margin: 0 auto;
  padding: 18px 18px 36px;
  min-height: 100vh;
}

.page {
  opacity: 1;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.page.fade-out {
  opacity: 0;
  transform: translateY(12px);
}

.banner-wrap {
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

.banner-image {
  width: 100%;
  display: block;
}

.topbar {
  padding: 10px 0 14px;
}

.app-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 2px;
  margin-left: 20px;
  color:#fff
}

.subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.progress {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 2px 22px;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 90px;
}

.step .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #c9d4df;
  position: relative;
}

.step.done .dot {
  background: var(--success);
}

.step.current .dot {
  background: var(--brand);
  box-shadow: 0 0 0 4px rgba(42, 123, 220, 0.16);
}

.step .label {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
}

.step.current .label {
  color: var(--brand-dark);
  font-weight: 600;
}

.line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, #b5c7d8 0%, #d9e2ea 100%);
  margin: 0 4px;
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 20px 18px 22px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}

.sms-text {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 18px;
}

.code-wrap {
  position: relative;
  margin-bottom: 16px;
}

.code-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 54px;
  border: none;
  caret-color: transparent;
}

.code-boxes {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.code-boxes .box {
  height: 54px;
  border-radius: 12px;
  border: 1.5px solid #d7e0e8;
  background: #f8fafc;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.code-boxes .box.filled {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(42, 123, 220, 0.08);
  background: #ffffff;
}

.code-wrap.shake {
  animation: shake 0.35s ease;
}

@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

.helper-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.link-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 13px;
  padding: 0;
}

.secure-text {
  margin-top: 18px;
  font-size: 12px;
  color: #8aa0b2;
  text-align: center;
}

.footnote {
  margin-top: 18px;
  font-size: 11px;
  color: #9db0c0;
  text-align: center;
}

.result-top .app-title {
  font-size: 22px;
}

.result-top,
.patient-card,
.info-list,
.action-row,
.panel-list {
  position: relative;
  z-index: 2;
}

.result-top {
  margin-top: -165px;
  padding-top: 0;
}

.patient-card {
  background: linear-gradient(135deg, #e9f4ff 0%, #ffffff 60%);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.pc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.pc-person {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pc-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}

.pc-name {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.1;
}

.pc-meta {
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}

.pc-hospital {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text);
}

.info-list {
  background: var(--card);
  border-radius: 18px;
  padding: 10px 16px;
  box-shadow: var(--shadow);
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.info-item:last-child {
  border-bottom: none;
}

.info-item .label {
  color: var(--muted);
}

.info-item .value {
  font-weight: 500;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0 10px;
}

.primary-btn, .ghost-btn {
  height: 52px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  border: none;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.primary-btn {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(42, 123, 220, 0.25);
}

.ghost-btn {
  background: #f2f7ff;
  color: var(--brand-dark);
  border: 1px solid #cfe0f3;
}

.panel-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.panel-item {
  background: var(--card);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  font-size: 14px;
  color: var(--text);
}

.panel-item::after {
  content: "›";
  float: right;
  color: #9bb0c2;
  font-size: 18px;
  line-height: 1;
}

.report-section {
  display: none;
  margin-top: 16px;
  animation: rise 0.35s ease;
}

.report-open .report-section {
  display: grid;
  gap: 12px;
}

.report-open .panel-list {
  display: none;
}

.report-card {
  background: var(--card);
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.report-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
}

.report-meta {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #eef2f7;
  font-size: 12px;
  color: #6b7c8f;
  font-weight: 500;
}

.report-divider {
  height: 1px;
  background: var(--line);
  margin: 12px 0;
}

.report-grid {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: #324152;
}

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

.report-row span:first-child {
  color: var(--muted);
}

.report-title {
  font-size: 15px;
  color: var(--brand-dark);
  font-weight: 600;
  margin-bottom: 8px;
}

.report-text {
  font-size: 14px;
  color: #3a4756;
  line-height: 1.7;
}

.report-note {
  text-align: center;
  font-size: 13px;
  color: #c07b37;
  padding: 10px 6px;
}

.helper-card {
  display: flex;
  gap: 12px;
  align-items: center;
}

.helper-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #e6eef9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--brand-dark);
}

.helper-title {
  font-size: 15px;
  font-weight: 600;
}

.helper-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.page-loading {
  background: #f4f7fb;
}

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 4px solid #dbe6f3;
  border-top-color: var(--brand);
  animation: spin 0.9s linear infinite;
}

.loading-text {
  font-size: 15px;
  color: #6e7f92;
}

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

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

@media (max-width: 480px) {
  .result-top {
    margin-top: -180px;
  }

  .pc-avatar {
    width: 46px;
    height: 46px;
  }

  .pc-name {
    font-size: 20px;
  }

  .pc-hospital {
    font-size: 13px;
  }

  .pc-meta {
    font-size: 13px;
  }
}

@media (min-width: 480px) {
  .screen {
    padding: 22px 22px 40px;
  }

  .result-top {
    margin-top: -150px;
  }

  .pc-name {
    font-size: 22px;
  }

  .pc-hospital {
    font-size: 15px;
  }

  .pc-meta {
    font-size: 14px;
  }
}
