/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* CSS变量定义 */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --blue-gradient: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    --pink-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --dark-gradient: linear-gradient(135deg, #4a4a4a 0%, #2c2c2c 100%);
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    --text-color: #333;
    --title-color: #2c3e50;
    --subtitle-color: #7f8c8d;
    --white-transparent: rgba(255, 255, 255, 0.95);
    --white-light: rgba(255, 255, 255, 0.1);
    --white-medium: rgba(255, 255, 255, 0.8);
    --white-full: rgba(255, 255, 255, 1);
    --blue-light: rgba(52, 152, 219, 0.3);
    --green-success: rgba(46, 204, 113, 0.8);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--primary-gradient);
    min-height: 100vh;
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    background: var(--white-transparent);
    border-radius: 20px;
    padding: 40px 30px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
}

.header h1 {
    font-size: 2.5rem;
    color: var(--title-color);
    margin-bottom: 10px;
    font-weight: 700;
}

.header .subtitle {
    font-size: 1.1rem;
    color: var(--subtitle-color);
    margin-bottom: 20px;
}

.last-update {
    background: var(--blue-gradient);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 500;
}

.header-codes {
    margin-top: 20px;
    padding: 15px;
    background: var(--white-light);
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.header-codes-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.header-code-item {
    background: var(--secondary-gradient);
    border-radius: 10px;
    padding: 10px 15px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.header-code-item:hover {
    transform: translateY(-2px);
}

.header-code-text {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: bold;
    background: var(--white-medium);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.header-code-text:hover {
    background: var(--white-full);
    transform: scale(1.02);
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.main-codes {
    background: var(--white-transparent);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--card-shadow);
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.general-codes {
    background: var(--secondary-gradient);
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--card-shadow);
}

.section-title {
    font-size: 1.5rem;
    color: var(--title-color);
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.invite-card {
    background: var(--pink-gradient);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    color: white;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.invite-card.latest {
    background: var(--blue-gradient);
    box-shadow: 0 10px 30px var(--blue-light);
}

.invite-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.invite-card.expired {
    background: var(--dark-gradient);
    opacity: 0.8;
}

.invite-card.expired .code-text {
    text-decoration: line-through;
    opacity: 0.6;
}

.card-date {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
    font-weight: 500;
}

.card-expiry {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 15px;
}

.code-text {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 8px;
    display: inline-block;
    margin: 5px 5px 5px 0;
    backdrop-filter: blur(5px);
    cursor: pointer;
    transition: all 0.3s ease;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.code-text:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.02);
}

.general-code-item {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.general-code-item h3 {
    color: var(--title-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.general-code-item .code-text {
    background: var(--blue-gradient);
    color: white;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.source-link {
    font-size: 0.85rem;
    color: var(--subtitle-color);
}

.source-link a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.source-link a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* 返回顶部按钮样式 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--blue-gradient);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.6);
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
}

.back-to-top.show {
    display: flex;
}

.footer {
    background: var(--white-transparent);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--card-shadow);
}

.footer p {
    color: var(--subtitle-color);
    margin-bottom: 10px;
}

.footer .beian {
    font-size: 0.9rem;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.footer .beian a {
    color: #666;
    text-decoration: none;
}

.footer .beian a:hover {
    color: #3498db;
    text-decoration: underline;
}

.footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

/* 页面加载时间样式 */
.page-load-time {
    margin-top: 15px;
    font-size: 0.85rem;
    color: var(--subtitle-color);
    text-align: center;
    padding: 8px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.page-load-time:hover {
    opacity: 1;
}

.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 8s ease-in-out infinite;
}

.shape:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.shape:nth-child(3) {
    width: 60px;
    height: 60px;
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .container {
        padding: 15px;
    }
    
    .main-codes, .general-codes, .header, .footer {
        padding: 20px;
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .floating-shapes, .back-to-top {
        display: none;
    }
    
    .header, .main-codes, .general-codes, .footer {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}