html { scrollbar-gutter: stable; }

.reservation-dialog {
  box-sizing: border-box;
  width: min(580px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: #16191f;
  box-shadow: 0 24px 80px #0003;
  overflow: hidden;
  font-family: inherit;
}
.reservation-dialog[open] { display: flex; flex-direction: column; }
.reservation-dialog::backdrop { background: rgba(8, 13, 20, .66); }
.reservation-dialog * { box-sizing: border-box; }
.reservation-dialog [hidden] { display: none !important; }
.reservation-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  min-height: 60px;
  padding: 10px 20px 10px 24px;
  border-bottom: 1px solid #d5d8dc;
}
.reservation-dialog-header h2 { margin: 0; font-size: 18px; line-height: 1.4; font-weight: 600; }
.reservation-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}
.reservation-close:hover { background: #f0f2f5; }
.reservation-close img { width: 24px; height: 24px; }
.reservation-dialog-body { min-height: 0; padding: 20px 28px 24px; overflow-y: auto; overscroll-behavior: contain; }
.reservation-field { display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: start; gap: 12px; margin-bottom: 12px; }
.reservation-field > label { padding-top: 11px; color: #27354a; font-size: 15px; line-height: 20px; }
.reservation-required { color: #d93043; }
.reservation-field input {
  display: block;
  width: 100%;
  height: 42px;
  padding: 10px 12px;
  border: 1px solid #8391a6;
  border-radius: 4px;
  background: #fff;
  color: #172b45;
  font: inherit;
  font-size: 15px;
}
.reservation-field input::placeholder { color: #8590a0; }
.reservation-field input:focus { border-color: #066cff; outline: 2px solid #066cff26; outline-offset: 1px; }
.reservation-field input[aria-invalid="true"] { border-color: #cc293d; }
.reservation-code-row { display: flex; gap: 12px; }
.reservation-code-row input { min-width: 0; flex: 1; }
.reservation-code-button {
  flex: none;
  min-width: 112px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid #066cff;
  border-radius: 4px;
  background: #fff;
  color: #066cff;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.reservation-code-button:hover:not(:disabled) { background: #f2f7ff; }
.reservation-code-button:disabled { color: #748095; border-color: #bfc7d2; cursor: default; }
.reservation-error, .reservation-code-hint { margin: 6px 0 0; font-size: 12px; line-height: 1.5; }
.reservation-error { color: #ba2339; }
.reservation-code-hint { color: #526681; }
.reservation-choice { display: flex; align-items: flex-start; gap: 8px; color: #3e4c60; font-size: 14px; line-height: 1.5; cursor: pointer; }
.reservation-dialog input[type="checkbox"] { flex: none; width: 16px; height: 16px; margin: 3px 0 0; accent-color: #066cff; cursor: pointer; }
.reservation-consent { margin-top: 18px; padding-top: 16px; border-top: 1px solid #d5d8dc; }
.reservation-consent .reservation-choice { font-size: 13px; }
@media (min-width: 640px) {
  .reservation-consent .reservation-choice { font-size: 14px; }
  .reservation-dialog input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; }
}
.reservation-consent a { color: #066cff; text-decoration: underline; text-underline-offset: 3px; }
.reservation-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  margin-top: 18px;
  padding: 11px 24px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(110deg, #066cff 0%, #943bfa 100%);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.reservation-submit:hover { background: linear-gradient(110deg, #0065f2 0%, #892cf0 100%); }
.reservation-dialog :is(button, a, input[type="checkbox"]):focus-visible { outline: 2px solid #066cff; outline-offset: 3px; }
.reservation-status { margin: 14px 0 0; padding: 12px 14px; border-radius: 6px; background: #f0f7ff; color: #18345d; font-size: 14px; line-height: 1.6; }
body#page #agenda .agenda-reservation { cursor: pointer; }
body#page #agenda .agenda-reservation:hover { background: linear-gradient(110deg, #0065f2 0%, #892cf0 100%); }
body#page #agenda .agenda-reservation:focus-visible { outline: 2px solid #5ea8ff; outline-offset: 3px; }
@media (max-width: 600px) {
  .reservation-dialog { max-height: calc(100dvh - 24px); border-radius: 20px; }
  .reservation-dialog-header { padding: 12px 18px; }
  .reservation-dialog-header h2 { font-size: 16px; }
  .reservation-dialog-body { padding: 24px; }
  .reservation-field { grid-template-columns: 1fr; gap: 6px; }
  .reservation-field > label { padding-top: 0; }
  .reservation-code-button { min-width: 118px; padding-inline: 8px; }
}

/* ========== 移动端（body.mobile-page）弹窗覆盖样式 ==========
   原位于 mobile/mobile.css，为保持弹窗样式单一来源并入本文件。
   仅在移动端页面（<body class="mobile-page">）生效。 */
body.mobile-page .reservation-dialog { width: min(420px, calc(100% - 24px)); }
body.mobile-page .reservation-dialog-body { padding: 16px 20px 22px; }
body.mobile-page .reservation-field { grid-template-columns: 1fr; gap: 4px; }
body.mobile-page .reservation-field > label { padding-top: 0; }
body.mobile-page .reservation-code-button { min-width: 104px; }
