:root {
  color-scheme: light;
  --wine: #782d3e;
  --wine-dark: #592030;
  --wine-soft: #faf2f3;
  --gold: #876b3e;
  --ink: #332e30;
  --muted: #70676b;
  --line: #e9dfe1;
  --paper: #fff;
  --wash: #fcfaf9;
  --danger: #a12835;
  --success: #34634b;
  --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.4; }
h1 { font-size: clamp(27px, 5vw, 37px); font-weight: 600; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 17px; font-weight: 600; }
a { color: var(--wine); text-underline-offset: 4px; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, fieldset, form, section, article, div { min-width: 0; }
button { touch-action: manipulation; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }
input:focus, select:focus, textarea:focus { border-color: var(--wine); outline: 2px solid var(--wine); outline-offset: 1px; }
button:disabled { cursor: not-allowed; opacity: .5; }
input:disabled, select:disabled, textarea:disabled { color: var(--muted); background: #f5f2f2; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 20; left: 16px; top: -100px; padding: 10px 20px; background: white; border: 2px solid var(--wine); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.guest-shell { width: min(100%, 720px); padding: 0 24px; margin: 0 auto; }
.admin-shell { width: min(100%, 1240px); padding: 0 32px; margin: 0 auto; }
.wedding-header { padding: 48px 0 30px; text-align: center; }
.eyebrow { color: var(--gold); font-size: 12px; font-weight: 600; letter-spacing: .2em; }
.header-ornament { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 19px 0 22px; }
.header-ornament span { width: 56px; height: 1px; background: #d5c4a3; }
.header-ornament i { display: block; width: 7px; height: 7px; border: 1px solid var(--gold); transform: rotate(45deg); }
.wedding-header h1 { color: var(--wine); letter-spacing: .04em; font-family: "Songti SC", "SimSun", Georgia, serif; font-weight: 500; }
.ampersand { padding: 0 9px; color: var(--gold); font-size: .7em; font-style: italic; }
.event-date { margin-top: 18px; font-size: 15px; letter-spacing: .06em; }
.event-venue { margin-top: 3px; color: var(--muted); }
.welcome-copy { margin-top: 25px; color: var(--muted); line-height: 1.95; font-size: 14px; }
.wedding-photo-frame { width: min(100%, 308px); margin: 26px auto 0; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 10px 28px rgb(89 32 48 / 9%); }
.wedding-photo { display: block; width: 100%; height: auto; border-radius: 9px; }
.intro-card { padding: 23px 25px; margin-bottom: 20px; background: var(--wash); border-top: 2px solid #c8af7c; border-radius: 0 0 12px 12px; }
.intro-card h2 { margin-bottom: 12px; color: var(--wine); font-size: 17px; }
.intro-card p + p { margin-top: 9px; }
.intro-card p { font-size: 13px; }
.form-conventions { padding-top: 12px; border-top: 1px solid var(--line); }
.card { background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 5px 22px rgb(66 30 36 / 3%); }
.form-card { padding: 25px; margin-bottom: 18px; }
.section-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 22px; }
.section-index { display: inline-flex; flex: 0 0 35px; justify-content: center; align-items: center; width: 35px; height: 35px; border: 1px solid #e0d2b8; border-radius: 50%; color: var(--gold); font-family: Georgia, serif; font-size: 14px; }
.section-heading h2 { color: var(--wine); }
.section-heading p { margin-top: 4px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.form-card > .section-heading { align-items: center; }
.section-marker { position: relative; display: block; flex: 0 0 64px; width: 64px; height: 68px; }
.section-sticker { display: block; width: 60px; height: 60px; object-fit: contain; transform: rotate(-7deg); filter: drop-shadow(0 2px 2px rgb(89 32 48 / 12%)); }
.form-card:nth-of-type(even) .section-sticker { transform: rotate(7deg); }
.section-marker .section-index { position: absolute; right: 0; bottom: 0; width: 26px; height: 26px; background: var(--paper); color: var(--wine); font-size: 12px; box-shadow: 0 2px 5px rgb(89 32 48 / 6%); }
.form-fields { border: 0; padding: 0; margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px 18px; }
.span-full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 7px; }
label { display: block; font-size: 14px; font-weight: 550; line-height: 1.6; }
.required-marker { color: var(--danger); margin-left: 3px; }
.optional { margin-left: 5px; color: var(--muted); font-size: 12px; font-weight: 400; }
input:not([type="checkbox"]), select, textarea { display: block; width: 100%; max-width: 100%; min-height: 46px; border: 1px solid #d8ced1; border-radius: 8px; background: white; color: var(--ink); padding: 10px 12px; font-size: 16px; line-height: 1.5; transition: border-color .15s; }
input[type="date"], input[type="time"] { appearance: none; -webkit-appearance: none; min-width: 0; width: 100%; }
input::-webkit-date-and-time-value { text-align: left; min-height: 24px; }
input::placeholder, textarea::placeholder { color: #8b8185; font-size: 14px; opacity: 1; }
textarea { resize: vertical; min-height: 110px; }
input[readonly] { background: var(--wash); font-size: 13px; }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-help { color: var(--muted); font-size: 12px; line-height: 1.65; font-weight: 400; }
.field-error { color: var(--danger); font-size: 13px; line-height: 1.6; }
#stay-help { margin-top: 12px; }
.privacy-box { margin-top: 21px; padding: 17px; background: var(--wash); border-radius: 10px; }
.checkbox-label { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; font-size: 13px; line-height: 1.8; }
input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 20px; margin: 2px 0 0; accent-color: var(--wine); cursor: pointer; }
.privacy-box > p { margin: 7px 0 0 31px; color: var(--muted); font-size: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 10px 18px; border: 1px solid transparent; border-radius: 9px; font-size: 14px; font-weight: 550; line-height: 1.55; text-align: center; white-space: normal; cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s; }
.button.primary { color: white; background: var(--wine); border-color: var(--wine); }
.button.secondary { color: var(--wine); background: white; border-color: #d8bdc4; }
.button.text-button { color: var(--wine); background: transparent; }
.full-width { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
@media (hover: hover) { .button.primary:not(:disabled):hover { background: var(--wine-dark); } .button.secondary:not(:disabled):hover, .button.text-button:not(:disabled):hover { background: var(--wine-soft); } }
.submit-area { margin-top: 23px; }
.submit-area .button { min-height: 52px; font-size: 16px; letter-spacing: .04em; }
.submit-area p { margin-top: 11px; color: var(--muted); text-align: center; font-size: 12px; }
.notice { margin: 16px 0; padding: 17px 19px; background: var(--wash); border: 1px solid var(--line); border-radius: 11px; font-size: 13px; line-height: 1.75; }
.notice h2 { margin-bottom: 6px; font-size: 16px; }
.notice p + p { margin-top: 7px; }
.notice .button-row, .notice > .button { margin-top: 12px; }
.notice .button-row:empty { display: none; }
.warning, .preview-notice { background: #fcf8ee; border-color: #e4d6b5; color: #6e5226; }
.message { white-space: pre-wrap; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.message:not(:empty) { margin: 16px 0; padding: 13px 16px; color: var(--wine); background: var(--wine-soft); border-radius: 9px; }
.message.error:not(:empty) { color: var(--danger); background: #fff3f3; border-left: 3px solid var(--danger); }
.message.success:not(:empty) { color: var(--success); background: #f1f7f3; }
.success-card { padding: 32px 27px; }
.success-card > h2 { margin: 11px 0; color: var(--wine); font-size: 26px; }
.success-card > p:not(.eyebrow) { color: var(--muted); font-size: 14px; }
.success-card > .full-width { margin-top: 21px; }
.summary-list { display: grid; grid-template-columns: 65px minmax(0, 1fr); gap: 13px 15px; padding: 19px 0; margin: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; white-space: pre-wrap; }
.weather-note { margin: 22px 0; padding: 20px; border: 1px solid #e6d4d9; border-top: 2px solid var(--wine); border-radius: 12px; background: var(--wine-soft); }
.weather-note h3 { margin: 7px 0; color: var(--wine); }
.weather-place { color: var(--muted); font-size: 12px; }
.weather-forecast { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 16px 0; padding-bottom: 16px; border-bottom: 1px solid #e6d4d9; color: var(--wine); }
.weather-forecast > strong { font-family: Georgia, "SimSun", serif; font-size: 36px; line-height: 1.2; font-weight: 500; white-space: nowrap; }
.weather-forecast > strong > span { margin-left: 4px; font-size: 20px; }
.weather-forecast > span { font-size: 16px; }
.weather-forecast-label { display: block; color: var(--muted); font-size: 11px; }
.weather-advice { font-size: 13px; line-height: 1.85; }
.weather-advice + .weather-advice { margin-top: 12px; }
.weather-advice > strong { display: block; margin-bottom: 3px; color: var(--wine); }
.weather-source { margin-top: 16px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.weather-link { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; font-size: 12px; }
.copy-fallback { margin-top: 16px; width: 100%; }
.copy-fallback label { margin-bottom: 7px; }
.page-footer { padding: 38px 0 max(28px, env(safe-area-inset-bottom)); color: var(--muted); text-align: center; font-size: 12px; }
.page-footer p + p { margin-top: 5px; font-size: 11px; letter-spacing: .05em; }
.footer-rule { display: block; width: 32px; height: 1px; margin: 0 auto 17px; background: #c8af7c; }

.admin-page { background: var(--wash); }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 32px 0 23px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.admin-header h1 { margin: 8px 0 9px; color: var(--wine); font-size: 29px; }
.admin-header > div > p:not(.eyebrow) { color: var(--muted); font-size: 13px; }
.login-card { max-width: 450px; padding: 30px; margin: 48px auto 80px; }
.login-card h2 { margin: 10px 0; color: var(--wine); font-size: 24px; }
.login-card > p:not(.eyebrow) { margin-bottom: 25px; color: var(--muted); font-size: 13px; }
.login-card .button { margin-top: 22px; }
.section-title-row { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.stat-card { padding: 20px 22px; border: 1px solid var(--line); background: white; border-radius: 13px; }
.stat-card p { color: var(--muted); font-size: 13px; }
.stat-card strong { display: block; margin: 6px 0; color: var(--wine); font-size: 33px; font-weight: 550; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat-card span { color: var(--muted); font-size: 11px; }
.stat-card.accent { border-top: 2px solid #b39a65; }
.pending-line { margin: 13px 0 23px; font-size: 13px; }
.pending-line strong { color: var(--wine); }
.invite-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 25px; margin-bottom: 22px; }
.invite-card h2 { margin-bottom: 6px; font-size: 17px; }
.invite-card > div:first-child { flex: 1 1 330px; }
.invite-card > .copy-fallback { flex: 1 1 100%; }
.invite-card > .message:empty { display: none; }
.invite-card > .message:not(:empty) { flex: 1 1 100%; margin: 0; }
#public-status.is-private { color: #805a25; font-weight: 600; }
.filter-card { padding: 25px; margin-bottom: 28px; }
.filter-card h2 { margin-bottom: 20px; }
.filter-grid { display: grid; grid-template-columns: minmax(170px, 1.5fr) repeat(4, minmax(0, 1fr)); gap: 14px; }
.filter-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding-top: 20px; }
#filters-help { margin-top: 14px; }
.records-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 18px; }
.record-card { overflow: hidden; }
.record-main { padding: 23px; }
.record-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 15px; }
.record-header h3 { color: var(--wine); font-size: 20px; }
.record-phone { display: inline-block; margin-top: 4px; min-height: 32px; font-size: 14px; }
.party-badge { flex-shrink: 0; padding: 4px 12px; color: var(--wine); border: 1px solid #e6d4d9; background: var(--wine-soft); border-radius: 20px; font-size: 13px; }
.trip-block { padding: 13px 0; border-top: 1px solid #eee7e8; }
.trip-title { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 5px; }
.trip-title h4 { margin: 0; font-size: 14px; font-weight: 650; }
.status-badge { display: inline-block; border: 1px solid #ded5c0; border-radius: 5px; color: #795e2d; background: #fcf9f1; padding: 1px 7px; font-size: 11px; line-height: 1.7; }
.status-badge.confirmed { color: var(--success); background: #f1f7f3; border-color: #d2e4d9; }
.trip-line { font-size: 13px; line-height: 1.8; white-space: pre-wrap; }
.trip-line.muted { color: var(--muted); }
.record-updated { color: var(--muted); font-size: 11px; margin-top: 10px; }
.record-details { border-top: 1px solid var(--line); }
.record-details > summary { padding: 14px 23px; color: var(--wine); font-size: 13px; cursor: pointer; background: #fdfbfb; }
.record-detail-body { padding: 3px 23px 23px; }
.record-detail-body .summary-list { margin-top: 0; border-top: 0; grid-template-columns: 70px minmax(0, 1fr); font-size: 13px; }
.arrangement-form h4 { margin: 0 0 8px; font-size: 15px; }
.arrangement-form .form-grid { margin-top: 15px; }
.arrangement-form .button-row { margin-top: 15px; }
.arrangement-form textarea { min-height: 88px; }
.empty-state { padding: 43px 24px; text-align: center; }
.empty-state .section-index { margin-bottom: 15px; }
.empty-state p { margin-top: 10px; color: var(--muted); font-size: 13px; }
.password-card { max-width: 720px; margin-top: 32px; padding: 20px 24px; }
.password-card > summary { color: var(--wine); cursor: pointer; font-size: 14px; font-weight: 550; min-height: 28px; }
.password-card[open] > summary { margin-bottom: 12px; }
.password-card form { margin-top: 19px; }
.password-card form > .button { margin-top: 20px; }

@media (max-width: 1000px) {
  .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-keyword { grid-column: span 2; }
}
@media (max-width: 720px) {
  .admin-shell { padding: 0 20px; }
  .records-list { grid-template-columns: minmax(0, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .admin-header { align-items: flex-start; }
  .admin-header h1 { font-size: 25px; }
  .admin-header > .button { padding: 8px 12px; flex-shrink: 0; margin-top: 4px; }
  .admin-header .eyebrow { letter-spacing: .06em; font-size: 11px; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-keyword { grid-column: 1 / -1; }
  .invite-card > div:first-child { flex-basis: 100%; }
}
@media (max-width: 560px) {
  .guest-shell, .admin-shell { padding: 0 16px; }
  .wedding-header { padding: 33px 0 27px; }
  .wedding-header h1 { font-size: 29px; letter-spacing: 0; }
  .ampersand { padding: 0 5px; }
  .wedding-photo-frame { width: min(100%, 280px); margin-top: 22px; padding: 7px; }
  .event-date { font-size: 14px; }
  .event-venue { font-size: 13px; }
  .intro-card { padding: 20px; }
  .form-card { padding: 22px 19px; border-radius: 14px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .section-heading { gap: 11px; margin-bottom: 20px; }
  .section-heading h2 { font-size: 18px; }
  .privacy-box { padding: 14px 12px; }
  .button-row > .button { flex: 1 1 auto; }
  .success-card { padding: 26px 20px; }
  .success-card .button-row { flex-direction: column; align-items: stretch; }
  .notice { padding: 15px 16px; }
  .admin-header { flex-wrap: wrap; gap: 12px; padding-top: 24px; }
  .admin-header > div { flex: 1 1 230px; }
  .stat-card { padding: 16px 18px; }
  .stat-card strong { font-size: 30px; }
  .filter-card, .invite-card { padding: 21px 18px; }
  .filter-grid { grid-template-columns: minmax(0, 1fr); gap: 17px; }
  .filter-actions { align-items: stretch; }
  .filter-actions > .button-row { width: 100%; }
  .record-main { padding: 21px 19px; }
  .record-details > summary { padding: 14px 19px; }
  .record-detail-body { padding: 3px 19px 21px; }
  .password-card { padding: 20px 18px; }
  .login-card { margin-top: 25px; padding: 25px 22px; }
  .page-footer { padding-top: 30px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
