:root {
  --formal-blue: #2463eb;
  --formal-blue-soft: #eef4ff;
  --formal-ink: #132a24;
  --formal-line: #dfe8e4;
}

.portal-links {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.portal-links a {
  color: inherit;
  text-decoration: none;
}

.formal-login-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f4f8f6;
  color: #5c6f68;
  font-size: 13px;
  line-height: 1.65;
}

.role-option[data-role="doctor"] i,
.role-option[data-role="agent"] i {
  background: var(--formal-blue-soft);
  color: var(--formal-blue);
}

.prototype-mode {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  color: #277052;
  background: #e7f6ee;
  font-size: 13px;
}

.prototype-mode::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #25a56a;
}

.formal-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  padding: 26px;
  border-radius: 20px;
  color: white;
  background: linear-gradient(125deg, #184f3d, #3c9571);
}

.formal-hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -80px;
  top: -120px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
}

.formal-hero h2 {
  margin: 8px 0;
  font-size: 28px;
}

.formal-hero p {
  margin: 0;
  opacity: .86;
}

.rule-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 22px;
}

.rule-card {
  padding: 16px;
  border: 1px solid var(--formal-line);
  border-radius: 14px;
  background: #fff;
}

.rule-card small,
.formal-subtle {
  display: block;
  margin-top: 5px;
  color: #71837c;
  line-height: 1.55;
}

.rule-card strong {
  color: #174d3c;
  font-size: 22px;
}

.formal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
}

.formal-toolbar input,
.formal-toolbar select {
  min-width: 160px;
  min-height: 39px;
  padding: 0 12px;
  border: 1px solid var(--formal-line);
  border-radius: 10px;
  background: #fff;
}

.formal-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 16px 0;
  padding: 15px 17px;
  border-left: 4px solid #ee9b45;
  border-radius: 10px;
  background: #fff8ed;
  color: #60492e;
  line-height: 1.65;
}

.formal-callout.info {
  border-left-color: var(--formal-blue);
  background: var(--formal-blue-soft);
  color: #294466;
}

.split-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.split-node {
  position: relative;
  padding: 15px;
  border: 1px solid var(--formal-line);
  border-radius: 13px;
  background: #fff;
}

.split-node b,
.split-node span {
  display: block;
}

.split-node span {
  margin-top: 7px;
  color: #71837c;
  font-size: 12px;
  line-height: 1.5;
}

.split-node strong {
  display: block;
  margin-top: 7px;
  color: #e87828;
  font-size: 21px;
}

.consent-grid,
.formal-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.consent-card,
.formal-feature {
  padding: 18px;
  border: 1px solid var(--formal-line);
  border-radius: 15px;
  background: #fff;
}

.consent-card h4,
.formal-feature h4 {
  margin: 0 0 8px;
}

.consent-card p,
.formal-feature p {
  color: #6c7f77;
  line-height: 1.65;
}

.formal-feature button {
  margin-top: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e9f6ef;
  color: #267350;
  font-size: 12px;
  white-space: nowrap;
}

.status-pill.warn {
  background: #fff2df;
  color: #ae641f;
}

.status-pill.danger {
  background: #fdeceb;
  color: #b9443e;
}

.formal-table tbody tr,
.metric-card,
.formal-feature,
.rule-card {
  cursor: pointer;
}

.formal-table tbody tr:hover,
.metric-card:hover,
.formal-feature:hover,
.rule-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(26,63,50,.08);
}

.drill-mask {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  background: rgba(12,31,25,.42);
  backdrop-filter: blur(2px);
}

.drill-mask.open {
  display: block;
}

.drill-panel {
  position: absolute;
  inset: 22px 22px 22px auto;
  width: min(920px, calc(100vw - 44px));
  overflow: auto;
  border-radius: 22px;
  background: #f5f8f7;
  box-shadow: -16px 0 48px rgba(7,30,23,.22);
}

.drill-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--formal-line);
  background: rgba(255,255,255,.96);
}

.drill-head h2 {
  margin: 5px 0 0;
}

.drill-head button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  font-size: 24px;
  background: #eef3f1;
  cursor: pointer;
}

.drill-body {
  padding: 22px 24px 34px;
}

.drill-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.drill-summary div {
  padding: 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--formal-line);
}

.drill-summary span,
.drill-summary b {
  display: block;
}

.drill-summary span {
  margin-bottom: 7px;
  color: #71837c;
  font-size: 12px;
}

.timeline {
  position: relative;
  margin: 8px 0 20px;
}

.timeline-item {
  position: relative;
  padding: 0 0 20px 24px;
  border-left: 2px solid #dce9e3;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3b9270;
}

.timeline-item b,
.timeline-item small {
  display: block;
}

.timeline-item small {
  margin-top: 5px;
  color: #71837c;
}

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

.evidence-list div {
  padding: 13px;
  border: 1px solid var(--formal-line);
  border-radius: 11px;
  background: #fff;
}

.hq-map {
  min-height: 280px;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at 63% 38%, rgba(46,153,113,.28) 0 5px, transparent 6px),
    radial-gradient(circle at 42% 57%, rgba(46,153,113,.35) 0 7px, transparent 8px),
    radial-gradient(circle at 52% 72%, rgba(232,120,40,.38) 0 6px, transparent 7px),
    linear-gradient(145deg,#eaf4ef,#dcebe4);
}

.hq-map::before {
  content: "全国业务聚合地图（展示省市统计，不展示用户实时定位）";
  position: absolute;
  left: 20px;
  bottom: 18px;
  color: #45665a;
  font-size: 13px;
}

.doctor-video {
  display: grid;
  place-items: center;
  min-height: 260px;
  border-radius: 18px;
  color: white;
  text-align: center;
  background: linear-gradient(145deg,#183c46,#295d68);
}

.doctor-video strong {
  display: block;
  margin-bottom: 8px;
  font-size: 26px;
}

.role-switch-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 3500;
  padding: 11px 15px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #1d5a45;
  box-shadow: 0 10px 30px rgba(13,55,41,.25);
  cursor: pointer;
}

@media (max-width: 980px) {
  .rule-strip,
  .split-flow {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
  .consent-grid,
  .formal-card-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .rule-strip,
  .split-flow,
  .consent-grid,
  .formal-card-grid,
  .drill-summary {
    grid-template-columns: 1fr;
  }
  .drill-panel {
    inset: 8px;
    width: auto;
  }
  .formal-toolbar input,
  .formal-toolbar select {
    width: 100%;
  }
}
