/* ===== Reset & Tokens ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --red: #b01c35;
    --red-bright: #c8223f;
    --red-deep: #7a1525;
    --red-dark: #5c0f1c;
    --gold: #d4a843;
    --gold-light: #f0d78c;
    --gold-pale: #faf0d7;
    --cream: #fef8f0;
    --text: #fef8f0;
    --text-dim: rgba(254, 248, 240, 0.6);
    --font-serif: 'Noto Serif SC', 'Source Han Serif SC', 'STSong', serif;
    --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-display: 'Bebas Neue', sans-serif;
}

body {
    font-family: var(--font-sans);
    background: #3a0a12;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.page {
    max-width: 480px;
    margin: 0 auto;
    background: linear-gradient(180deg, #8b1a2b 0%, #721420 30%, #5c0f1c 60%, #4a0c16 100%);
    position: relative;
    min-height: 100vh;
}

/* ===== 开幕帷幕 ===== */
.curtain {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    max-width: 480px;
    margin: 0 auto;
    pointer-events: none;
}
.curtain.open {
    pointer-events: none;
}
.curtain.open .curtain-left {
    animation: curtainLeft 0.8s cubic-bezier(0.7, 0, 0.3, 1) forwards;
}
.curtain.open .curtain-right {
    animation: curtainRight 0.8s cubic-bezier(0.7, 0, 0.3, 1) forwards;
}
.curtain.done {
    display: none;
}

.curtain-half {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #8b1a2b 0%, #5c0f1c 100%);
    position: relative;
}
.curtain-left {
    border-right: 2px solid var(--gold);
    box-shadow: inset -8px 0 24px rgba(0,0,0,0.3);
}
.curtain-right {
    border-left: 2px solid var(--gold);
    box-shadow: inset 8px 0 24px rgba(0,0,0,0.3);
}

.curtain-inner {
    display: flex;
    align-items: center;
    justify-content: center;
}
.curtain-char {
    font-family: var(--font-serif);
    font-size: 56px;
    font-weight: 900;
    color: var(--gold-light);
    text-shadow: 0 2px 16px rgba(0,0,0,0.5);
    opacity: 0.9;
}

@keyframes curtainLeft {
    0%   { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(-105%); opacity: 0; }
}
@keyframes curtainRight {
    0%   { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(105%); opacity: 0; }
}

/* ===== 漂浮光点 ===== */
.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    max-width: 480px;
    margin: 0 auto;
}
.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--gold-light);
    border-radius: 50%;
    opacity: 0;
    animation: floatUp var(--dur) ease-in var(--delay) infinite;
}
.particle:nth-child(1) { left: 12%; --dur: 7s; --delay: 0s; bottom: 0; }
.particle:nth-child(2) { left: 30%; --dur: 9s; --delay: 2.5s; width: 2px; height: 2px; bottom: 0; }
.particle:nth-child(3) { left: 48%; --dur: 8s; --delay: 5s; bottom: 0; }
.particle:nth-child(4) { left: 65%; --dur: 10s; --delay: 1s; width: 2px; height: 2px; bottom: 0; }
.particle:nth-child(5) { left: 78%; --dur: 7.5s; --delay: 3.5s; bottom: 0; }
.particle:nth-child(6) { left: 20%; --dur: 8.5s; --delay: 6s; width: 4px; height: 4px; bottom: 0; }
.particle:nth-child(7) { left: 55%; --dur: 9.5s; --delay: 0.8s; width: 2px; height: 2px; bottom: 0; }

@keyframes floatUp {
    0%   { transform: translateY(0) scale(0); opacity: 0; }
    15%  { opacity: 0.9; }
    70%  { opacity: 0.3; }
    100% { transform: translateY(-105vh) scale(1.2); opacity: 0; }
}

/* ===== Hero 页眉 ===== */
.hero {
    position: relative;
    z-index: 1;
    padding: 44px 28px 20px;
    text-align: center;
}
.hero-badge {
    font-size: 12px;
    letter-spacing: 6px;
    color: var(--gold-light);
    opacity: 0;
    animation: fadeDown 0.5s ease 0.9s forwards;
}
.hero-title {
    font-family: var(--font-serif);
    font-size: 40px;
    font-weight: 900;
    line-height: 1.3;
    letter-spacing: 6px;
    margin: 16px 0 12px;
    background: linear-gradient(90deg, var(--gold-light) 0%, var(--gold-pale) 30%, var(--gold-light) 50%, var(--gold-pale) 70%, var(--gold-light) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    opacity: 0;
    animation: fadeDown 0.5s ease 0.95s forwards, goldShimmer 4.5s ease 2s infinite;
}
.hero-event {
    font-size: 14px;
    letter-spacing: 2px;
    color: var(--text-dim);
    opacity: 0;
    animation: fadeDown 0.5s ease 1s forwards;
}

/* ===== 金色分割线 ===== */
.gold-rule {
    position: relative;
    z-index: 1;
    width: 55%;
    height: 1px;
    margin: 0 auto;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0;
    animation: fadeUp 0.5s ease forwards;
}

/* ===== 邀请函正卡 ===== */
.invitation-card {
    position: relative;
    z-index: 1;
    margin: 24px 18px 12px;
    background: rgba(0,0,0,0.18);
    border: 1px solid rgba(212, 168, 67, 0.25);
    box-shadow:
        0 0 0 5px rgba(0,0,0,0.08),
        0 0 0 6px rgba(212, 168, 67, 0.1),
        0 8px 32px rgba(0,0,0,0.25);
    padding: 44px 24px 28px;
    opacity: 0;
    animation: fadeUp 0.6s ease 1.15s forwards;
}

/* ===== 缠绕丝带 ===== */
.card-ribbon {
    position: absolute;
    top: -16px;
    left: -22px;
    right: -22px;
    height: 38px;
    z-index: 3;
    display: flex;
    align-items: center;
}

.ribbon-band {
    flex: 1;
    height: 100%;
    background: linear-gradient(180deg,
        #a81a30 0%,
        #8b1a2b 30%,
        #7a1525 70%,
        #6b1018 100%);
    border-top: 2px solid var(--gold);
    border-bottom: 2px solid var(--gold);
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    transform-origin: left center;
    animation: ribbonWrap 0.7s cubic-bezier(0.22, 1, 0.36, 1) 1.5s both;
}

/* 丝带结 */
.ribbon-knot {
    position: absolute;
    right: -18px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background: radial-gradient(circle, #c8223f 0%, #8b1a2b 100%);
    border: 2px solid var(--gold);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    opacity: 0;
    animation: knotPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) 2s both;
}
.ribbon-knot::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(212, 168, 67, 0.35);
    border-radius: 50%;
}

@keyframes ribbonWrap {
    from { transform: scaleX(0); opacity: 0; }
    to   { transform: scaleX(1); opacity: 1; }
}
@keyframes knotPop {
    from { transform: translateY(-50%) scale(0); opacity: 0; }
    to   { transform: translateY(-50%) scale(1); opacity: 1; }
}

/* ===== 邀请函正文 ===== */
.card-body {
    text-align: center;
    padding: 10px 0 20px;
    position: relative;
    z-index: 1;
}

.card-greeting {
    font-family: var(--font-serif);
    font-size: 22px;
    color: var(--gold-light);
    letter-spacing: 8px;
    margin-bottom: 18px;
    opacity: 0;
    animation: fadeUp 0.5s ease 1.35s forwards;
}

.card-slogan {
    font-family: var(--font-serif);
    font-size: 17px;
    line-height: 2.2;
    letter-spacing: 3px;
    color: var(--text);
    opacity: 0;
    animation: fadeUp 0.5s ease 1.4s forwards;
}
.card-slogan span {
    white-space: nowrap;
}

/* ===== 编号印章 ===== */
.card-stamp {
    margin: 0 -4px;
    background: linear-gradient(135deg, #8b1a2b 0%, #641218 100%);
    border: 2px solid var(--gold);
    outline: 1px solid var(--gold);
    outline-offset: -7px;
    padding: 24px 16px 20px;
    text-align: center;
    box-shadow:
        0 0 0 3px rgba(0,0,0,0.15),
        inset 0 0 30px rgba(0,0,0,0.3);
    opacity: 0;
    animation: stampIn 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 1.6s forwards;
}

.stamp-label {
    font-family: var(--font-serif);
    font-size: 13px;
    color: var(--gold-light);
    letter-spacing: 5px;
    margin-bottom: 10px;
}

.stamp-number {
    font-family: var(--font-serif);
    font-size: 54px;
    font-weight: 900;
    letter-spacing: 8px;
    line-height: 1.2;
    color: var(--gold-pale);
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.stamp-number.loading {
    font-size: 15px;
    font-family: var(--font-sans);
    letter-spacing: 4px;
    color: var(--text-dim);
    animation: pulse 1.5s ease infinite;
}

/* ===== 绑定 ===== */
.bind-wrap {
    margin-top: 18px;
    padding: 20px 16px;
    background: rgba(0,0,0,0.12);
    border: 1px solid rgba(212, 168, 67, 0.15);
    border-radius: 8px;
    text-align: center;
    opacity: 0;
    animation: fadeUp 0.5s ease 1.65s forwards;
}

.bind-title { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.bind-desc { font-size: 11px; color: var(--text-dim); margin-bottom: 16px; }
.bind-form { display: flex; flex-direction: column; gap: 10px; }

.bind-form input {
    width: 100%;
    padding: 13px 14px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text);
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(212, 168, 67, 0.2);
    border-radius: 8px;
    outline: none;
    text-align: center;
    letter-spacing: 4px;
    transition: border-color 0.3s, box-shadow 0.3s;
    -webkit-appearance: none;
}
.bind-form input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.1);
}
.bind-form input::placeholder { color: var(--text-dim); letter-spacing: 2px; }

.bind-btn {
    width: 100%;
    padding: 13px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: 4px;
    color: var(--red-dark);
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    -webkit-appearance: none;
}
.bind-btn:active { transform: scale(0.97); box-shadow: 0 0 18px rgba(212,168,67,0.3); }
.bind-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ===== 凭证 ===== */
.credential-wrap {
    margin-top: 18px;
    padding: 20px 16px;
    background: rgba(0,0,0,0.12);
    border: 1px solid rgba(212, 168, 67, 0.15);
    border-radius: 8px;
    text-align: center;
    opacity: 0;
    animation: fadeUp 0.5s ease 1.65s forwards;
}

.credential-badge {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    color: #5ec278;
    background: rgba(94,194,120,0.1);
    padding: 5px 16px;
    border-radius: 20px;
    letter-spacing: 2px;
    margin-bottom: 14px;
    animation: badgeGlow 2s ease 0.3s infinite;
}

.credential-box {
    background: rgba(212,168,67,0.05);
    border: 1px dashed rgba(212,168,67,0.2);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
}

.credential-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}
.credential-row + .credential-row {
    border-top: 1px solid rgba(212,168,67,0.08);
}

.credential-label { font-size: 12px; color: var(--text-dim); letter-spacing: 3px; }
.credential-value {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--gold-light);
    letter-spacing: 2px;
}
.credential-hint { font-size: 11px; color: var(--text-dim); letter-spacing: 1px; }

/* ===== 赞助点缀（淡化） ===== */
.sponsor-note {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 16px 28px 4px;
    opacity: 0;
    animation: fadeUp 0.5s ease 1.7s forwards;
}
.sponsor-note-text {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.8;
    letter-spacing: 1px;
}
.sponsor-note-brand {
    font-size: 11px;
    color: rgba(254,248,240,0.35);
    letter-spacing: 2px;
    margin-top: 6px;
}

/* ===== 赛事信息（淡化） ===== */
.logistics {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 14px 28px 0;
    opacity: 0;
    animation: fadeUp 0.5s ease 1.75s forwards;
}
.logistics p {
    font-size: 11px;
    color: rgba(254,248,240,0.4);
    line-height: 2;
    letter-spacing: 1px;
}

/* ===== Footer ===== */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 16px 0 32px;
    margin-top: 16px;
    opacity: 0;
    animation: fadeUp 0.5s ease 1.8s forwards;
}
.footer p {
    font-size: 11px;
    color: rgba(254,248,240,0.35);
    letter-spacing: 5px;
}

/* ===== 关键帧 ===== */
@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes goldShimmer {
    0%   { background-position: 200% center; }
    100% { background-position: -200% center; }
}
@keyframes stampIn {
    from { opacity: 0; transform: scale(0.82); }
    55%  { transform: scale(1.05); }
    75%  { transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
    0%, 100% { opacity: 0.35; }
    50%      { opacity: 1; }
}
@keyframes badgeGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(94,194,120,0.15); }
    50%      { box-shadow: 0 0 10px 2px rgba(94,194,120,0.12); }
}

/* ===== 响应式 ===== */
@media (max-width: 380px) {
    .hero { padding: 36px 20px 16px; }
    .hero-title { font-size: 32px; letter-spacing: 4px; }
    .invitation-card { margin: 20px 12px 8px; padding: 38px 18px 22px; }
    .card-ribbon { left: -16px; right: -16px; top: -14px; height: 32px; }
    .stamp-number { font-size: 42px; letter-spacing: 5px; }
    .curtain-char { font-size: 40px; }
}
@media (min-width: 420px) {
    .hero { padding: 56px 36px 28px; }
    .hero-title { font-size: 46px; }
    .stamp-number { font-size: 60px; }
    .curtain-char { font-size: 64px; }
}
