/* ==========================================================
   校庆班级聚会报名 · 暖色邀请函风格
   ========================================================== */

:root {
    --bg: #FAF3E7;
    --paper: #FFFDF8;
    --ink: #3E2C20;
    --ink-soft: #6C5138;
    --muted: #9B7E60;
    --primary: #C75B39;
    --primary-deep: #A8452A;
    --gold: #C99A4B;
    --gold-deep: #A9803A;
    --line: rgba(201, 154, 75, .26);
    --radius-card: 22px;
    --shadow-card: 0 22px 44px -26px rgba(107, 66, 35, .5), 0 2px 6px rgba(107, 66, 35, .05);
    --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
    --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
            "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: var(--sans);
    background:
        radial-gradient(1200px 620px at 50% -12%, #FFE7C4 0%, rgba(255, 231, 196, 0) 62%),
        radial-gradient(820px 520px at 108% 12%, rgba(226, 150, 90, .20), transparent 62%),
        radial-gradient(700px 480px at -10% 32%, rgba(214, 167, 104, .13), transparent 60%),
        var(--bg);
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .35) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .35) 1px, transparent 1px);
    background-size: 44px 44px;
    opacity: .18;
    mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
}

.wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 18px calc(30px + env(safe-area-inset-bottom));
}

/* ---------------- Hero ---------------- */

.hero {
    position: relative;
    padding: 36px 6px 26px;
    text-align: center;
}

.seal {
    width: 62px;
    height: 62px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #B4552F;
    font-family: var(--serif);
    font-size: 25px;
    line-height: 1;
    background: radial-gradient(circle at 32% 26%, #FFF9EC 0%, #F8E7C9 78%);
    border: 1px solid rgba(180, 85, 47, .38);
    box-shadow:
        inset 0 0 0 4px #FFF9EC,
        inset 0 0 0 5px rgba(180, 85, 47, .24),
        0 10px 22px -12px rgba(150, 90, 40, .55);
    animation: sealIn .7s cubic-bezier(.2, .8, .3, 1.2) both;
}

.kicker {
    margin: 0;
    font-size: 10.5px;
    letter-spacing: .42em;
    text-indent: .42em;
    text-transform: uppercase;
    color: var(--gold-deep);
    font-weight: 600;
}

.hero h1 {
    margin: 10px 0 0;
    font-family: var(--serif);
    font-size: clamp(27px, 7.2vw, 37px);
    font-weight: 600;
    letter-spacing: .08em;
    color: #40291A;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .65);
}

.title-rule {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 15px auto 15px;
}

.title-rule::before,
.title-rule::after {
    content: "";
    width: 44px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 154, 75, .9));
}

.title-rule::after {
    background: linear-gradient(270deg, transparent, rgba(201, 154, 75, .9));
}

.title-rule i {
    width: 5px;
    height: 5px;
    transform: rotate(45deg);
    background: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 154, 75, .16);
}

.hero-sub {
    margin: 0;
    font-size: 14px;
    line-height: 1.95;
    color: #8B6F55;
    letter-spacing: .04em;
}

.hero-stat {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
    padding: 8px 17px;
    border-radius: 999px;
    font-size: 12.5px;
    letter-spacing: .04em;
    color: #7A5C40;
    background: rgba(255, 252, 245, .82);
    border: 1px solid rgba(201, 154, 75, .32);
    box-shadow: 0 8px 18px -14px rgba(120, 80, 40, .5);
    backdrop-filter: blur(4px);
}

.hero-stat b {
    color: var(--primary-deep);
    font-size: 15px;
    font-family: var(--serif);
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 0 rgba(199, 91, 57, .45);
    animation: pulse 2.4s infinite;
}

.spark {
    position: absolute;
    width: 5px;
    height: 5px;
    transform: rotate(45deg);
    background: var(--gold);
    opacity: .55;
    animation: twinkle 3.6s ease-in-out infinite;
}

.spark.s1 { top: 52px; left: 10%; animation-delay: .2s; }
.spark.s2 { top: 118px; right: 9%; width: 4px; height: 4px; animation-delay: 1.1s; }
.spark.s3 { top: 26px; right: 24%; width: 3px; height: 3px; animation-delay: 2s; opacity: .4; }

/* ---------------- Card ---------------- */

.card {
    position: relative;
    padding: 24px 20px 22px;
    border-radius: var(--radius-card);
    background: linear-gradient(180deg, #FFFEFA 0%, #FFF9EF 100%);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    animation: riseIn .6s cubic-bezier(.2, .7, .3, 1) both;
}

.card::before {
    content: "";
    position: absolute;
    inset: 8px 8px auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 154, 75, .55), transparent);
    border-radius: 1px;
}

.card + .card {
    margin-top: 18px;
    animation-delay: .08s;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title.row {
    justify-content: space-between;
}

.title-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar {
    width: 3px;
    height: 17px;
    border-radius: 3px;
    background: linear-gradient(180deg, #E0A85C, #BE5430);
}

.card-title h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: .06em;
    color: #4A3121;
}

.card-desc {
    margin: 8px 0 0 13px;
    font-size: 12.5px;
    color: var(--muted);
    letter-spacing: .02em;
}

.count-pill {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    color: #8A6535;
    background: #FBF1DE;
    border: 1px solid rgba(201, 154, 75, .3);
}

.count-pill b {
    font-family: var(--serif);
    font-size: 14px;
    color: var(--primary-deep);
}

/* ---------------- 我的报名 ---------------- */

.my-bar {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 16px;
    padding: 11px 13px;
    border-radius: 15px;
    background: linear-gradient(135deg, #FDF4E3, #FAEAD3);
    border: 1px solid rgba(201, 154, 75, .38);
}

.my-avatar {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-family: var(--serif);
    font-size: 15px;
    color: #FFF6E7;
    background: linear-gradient(145deg, #D0713F, #B44E2C);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3);
}

.my-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #6B4E33;
    line-height: 1.45;
}

.my-text b {
    color: #40291A;
    font-size: 13.5px;
}

.my-text span {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    color: #9B7E60;
    letter-spacing: .04em;
}

.link-btn {
    flex: 0 0 auto;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid rgba(199, 91, 57, .34);
    background: #FFFBF3;
    color: #B4552F;
    font-size: 12.5px;
    font-family: var(--sans);
    cursor: pointer;
}

.link-btn:active {
    background: #FDF1DE;
}

.edit-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 10px 13px;
    border-radius: 13px;
    font-size: 12.5px;
    color: #8A5A25;
    background: #FCF2DE;
    border: 1px dashed rgba(201, 154, 75, .6);
}

/* ---------------- 表单 ---------------- */

.field {
    margin-top: 17px;
}

.field > label,
.label-row label {
    display: block;
    margin-bottom: 8px;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: .03em;
    color: var(--ink-soft);
}

.req {
    margin-left: 3px;
    color: var(--primary);
}

.opt {
    margin-left: 7px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: .04em;
    color: #A98B6D;
    background: #F6EBD9;
    vertical-align: 1px;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.label-row label {
    margin: 0;
}

.gift-note {
    font-size: 11px;
    color: #B08A56;
    letter-spacing: .03em;
}

input[type="text"],
input[type="tel"],
select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border-radius: 13px;
    border: 1px solid #E7D6C0;
    background: #FFFCF7;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
}

input::placeholder {
    color: #B9A48D;
    font-size: 14.5px;
}

input:focus,
select:focus {
    border-color: var(--gold);
    background: #FFFFFF;
    box-shadow: 0 0 0 4px rgba(201, 154, 75, .14);
}

.field.invalid input,
.field.invalid select {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(199, 91, 57, .1);
}

.field-err {
    display: none;
    margin: 6px 3px 0;
    font-size: 12px;
    color: #B54A2C;
}

.field.invalid .field-err {
    display: block;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.addr-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.addr-grid.municipality {
    grid-template-columns: 1fr 1fr;
}

.addr-grid select {
    padding: 0 26px 0 10px;
    font-size: 13.5px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23A9803A' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px;
    text-overflow: ellipsis;
}

.addr-grid select:disabled {
    color: #B9A48D;
    background-color: #FBF6EC;
}

#detailInput {
    margin-top: 8px;
}

.hint {
    margin: 9px 2px 0;
    padding: 8px 11px;
    border-radius: 10px;
    font-size: 11.5px;
    line-height: 1.7;
    color: #A08468;
    background: #FBF3E4;
}

.btn-primary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    margin-top: 24px;
    border: 0;
    border-radius: 15px;
    color: #FFF8EC;
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: .26em;
    text-indent: .26em;
    background: linear-gradient(135deg, #D57A45 0%, #BE5430 56%, #A8452A 100%);
    box-shadow:
        0 14px 26px -12px rgba(168, 69, 42, .6),
        inset 0 1px 0 rgba(255, 255, 255, .26);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.btn-primary:active {
    transform: translateY(1px) scale(.995);
    box-shadow: 0 8px 18px -10px rgba(168, 69, 42, .55);
}

.btn-primary[disabled] {
    opacity: .62;
    cursor: default;
}

.spinner {
    width: 17px;
    height: 17px;
    border: 2px solid rgba(255, 248, 236, .35);
    border-top-color: #FFF8EC;
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.form-foot {
    margin: 12px 0 0;
    text-align: center;
    font-size: 11.5px;
    color: #B29A80;
    letter-spacing: .03em;
}

.form-card.is-success .card-title,
.form-card.is-success .card-desc {
    display: none;
}

/* ---------------- 成功面板 ---------------- */

.success {
    padding: 14px 2px 6px;
    text-align: center;
    animation: riseIn .45s ease both;
}

.success-mark {
    width: 64px;
    height: 64px;
    margin: 4px auto 14px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 30px;
    color: #FFFDF6;
    background: radial-gradient(circle at 32% 26%, #E4B368, #C2923F 82%);
    box-shadow:
        inset 0 0 0 3px rgba(255, 255, 255, .32),
        0 14px 26px -12px rgba(170, 118, 40, .6);
}

.success h2 {
    margin: 0;
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: .1em;
    color: #40291A;
}

.success-sub {
    margin: 8px 0 0;
    font-size: 12.5px;
    color: var(--muted);
}

.summary {
    margin: 20px 0 0;
    padding: 8px 16px;
    border-radius: 15px;
    text-align: left;
    background: #FFF9EE;
    border: 1px dashed rgba(201, 154, 75, .48);
}

.summary > div {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 9px 0;
    font-size: 13.5px;
    border-bottom: 1px solid rgba(201, 154, 75, .12);
}

.summary > div:last-child {
    border-bottom: 0;
}

.summary dt {
    flex: 0 0 auto;
    color: #9B7E60;
}

.summary dd {
    margin: 0;
    color: #40291A;
    text-align: right;
    word-break: break-all;
}

.success-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 22px;
}

.btn-ghost {
    width: 100%;
    height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(199, 91, 57, .38);
    background: #FFFBF3;
    color: #B4552F;
    font-family: var(--sans);
    font-size: 14px;
    letter-spacing: .08em;
    cursor: pointer;
}

.btn-ghost:active {
    background: #FDF1DE;
}

.btn-text {
    font-size: 12.5px;
    color: #A9803A;
    text-decoration: none;
    border-bottom: 1px solid rgba(169, 128, 58, .4);
    padding-bottom: 2px;
}

/* ---------------- 报名名单 ---------------- */

.wall {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 17px;
    max-height: 330px;
    overflow-y: auto;
    padding: 2px 2px 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 154, 75, .5) transparent;
}

.wall::-webkit-scrollbar {
    width: 4px;
}

.wall::-webkit-scrollbar-thumb {
    background: rgba(201, 154, 75, .45);
    border-radius: 4px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 14px;
    color: #5C3D25;
    background: #FBF1DF;
    border: 1px solid rgba(201, 154, 75, .24);
    animation: chipIn .42s ease both;
    animation-delay: var(--d, 0ms);
}

.chip i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #CF8A4E;
    box-shadow: 0 0 0 3px rgba(207, 138, 78, .14);
}

.chip:nth-child(4n+2) { background: #FDF5E9; }
.chip:nth-child(4n+3) { background: #FAEEE3; }
.chip:nth-child(4n+4) { background: #F9F0DD; }

.wall-empty {
    width: 100%;
    padding: 26px 10px;
    text-align: center;
    font-size: 13px;
    color: #B29A80;
    border: 1px dashed rgba(201, 154, 75, .38);
    border-radius: 14px;
    background: #FFFAF1;
}

.wall-note {
    margin: 14px 2px 0;
    font-size: 11px;
    color: #B49C82;
    letter-spacing: .03em;
    text-align: center;
}

/* ---------------- 页脚 / 提示 ---------------- */

.footer {
    margin-top: 28px;
    text-align: center;
    color: #A98B6D;
}

.footer p {
    margin: 0;
    font-family: var(--serif);
    font-size: 12.5px;
    letter-spacing: .14em;
}

.footer .footer-sub {
    margin-top: 7px;
    font-family: var(--sans);
    font-size: 11px;
    letter-spacing: .02em;
    color: #B9A48D;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(26px + env(safe-area-inset-bottom));
    z-index: 60;
    max-width: 84vw;
    padding: 11px 19px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    color: #FFF6E7;
    background: rgba(62, 42, 28, .94);
    box-shadow: 0 14px 30px -14px rgba(40, 24, 12, .6);
    opacity: 0;
    transform: translate(-50%, 16px);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.noscript {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13px;
    text-align: center;
    color: #FFF6E7;
    background: #A8452A;
    z-index: 70;
}

/* ---------------- 动画 ---------------- */

@keyframes riseIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes sealIn {
    from { opacity: 0; transform: scale(.72) rotate(-8deg); }
    to   { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes chipIn {
    from { opacity: 0; transform: translateY(8px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(199, 91, 57, .45); }
    70%  { box-shadow: 0 0 0 7px rgba(199, 91, 57, 0); }
    100% { box-shadow: 0 0 0 0 rgba(199, 91, 57, 0); }
}

@keyframes twinkle {
    0%, 100% { opacity: .25; transform: rotate(45deg) scale(.85); }
    50%      { opacity: .7; transform: rotate(45deg) scale(1.15); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---------------- 小屏适配 ---------------- */

@media (max-width: 400px) {
    .wrap { padding-left: 14px; padding-right: 14px; }
    .hero { padding-top: 28px; }
    .card { padding: 21px 16px 19px; }
    .addr-grid { grid-template-columns: 1fr 1fr; }
    #districtSelect { grid-column: 1 / -1; }
    .gift-note { font-size: 10.5px; }
    .seal { width: 56px; height: 56px; font-size: 23px; }
}

@media (min-width: 768px) {
    .hero { padding: 52px 6px 34px; }
    .card { padding: 28px 26px 26px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
