:root {
    --bg: #fbf6f1;
    --paper: #fffdf9;
    --ink: #2c2420;
    --muted: #7a6a62;
    --accent: #c9a27c;
    --accent-deep: #a67c52;
    --line: rgba(201, 162, 124, 0.35);
    --shadow: 0 12px 40px rgba(44, 36, 32, 0.08);
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

.h5-body {
    min-height: 100vh;
}

.page-shell {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 0 96px;
}

.section {
    padding: 28px 20px 8px;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-align: center;
    margin: 0 0 18px;
    color: var(--accent-deep);
}

/* 新人 */
.couple-hero {
    text-align: center;
    padding-top: 36px;
}

.couple-photos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 12px;
}

.couple-photos .avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: var(--shadow);
}

.heart-badge {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(145deg, #f3d4c8, #e8b4a8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: var(--shadow);
}

.couple-names {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 8px 0 12px;
    letter-spacing: 0.06em;
}

.couple-names .ampersand {
    color: var(--accent);
    padding: 0 6px;
    font-weight: 400;
}

.love-quote {
    margin: 0 auto 20px;
    max-width: 34em;
    line-height: 1.75;
    color: var(--muted);
    font-size: 0.95rem;
}

.couple-main-photo img {
    width: 100%;
    border-radius: 16px;
    display: block;
    box-shadow: var(--shadow);
    object-fit: cover;
    max-height: 70vh;
}

/* 婚礼卡片 */
.wedding-card {
    margin: 8px 16px 0;
    padding: 22px 18px 20px;
    background: var(--paper);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.info-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 0.95rem;
}

.info-row.full {
    flex-direction: column;
}

.info-row .label {
    flex: 0 0 3em;
    color: var(--muted);
}

.info-row .value {
    flex: 1;
    line-height: 1.55;
}

.nav-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 0.9rem;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn.primary {
    background: linear-gradient(135deg, #d4a574, #c49468);
    color: #fff;
}

.btn.primary:active {
    opacity: 0.92;
}

.btn.ghost {
    background: transparent;
    color: var(--accent-deep);
    border-color: var(--line);
}

.hint {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin: 8px 0 0;
}

/* 轮播 */
.carousel {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
    margin: 0 -8px;
}

.carousel::-webkit-scrollbar {
    height: 4px;
}

.carousel::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 4px;
}

.carousel-track {
    display: flex;
    gap: 12px;
    padding: 4px 8px 8px;
}

.carousel-item {
    flex: 0 0 82%;
    scroll-snap-align: center;
    margin: 0;
}

.carousel-item img {
    width: 100%;
    border-radius: 14px;
    display: block;
    box-shadow: var(--shadow);
    object-fit: cover;
    aspect-ratio: 4 / 5;
}

.carousel-hint {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

/* 时间轴 */
.story-intro {
    text-align: center;
    color: var(--muted);
    margin: -8px 0 20px;
    font-size: 0.92rem;
}

.timeline {
    list-style: none;
    margin: 0;
    padding: 0 4px 0 8px;
    border-left: 2px solid var(--line);
}

.timeline-item {
    position: relative;
    padding: 0 0 22px 18px;
}

.timeline-dot {
    position: absolute;
    left: -9px;
    top: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 3px rgba(201, 162, 124, 0.2);
}

.timeline-card {
    background: var(--paper);
    border-radius: 14px;
    padding: 14px 14px 12px;
    box-shadow: var(--shadow);
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--accent-deep);
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.timeline-title {
    margin: 0 0 8px;
    font-size: 1rem;
}

.timeline-desc {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
    font-size: 0.92rem;
}

/* 祝福墙 */
.blessing-wall {
    padding-bottom: 24px;
}

.blessing-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blessing-item {
    background: var(--paper);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
}

.blessing-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.blessing-meta .guest {
    font-weight: 600;
    color: var(--accent-deep);
}

.blessing-text {
    margin: 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.empty-tip {
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

/* 出席回执 */
.rsvp-section {
    padding-bottom: 28px;
}

.rsvp-card {
    margin: 0 4px;
    padding: 20px 16px 18px;
    background: var(--paper);
    border-radius: 18px;
    box-shadow: var(--shadow);
}

.rsvp-hint {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 14px;
}

.rsvp-form .field {
    display: block;
    margin-bottom: 16px;
}

.rsvp-form .field-label {
    display: block;
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 8px;
}

.rsvp-form .optional {
    font-weight: 400;
    color: var(--muted);
    font-size: 0.82rem;
}

.rsvp-form .field-input,
.rsvp-form .field-textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 1rem;
    background: #fff;
    color: var(--ink);
}

.rsvp-form .field-textarea {
    resize: vertical;
    min-height: 88px;
}

.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 0.92rem;
}

.radio-pill input {
    margin: 0;
}

.stepper {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 220px;
}

.stepper .step-input {
    flex: 1;
    text-align: center;
}

.step-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--accent-deep);
    cursor: pointer;
}

.char-count {
    display: block;
    text-align: right;
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 4px;
}

.field-error {
    display: block;
    color: #c45c5c;
    font-size: 0.8rem;
    margin-top: 6px;
}

.global-error {
    color: #c45c5c;
    font-size: 0.88rem;
    margin: 0 0 10px;
}

.rsvp-submit {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    border: none;
    cursor: pointer;
}

.rsvp-done-msg {
    margin: 0 0 12px;
    line-height: 1.6;
    color: var(--ink);
}

.rsvp-summary {
    font-size: 0.95rem;
    line-height: 1.7;
}

.rsvp-summary p {
    margin: 6px 0;
}

.rsvp-summary .k {
    display: inline-block;
    min-width: 3.5em;
    color: var(--muted);
    margin-right: 8px;
}

.rsvp-summary .muted {
    color: var(--muted);
    font-size: 0.88rem;
}

.rsvp-result-wrap {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px 80px;
}

.rsvp-result-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
    background: var(--paper);
    border-radius: 18px;
    padding: 32px 24px 28px;
    box-shadow: var(--shadow);
}

.rsvp-result-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(201, 162, 124, 0.25);
    color: var(--accent-deep);
    font-size: 1.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rsvp-result-icon.muted {
    background: rgba(122, 106, 98, 0.15);
    color: var(--muted);
    font-style: italic;
    font-weight: 600;
}

.rsvp-result-title {
    font-size: 1.25rem;
    margin: 0 0 10px;
}

.rsvp-result-text {
    color: var(--muted);
    line-height: 1.65;
    margin: 0 0 22px;
    font-size: 0.95rem;
}

.rsvp-result-card .btn {
    text-decoration: none;
}

.footer {
    text-align: center;
    padding: 32px 16px 16px;
    color: var(--muted);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
}

/* 音乐悬浮钮 */
.music-fab {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 253, 249, 0.95);
    box-shadow: 0 8px 24px rgba(44, 36, 32, 0.18);
    color: var(--accent-deep);
    font-size: 1.25rem;
    z-index: 50;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-fab .music-icon.off {
    display: none;
}

.music-fab.is-muted .music-icon.on {
    display: none;
}

.music-fab.is-muted .music-icon.off {
    display: inline;
}
