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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 15px;
    border-radius: 20px;
}

.nav-links a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
}

/* 导航下拉菜单样式 */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 15px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.dropdown-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    z-index: 1000;
    overflow: hidden;
}

.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-weight: 500;
    transition: all 0.3s ease;
}

.dropdown-content a:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 显示下拉菜单 */
.nav-dropdown:hover .dropdown-content {
    display: block;
}

/* 主内容区 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 30px;
}

/* 模块通用样式 */
.module {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.module h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5rem;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

/* 上传区域 */
.upload-area, .pdf-upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(102, 126, 234, 0.05);
}

.upload-area:hover, .pdf-upload-area:hover {
    border-color: #764ba2;
    background: rgba(118, 75, 162, 0.05);
    transform: scale(1.02);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-icon {
    font-size: 3rem;
    color: #667eea;
}

.upload-content p {
    color: #666;
    font-size: 1.1rem;
    font-weight: 500;
}

/* 图片信息和压缩选项 */
.image-info, .pdf-info {
    margin-top: 25px;
}

.image-info p, .pdf-info p {
    margin-bottom: 15px;
    font-weight: 500;
    color: #555;
}

.compression-levels, .quality-options {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.compression-levels label, .quality-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 8px 15px;
    border-radius: 20px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.compression-levels label:hover, .quality-options label:hover {
    background: rgba(102, 126, 234, 0.1);
}

.compression-levels input:checked + label, .quality-options input:checked + label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

/* 按钮样式 */
button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px 10px 10px 0;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 按钮组样式 */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

button:active {
    transform: translateY(0);
}

/* 预览容器 */
.preview-container {
    margin-top: 25px;
    text-align: center;
}

.preview-container img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* 转换状态 */
#conversion-status {
    margin-top: 20px;
    padding: 20px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 10px;
    text-align: center;
}

#conversion-status p {
    color: #155724;
    font-weight: 600;
    margin-bottom: 15px;
}

/* 弹幕系统 */
.danmaku-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    overflow: hidden;
}

.danmaku {
    position: absolute;
    white-space: nowrap;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    animation: danmaku-move linear forwards;
}

/* 弹幕昵称样式 */
.danmaku-nickname {
    color: #ffff00;
    margin-right: 5px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

@keyframes danmaku-move {
    from { transform: translateX(100vw); }
    to { transform: translateX(-100%); }
}

/* 弹幕输入区域 */
.danmaku-input-area {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 25px;
    padding: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

/* 昵称输入区域 */
.danmaku-nickname-section {
    display: flex;
    gap: 10px;
}

#danmaku-nickname {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #667eea;
    border-radius: 20px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

#danmaku-nickname:focus {
    border-color: #764ba2;
}

#save-nickname {
    padding: 10px 15px;
    background: linear-gradient(135deg, #4ecdc4 0%, #45b7d1 100%);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

#save-nickname:hover {
    background: linear-gradient(135deg, #45b7d1 0%, #4ecdc4 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

#danmaku-input {
    padding: 10px 15px;
    border: 2px solid #667eea;
    border-radius: 20px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

#danmaku-input:focus {
    border-color: #764ba2;
}

.danmaku-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

#danmaku-size {
    width: 80px;
    padding: 8px;
    border: 2px solid #667eea;
    border-radius: 15px;
    outline: none;
}

#danmaku-color {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    padding: 2px;
}

#send-danmaku {
    flex: 1;
    padding: 10px 15px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

#send-danmaku:hover {
    background: linear-gradient(135deg, #ee5a52 0%, #ff6b6b 100%);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

/* 发射特效 */
.fire-effect {
    position: fixed;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(255,255,0,1) 0%, rgba(255,165,0,1) 50%, rgba(255,0,0,1) 100%);
    border-radius: 50%;
    opacity: 0;
    animation: fire-explode 1s ease-out forwards;
}

@keyframes fire-explode {
    0% {
        opacity: 1;
        transform: scale(0.5);
    }
    100% {
        opacity: 0;
        transform: scale(3);
    }
}

/* 打赏弹窗 */
.donate-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.donate-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
}

.donate-content h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.donate-content p {
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.donate-qr img {
    max-width: 250px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #333;
}

/* 压缩次数计数器样式 */
.compression-counter {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    z-index: 1500;
}

.counter-label {
    color: #666;
    margin-right: 5px;
}

.counter-value {
    color: #667eea;
    font-weight: bold;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        padding: 20px 15px;
    }

    .nav-container {
        padding: 0 15px;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-links a {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .module {
        padding: 20px;
    }

    .upload-area, .pdf-upload-area {
        padding: 30px 15px;
    }

    .danmaku-input-area {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }

    .danmaku-controls {
        flex-wrap: wrap;
    }
}

/* 下载动画效果 */
@keyframes download-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

button.downloading {
    animation: download-pulse 0.8s infinite;
}

/* 加载状态 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

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