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

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

:root {
    --primary-red: #8B0000;
    --dark-red: #5C0000;
    --light-red: #A52A2A;
    --accent-gold: #FFD700;
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, var(--dark-red) 0%, var(--primary-red) 50%, var(--light-red) 100%);
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    color: var(--white);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    overflow-x: hidden;
}

.header {
    text-align: center;
    padding: 60px 20px 40px;
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

.header-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    animation: pulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.8; }
}

.main-title {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 900;
    background: linear-gradient(45deg, var(--white), var(--accent-gold), var(--white));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
    letter-spacing: 0.05em;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    position: relative;
    z-index: 1;
}

@keyframes shimmer {
    to { background-position: 200% center; }
}

.subtitle {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    color: var(--accent-gold);
    margin-top: 10px;
    font-weight: 300;
    letter-spacing: 0.1em;
}

.intro-section {
    margin: 40px 0;
    max-width: 100%;
    overflow: hidden;
}

.section-title {
    font-size: clamp(1.5rem, 5vw, 2rem);
    color: var(--accent-gold);
    text-align: center;
    margin-bottom: 30px;
    font-weight: 700;
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

.content-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    max-width: 100%;
    overflow: hidden;
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px var(--shadow);
}

.intro-text {
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    line-height: 1.8;
    text-align: justify;
    word-wrap: break-word;
    word-break: break-word;
}

.document-links {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

.doc-btn {
    flex: 1;
    min-width: 150px;
    max-width: 300px;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--accent-gold), #FFA500);
    color: var(--dark-red);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    white-space: nowrap;
}

.doc-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.5);
}

.btn-icon {
    font-size: 1.3rem;
}

.form-section {
    margin: 50px 0;
    max-width: 100%;
    overflow: hidden;
}

#memberForm {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 40px;
    box-shadow: 0 10px 40px var(--shadow);
    color: var(--dark-red);
    max-width: 100%;
    overflow: hidden;
}

.form-group {
    margin-bottom: 40px;
}

.form-section-title {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    color: var(--primary-red);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent-gold);
    font-weight: 700;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark-red);
    font-size: 1rem;
}

.required {
    color: #FF0000;
    font-weight: bold;
}

.input-group input[type="text"],
.input-group input[type="tel"],
.input-group .select-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #DDD;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.input-group .select-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238B0000' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 45px;
}

.input-group input[type="text"]:focus,
.input-group input[type="tel"]:focus,
.input-group .select-input:focus {
    outline: none;
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

.input-group .select-input:hover {
    border-color: var(--light-red);
}

.radio-group {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.radio-label input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary-red);
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s ease;
    word-wrap: break-word;
    word-break: break-word;
}

.checkbox-label:hover {
    background: rgba(139, 0, 0, 0.05);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary-red);
}

.submit-btn {
    width: 100%;
    padding: 18px 40px;
    background: linear-gradient(135deg, var(--primary-red), var(--light-red));
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 6px 25px rgba(139, 0, 0, 0.4);
    margin-top: 30px;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 35px rgba(139, 0, 0, 0.6);
}

.submit-btn:active {
    transform: translateY(-1px);
}

.btn-arrow {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.submit-btn:hover .btn-arrow {
    transform: translateX(5px);
}

.contact-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    margin: 50px 0;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 100%;
    overflow: hidden;
}

.contact-title {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
    color: var(--accent-gold);
    margin-bottom: 10px;
    font-weight: 700;
}

.contact-subtitle {
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
}

.contact-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 100%;
}

.contact-btn {
    flex: 1;
    min-width: 200px;
    max-width: 350px;
    padding: 18px 25px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid var(--accent-gold);
    color: var(--white);
    text-decoration: none;
    border-radius: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.contact-btn:hover {
    background: var(--accent-gold);
    color: var(--dark-red);
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.4);
}

.contact-icon {
    font-size: 1.5rem;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: linear-gradient(135deg, var(--white) 0%, #FFF8F0 100%);
    border-radius: 25px;
    max-width: 90%;
    width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.4s ease;
    z-index: 1001;
}

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: var(--primary-red);
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    background: var(--dark-red);
    transform: rotate(90deg);
}

.modal-title {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
    color: var(--primary-red);
    margin-bottom: 25px;
    font-weight: 700;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--accent-gold);
}

.modal-body {
    color: #333;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.modal-intro {
    font-size: 1.05rem;
    margin-bottom: 20px;
    text-align: justify;
}

.modal-intro strong {
    color: var(--primary-red);
    font-weight: 700;
}

.leader-list,
.funding-list,
.benefit-list {
    list-style: none;
    margin: 20px 0;
    padding: 0;
}

.leader-list li,
.funding-list li,
.benefit-list li {
    padding: 12px 0;
    font-size: 1.05rem;
    border-bottom: 1px solid rgba(139, 0, 0, 0.1);
}

.leader-list li:last-child,
.funding-list li:last-child,
.benefit-list li:last-child {
    border-bottom: none;
}

.leader-list strong {
    color: var(--primary-red);
    font-weight: 700;
}

.benefit-title {
    font-size: 1.3rem;
    color: var(--primary-red);
    margin: 25px 0 15px;
    font-weight: 700;
}

.highlight {
    color: var(--primary-red);
    font-weight: 700;
    font-size: 1.1em;
}

.modal-footer-text {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid rgba(139, 0, 0, 0.1);
    font-size: 1rem;
    text-align: justify;
    color: #555;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header {
        padding: 30px 10px 20px;
    }

    .content-card {
        padding: 20px;
        border-radius: 15px;
    }

    #memberForm {
        padding: 20px;
        border-radius: 20px;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .checkbox-label {
        padding: 8px;
    }

    .document-links {
        flex-direction: row;
        gap: 10px;
    }

    .contact-links {
        flex-direction: column;
        gap: 10px;
    }

    .doc-btn {
        max-width: 100%;
        min-width: auto;
        flex: 1;
        padding: 15px 15px;
    }

    .contact-btn {
        max-width: 100%;
        min-width: auto;
        width: 100%;
        padding: 15px 20px;
    }

    .contact-section {
        padding: 25px 20px;
    }

    .modal-content {
        padding: 30px 20px;
        max-width: 95%;
    }

    .radio-group {
        gap: 15px;
    }

    .submit-btn {
        padding: 15px 30px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 8px;
    }

    .header {
        padding: 25px 8px 15px;
    }

    .header-glow {
        width: 150px;
        height: 150px;
    }

    .content-card {
        padding: 15px;
        border-radius: 12px;
    }

    #memberForm {
        padding: 15px;
        border-radius: 15px;
    }

    .form-section-title {
        font-size: 1.1rem;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .input-group {
        margin-bottom: 20px;
    }

    .input-group input[type="text"],
    .input-group input[type="tel"],
    .input-group .select-input {
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .input-group .select-input {
        padding-right: 40px;
        background-position: right 12px center;
    }

    .checkbox-group {
        gap: 8px;
    }

    .checkbox-label {
        padding: 6px;
        font-size: 0.9rem;
    }

    .checkbox-label input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }

    .radio-label {
        font-size: 0.95rem;
    }

    .doc-btn {
        padding: 12px 12px;
        font-size: 0.95rem;
        min-width: auto;
        flex: 1;
    }

    .contact-btn {
        padding: 12px 15px;
        font-size: 0.95rem;
        min-width: auto;
        width: 100%;
    }

    .contact-section {
        padding: 20px 15px;
    }

    .submit-btn {
        padding: 14px 25px;
        font-size: 1.1rem;
        gap: 10px;
    }

    .modal-content {
        padding: 20px 12px;
        max-width: 96%;
        border-radius: 15px;
    }

    .modal-title {
        font-size: 1.2rem;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .modal-intro,
    .leader-list li,
    .funding-list li,
    .benefit-list li {
        font-size: 0.95rem;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 5px;
    }

    .header {
        padding: 20px 5px 15px;
    }

    .content-card {
        padding: 12px;
        margin: 15px 0;
    }

    #memberForm {
        padding: 12px;
    }

    .form-section-title {
        font-size: 1rem;
    }

    .input-group label {
        font-size: 0.9rem;
    }

    .input-group input[type="text"],
    .input-group input[type="tel"],
    .input-group .select-input {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .input-group .select-input {
        padding-right: 35px;
        background-position: right 10px center;
    }

    .checkbox-label {
        padding: 5px;
        font-size: 0.85rem;
    }

    .doc-btn {
        padding: 10px 8px;
        font-size: 0.85rem;
        gap: 6px;
        min-width: auto;
        flex: 1;
    }

    .contact-btn {
        padding: 10px 12px;
        font-size: 0.9rem;
        gap: 8px;
        min-width: auto;
        width: 100%;
    }

    .submit-btn {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .contact-section {
        padding: 15px 10px;
    }

    .modal-content {
        padding: 15px 10px;
        max-width: 98%;
    }

    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
}

.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--dark-red);
}

.leader-qr-modal {
    max-width: 500px;
    text-align: center;
}

.qr-image-container {
    background: var(--white);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.qr-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 10px;
    display: block;
    margin: 0 auto;
}

.qr-tip {
    color: #666;
    font-size: 1rem;
    margin: 15px 0 25px;
    font-weight: 500;
}

.add-leader-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--primary-red), var(--light-red));
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(139, 0, 0, 0.3);
    margin-top: 10px;
}

.add-leader-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(139, 0, 0, 0.5);
}

.add-leader-btn .btn-arrow {
    font-size: 1.3rem;
    transition: transform 0.3s ease;
}

.add-leader-btn:hover .btn-arrow {
    transform: translateX(5px);
}

@media (max-width: 480px) {
    .leader-qr-modal {
        max-width: 95%;
    }

    .qr-image {
        max-width: 250px;
    }

    .qr-tip {
        font-size: 0.9rem;
    }

    .add-leader-btn {
        padding: 14px 30px;
        font-size: 1rem;
    }
}

@media (max-width: 360px) {
    .qr-image {
        max-width: 200px;
    }

    .qr-image-container {
        padding: 15px;
    }

    .add-leader-btn {
        padding: 12px 25px;
        font-size: 0.95rem;
    }
}
