:root {
  color-scheme: light;
  --ink: #20253d;
  --muted: #8790a8;
  --line: #e8ebf3;
  --surface: #fff;
  --page: #f6f7fb;
  --primary: #5b5ce2;
  --primary-soft: #f0efff;
  --green: #20a36a;
  --red: #e36767;
  --shadow: 0 16px 45px rgba(48, 56, 115, .08);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 50% -20%, #e9e8ff 0, transparent 35%), var(--page); }
button { font: inherit; }
button:focus-visible { outline: 3px solid rgba(91, 92, 226, .3); outline-offset: 3px; }

.page-shell { width: min(100% - 32px, 760px); margin: 0 auto; padding: 20px 0 110px; }
.top-actions { display: flex; justify-content: flex-end; margin-bottom: 13px; }
.records-button { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 12px; border: 1px solid #dfe1f5; border-radius: 10px; color: var(--primary); background: rgba(255,255,255,.8); cursor: pointer; font-size: 12px; font-weight: 700; transition: .2s ease; }
.records-button:hover { border-color: #b9b9f6; background: #fff; transform: translateY(-1px); }
.records-count { min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; color: #fff; background: var(--primary); font-size: 10px; line-height: 16px; text-align: center; }
.eyebrow { display: flex; align-items: center; gap: 7px; color: var(--primary); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #2cc183; box-shadow: 0 0 0 4px rgba(44,193,131,.12); }
h1 { margin: 7px 0 0; font-size: 32px; letter-spacing: -.05em; }

.alert { margin: 0 0 16px; padding: 12px 14px; border: 1px solid #ffd9dc; border-radius: 12px; color: #a13b46; background: #fff5f5; font-size: 12px; line-height: 1.6; }
.info-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 17px; background: var(--line); box-shadow: 0 7px 20px rgba(48,56,115,.035); }
.info-strip > div { min-width: 0; padding: 15px 18px; background: rgba(255,255,255,.9); }
.info-strip span, .info-strip strong { display: block; }
.info-strip span { margin-bottom: 5px; color: var(--muted); font-size: 11px; }
.info-strip strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }

.booking-card { margin-top: 10px; padding: 20px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); box-shadow: var(--shadow); }
.section-heading { display: flex; gap: 11px; align-items: flex-start; margin-bottom: 15px; }
.section-heading-main { display: flex; gap: 11px; align-items: flex-start; }
.date-section-heading { justify-content: space-between; align-items: center; }
.date-section-heading .records-button { flex: none; margin-left: 12px; }
.step-badge { display: grid; place-items: center; flex: none; width: 29px; height: 29px; border-radius: 10px; color: #fff; background: var(--primary); font-size: 13px; font-weight: 800; }
.section-heading h2 { margin: 1px 0 4px; font-size: 18px; letter-spacing: -.03em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.date-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.date-option { position: relative; min-height: 87px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; transition: .2s ease; }
.date-option:hover { border-color: #b9b9f6; transform: translateY(-1px); }
.date-option.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 6px 15px rgba(91,92,226,.12); }
.date-option.selected::after { content: "✓"; position: absolute; top: 11px; right: 12px; color: var(--primary); font-size: 14px; font-weight: 900; }
.date-option .date-top { display: flex; align-items: baseline; gap: 4px; }
.date-option .day { font-size: 27px; font-weight: 800; line-height: 1; }
.date-option .month { color: var(--muted); font-size: 11px; }
.date-option .weekday { display: block; margin-top: 11px; color: var(--muted); font-size: 11px; }
.date-option .today-label { display: inline-block; margin-left: 5px; padding: 2px 6px; border-radius: 999px; color: var(--primary); background: #dfddff; font-size: 9px; font-weight: 700; }

.time-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.time-option { min-height: 82px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; transition: .2s ease; }
.time-option:hover:not(:disabled) { border-color: #b9b9f6; transform: translateY(-1px); }
.time-option.selected { border-color: var(--primary); background: var(--primary-soft); }
.time-option:disabled { color: #afb5c5; background: #fafbfc; cursor: not-allowed; }
.time-option .time-label { display: block; font-size: 14px; font-weight: 800; }
.time-option .time-status { display: block; margin-top: 7px; color: var(--green); font-size: 10px; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.time-option.is-occupied .time-status { color: var(--red); }
.time-option.is-mine { border: 2px solid #e8a33b; background: #fff8eb; box-shadow: 0 7px 16px rgba(232,163,59,.2); }
.time-option.is-mine .time-status { color: #bd7517; font-weight: 700; }
.time-option.is-past .time-status { color: #a7adbd; }
.loading-state, .empty-state { display: grid; place-items: center; min-height: 130px; color: var(--muted); text-align: center; font-size: 12px; }
.empty-state strong, .empty-state span { display: block; }
.empty-state strong { margin-bottom: 5px; color: var(--ink); font-size: 13px; }
.text-button { margin-top: 13px; padding: 0; border: 0; color: var(--primary); background: transparent; font-size: 12px; cursor: pointer; }
.spinner { display: inline-block; width: 16px; height: 16px; margin-right: 6px; border: 2px solid #d9d9fa; border-top-color: var(--primary); border-radius: 50%; vertical-align: -4px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.legend { display: flex; gap: 15px; margin-top: 17px; color: var(--muted); font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.occupied-dot { background: var(--red); }
.past-dot { background: #bbc0ce; }

.booking-bar { position: fixed; z-index: 10; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px max(18px, calc((100vw - 760px) / 2)); padding-bottom: max(13px, env(safe-area-inset-bottom)); border-top: 1px solid rgba(226,229,242,.95); background: rgba(255,255,255,.94); box-shadow: 0 -10px 28px rgba(35,40,90,.07); backdrop-filter: blur(16px); }
.summary span, .summary strong { display: block; }
.summary span { margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.summary strong { max-width: 330px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 17px; border-radius: 12px; cursor: pointer; font-size: 13px; font-weight: 700; transition: .2s ease; }
.primary-button { gap: 14px; border: 0; color: #fff; background: linear-gradient(135deg, var(--primary), #7769e8); box-shadow: 0 7px 16px rgba(91,92,226,.22); }
.primary-button:hover:not(:disabled) { transform: translateY(-1px); }
.primary-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.button-arrow { font-size: 18px; font-weight: 400; }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: #fff; }

.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(20,24,55,.48); backdrop-filter: blur(7px); }
.confirm-modal { position: relative; width: min(100%, 410px); padding: 27px; border-radius: 20px; background: #fff; box-shadow: 0 25px 80px rgba(21,25,70,.24); }
.records-modal { position: relative; width: min(100%, 520px); max-height: min(78vh, 680px); padding: 25px; overflow: auto; border-radius: 20px; background: #fff; box-shadow: 0 25px 80px rgba(21,25,70,.24); }
.records-header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.records-header h2 { margin: 0 0 5px; font-size: 20px; }
.records-header p { margin: 0; color: var(--muted); font-size: 12px; }
.records-icon { flex: none; margin: 0; font-size: 21px; }
.records-list { display: grid; gap: 10px; }
.record-item { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fbfbfe; }
.record-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.record-date { color: var(--ink); font-size: 14px; font-weight: 800; }
.record-time { color: var(--primary); font-size: 13px; font-weight: 800; white-space: nowrap; }
.record-subject { margin-top: 8px; color: var(--muted); font-size: 11px; }
.record-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.record-status { padding: 3px 7px; border-radius: 999px; color: var(--primary); background: var(--primary-soft); font-weight: 700; }
.record-status.is-cancelled { color: #b94a53; background: #fff0f1; }
.record-created { text-align: right; }
.record-cancel-button { display: block; width: 100%; margin-top: 11px; padding: 8px 0 0; border: 0; border-top: 1px solid var(--line); color: #c56a71; background: transparent; cursor: pointer; font-size: 11px; text-align: right; }
.record-cancel-button:hover { color: #a84049; }
.records-empty { padding: 35px 10px; color: var(--muted); text-align: center; font-size: 12px; }
.cancel-icon { color: #a65e28; background: #fff0df; }
.cancel-summary { padding: 12px 14px; border-radius: 13px; color: var(--ink); background: #f7f8fd; font-size: 13px; font-weight: 700; line-height: 1.6; }
.cancel-confirm-button { color: #fff; background: linear-gradient(135deg, #d98345, #c75d65); box-shadow: 0 7px 16px rgba(199,93,101,.2); }
.modal-close { position: absolute; top: 13px; right: 14px; width: 30px; height: 30px; border: 0; border-radius: 50%; color: var(--muted); background: #f4f5fa; cursor: pointer; font-size: 21px; line-height: 1; }
.modal-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 15px; border-radius: 13px; color: #fff; background: var(--primary); font-size: 19px; }
.confirm-modal h2 { margin: 0 0 7px; font-size: 20px; }
.confirm-modal > p { margin: 0 0 19px; color: var(--muted); font-size: 12px; }
.beijing-clock-card { margin: 0 0 17px; padding: 12px 14px; text-align: center; border: 1px solid #dcdcff; border-radius: 13px; background: linear-gradient(135deg, #f7f6ff, #fbfbff); }
.beijing-clock-label { margin-bottom: 4px; color: var(--primary); font-size: 11px; font-weight: 700; }
.beijing-clock-card strong { display: block; color: var(--ink); font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 19px; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.beijing-clock-card span:last-child { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; }
.confirm-list { margin: 0; padding: 12px 14px; border-radius: 14px; background: #f7f8fd; }
.confirm-list div { display: flex; justify-content: space-between; gap: 15px; padding: 7px 0; font-size: 12px; }
.confirm-list dt { color: var(--muted); }
.confirm-list dd { margin: 0; font-weight: 700; text-align: right; }
.modal-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 9px; margin-top: 20px; }

[hidden] { display: none !important; }
@media (max-width: 620px) {
  .page-shell { width: min(100% - 22px, 500px); padding-top: 10px; padding-bottom: 92px; }
  h1 { font-size: 28px; }
  .date-section-heading { align-items: flex-start; }
  .date-section-heading .records-button { margin-top: 1px; }
  .info-strip > div { padding: 13px 11px; }
  .info-strip strong { font-size: 12px; }
  .booking-card { margin-top: 8px; padding: 14px 12px; border-radius: 15px; }
  .date-list, .time-grid { gap: 6px; }
  .date-option { min-height: 72px; padding: 9px 9px; }
  .time-option { min-height: 62px; padding: 9px 8px; }
  .time-option .time-label { font-size: 13px; }
  .legend { gap: 8px; margin-top: 11px; }
  .booking-bar { gap: 8px; padding-right: 9px; padding-left: 9px; }
  .summary strong { max-width: 185px; font-size: 12px; }
  .primary-button { padding: 0 13px; font-size: 12px; }
  .records-modal { padding: 20px 16px; }
  .record-bottom { align-items: flex-start; flex-direction: column; }
  .record-created { text-align: left; }
}
@media (max-width: 390px) {
  .date-option .today-label { display: block; width: max-content; margin: 7px 0 0; }
  .time-grid { grid-template-columns: repeat(2, 1fr); }
  .summary strong { max-width: 140px; }
}
