/* 全局样式 */
* {
    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;
}

/* Logo样式 */
.logo-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

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

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



/* 链接网格样式 */
.links-grid {
    display: grid;
    gap: 15px;
}

.extensions-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.entertainment-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.extension-link {
    display: block;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.extension-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(240, 147, 251, 0.3);
}

.academic-link {
    display: block;
    padding: 12px 15px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.academic-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(79, 172, 254, 0.3);
}

.entertainment-link {
    display: block;
    padding: 10px 12px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    color: #333;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
}

/* 在线人数显示样式 */
.danmaku-online-count {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
    margin-bottom: 15px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.danmaku-online-count #online-count {
    font-size: 1.2em;
    font-weight: 700;
    margin: 0 5px;
}

.entertainment-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(168, 237, 234, 0.3);
}



/* 主内容区 */
.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-area.drag-over, .pdf-upload-area.drag-over {
    border-color: #764ba2;
    background: rgba(118, 75, 162, 0.1);
}

.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, .bg-info, .image-processor-info {
    margin-top: 25px;
}

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

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

.compression-levels label, .quality-options label, .conversion-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, .conversion-options label:hover {
    background: rgba(102, 126, 234, 0.1);
}

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

/* 图片处理模块样式 */
.option-group {
    margin: 15px 0;
}

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

.option-group select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #667eea;
    border-radius: 20px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.option-group select:hover {
    border-color: #764ba2;
}

.grayscale-options {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #764ba2;
}

#grayscale-threshold {
    width: 100%;
    margin: 10px 0;
}

#processing-status {
    margin-top: 20px;
    padding: 20px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 10px;
    text-align: center;
}

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

/* 按钮样式 */
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, .pdf-preview-container, .bg-preview-container {
    margin-top: 25px;
    text-align: center;
}

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

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

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

/* 方法选项样式 */
.method-options {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.method-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;
}

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

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

/* API信息样式 */
.api-info {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.api-info p {
    margin-bottom: 8px;
    color: #495057;
}

#api-remaining-count {
    font-weight: bold;
    color: #667eea;
}

/* 背景参数样式 */
.bg-params {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #764ba2;
}

.param-row {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.param-row:last-child {
    margin-bottom: 0;
}

.param-row label {
    flex: 0 0 120px;
    font-size: 14px;
    color: #495057;
}

.param-row input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
    -webkit-appearance: none;
}

.param-row input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

.param-row input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}





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

.donate-modal.show {
    display: flex;
}

.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);
    position: relative;
}

.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);
}

/* 功能清单弹窗 */
.features-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.features-modal.show {
    display: flex;
}

.features-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    position: relative;
}

.features-content h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.4rem;
    text-align: center;
}

.features-list {
    margin-bottom: 20px;
}

.feature-category {
    margin-bottom: 20px;
}

.feature-category h4 {
    color: #444;
    margin-bottom: 10px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature-category ul {
    list-style: none;
    padding-left: 20px;
}

.feature-category li {
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
    position: relative;
}

.feature-category li::before {
    content: "•";
    color: #667eea;
    font-weight: bold;
    position: absolute;
    left: -15px;
}

.features-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    text-align: center;
}

.features-footer p {
    color: #888;
    font-size: 0.9rem;
}

.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;
    }


}

/* 下载动画效果 */
@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); }
}

/* 备案信息样式 */
.beian-info {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(102, 126, 234, 0.9);
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    font-size: 12px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 15px;
    color: white;
    transition: background-color 0.3s ease;
}

.beian-info a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.beian-info a:hover {
    color: white;
    text-decoration: underline;
}

.beian-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.miit-beian {
    margin-left: 10px;
}

/* 弹幕功能样式 */
.danmaku-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.danmaku-screen {
    position: relative;
    width: 100%;
    height: 300px;
    background: #1a1a1a;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.danmaku-item {
    position: absolute;
    white-space: nowrap;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 10;
    animation-timing-function: linear;
}

.danmaku-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

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

.danmaku-input-area input:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.danmaku-input-area button {
    padding: 12px 25px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.danmaku-input-area button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.danmaku-options {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.danmaku-options .option-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.danmaku-options label {
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

.danmaku-options input[type="color"] {
    width: 40px;
    height: 40px;
    border: 2px solid #667eea;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

.danmaku-options select {
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 15px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
    background: white;
}

.danmaku-options select:hover {
    border-color: #764ba2;
}

.danmaku-options input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.danmaku-options input[type="range"] {
    width: 100px;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
    -webkit-appearance: none;
}

.danmaku-options input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

.danmaku-options input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
}

#danmaku-opacity-value {
    font-weight: 600;
    color: #667eea;
    min-width: 40px;
}

/* 响应式设计 - 弹幕功能 */
@media (max-width: 768px) {
    .danmaku-screen {
        height: 200px;
    }
    
    .danmaku-input-area {
        flex-direction: column;
        align-items: stretch;
    }
    
    .danmaku-input-area button {
        width: 100%;
        margin: 0;
    }
    
    .danmaku-options {
        flex-direction: column;
        align-items: stretch;
    }
    
    .danmaku-options .option-group {
        justify-content: space-between;
    }
}

