* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.page-wrapper {
    position: relative;
    width: 100%;
    max-width: 750px;
    min-height: 100vh;
    overflow: hidden;
    background: #fff;
}

.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.content {
    position: relative;
    z-index: 1;
    padding: 0 3.7%;
    padding-top: 14% !important;
}

.header-logo {
    display: block;
    width: 80.7%;
    margin: 12% auto 0 !important;
}

/* ==================== 表单卡片 ==================== */
.form-card {
    background: #fff;
    border-radius: 20px;
    padding: 6% 5%;
    margin-top: 6%;
    width: 92.5%;
    margin-left: auto;
    margin-right: auto;
}

.form-group {
    margin-bottom: 0;
    padding-bottom: 4%;
    border-bottom: 1px solid #989797;
}

.form-group:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: #000;
    margin-bottom: 2%;
}

.form-group input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: #333;
    padding: 2% 0;
    background: transparent;
}

.form-group input::placeholder {
    color: #aaa;
}

.form-group .fixed-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #000;
    padding: 2% 0;
    display: block;
}

.form-group textarea {
    width: 100%;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: #333;
    background: transparent;
    resize: none;
}

.form-group textarea::placeholder {
    color: #aaa;
}

.address-box-inner {
    background: #d9d9d9;
    border-radius: 12px;
    padding: 4%;
    margin-top: 3%;
}

.address-box-inner textarea {
    width: 100%;
    min-height: 140px;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: #333;
    background: transparent;
    resize: none;
    font-family: inherit;
}

.address-box-inner textarea::placeholder {
    color: #666;
}

/* ==================== 提交按钮 ==================== */
.submit-btn-wrapper {
    width: 92.5%;
    margin: 5% auto 8%;
}

.submit-btn {
    display: block;
    width: 100%;
    padding: 3.8% 0;
    background: linear-gradient(135deg, #d4232a, #b71c1c);
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    letter-spacing: 4px;
    box-shadow: 0 4px 15px rgba(183, 28, 28, 0.4);
    transition: all 0.3s ease;
}

.submit-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(183, 28, 28, 0.3);
}

.submit-btn:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
}

/* ==================== 成功页面 ==================== */
.success-card {
    background: #fff;
    border-radius: 20px;
    padding: 5%;
    margin-top: 6%;
    width: 92.5%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.cert-image {
    width: 95%;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    margin-bottom: 5%;
}

.success-text {
    font-size: 1rem;
    font-weight: 500;
    color: #110d0d;
    line-height: 2;
    padding: 2% 4%;
}

.info-card {
    background: #fff;
    border-radius: 20px;
    padding: 6% 5%;
    margin-top: 4%;
    width: 92.5%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.name-red {
    color: #d4232a !important;
    font-weight: 700;
}

.black-text {
    color: #000 !important;
    font-weight: 400;
}

.black-text strong {
    font-weight: 800;
}

.notice-red {
    color: #d4232a !important;
}

.info-card .notice-text {
    font-size: 1rem;
    font-weight: 700;
    color: #000;
    line-height: 1.8;
}

.qr-section {
    margin-top: 5%;
    text-align: center;
}

.qr-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #000;
    margin-bottom: 3%;
}

.qr-image {
    width: 50%;
    max-width: 220px;
    border: 1px solid #c2b5b5;
    border-radius: 4px;
}

.join-btn {
    display: inline-block;
    margin-top: 5%;
    padding: 3% 10%;
    background: linear-gradient(135deg, #d4232a, #b71c1c);
    color: #fff !important;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50px;
    text-decoration: none;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(183, 28, 28, 0.4);
    transition: all 0.3s ease;
}

.join-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(183, 28, 28, 0.3);
}

/* ==================== 响应式设计 ==================== */

/* 大屏手机 (414px+, iPhone Plus/Max/Pro Max) */
@media screen and (min-width: 414px) {
    html { font-size: 17px; }
}

/* 标准手机 (375px - 413px, iPhone 6/7/8/X/11/12/13/14) */
@media screen and (min-width: 375px) and (max-width: 413px) {
    html { font-size: 16px; }
}

/* 小屏手机 (360px - 374px, 部分安卓) */
@media screen and (min-width: 360px) and (max-width: 374px) {
    html { font-size: 15px; }
}

/* 超小屏手机 (320px - 359px, iPhone SE 1代) */
@media screen and (max-width: 359px) {
    html { font-size: 14px; }
    .form-card { padding: 5% 4%; }
    .submit-btn { font-size: 1rem; letter-spacing: 2px; }
}

/* 平板竖屏 (768px+) */
@media screen and (min-width: 768px) {
    html { font-size: 18px; }
    .page-wrapper {
        max-width: 750px;
        margin: 0 auto;
        box-shadow: 0 0 30px rgba(0,0,0,0.1);
    }
}

/* 横屏适配 */
@media screen and (orientation: landscape) and (max-height: 500px) {
    .page-wrapper {
        max-width: 480px;
    }
    .address-box textarea {
        min-height: 100px;
    }
}

/* loading 遮罩 */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #fff;
    border-top: 4px solid #d4232a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Toast 提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 10000;
    display: none;
    text-align: center;
    max-width: 80%;
}

.toast.show {
    display: block;
    animation: fadeInOut 2s ease forwards;
}

@keyframes fadeInOut {
    0%   { opacity: 0; }
    15%  { opacity: 1; }
    75%  { opacity: 1; }
    100% { opacity: 0; }
}
