/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.header i {
    margin-right: 10px;
}

/* 主内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

/* 编辑面板 */
.editor-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.editor-panel h2 {
    margin-bottom: 25px;
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 头像预览 */
.avatar-preview,
.qrcode-preview {
    margin-top: 10px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #e1e5e9;
    cursor: pointer;
    transition: all 0.3s ease;
}

.qrcode-preview {
    border-radius: 12px;
}

.avatar-preview:hover,
.qrcode-preview:hover {
    border-color: #667eea;
    transform: scale(1.05);
}

.avatar-preview img,
.qrcode-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 主题选择器 */
.theme-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.theme-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-btn:hover {
    transform: scale(1.1);
}

.theme-btn.active {
    box-shadow: 0 0 0 3px white, 0 0 0 5px #667eea;
}

/* 预览面板 */
.preview-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.preview-panel h2 {
    margin-bottom: 25px;
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 卡片容器 */
.card-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

/* 个人资料卡片 */
.profile-card {
    width: 400px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 30px 60px rgba(0,0,0,0.2);
}

/* 卡片头部 */
.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    color: white;
    text-align: center;
    position: relative;
}

.card-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="3" fill="rgba(255,255,255,0.1)"/><circle cx="40" cy="60" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="70" cy="30" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.3;
}

.avatar-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 20px;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

.avatar-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-info h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.header-info p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

/* 卡片主体 */
.card-body {
    padding: 30px;
}

.bio-section,
.contact-section {
    margin-bottom: 25px;
}

.bio-section:last-child,
.contact-section:last-child {
    margin-bottom: 0;
}

.bio-section h4,
.contact-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bio-section p {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    color: #555;
    font-size: 0.9rem;
}

.contact-item i {
    width: 16px;
    color: #667eea;
}

/* 卡片底部 */
.card-footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e9ecef;
}

.qr-code {
    width: 120px;
    height: 120px;
    margin: 0 auto 10px;
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.qr-code img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.footer-text {
    font-size: 0.8rem;
    color: #888;
    margin: 0;
}

/* 下载区域 */
.download-section {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.download-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.download-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.download-btn.secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.download-btn.primary:hover {
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

.download-btn.secondary:hover {
    background: #e9ecef;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

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

.loading-spinner {
    text-align: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 主题样式 */
.profile-card.theme-purple .card-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.profile-card.theme-green .card-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.profile-card.theme-orange .card-header {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.profile-card.theme-dark .card-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

/* 卡片样式变体 */
.profile-card.style-elegant {
    border: 2px solid #e9ecef;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.profile-card.style-creative {
    border-radius: 30px;
    transform: rotate(-1deg);
}

.profile-card.style-creative .card-header {
    border-radius: 30px 30px 0 0;
}

.profile-card.style-minimal {
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border: 1px solid #f1f3f4;
}

.profile-card.style-minimal .card-header {
    background: white;
    color: #333;
    border-bottom: 2px solid #667eea;
}

.profile-card.style-minimal .avatar-container {
    border-color: #667eea;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .profile-card {
        width: 100%;
        max-width: 400px;
    }
}

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

    .header h1 {
        font-size: 2rem;
    }

    .editor-panel,
    .preview-panel {
        padding: 20px;
    }

    .profile-card {
        width: 100%;
        max-width: 350px;
    }

    .download-section {
        flex-direction: column;
        align-items: center;
    }

    .download-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .profile-card {
        max-width: 100%;
    }

    .card-header {
        padding: 20px;
    }

    .card-body {
        padding: 20px;
    }

    .avatar-container {
        width: 80px;
        height: 80px;
    }

    .header-info h3 {
        font-size: 1.5rem;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-card {
    animation: fadeInUp 0.6s ease-out;
}

.form-group input,
.form-group textarea,
.form-group select {
    animation: fadeInUp 0.4s ease-out;
}

/* 成功提示 */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.success-message.show {
    transform: translateX(0);
}

.success-message i {
    margin-right: 8px;
}