:root {
  color-scheme: light;
  --bg: #eef2f6;
  --panel: #ffffff;
  --ink: #1d2633;
  --muted: #657184;
  --line: #d7e0ea;
  --accent: #245f9d;
  --accent-strong: #17314f;
  --accent-soft: #eaf2fb;
  --warn: #b44700;
  --soft: #edf4fb;
  --shadow-sm: 0 8px 18px rgba(31, 48, 71, 0.045);
  --shadow-md: 0 22px 54px rgba(31, 48, 71, 0.11);
  --focus: 0 0 0 3px rgba(36, 95, 157, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 42%, #f7f9fc 100%);
  color: var(--ink);
  font-family: "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

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

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.booking-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 34px 36px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(240, 245, 250, 0.94)),
    #ffffff;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
legend,
p {
  margin-top: 0;
}

h1 {
  display: inline-block;
  margin-bottom: 0;
  padding: 11px 17px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, #1d3a5c 0%, #17314f 100%);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(23, 49, 79, 0.2);
  font-size: clamp(30px, 3.4vw, 38px);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.hero-copy {
  max-width: 720px;
  margin: 16px 0 0;
  color: #415066;
  font-size: 16px;
  line-height: 1.65;
}

.hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-points span {
  padding: 8px 12px;
  border: 1px solid rgba(36, 95, 157, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.line-link {
  align-self: flex-start;
  flex: 0 0 auto;
  padding: 12px 16px;
  border: 1px solid rgba(36, 95, 157, 0.35);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(36, 95, 157, 0.12);
}

.line-inline-link {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.line-inline-link:hover {
  color: var(--accent);
}

.header-actions {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 0 0 auto;
}

.menu-toggle {
  display: grid;
  place-items: center;
  gap: 4px;
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border: 1px solid rgba(36, 95, 157, 0.35);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(36, 95, 157, 0.12);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-strong);
}

.site-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 5;
  width: min(460px, calc(100vw - 28px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-md);
}

.site-menu h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 18px;
}

.site-menu p {
  margin-bottom: 14px;
  color: #405064;
  font-size: 14px;
  line-height: 1.75;
}

.official-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.official-link:hover {
  background: var(--accent-strong);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-dialog {
  width: min(460px, 100%);
  padding: 22px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
}

.modal-dialog h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 22px;
}

.modal-dialog p {
  color: #405064;
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

@media (max-width: 520px) {
  .modal-actions {
    flex-direction: column;
  }
}

.rental-form {
  display: grid;
  gap: 20px;
  padding: 30px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  box-shadow: var(--shadow-sm);
}

legend,
.summary-box h2,
.payment-box h2,
.notice-box h2,
.flow-box h2,
.line-send-box h2 {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

legend {
  padding: 0 8px;
}

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.item-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 15px;
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.item-card:hover {
  border-color: rgba(36, 95, 157, 0.38);
  box-shadow: 0 14px 30px rgba(31, 48, 71, 0.08);
  transform: translateY(-1px);
}

.item-card:has(input[type="checkbox"]:checked) {
  border-color: rgba(36, 95, 157, 0.62);
  background: linear-gradient(180deg, #f3f7fc 0%, #ffffff 72%);
  box-shadow: 0 16px 36px rgba(36, 95, 157, 0.14);
}

.item-card input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
  margin-top: 2px;
}

.item-info {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.item-kicker {
  width: fit-content;
  padding: 4px 7px;
  border-radius: 999px;
  background: #edf3f7;
  color: #4d5c70;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.item-info strong {
  color: #182433;
  font-size: 19px;
  overflow-wrap: anywhere;
}

.price-tag {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  margin-top: 4px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.item-info small,
.field-hint,
.status-message,
.char-count {
  color: var(--muted);
  line-height: 1.5;
}

.char-count {
  justify-self: end;
  font-size: 13px;
}

.qty-control {
  display: grid;
  gap: 6px;
  min-width: 74px;
  color: var(--muted);
  font-size: 13px;
}

.qty-control input {
  width: 74px;
  min-height: 42px;
}

.field-hint {
  margin: 10px 0 0;
  font-size: 14px;
}

.dynamic-hint {
  align-self: end;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(36, 95, 157, 0.2);
  border-radius: 8px;
  background: #f7fbff;
  color: #2f4b68;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

label > span {
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #ccd5df;
  border-radius: 6px;
  background: #fbfcfe;
  color: var(--ink);
  padding: 11px 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-color: var(--accent);
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aebcca;
  background: #ffffff;
}

.full-width {
  margin-top: 16px;
}

.flow-box {
  padding: 20px;
  border: 1px solid rgba(36, 95, 157, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
  box-shadow: var(--shadow-sm);
}

.flow-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  counter-reset: flow-step;
}

.flow-list li {
  position: relative;
  display: grid;
  gap: 6px;
  min-width: 0;
  align-content: start;
  padding: 14px;
  border: 1px solid rgba(36, 95, 157, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  counter-increment: flow-step;
  box-shadow: 0 10px 24px rgba(31, 48, 71, 0.05);
}

.flow-list li::before {
  content: counter(flow-step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(36, 95, 157, 0.22);
}

.flow-list strong {
  color: var(--ink);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.flow-list span,
.flow-box p {
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.flow-box p {
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: #2f4b68;
  font-weight: 700;
  margin-bottom: 0;
}

.payment-box {
  padding: 20px;
  border: 1px solid rgba(36, 95, 157, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
  box-shadow: var(--shadow-sm);
}

.notice-box {
  padding: 16px;
  border: 1px solid rgba(180, 71, 0, 0.2);
  border-radius: 8px;
  background: #fffdf9;
  box-shadow: var(--shadow-sm);
}

.payment-box p,
.notice-box p {
  margin-bottom: 14px;
  color: #2a3545;
  line-height: 1.6;
}

.notice-box p {
  margin-bottom: 0;
}

.terms-details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.terms-details summary {
  min-height: 52px;
  padding: 15px 18px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  list-style-position: inside;
  overflow-wrap: anywhere;
  background: #f8fafc;
}

.terms-details summary:hover {
  background: #f8fafc;
}

.terms-content {
  display: grid;
  gap: 14px;
  padding: 0 18px 18px;
}

.payment-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.payment-list div {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e2eaf2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.payment-list dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.payment-list dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.notice-box h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
}

.notice-box h2::before {
  content: "";
  flex: 0 0 auto;
  width: 7px;
  height: 20px;
  border-radius: 999px;
  background: #d98a32;
}

.refund-box {
  border-color: rgba(36, 95, 157, 0.24);
  background: #f7fbff;
}

.refund-box h2::before {
  background: var(--accent);
}

.refund-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 14px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.refund-link:hover {
  background: var(--accent-strong);
}

.summary-box {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.estimate-box {
  border-color: rgba(36, 95, 157, 0.28);
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
}

.message-box {
  background: #ffffff;
}

.estimate-box h2,
.message-box h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.estimate-box h2::before,
.message-box h2::before {
  content: "";
  width: 8px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
}

.estimate-box pre {
  min-height: 110px;
  padding: 14px;
  border: 1px solid rgba(36, 95, 157, 0.16);
  border-radius: 8px;
  background: #ffffff;
}

.estimate-note {
  margin-bottom: 12px;
  color: #536174;
  font-size: 14px;
  line-height: 1.55;
}

.message-box pre {
  min-height: 180px;
  padding: 14px;
  border: 1px solid #d7e0ea;
  border-radius: 8px;
  background: #f6f8fb;
}

.agreement-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(36, 95, 157, 0.3);
  border-radius: 8px;
  background: #f7fbff;
  box-shadow: var(--shadow-sm);
}

.line-send-box {
  padding: 20px;
  border: 1px solid rgba(36, 95, 157, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%);
  box-shadow: var(--shadow-sm);
}

.line-send-box ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  color: #2a3545;
  line-height: 1.6;
}

.send-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.send-step-action,
.send-step-note {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 10px;
  border: 1px solid rgba(36, 95, 157, 0.2);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.send-step-action {
  border-color: rgba(36, 95, 157, 0.42);
  background: #ffffff;
  cursor: pointer;
}

.send-step-action:hover {
  border-color: rgba(36, 95, 157, 0.72);
  background: var(--accent-soft);
}

.send-step-note {
  color: #405064;
  background: #f8fafc;
}

.agreement-check input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  min-height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.agreement-check span {
  color: #263444;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.summary-box h2 {
  font-size: 16px;
}

pre {
  overflow: auto;
  min-height: 130px;
  max-height: 420px;
  margin: 0;
  white-space: pre-wrap;
  color: #2a3545;
  font-family: "Microsoft JhengHei", "Noto Sans TC", Arial, sans-serif;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding-top: 4px;
}

.actions button {
  width: 100%;
  min-height: 54px;
}

button {
  min-height: 50px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  overflow-wrap: anywhere;
  line-height: 1.35;
  transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.primary-button {
  background: linear-gradient(180deg, #2a68a8 0%, var(--accent) 100%);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(36, 95, 157, 0.22);
}

.primary-button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.emphasis-button {
  box-shadow:
    0 12px 26px rgba(36, 95, 157, 0.22),
    0 0 0 3px rgba(36, 95, 157, 0.12);
}

.secondary-button {
  border-color: #c8d2dd;
  background: #ffffff;
  color: #243244;
}

.secondary-button:hover {
  background: #f3f6f9;
  border-color: #aebcca;
}

.status-message {
  min-height: 22px;
  margin: -8px 0 0;
}

.status-message.warning {
  color: var(--warn);
}

.status-message.success {
  color: var(--accent-strong);
}

@media (max-width: 1020px) {
  h1 {
    font-size: 32px;
  }

  .items-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .flow-list {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 860px) {
  .panel-header {
    flex-direction: column;
  }

  .header-actions {
    width: 100%;
  }

  .line-link {
    white-space: normal;
  }

  .site-menu {
    right: auto;
    left: 0;
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 20px, 620px);
    padding: 10px 0;
  }

  .panel-header,
  .rental-form {
    padding: 18px;
  }

  .panel-header {
    position: relative;
  }

  .eyebrow {
    padding-right: 62px;
    font-size: 13px;
    line-height: 1.45;
  }

  .hero-copy {
    margin-top: 11px;
    font-size: 14.5px;
    line-height: 1.6;
  }

  .hero-points {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 13px;
  }

  .hero-points span {
    display: grid;
    place-items: center;
    min-height: 40px;
    padding: 7px 6px;
    font-size: 12.5px;
    text-align: center;
  }

  .actions {
    grid-template-columns: 1fr;
  }

  .line-link,
  .actions button {
    width: 100%;
    text-align: center;
  }

  .header-actions {
    position: absolute;
    top: 20px;
    right: 20px;
    left: auto;
    z-index: 10;
    width: auto;
    align-items: flex-start;
  }

  .menu-toggle {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    min-height: 50px;
  }

  .site-menu {
    position: fixed;
    top: 78px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - 92px);
    overflow: auto;
  }

  .items-grid,
  .payment-list {
    grid-template-columns: 1fr;
  }

  .flow-list {
    grid-template-columns: 1fr;
  }

  .send-steps {
    grid-template-columns: 1fr;
  }

  .line-send-box ol {
    padding-left: 18px;
    font-size: 14px;
  }

  .send-step-action,
  .send-step-note,
  button {
    font-size: 14px;
  }

  .item-info strong {
    font-size: 18px;
  }

  .price-tag {
    font-size: 12.5px;
  }

  .item-card {
    grid-template-columns: auto 1fr;
  }

  .qty-control {
    grid-column: 2;
    width: 100%;
  }

  .qty-control input {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .page-shell {
    width: 100%;
    padding: 0;
  }

  .booking-panel {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .panel-header,
  .rental-form {
    padding: 16px 14px;
  }

  .panel-header {
    position: relative;
  }

  h1 {
    max-width: calc(100% - 60px);
    padding: 9px 11px;
    font-size: 23px;
    white-space: nowrap;
  }

  .header-actions {
    top: 18px;
    right: 14px;
  }

  .menu-toggle {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
  }

  .site-menu {
    top: 74px;
  }

  legend,
  .summary-box h2,
  .payment-box h2,
  .notice-box h2,
  .flow-box h2 {
    font-size: 16px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .summary-box pre {
    font-size: 13.5px;
  }

  .flow-box,
  .payment-box,
  .notice-box,
  .summary-box,
  .line-send-box,
  .agreement-check {
    padding: 15px;
  }

  .terms-details summary {
    padding: 14px;
  }

  .terms-content {
    padding: 0 14px 14px;
  }

  .item-card {
    padding: 14px;
  }

  .actions button {
    min-height: 50px;
  }
}

@media (max-width: 380px) {
  .panel-header,
  .rental-form {
    padding-left: 12px;
    padding-right: 12px;
  }

  h1 {
    font-size: 21px;
  }

  .hero-points span {
    font-size: 12px;
  }

  .item-card {
    gap: 10px;
  }
}
