:root {
  color-scheme: light;
  --bg: #f3f7fb;
  --card: #ffffff;
  --text: #18283a;
  --muted: #64748b;
  --primary: #1d7f6e;
  --primary-dark: #126255;
  --warning: #f59e0b;
  --danger: #dc2626;
  --success: #15803d;
  --line: #d8e1ec;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: linear-gradient(135deg, #e8f5f2, #f8fbff 46%, #eef4ff);
  color: var(--text);
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px clamp(20px, 5vw, 70px);
}
.eyebrow { margin: 0 0 8px; color: var(--primary); font-weight: 700; letter-spacing: 0.08em; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(30px, 4vw, 52px); }
.subtitle { max-width: 680px; color: var(--muted); font-size: 20px; line-height: 1.6; }
.role-switch { display: flex; gap: 12px; flex-wrap: wrap; }
.pill {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  font-weight: 700;
}
.pill.active { background: var(--primary); color: #fff; }

main { padding: 0 clamp(16px, 4vw, 70px) 60px; }
.view { display: none; }
.view.active { display: block; }

.phone-frame {
  width: min(430px, 100%);
  margin: 0 auto;
  border-radius: 38px;
  padding: 18px;
  background: #111827;
  box-shadow: var(--shadow);
}
.phone-status { color: #d1d5db; text-align: center; padding: 6px 0 16px; }
.phone-frame section { margin-bottom: 14px; }
.hero-card, .card, .notice-card {
  background: var(--card);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.patient-hero { display: flex; justify-content: space-between; align-items: center; background: linear-gradient(135deg, #dcfce7, #ffffff); }
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 800;
}
.badge.doctor { background: #ede9fe; color: #6d28d9; }
.avatar {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 30px;
  font-weight: 800;
}
.notice-card { border: 2px solid #fde68a; background: #fffbeb; font-size: 18px; line-height: 1.6; }
.large-touch label { display: block; margin: 16px 0 8px; font-size: 18px; font-weight: 800; }
select, input, textarea {
  width: 100%;
  min-height: 52px;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 96px; resize: vertical; }
.upload-area {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 150px;
  margin-top: 16px;
  border: 3px dashed #93c5fd;
  border-radius: 24px;
  background: #eff6ff;
  color: #1d4ed8;
}
.upload-area span { font-size: 44px; line-height: 1; }
.consent { display: flex !important; gap: 10px; align-items: center; font-size: 17px !important; }
.consent input { width: 24px; min-height: 24px; }
.button-row { display: flex; gap: 12px; margin-top: 18px; }
.primary, .secondary, .warning {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 16px;
  font-weight: 800;
}
.primary { background: var(--primary); color: #fff; }
.secondary { background: #e2e8f0; color: var(--text); }
.warning { background: #fef3c7; color: #92400e; }
.status-line { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.status { padding: 7px 12px; border-radius: 999px; font-weight: 800; background: #e2e8f0; }
.status.success { background: #dcfce7; color: var(--success); }
.status.danger { background: #fee2e2; color: var(--danger); }
.simple-list { padding-left: 22px; font-size: 18px; line-height: 1.8; }
.disclaimer { padding: 12px; border-radius: 14px; background: #fff7ed; color: #9a3412; font-weight: 700; }
.bottom-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; background: #fff; padding: 10px; border-radius: 22px; }
.tab { min-height: 48px; border-radius: 14px; background: transparent; color: var(--muted); font-weight: 800; }
.tab.active { background: #e0f2fe; color: #0369a1; }

.workspace, .admin-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
  max-width: 1180px;
  margin: 0 auto;
}
.side-panel, .work-main, .admin-menu, .admin-main, .case-card, .review-panel, .table-card {
  background: #fff;
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.cert-pass { color: var(--success); font-weight: 800; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.filters { display: grid; grid-template-columns: 1fr 180px 180px; gap: 12px; margin-bottom: 16px; }
.case-card { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; border-left: 8px solid var(--danger); }
.image-strip { display: flex; gap: 12px; margin: 12px 0; }
.image-strip span { width: 110px; height: 86px; border-radius: 18px; background: linear-gradient(135deg, #fecaca, #fde68a); }
.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ai-box, .doctor-edit { border: 2px solid var(--line); border-radius: 20px; padding: 16px; background: #f8fafc; }

.admin-menu { display: flex; flex-direction: column; gap: 10px; }
.admin-menu button { min-height: 46px; border-radius: 14px; background: #f1f5f9; color: var(--text); font-weight: 700; text-align: left; padding: 0 14px; }
.admin-menu button.active { background: var(--primary); color: #fff; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric { padding: 20px; border-radius: 22px; background: #f8fafc; border: 1px solid var(--line); }
.metric span { color: var(--muted); }
.metric strong { display: block; margin-top: 8px; font-size: 34px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); }

@media (max-width: 860px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .workspace, .admin-shell { grid-template-columns: 1fr; }
  .filters, .split-grid, .metric-grid { grid-template-columns: 1fr; }
  .case-card, .section-header { align-items: stretch; flex-direction: column; }
  .button-row { flex-direction: column; }
}
