:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #172033;
  background: #edf1f5;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }

.toolbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 76px;
  padding: 12px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid #d7dee7;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
}

.toolbar h1, h2 { margin: 0; }
.toolbar h1 { font-size: 20px; }
.toolbar p { margin: 4px 0 0; color: #667085; font-size: 13px; }
.actions, .quick-ranges, .month-nav { display: flex; align-items: center; gap: 8px; }

button, .button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid #cfd7e3;
  border-radius: 7px;
  color: #263247;
  background: #fff;
  text-decoration: none;
  cursor: pointer;
}

button:hover, .button:hover { background: #f4f6f8; }
button:disabled { cursor: not-allowed; opacity: .45; }
.primary { border-color: #087f5b; color: #fff; background: #087f5b; }
.primary:hover { background: #066e4e; }

.page { width: min(1180px, calc(100% - 32px)); margin: 28px auto 52px; }
.panel { border: 1px solid #d4dce7; border-radius: 10px; background: #fff; box-shadow: 0 12px 30px rgba(24, 34, 51, .07); }
.controls { padding: 24px; }
.control-head, .calendar-tools, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow { margin-bottom: 6px; color: #087f5b; font-size: 11px; font-weight: 900; letter-spacing: .06em; }
h2 { font-size: 22px; }

.price-field { display: grid; gap: 6px; color: #667085; font-size: 12px; font-weight: 700; }
.price-field input { width: 180px; height: 40px; padding: 0 10px; border: 1px solid #cfd7e3; border-radius: 6px; color: #172033; }
.calendar-tools { margin: 24px 0 14px; }
.month-nav strong { min-width: 170px; text-align: center; }
.month-nav button { width: 40px; padding: 0; }
.quick-ranges button { min-height: 34px; padding: 0 11px; font-size: 12px; }

.calendars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; user-select: none; }
.calendar { overflow: hidden; border: 1px solid #dfe5ed; border-radius: 8px; }
.calendar-title { padding: 12px; border-bottom: 1px solid #e7ebf0; background: #f7f9fb; text-align: center; font-size: 14px; font-weight: 900; }
.weekdays, .days { display: grid; grid-template-columns: repeat(7, 1fr); }
.weekdays div { padding: 9px 2px; color: #778195; text-align: center; font-size: 11px; font-weight: 800; }
.day, .day-blank { min-height: 43px; border: 0; border-radius: 0; padding: 0; }
.day { position: relative; background: #fff; font-size: 13px; }
.day:hover { z-index: 1; background: #eef8f4; }
.day.in-range { color: #075f45; background: #dff3eb; }
.day.range-start, .day.range-end { color: #fff; background: #087f5b; font-weight: 900; }
.day.today::after { position: absolute; right: 5px; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: #d9485f; content: ""; }
.day-blank { background: #fafbfc; }

.range-line { display: flex; align-items: baseline; gap: 10px; margin-top: 16px; padding: 13px 15px; border-radius: 7px; background: #f4f7f9; font-size: 13px; }
.range-line strong { font-size: 16px; }
.muted { color: #778195; }
.hint { margin: 9px 2px 0; color: #778195; font-size: 12px; }

.result { margin-top: 20px; overflow: hidden; }
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 20px 24px; border-bottom: 1px solid #e1e6ed; }
.summary-item { min-height: 74px; padding: 12px; border: 1px solid #dde3eb; border-radius: 7px; background: #fafbfc; }
.summary-label { color: #697386; font-size: 12px; }
.summary-value { margin-top: 7px; font-size: 18px; font-weight: 900; }
.warning { margin: 18px 24px 0; padding: 12px 14px; border: 1px solid #f5c2c7; border-radius: 7px; color: #842029; background: #f8d7da; font-size: 13px; }
.section-head { padding: 24px 24px 12px; }
.windows-head { border-top: 1px solid #e1e6ed; }
.table-wrap { padding: 0 24px 24px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid #e9edf2; text-align: left; }
th { color: #697386; font-size: 11px; }
td { font-size: 14px; }
td:nth-child(n+2), th:nth-child(n+2) { text-align: right; }
.user-name { font-weight: 900; }
.user-id { margin-top: 3px; color: #778195; font-size: 11px; }
.share { color: #087f5b; font-size: 17px; font-weight: 900; }
.amount { font-weight: 900; }
.empty { padding: 32px; color: #778195; text-align: center !important; }

.window-list { display: grid; gap: 10px; padding: 0 24px 24px; }
.window-item { display: grid; grid-template-columns: 1fr auto auto auto; gap: 18px; align-items: center; padding: 14px 15px; border: 1px solid #e0e5ec; border-radius: 7px; background: #fafbfc; }
.window-title { font-weight: 900; }
.window-meta { margin-top: 4px; color: #778195; font-size: 11px; }
.badge { padding: 4px 7px; border-radius: 999px; color: #087f5b; background: #dff3eb; font-size: 11px; font-weight: 800; }

dialog { width: min(400px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 24px 60px rgba(20, 29, 43, .25); }
dialog::backdrop { background: rgba(20, 29, 43, .5); }
dialog form { padding: 24px; }
dialog p { color: #667085; font-size: 14px; }
dialog input { width: 100%; height: 42px; padding: 0 10px; border: 1px solid #cbd3df; border-radius: 5px; }
dialog button { width: 100%; margin-top: 16px; }
.form-error { min-height: 18px; margin-top: 7px; color: #b42318; font-size: 12px; }

@media (max-width: 760px) {
  .toolbar, .control-head, .calendar-tools { align-items: flex-start; flex-direction: column; }
  .actions { width: 100%; flex-wrap: wrap; }
  .page { width: min(100% - 20px, 1180px); margin-top: 12px; }
  .controls { padding: 16px; }
  .price-field, .price-field input { width: 100%; }
  .calendar-tools { margin-top: 18px; }
  .calendars { grid-template-columns: 1fr; }
  .calendar:nth-child(2) { display: none; }
  .summary { grid-template-columns: repeat(2, 1fr); padding: 16px; }
  .section-head, .table-wrap, .window-list { padding-left: 16px; padding-right: 16px; }
  .window-item { grid-template-columns: 1fr auto; }
  .window-item > :nth-child(3), .window-item > :nth-child(4) { text-align: right; }
}
