:root {
    color-scheme: light;
    --ink: #241d1d;
    --muted: #6f6262;
    --paper: #fffaf7;
    --line: #eadbd4;
    --rose: #b94d61;
    --wine: #6f263d;
    --leaf: #657b56;
    --gold: #b9873b;
    --shadow: 0 18px 50px rgba(63, 34, 41, 0.16);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background: var(--paper);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button,
input,
textarea {
    font: inherit;
}

.page-shell {
    overflow: hidden;
}

.hero {
    position: relative;
    min-height: clamp(520px, 88vh, 760px);
    display: flex;
    align-items: flex-end;
    padding: 32px clamp(18px, 5vw, 72px) 78px;
    isolation: isolate;
}

.hero__media,
.hero__shade {
    position: absolute;
    inset: 0;
}

.hero__media {
    z-index: -2;
    background-color: #6f263d;
    background-position: center;
    background-size: cover;
}

.hero__shade {
    z-index: -1;
    background:
        linear-gradient(90deg, rgba(36, 29, 29, 0.78), rgba(36, 29, 29, 0.34) 48%, rgba(36, 29, 29, 0.18)),
        linear-gradient(0deg, rgba(36, 29, 29, 0.64), rgba(36, 29, 29, 0.08) 55%);
}

.hero__content {
    width: min(760px, 100%);
    color: #fff;
}

.kicker {
    margin: 0 0 12px;
    color: #f1d8b4;
    font-size: 14px;
    letter-spacing: 0;
    text-transform: uppercase;
}

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

.hero h1 {
    margin-bottom: 16px;
    font-size: clamp(46px, 9vw, 96px);
    line-height: 0.98;
    font-weight: 650;
}

.hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 28px;
    color: rgba(255, 255, 255, 0.86);
    font-size: clamp(16px, 2vw, 20px);
}

.countdown {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
}

.countdown span {
    min-width: 58px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
    border-radius: 8px;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
}

.countdown b {
    margin-right: 8px;
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
}

.live-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    width: min(1180px, calc(100% - 36px));
    margin: -44px auto 34px;
    position: relative;
    z-index: 2;
    align-items: start;
}

.player-panel,
.info-block,
.blessing-wall {
    border: 1px solid var(--line);
    background: rgba(255, 250, 247, 0.94);
    box-shadow: var(--shadow);
    border-radius: 8px;
}

.player-panel {
    overflow: hidden;
}

.player-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #161213;
}

.player-shell,
.player-frame video,
.player-frame object,
.player-frame embed {
    width: 100%;
    height: 100%;
    display: block;
    background: #161213;
}

.player-shell > div {
    width: 100% !important;
    height: 100% !important;
}

.player-empty {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: grid;
    place-content: center;
    gap: 10px;
    padding: 28px;
    color: #fff;
    text-align: center;
    background: rgba(22, 18, 19, 0.86);
}

.player-cover {
    background-color: #2a1814;
    background-position: center;
    background-size: cover;
}

.player-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(0deg, rgba(28, 18, 15, 0.56), rgba(28, 18, 15, 0.18)),
        radial-gradient(circle at 50% 42%, rgba(255, 246, 224, 0.22), transparent 44%);
}

.player-cover__content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 8px;
    justify-items: center;
    padding: 16px 20px;
    border: 1px solid rgba(255, 236, 184, 0.46);
    border-radius: 14px;
    background: rgba(55, 32, 24, 0.42);
    backdrop-filter: blur(8px);
}

.player-empty[hidden] {
    display: none;
}

.player-empty strong {
    font-size: 22px;
}

.player-empty span {
    max-width: 420px;
    color: rgba(255, 255, 255, 0.72);
}

.live-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
}

.live-pill {
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--rose);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.viewer-count {
    color: var(--muted);
}

.side-panel {
    display: grid;
    gap: 18px;
}

.info-block {
    padding: 20px;
}

.info-block h2,
.blessing-wall h2 {
    margin-bottom: 16px;
    font-size: 22px;
}

.agenda {
    display: grid;
    gap: 12px;
}

.agenda__item {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 12px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.agenda__item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.agenda__item time {
    color: var(--wine);
    font-weight: 700;
}

.blessing-form {
    display: grid;
    gap: 10px;
}

.blessing-form input,
.blessing-form textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    color: var(--ink);
    background: #fff;
    outline: none;
}

.blessing-form textarea {
    resize: vertical;
    min-height: 92px;
}

.blessing-form input:focus,
.blessing-form textarea:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgba(185, 77, 97, 0.13);
}

.blessing-form button,
.section-head button {
    border: 0;
    border-radius: 8px;
    background: var(--wine);
    color: #fff;
    cursor: pointer;
}

.blessing-form button {
    min-height: 44px;
    font-weight: 700;
}

.blessing-form button:disabled {
    cursor: progress;
    opacity: 0.72;
}

.form-note {
    min-height: 20px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: 13px;
}

.blessing-wall {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto 42px;
    padding: 22px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.section-head h2 {
    margin-bottom: 0;
}

.section-head button {
    min-width: 74px;
    min-height: 36px;
    background: var(--leaf);
}

.messages {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.message {
    min-height: 118px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.message__head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 13px;
}

.message__head strong {
    min-width: 0;
    color: var(--wine);
    overflow-wrap: anywhere;
}

.message__head time {
    white-space: nowrap;
}

.message p {
    margin-bottom: 0;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.message--empty {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    color: var(--muted);
}

@media (max-width: 940px) {
    .live-layout {
        grid-template-columns: 1fr;
    }

    .messages {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .hero {
        min-height: 560px;
        padding: 28px 18px 72px;
    }

    .hero h1 {
        font-size: clamp(42px, 16vw, 68px);
    }

    .countdown span {
        min-width: 50px;
        font-size: 22px;
    }

    .live-layout,
    .blessing-wall {
        width: calc(100% - 24px);
    }

    .live-bar,
    .section-head,
    .message__head {
        align-items: flex-start;
        flex-direction: column;
    }

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

.anchor-page {
    background: #fffaf7;
}

.anchor-shell {
    width: min(760px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 42px;
}

.anchor-hero,
.anchor-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
}

.anchor-hero {
    padding: 30px 22px;
    color: var(--ink);
}

.anchor-hero .kicker {
    color: var(--gold);
}

.anchor-hero h1 {
    margin-bottom: 12px;
    font-size: clamp(30px, 8vw, 44px);
    line-height: 1.12;
    color: var(--wine);
    overflow-wrap: anywhere;
}

.anchor-hero p {
    margin-bottom: 24px;
    color: var(--muted);
    line-height: 1.7;
}

.anchor-button {
    display: grid;
    min-height: 54px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: var(--wine);
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
}

.anchor-button:disabled {
    cursor: progress;
    opacity: 0.62;
}

.anchor-button--secondary {
    background: var(--leaf);
}

.anchor-missing {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: 8px;
    background: #fff4e6;
    color: var(--wine);
}

.anchor-missing span,
.anchor-card p {
    color: var(--muted);
}

.anchor-card {
    margin-top: 16px;
    padding: 20px;
}

.anchor-card h2 {
    margin-bottom: 14px;
    font-size: 22px;
}

.anchor-card input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    color: var(--ink);
    background: var(--paper);
}

.anchor-login {
    display: grid;
    gap: 12px;
}

.anchor-login input {
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.anchor-login button {
    min-height: 48px;
    border: 0;
    border-radius: 8px;
    background: var(--wine);
    color: #fff;
    font-weight: 700;
}

.anchor-studio {
    padding: 14px;
}

.anchor-preview {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 8px;
    background: #171313;
    color: rgba(255, 255, 255, 0.72);
}

.anchor-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.anchor-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.anchor-status {
    min-height: 24px;
    margin: 12px 2px 0;
    color: var(--muted);
    line-height: 1.6;
}

@media (max-width: 620px) {
    .anchor-shell {
        width: min(100% - 24px, 520px);
        padding-top: 16px;
    }

    .anchor-hero,
    .anchor-card {
        box-shadow: 0 10px 28px rgba(63, 34, 41, 0.1);
    }

    .anchor-hero {
        padding: 20px 16px;
    }

    .anchor-hero h1 {
        font-size: clamp(28px, 9vw, 38px);
    }

    .anchor-hero p {
        margin-bottom: 0;
        font-size: 15px;
    }

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

.anchor-checks {
    display: grid;
    gap: 10px;
}

.anchor-checks span {
    padding-left: 18px;
    color: var(--muted);
    position: relative;
}

.anchor-checks span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.7em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--leaf);
}

body.viewer-page {
    background:
        radial-gradient(circle at 8% 8%, rgba(255, 201, 178, 0.48), transparent 24%),
        radial-gradient(circle at 92% 4%, rgba(255, 232, 190, 0.7), transparent 28%),
        linear-gradient(135deg, #fff8eb 0%, #fffdfa 42%, #fff2e4 100%);
}

.viewer-page .page-shell {
    min-height: 100vh;
    padding: 18px 0 34px;
}

.invitation-shell {
    position: relative;
    width: min(1080px, calc(100% - 28px));
    margin: 0 auto;
    padding: clamp(24px, 5vw, 54px) clamp(16px, 4vw, 48px) 32px;
    border: 2px solid rgba(202, 146, 57, 0.72);
    border-radius: 28px 28px 8px 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 252, 244, 0.94)),
        radial-gradient(circle at 12% 0%, rgba(255, 199, 177, 0.36), transparent 30%);
    box-shadow: 0 22px 70px rgba(142, 83, 40, 0.13);
    overflow: hidden;
}

.invitation-shell::before,
.invitation-shell::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 204, 185, 0.7), rgba(255, 204, 185, 0));
    pointer-events: none;
}

.invitation-shell::before {
    left: -72px;
    bottom: -72px;
}

.invitation-shell::after {
    right: -78px;
    top: -78px;
}

.ornament {
    position: relative;
    z-index: 1;
    color: #c99239;
    text-align: center;
    letter-spacing: 8px;
    font-size: 18px;
}

.ornament--top {
    margin-bottom: 18px;
}

.ornament--bottom {
    margin-top: 22px;
}

.invite-title {
    position: relative;
    z-index: 1;
    text-align: center;
}

.invite-title .kicker {
    margin-bottom: 8px;
    color: #c99239;
    font-size: 14px;
}

.invite-title h1 {
    margin: 0;
    color: #8b4a17;
    font-family: "STKaiti", "KaiTi", "Microsoft YaHei", serif;
    font-size: clamp(54px, 13vw, 116px);
    line-height: 1;
    font-weight: 600;
    text-shadow: 0 8px 18px rgba(201, 146, 57, 0.16);
}

.couple-names {
    margin: 12px 0 0;
    color: #8f5527;
    font-size: clamp(18px, 4vw, 28px);
}

.ceremony-time {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    margin: 28px auto 24px;
    padding: 14px 10px 16px;
    border-top: 1px solid rgba(201, 146, 57, 0.28);
    border-bottom: 1px solid rgba(201, 146, 57, 0.28);
    text-align: center;
}

.ceremony-time > span {
    display: block;
    margin-bottom: 10px;
    color: #7b351f;
    font-size: clamp(22px, 5vw, 40px);
    font-weight: 700;
}

.ceremony-time small {
    display: block;
    margin-top: 10px;
    color: #a66d34;
    font-size: 15px;
}

.viewer-page .countdown {
    justify-content: center;
    gap: 6px;
}

.viewer-page .countdown span {
    min-width: 54px;
    padding: 8px 9px;
    border: 1px solid rgba(201, 146, 57, 0.45);
    background: rgba(255, 255, 255, 0.58);
    color: #7b351f;
    border-radius: 8px;
    font-size: clamp(24px, 6vw, 42px);
    box-shadow: inset 0 0 16px rgba(240, 201, 130, 0.18);
}

.viewer-page .countdown b {
    color: #8f5527;
    font-weight: 700;
}

.live-stage {
    position: relative;
    z-index: 1;
    width: min(900px, 100%);
    margin: 0 auto 22px;
}

.viewer-page .player-panel {
    position: relative;
    padding: 12px;
    border: 2px solid #d4a34f;
    border-radius: 28px 28px 10px 10px;
    background: rgba(255, 252, 245, 0.88);
    box-shadow: 0 18px 44px rgba(150, 91, 37, 0.18);
}

.viewer-page .player-frame {
    border: 1px solid rgba(212, 163, 79, 0.78);
    border-radius: 18px;
    overflow: hidden;
}

.frame-corner {
    position: absolute;
    z-index: 2;
    width: 48px;
    height: 48px;
    border-color: #d4a34f;
    pointer-events: none;
}

.frame-corner--tl {
    left: 3px;
    top: 3px;
    border-left: 3px solid;
    border-top: 3px solid;
    border-radius: 24px 0 0 0;
}

.frame-corner--tr {
    right: 3px;
    top: 3px;
    border-right: 3px solid;
    border-top: 3px solid;
    border-radius: 0 24px 0 0;
}

.frame-corner--bl {
    left: 3px;
    bottom: 58px;
    border-left: 3px solid;
    border-bottom: 3px solid;
    border-radius: 0 0 0 24px;
}

.frame-corner--br {
    right: 3px;
    bottom: 58px;
    border-right: 3px solid;
    border-bottom: 3px solid;
    border-radius: 0 0 24px 0;
}

.viewer-page .live-bar {
    padding: 13px 8px 2px;
}

.viewer-page .live-pill {
    background: linear-gradient(135deg, #be5168, #9f3d55);
}

.viewer-page .viewer-count {
    color: #8f5527;
    font-size: 16px;
}

.invite-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 22px;
}

.invite-card {
    border: 1px solid rgba(212, 163, 79, 0.58);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 14px 34px rgba(150, 91, 37, 0.1);
}

.invite-card h2 {
    margin: 0 0 16px;
    color: #8b4a17;
    font-size: clamp(24px, 5vw, 36px);
    text-align: center;
    font-weight: 700;
}

.interaction-card,
.guest-card,
.agenda-card {
    padding: 22px;
}

.viewer-page .blessing-form input,
.viewer-page .blessing-form textarea {
    border-color: rgba(212, 163, 79, 0.45);
    background: rgba(255, 253, 248, 0.92);
}

.viewer-page .blessing-form button {
    min-height: 50px;
    border: 1px solid #d8a760;
    background: linear-gradient(135deg, #fff5dd, #ffc7b2 52%, #f5a77d);
    color: #7b351f;
    font-size: 20px;
    box-shadow: 0 10px 22px rgba(216, 132, 86, 0.24);
}

.guest-list {
    display: grid;
    gap: 14px;
}

.guest-list div {
    display: grid;
    grid-template-columns: 86px 1fr;
    align-items: center;
    gap: 12px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(212, 163, 79, 0.28);
}

.guest-list div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.guest-list span {
    color: #a66d34;
    font-size: 18px;
}

.guest-list strong {
    color: #6e3518;
    font-size: 24px;
    font-weight: 700;
}

.viewer-page .agenda-card {
    position: relative;
    z-index: 1;
    margin-top: 18px;
}

.viewer-page .agenda__item {
    grid-template-columns: 70px 1fr;
    border-bottom-color: rgba(212, 163, 79, 0.28);
}

.viewer-page .agenda__item time {
    color: #8b4a17;
}

.viewer-page .blessing-wall {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 18px 0 0;
    padding: 20px;
}

.viewer-page .section-head button {
    border: 1px solid rgba(139, 74, 23, 0.32);
    background: transparent;
    color: #8b4a17;
}

.viewer-page .messages {
    grid-template-columns: 1fr;
}

.viewer-page .message {
    min-height: auto;
    border-color: rgba(212, 163, 79, 0.38);
    background: rgba(255, 253, 248, 0.78);
}

@media (max-width: 760px) {
    .viewer-page .page-shell {
        padding-top: 10px;
    }

    .invitation-shell {
        width: calc(100% - 18px);
        padding: 18px 12px 24px;
        border-radius: 22px 22px 8px 8px;
    }

    .invite-title h1 {
        font-size: clamp(52px, 17vw, 76px);
    }

    .couple-names {
        font-size: 19px;
    }

    .ceremony-time {
        margin-top: 20px;
    }

    .viewer-page .countdown span {
        min-width: 44px;
        font-size: 24px;
    }

    .viewer-page .countdown b {
        margin-right: 2px;
        font-size: 15px;
    }

    .viewer-page .player-panel {
        padding: 8px;
        border-radius: 20px 20px 8px 8px;
    }

    .invite-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .interaction-card,
    .guest-card,
    .agenda-card,
    .viewer-page .blessing-wall {
        padding: 18px;
    }

    .guest-list div {
        grid-template-columns: 74px 1fr;
    }

    .guest-list span {
        font-size: 16px;
    }

    .guest-list strong {
        font-size: 22px;
    }
}
