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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: #2a2a2a;
    color: #e0e0e0;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    background: #2a2a2a;
    min-height: 100vh;
}

/* 顶部语言选择栏 */
.top-bar {
    background: #333333;
    border-bottom: 1px solid #444444;
    padding: 12px 20px;
    text-align: right;
}

.lang-selector {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-size: 0.85em;
}

.lang-item {
    color: #999;
    text-decoration: none;
    padding: 2px 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.lang-item:hover {
    color: #e0e0e0;
}

.lang-item.active {
    color: #e0e0e0;
    font-weight: 500;
}

.lang-separator {
    color: #666;
    margin: 0 2px;
}

/* 主内容包装器 */
.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 主标题区域 */
.header-section {
    padding: 40px 0 30px;
    text-align: center;
}

.header-section h1 {
    font-size: 2.5em;
    color: #ffffff;
    margin-bottom: 20px;
    font-weight: 600;
}

.subtitle {
    font-size: 1.1em;
    color: #cccccc;
    margin-bottom: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.feature-list {
    list-style: none;
    text-align: left;
    max-width: 800px;
    margin: 20px auto 0;
    padding: 0;
}

.feature-list li {
    padding: 8px 0;
    color: #cccccc;
    padding-left: 20px;
    position: relative;
}

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

/* 格式选择和操作按钮区域（同一行） */
.format-action-section {
    padding: 20px 0;
    display: flex;
    flex-direction: row;
    gap: 20px;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
}

.format-wrapper {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.format-label {
    font-size: 1em;
    color: #e0e0e0;
    font-weight: 500;
    white-space: nowrap;
}

.format-select {
    padding: 10px 20px;
    border: 2px solid #444444;
    border-radius: 6px;
    font-size: 1em;
    background: #333333;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 200px;
}

.format-select:hover {
    border-color: #667eea;
    background: #3a3a3a;
}

.format-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.format-select option {
    background: #333333;
    color: #e0e0e0;
    padding: 10px;
}

/* 操作按钮区域 */
.action-wrapper {
    display: flex;
    flex-direction: row;
    gap: 15px;
    justify-content: center;
    flex-wrap: nowrap;
    align-items: center;
    white-space: nowrap;
}

.upload-btn,
.clear-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

.upload-btn {
    background: #667eea;
    color: white;
}

.upload-btn:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.clear-btn {
    background: #ff6b6b;
    color: white;
}

.clear-btn:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-icon {
    font-size: 1.2em;
    font-weight: bold;
    line-height: 1;
}

.btn-text {
    line-height: 1;
}

/* 拖放区域 */
.dropzone-section {
    padding: 40px 20px;
    text-align: center;
    position: relative;
}

.dropzone {
    border: 3px dashed #667eea;
    border-radius: 8px;
    padding: 80px 20px;
    text-align: center;
    background: #333333;
    transition: all 0.3s ease;
    cursor: pointer;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.dropzone:hover {
    border-color: #7c8ef5;
    background: #3a3a3a;
}

.dropzone.dragover {
    border-color: #7c8ef5;
    background: #404040;
    transform: scale(1.02);
}

.dropzone-text {
    color: #cccccc;
    font-size: 1.3em;
    margin: 0;
    font-weight: 500;
}

/* 拖放区域左右导航箭头（占位） */
.dropzone-section::before,
.dropzone-section::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    opacity: 0.3;
    pointer-events: none;
}

.dropzone-section::before {
    left: 20px;
    border-left: 3px solid #667eea;
    border-bottom: 3px solid #667eea;
    transform: translateY(-50%) rotate(45deg);
}

.dropzone-section::after {
    right: 20px;
    border-right: 3px solid #667eea;
    border-bottom: 3px solid #667eea;
    transform: translateY(-50%) rotate(-45deg);
}

/* 文件队列和转换结果区域（合并显示） */
.files-section {
    padding: 15px 10px;
    min-height: 160px;
    display: none;
    position: relative;
    border-bottom: 1px solid #444444;
}

.files-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 0;
    min-height: 140px;
    scroll-behavior: smooth;
    position: relative;
}

.files-container::-webkit-scrollbar {
    height: 8px;
}

.files-container::-webkit-scrollbar-track {
    background: #333333;
    border-radius: 4px;
}

.files-container::-webkit-scrollbar-thumb {
    background: #666666;
    border-radius: 4px;
}

.files-container::-webkit-scrollbar-thumb:hover {
    background: #777777;
}

/* 队列项 */
.queue-item {
    background: #333333;
    border: 2px solid #444444;
    border-radius: 6px;
    padding: 10px;
    min-width: 100px;
    max-width: 100px;
    height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.queue-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-color: #667eea;
}

/* 等待中状态 */
.queue-item-waiting {
    background: #3a3a3a;
    border-color: #555555;
}

/* 上传中状态 */
.queue-item-uploading {
    background: #2a3a4a;
    border-color: #667eea;
}

/* 转换中状态 */
.queue-item-converting {
    background: #4a3a2a;
    border-color: #ffc107;
}

/* 错误状态 */
.queue-item-error {
    background: #4a2a2a;
    border-color: #ff6b6b;
}

/* 队列删除按钮 */
.queue-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    border: none;
    background: rgba(153, 153, 153, 0.8);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
    z-index: 10;
    line-height: 1;
    padding: 0;
}

.queue-delete-btn:hover {
    background: #ff6b6b;
    transform: scale(1.1);
}

/* 队列文件名 */
.queue-filename {
    font-size: 0.7em;
    color: #cccccc;
    font-weight: 500;
    margin-bottom: 6px;
    word-break: break-all;
    text-align: center;
    line-height: 1.2;
}

/* 队列状态 */
.queue-status {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 8px 0;
}

.queue-icon {
    font-size: 2em;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
}

.queue-icon svg {
    width: 30px;
    height: 30px;
}

.queue-status-text {
    font-size: 0.75em;
    color: #cccccc;
    font-weight: 500;
}

/* 队列进度 */
.queue-progress {
    margin-top: 6px;
}

.queue-progress-bar {
    width: 100%;
    height: 4px;
    background: #555555;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.queue-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.queue-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.queue-progress-text {
    font-size: 0.65em;
    color: #999999;
    text-align: center;
}

/* 空状态提示 */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 1.1em;
    width: 100%;
    text-align: center;
    padding: 60px 20px;
}

/* 转换项卡片 */
.conversion-item {
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 6px;
    padding: 8px;
    min-width: 100px;
    max-width: 100px;
    height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    background-image: 
        linear-gradient(45deg, #444444 25%, transparent 25%),
        linear-gradient(-45deg, #444444 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #444444 75%),
        linear-gradient(-45deg, transparent 75%, #444444 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
    background-color: #2a2a2a;
    overflow: hidden;
}

.conversion-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    border-color: #667eea;
}

/* 删除按钮 */
.delete-btn {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px;
    height: 18px;
    border: none;
    background: rgba(255, 107, 107, 0.9);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s ease;
    z-index: 10;
    line-height: 1;
    padding: 0;
}

.delete-btn:hover {
    background: #ff5252;
    transform: scale(1.1);
}

/* 文件名 */
.conversion-filename {
    font-size: 0.7em;
    color: white;
    font-weight: 500;
    margin-bottom: 4px;
    word-break: break-all;
    text-align: center;
    line-height: 1.2;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    padding: 0 2px;
    display: none; /* 隐藏文件名 */
}

/* 转换后的图像预览 */
.conversion-image {
    width: 100%;
    height: auto;
    max-height: 60px;
    min-height: 40px;
    object-fit: contain;
    background: transparent;
    border-radius: 4px;
    margin: 2px 0;
    position: relative;
    z-index: 2;
    display: block;
}

/* PNG标签（显示在图像下方） */
.png-label {
    font-size: 1.2em;
    font-weight: bold;
    color: white;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin: 2px 0;
    position: relative;
    z-index: 2;
    line-height: 1.2;
}

/* 图像容器，用于垂直排列图像和PNG文字 */
.conversion-image-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

/* 下载按钮 */
.download-btn {
    background: white;
    color: #333;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75em;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 4px;
}

.download-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
}

/* 下载所有按钮区域 */
.download-all-section {
    padding: 20px 0;
    text-align: center;
    position: relative;
}

.download-all-btn {
    padding: 12px 30px;
    background: #555;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 180px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    position: relative;
}

.download-all-btn:hover {
    background: #444;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.download-all-btn .btn-icon {
    font-size: 1.1em;
    line-height: 1;
}

.download-all-btn .btn-text {
    line-height: 1;
}

#downloadCount {
    display: none; /* 使用徽章显示，隐藏文本计数 */
}

/* 下载计数徽章 */
.download-all-btn::after {
    content: attr(data-count);
    position: absolute;
    top: -8px;
    right: -8px;
    background: #999;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    font-weight: 600;
    padding: 0 4px;
    border: 2px solid white;
    box-sizing: border-box;
    line-height: 1;
}

.download-all-btn[data-count="0"]::after {
    display: none !important;
}

/* 内容介绍区域 */
.content-section {
    padding: 50px 20px;
    max-width: 900px;
    margin: 0 auto;
    background: transparent;
}

.content-section h2 {
    font-size: 2em;
    color: #ffffff;
    margin-bottom: 30px;
    font-weight: 600;
}

.content-section h3 {
    font-size: 1.5em;
    color: #ffffff;
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
}

.content-section p {
    color: #cccccc;
    margin-bottom: 15px;
    line-height: 1.8;
}

.content-section ul {
    margin-left: 30px;
    margin-bottom: 20px;
    color: #cccccc;
}

.content-section li {
    margin-bottom: 10px;
    line-height: 1.8;
}

/* 页脚 */
.footer-section {
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid #444444;
    background: #333333;
    color: #999;
    font-size: 0.9em;
    margin-top: 40px;
}

.footer-section p {
    margin: 8px 0;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #667eea;
    font-size: 1.1em;
}

/* 错误状态 */
.error {
    background: #ffe0e0;
    color: #d32f2f;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid #ffcdd2;
}

/* 成功状态 */
.success {
    background: #e8f5e9;
    color: #388e3c;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid #c8e6c9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-section {
        padding: 30px 0 20px;
    }

    .header-section h1 {
        font-size: 2em;
    }

    .format-action-section {
        flex-direction: row;
        gap: 10px;
        flex-wrap: wrap;
        padding: 15px 0;
    }
    
    .format-wrapper {
        flex-direction: row;
        gap: 8px;
    }
    
    .format-select {
        min-width: 150px;
        padding: 8px 15px;
        font-size: 0.9em;
    }
    
    .action-wrapper {
        flex-direction: row;
        gap: 10px;
    }
    
    .upload-btn,
    .clear-btn {
        padding: 10px 20px;
        font-size: 0.9em;
        min-width: 120px;
        max-width: none;
        width: auto;
    }

    .dropzone-section {
        padding: 30px 10px;
    }

    .dropzone {
        padding: 40px 15px;
    }

    .files-section {
        padding: 20px 0;
    }

    .content-section {
        padding: 30px 15px;
    }

    .download-all-section {
        padding: 15px 0;
    }

    .download-all-btn {
        width: 100%;
        max-width: 300px;
    }

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

    .lang-selector {
        justify-content: center;
        font-size: 0.75em;
    }

    .conversion-item {
        min-width: 90px;
        max-width: 90px;
        height: 130px;
    }
    
    .queue-item {
        min-width: 90px;
        max-width: 90px;
        height: 130px;
    }
}
