:root {
  --ink: #25282b;
  --muted: #767d82;
  --quiet: #a5adaf;
  --line: #e4e9ea;
  --wash: #f7fbfb;
  --teal: #0b989c;
  --teal-deep: #087f83;
  --teal-soft: #eaf8f8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #eef3f3;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:active {
  transform: translateY(1px);
}

.phone {
  position: relative;
  width: min(100vw, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  overflow: hidden;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.page {
  min-height: 100vh;
  padding: 24px 18px 92px;
}

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

h1,
h2,
p {
  margin: 0;
}

.page-head p,
.selected-doctor p,
.upload-panel p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.banner-card {
  height: 142px;
  margin: 0 0 32px;
  overflow: hidden;
  background: #f7f3ec;
  border-radius: 16px;
}

.banner-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.section-title {
  margin: 30px 0 16px;
  padding-left: 10px;
  border-left: 5px solid var(--teal);
  font-size: 22px;
}

.doctor-card {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 14px;
  padding: 16px;
  margin-bottom: 14px;
}

.doctor-card img,
.selected-doctor img {
  width: 62px;
  height: 74px;
  object-fit: cover;
  border-radius: 12px;
  background: #eef3f3;
}

.doctor-name {
  font-size: 18px;
  font-weight: 800;
}

.doctor-name span {
  margin-left: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.tag {
  padding: 4px 8px;
  color: var(--teal-deep);
  background: var(--teal-soft);
  border-radius: 6px;
  font-size: 12px;
}

.doctor-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.helper-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.helper-grid button,
.menu-list button {
  height: 44px;
  color: var(--teal);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.menu-list button {
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  text-align: left;
}

.menu-list button::after {
  content: "›";
  margin-left: auto;
  color: var(--quiet);
  font-size: 22px;
}

.menu-list button em {
  margin-left: auto;
  margin-right: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.page-head {
  padding: 8px 0 18px;
  text-align: center;
}

.page-head.left {
  text-align: left;
}

.page-head h1 {
  font-size: 25px;
}

.page-head h1::after {
  content: "";
  display: block;
  width: 34px;
  height: 4px;
  margin: 11px auto 0;
  background: var(--teal);
  border-radius: 4px;
}

.page-head.left h1::after {
  margin-left: 0;
}

.doctor-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 10px 0 14px;
}

.doctor-tabs button {
  min-height: 58px;
  color: var(--muted);
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.doctor-tabs button strong,
.doctor-tabs button span {
  display: block;
}

.doctor-tabs button strong {
  color: var(--ink);
  font-size: 14px;
}

.doctor-tabs button span {
  margin-top: 4px;
  font-size: 12px;
}

.doctor-tabs .active {
  background: var(--teal-soft);
  border-color: rgba(11, 152, 156, .35);
}

.doctor-tabs .active strong {
  color: var(--teal-deep);
}

.selected-doctor {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 14px;
  padding: 14px;
  margin-bottom: 16px;
}

.calendar-card {
  padding: 16px 12px 18px;
}

.calendar-top,
.date-summary,
.slot-head,
.simple-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.calendar-top {
  margin-bottom: 18px;
}

.calendar-top span {
  color: var(--muted);
  font-size: 13px;
}

.week-row,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
}

.week-row {
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 13px;
}

.calendar-grid {
  row-gap: 7px;
}

.calendar-day {
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
}

.calendar-day .day {
  font-size: 18px;
  font-weight: 800;
}

.calendar-day .state {
  margin-top: 4px;
  color: var(--teal);
  font-size: 11px;
}

.calendar-day.disabled {
  color: #c3ccce;
}

.calendar-day.disabled .state {
  color: #c3ccce;
}

.calendar-day.selected {
  background: var(--teal-soft);
}

.calendar-day.selected .day,
.calendar-day.selected .state {
  color: var(--teal-deep);
}

.date-summary {
  margin-top: 18px;
}

.date-summary strong,
.date-summary span,
.date-summary em {
  display: block;
}

.date-summary strong {
  color: var(--teal-deep);
  font-size: 18px;
}

.date-summary span {
  margin-top: 8px;
  font-size: 14px;
}

.date-summary em {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.date-summary button {
  width: 96px;
  height: 44px;
  color: #fff;
  background: var(--teal);
  border-radius: 24px;
  font-weight: 800;
  flex-shrink: 0;
}

.primary-btn,
.ghost-btn {
  width: 100%;
  height: 52px;
  border-radius: 12px;
  font-weight: 800;
}

.primary-btn {
  color: #fff;
  background: var(--teal);
}

.ghost-btn {
  margin-top: 12px;
  color: var(--teal);
  background: var(--teal-soft);
}

.simple-head {
  margin-bottom: 18px;
}

.simple-head button {
  color: var(--teal);
  background: transparent;
}

.summary-card {
  padding: 16px;
  margin-bottom: 14px;
  background: var(--teal-soft);
}

.patient-picker {
  position: relative;
  width: 100%;
  min-height: 68px;
  margin-bottom: 14px;
  padding: 13px 66px 13px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.patient-picker span {
  color: var(--muted);
  font-size: 12px;
}

.patient-picker strong {
  margin-top: 5px;
  font-size: 16px;
}

.patient-picker em {
  position: absolute;
  right: 16px;
  color: var(--teal);
  font-size: 13px;
  font-style: normal;
}

.summary-card strong,
.summary-card span,
.receipt div,
.ticket span {
  display: block;
}

.form-list {
  margin-bottom: 22px;
  border-top: 1px solid var(--line);
}

label {
  display: block;
  padding: 13px 0;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
}

textarea {
  min-height: 96px;
}

select {
  height: 46px;
  background: #fff;
}

.member-fields label b {
  margin-left: 4px;
  color: var(--teal-deep);
  font-size: 11px;
}

.page-note {
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.pay-page,
.success-page {
  text-align: center;
}

.countdown {
  width: 120px;
  height: 120px;
  margin: 72px auto 22px;
  display: grid;
  place-items: center;
  color: var(--teal);
  border: 9px solid var(--teal-soft);
  border-radius: 50%;
  font-size: 27px;
  font-weight: 900;
}

.pay-page p,
.success-page p {
  margin: 14px auto 24px;
  color: var(--muted);
  line-height: 1.65;
}

.receipt,
.ticket,
.profile {
  padding: 16px;
  margin-bottom: 22px;
  text-align: left;
}

.profile {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 13px;
  align-items: center;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 50%;
  font-weight: 800;
}

.receipt div {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.receipt div:last-child {
  border-bottom: 0;
}

.success-icon {
  width: 92px;
  height: 92px;
  margin: 90px auto 22px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--teal);
  border-radius: 50%;
  font-size: 48px;
}

.profile strong,
.profile span {
  display: block;
}

.next-appointment {
  position: relative;
  padding: 16px;
  margin-bottom: 22px;
  border-color: rgba(11, 152, 156, .28);
  background: var(--teal-soft);
}

.next-appointment strong,
.next-appointment span {
  display: block;
}

.next-appointment strong {
  margin: 8px 0 7px;
  font-size: 17px;
}

.next-appointment small,
.next-appointment span {
  color: var(--muted);
}

.next-appointment button {
  position: absolute;
  right: 14px;
  bottom: 14px;
  color: var(--teal-deep);
  background: transparent;
  font-weight: 700;
}

.profile span {
  margin-top: 8px;
  color: var(--muted);
}

.menu-list {
  display: grid;
  gap: 10px;
}

.status-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px;
  background: #f3f6f6;
  border-radius: 12px;
}

.status-tabs button {
  height: 38px;
  color: var(--muted);
  background: transparent;
  border-radius: 9px;
  font-size: 13px;
}

.status-tabs button.active {
  color: var(--teal-deep);
  background: #fff;
  box-shadow: 0 3px 12px rgba(32, 73, 74, .08);
  font-weight: 800;
}

.appointment-card {
  padding: 16px;
  margin-bottom: 12px;
}

.order-top,
.order-doctor,
.member-card,
.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-top {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.order-top small {
  color: var(--muted);
}

.order-status {
  color: var(--teal-deep);
  font-size: 13px;
  font-weight: 800;
}

.order-status.muted {
  color: var(--quiet);
}

.order-doctor {
  align-items: flex-start;
  padding: 14px 0 7px;
}

.order-doctor img {
  width: 50px;
  height: 58px;
  object-fit: cover;
  border-radius: 10px;
}

.order-copy {
  flex: 1;
}

.order-copy strong,
.order-copy span {
  display: block;
}

.order-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.order-bottom {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}

.small-action {
  min-width: 82px;
  height: 36px;
  padding: 0 14px;
  color: var(--teal-deep);
  background: #fff;
  border: 1px solid rgba(11, 152, 156, .35);
  border-radius: 9px;
  font-size: 13px;
}

.empty-state {
  padding: 54px 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 17px;
}

.detail-status,
.detail-list {
  padding: 18px;
  margin-bottom: 14px;
}

.detail-status strong,
.detail-status span {
  display: block;
}

.detail-status strong {
  color: var(--teal-deep);
  font-size: 20px;
}

.detail-status span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.detail-row {
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row span {
  color: var(--muted);
  font-size: 13px;
}

.detail-row strong {
  max-width: 68%;
  text-align: right;
  font-size: 14px;
}

.detail-actions {
  margin-top: 20px;
}

.danger-btn,
.danger-solid-btn {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  font-weight: 800;
}

.danger-btn {
  margin-top: 12px;
  color: #b54848;
  background: #fff;
  border: 1px solid #e8caca;
}

.danger-solid-btn {
  color: #fff;
  background: #b54848;
}

.family-list {
  margin-bottom: 20px;
}

.member-card {
  padding: 16px;
  margin-bottom: 12px;
}

.member-card strong,
.member-card span {
  display: block;
}

.member-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.member-card button {
  color: var(--teal);
  background: transparent;
}

.patient-options {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.patient-option {
  width: 100%;
  min-height: 60px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: left;
}

.patient-option.active {
  border-color: rgba(11, 152, 156, .42);
  background: var(--teal-soft);
}

.patient-option strong,
.patient-option span {
  display: block;
}

.patient-option span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.patient-option em {
  color: var(--teal-deep);
  font-size: 13px;
  font-style: normal;
}

.confirm-panel {
  width: min(calc(100vw - 36px), 394px);
  margin: auto;
  padding: 22px;
  background: #fff;
  border-radius: 16px;
}

.confirm-panel h2 {
  font-size: 20px;
}

.confirm-panel p {
  margin: 10px 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.upload-panel {
  padding: 32px 18px;
  text-align: center;
}

.upload-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 50%;
  font-size: 38px;
}

.report-list {
  margin-top: 14px;
}

.report-file {
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-file div {
  min-width: 0;
}

.report-file strong,
.report-file span {
  display: block;
}

.report-file strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.report-file span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.report-file em {
  flex-shrink: 0;
  color: var(--teal-deep);
  font-size: 12px;
  font-style: normal;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  width: min(100vw, 430px);
  height: 70px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  transform: translateX(-50%);
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid var(--line);
}

.tabbar button {
  color: var(--muted);
  background: transparent;
}

.tabbar button.active {
  color: var(--teal);
  font-weight: 900;
}

.slot-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, .42);
}

.slot-mask.hidden,
.toast.hidden,
.hidden {
  display: none;
}

.service-qr-panel {
  position: relative;
  width: min(330px, calc(100% - 36px));
  padding: 32px 26px 26px;
  background: #fff;
  border-radius: 12px;
  text-align: center;
}

.service-qr-panel h2 { margin: 0; font-size: 20px; }
.service-qr-panel p { margin: 9px 0 20px; color: var(--muted); font-size: 13px; }
.service-qr-panel img { width: 240px; height: 240px; max-width: 100%; object-fit: contain; }
.service-qr-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; padding: 0; color: var(--muted); background: #f0f3f3; border: 0; border-radius: 50%; font-size: 22px; }

.slot-panel {
  width: min(100vw, 430px);
  padding: 18px;
  background: #fff;
  border-radius: 20px 20px 0 0;
}

.slot-head {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.slot-head button {
  width: 30px;
  height: 30px;
  color: #fff;
  background: #cfd4d6;
  border-radius: 50%;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin: 16px 0 18px;
}

.slot-grid button {
  height: 46px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.slot-grid button.active {
  color: var(--teal-deep);
  background: var(--teal-soft);
  border-color: rgba(11, 152, 156, .35);
  font-weight: 900;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 30;
  max-width: 320px;
  padding: 10px 14px;
  color: #fff;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .74);
  border-radius: 999px;
  font-size: 14px;
}

.legal-page { padding-bottom: 48px; }
.legal-date { margin: 10px 0 24px; color: var(--quiet); font-size: 12px; }
.legal-content { padding-top: 22px; color: #3f484a; border-top: 1px solid var(--line); white-space: pre-wrap; font-size: 14px; line-height: 1.95; }

@media (max-width: 360px) {
  .page {
    padding-left: 14px;
    padding-right: 14px;
  }

  .status-tabs {
    gap: 2px;
  }

  .status-tabs button {
    font-size: 12px;
  }
}
