:root {
  --ink: #24313a;
  --muted: #6a757c;
  --paper: #eef8fd;
  --soft: #eef8fd;
  --sky: #8cc6dd;
  --blue: #5aaed2;
  --blue-deep: #3f91b8;
  --line: rgba(36, 49, 58, .14);
  --shadow: 0 20px 45px rgba(90, 174, 210, .18);
}

* { box-sizing: border-box; min-width: 0; }
html { scroll-behavior: smooth; }
body,
body * {
  font-family: "標楷體", "DFKai-SB", "BiauKai", "KaiTi", "Kaiti TC", "STKaiti", serif !important;
}
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
}
h1, h2, h3, p, a, button, label, input, select, textarea, td, th, dd { overflow-wrap: anywhere; }
button, input, select, textarea { font-family: inherit; }
.container { width: min(1120px, calc(100% - 32px)); }
.nav-glass { background: rgba(255, 255, 255, .92); border-bottom: 1px solid rgba(140, 198, 221, .34); backdrop-filter: blur(16px); }
.navbar-brand { max-width: calc(100vw - 96px); font-weight: 800; white-space: nowrap; overflow-wrap: normal; }
.navbar-toggler { width: 48px; min-height: 44px; padding: 0; display: inline-grid; place-items: center; border-radius: 8px; }
.navbar-toggler:focus { outline: 0; box-shadow: none; }
.navbar-toggler-icon { width: 1.35rem; height: 1.35rem; background-size: 1.35rem; }
.nav-link { color: var(--ink); font-weight: 600; }
.nav-link:hover { color: var(--blue); }

.hero { position: relative; min-height: 92svh; display: grid; align-items: center; overflow: hidden; }
.hero img, .hero-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero img { object-fit: cover; }
.hero-shade { background: linear-gradient(180deg, rgba(90, 174, 210, .08), rgba(20, 45, 58, .70)); }
.hero-copy { position: relative; z-index: 1; max-width: 860px; padding-top: 88px; color: #fff; text-align: center; }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: .8rem; font-weight: 900; }
.hero .eyebrow { color: #fff; }
.hero h1 { margin: 0; font-size: 4.8rem; line-height: 1.05; white-space: nowrap; overflow-wrap: normal; }
.hero-date { margin: 18px 0 0; font-size: 1.35rem; font-weight: 700; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 560px; margin: 34px auto 0; }
.countdown div { min-height: 96px; display: grid; place-items: center; padding: 14px; border: 1px solid rgba(255,255,255,.38); border-radius: 8px; background: rgba(255,255,255,.16); backdrop-filter: blur(10px); }
.countdown b { display: block; font-size: 2.4rem; line-height: 1; }
.countdown span { font-size: .88rem; }
.done { margin-top: 28px; font-weight: 800; }

.section {
  padding: 88px 0;
}
.soft { background: var(--paper); }
.heading { max-width: 720px; margin: 0 auto 34px; text-align: center; }
.heading h2 { margin: 0 0 12px; font-size: 2.6rem; }
.heading p:last-child { margin-bottom: 0; color: var(--muted); }

.couple-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 24px; }
.person, .venue-card, .rsvp-card, .admin-login, .admin-panel, .admin-edit, .admin-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow);
}
.person { padding: 18px; text-align: center; }
.person img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 8px; }
.person p { margin: 18px 0 4px; color: var(--blue); font-size: .8rem; font-weight: 900; }
.person h3 { margin: 0; font-size: 2rem; line-height: 1.2; white-space: nowrap; overflow-wrap: normal; }
.heart { color: var(--blue); font-size: 2rem; }

.timeline { display: grid; gap: 16px; max-width: 820px; margin: 0 auto; }
.timeline article { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 20px; border-left: 4px solid var(--sky); border-radius: 8px; background: rgba(255,255,255,.78); }
.timeline time { color: var(--blue); font-size: 1.3rem; font-weight: 900; }
.timeline h3 { margin: 0 0 4px; font-size: 1.2rem; }
.timeline p { margin: 0; color: var(--muted); }

.venue-card, .rsvp-card { max-width: 960px; margin: 0 auto; padding: 28px; }
#venue {
  padding-top: 104px;
}
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.info-grid div { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.info-grid span { display: block; color: var(--muted); font-size: .85rem; font-weight: 800; }
.info-grid b { display: block; margin-top: 4px; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.btn { min-height: 44px; max-width: 100%; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; white-space: normal; text-align: center; }
.btn-primary { background: var(--blue); border-color: var(--blue); }
.btn-outline-primary { color: var(--blue); border-color: var(--blue); }
.btn-primary:hover, .btn-outline-primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.status { min-height: 24px; margin: 12px 0 0; font-weight: 800; }
.status.success { color: #2e7558; }
.status.error { color: #a4434c; }

.gallery { overflow: hidden; border-radius: 8px; box-shadow: var(--shadow); }
.gallery img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.carousel-control-prev, .carousel-control-next { width: 56px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 12px; }
.radio-row label { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.78); }
footer { padding: 28px 16px; color: #fff; background: var(--ink); text-align: center; }

.admin-page { background: var(--paper); }
.admin-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0; }
.admin-login { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 24px; }
.admin-login > div { width: min(420px, 100%); }
.admin-panel { padding: 28px; }
.admin-header { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.admin-stats { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 24px; }
.admin-stats div { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.78); }
.admin-stats span { display: block; font-size: 1.6rem; font-weight: 900; }
.admin-edit, .admin-table-wrap { padding: 20px; margin-top: 20px; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { min-width: 1060px; }
.admin-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.admin-actions form { margin: 0; }
.admin-actions .btn, .submitted-at { white-space: nowrap; }
.message-cell { max-width: 280px; white-space: normal; }
.status-pill { display: inline-flex; padding: 2px 10px; border-radius: 999px; font-weight: 800; }
.is-attending { color: #225740; background: #dcebe4; }
.is-declined { color: #82434b; background: #f0dce0; }

@media (max-width: 767.98px) {
  .container, .admin-shell { width: min(100% - 24px, 1120px); }
  .hero { min-height: 86svh; }
  .hero-copy { padding-top: 78px; }
  .hero h1 { font-size: 2.25rem; }
  .hero-date { font-size: 1.1rem; }
  .countdown { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; max-width: 100%; }
  .countdown div { min-height: 68px; padding: 8px 4px; }
  .countdown b { font-size: 1.55rem; }
  .countdown span { font-size: .78rem; }
  .section { padding: 76px 0; }
  #venue { padding-top: 82px; }
  .heading h2 { font-size: 2.1rem; }
  .couple-grid { grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); gap: 8px; }
  .timeline article, .info-grid { grid-template-columns: 1fr; }
  .heart { text-align: center; font-size: 1.3rem; }
  .person { padding: 10px; }
  .person p { margin-top: 10px; font-size: .68rem; }
  .person h3 { font-size: 1.45rem; }
  .person img, .gallery img { aspect-ratio: 4/5; }
  .venue-card, .rsvp-card, .admin-panel { padding: 18px; }
  .actions, .actions .btn, #submitRsvp { width: 100%; }
  .admin-header { flex-direction: column; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 380px) {
  .hero h1 { font-size: 1.95rem; }
  .navbar-brand { font-size: 1.35rem; }
  .person h3 { font-size: 1.25rem; }
}
