/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

:root {
    --primary-color: #007AFF;
    --secondary-color: #34C759;
    --light-gray: #F2F2F7;
    --medium-gray: #E5E5EA;
    --dark-gray: #8E8E93;
    --text-color: #1C1C1E;
    --error-color: #FF3B30;
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body {
    background-color: #FBFBFD;
    color: var(--text-color);
    line-height: 1.6;
    position: relative;
}

/* GitHub角标样式 */
.github-corner {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 99;
}

.github-corner svg {
    position: absolute;
    top: 0;
    right: 0;
    color: #fff;
    border: 0;
}

.github-corner .octo-arm {
    transform-origin: 130px 106px;
}

.github-corner:hover .octo-arm {
    animation: octocat-wave 560ms ease-in-out;
}

@keyframes octocat-wave {
    0%, 100% {
        transform: rotate(0);
    }
    20%, 60% {
        transform: rotate(-25deg);
    }
    40%, 80% {
        transform: rotate(10deg);
    }
}

@media (max-width: 500px) {
    .github-corner:hover .octo-arm {
        animation: none;
    }
    .github-corner .octo-arm {
        animation: octocat-wave 560ms ease-in-out;
    }
}

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

/* 头部样式 */
header {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    padding: 20px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo h1 {
    font-weight: 600;
    font-size: 24px;
    color: var(--text-color);
}

/* 主内容区域 */
main {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 工具栏样式 */
.toolbar {
    display: flex;
    justify-content: center;
    gap: 0;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 4px;
    margin-bottom: 20px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.tool-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    background-color: transparent;
    color: var(--dark-gray);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.tool-btn:hover {
    background-color: var(--light-gray);
}

.tool-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.tool-btn i {
    font-size: 16px;
}

/* 上传区域样式 */
.upload-section {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    border: 2px dashed var(--medium-gray);
    border-radius: var(--border-radius);
    padding: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 350px;
    justify-content: center;
}

.upload-container:hover, .upload-container.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(0, 122, 255, 0.05);
}

.upload-icon {
    font-size: 64px;
    color: var(--primary-color);
    margin-bottom: 12px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

#extract-icon {
    display: none;
    font-size: 64px;
    color: #007AFF;
}

#compress-icon {
    font-size: 64px;
    color: #007AFF;
}

#image-compress-icon {
    display: none;
    font-size: 64px;
    color: #007AFF;
}

#upload-buttons {
    display: none;
}

#image-compress-buttons {
    display: none;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    min-height: 48px;
    justify-content: center;
}

/* 浮动动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.upload-container h2 {
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 20px;
}

.upload-container p {
    color: var(--dark-gray);
    margin-bottom: 16px;
    font-size: 14px;
}

.upload-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.upload-btn:hover {
    background-color: #0066CC;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.upload-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.upload-btn.secondary {
    background-color: var(--medium-gray);
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.upload-btn.secondary:hover {
    background-color: var(--dark-gray);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.upload-buttons, .compress-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 48px;
    align-items: center;
}

.compress-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 16px;
    background-color: var(--light-gray);
    border-radius: 8px;
    min-width: 200px;
}

.compress-options label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

.quality-slider {
    width: 180px;
    height: 6px;
    border-radius: 3px;
    background: var(--medium-gray);
    outline: none;
    -webkit-appearance: none;
}

.quality-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.3);
}

.quality-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 122, 255, 0.3);
}

/* 处理中区域样式 */
.processing-section {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 40px;
    text-align: center;
    display: none;
}

.progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.progress-container h2 {
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 20px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background-color: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease;
}

#progress-text {
    font-weight: 600;
    color: var(--primary-color);
}

/* 结果区域样式 */
.result-section {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    display: none;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--medium-gray);
    flex-wrap: wrap;
    gap: 12px;
}

.result-header h2 {
    font-weight: 600;
    font-size: 20px;
}

.file-info {
    flex-grow: 1;
    margin-left: 20px;
    color: var(--dark-gray);
    font-size: 14px;
}

.download-all-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-all-btn:hover {
    background-color: #30B350;
}

/* 文件浏览器样式 */
.file-explorer {
    max-height: 400px;
    overflow-y: auto;
}

.file-list-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr;
    gap: 16px;
    padding: 12px 24px;
    background-color: var(--light-gray);
    font-weight: 600;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.file-list {
    max-height: 400px;
    overflow-y: auto;
}

.file-item {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr;
    gap: 16px;
    padding: 12px 24px;
    border-bottom: 1px solid var(--medium-gray);
    align-items: center;
}

.file-item:hover {
    background-color: var(--light-gray);
}

.file-name {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-icon {
    color: var(--primary-color);
    font-size: 16px;
}

.file-size {
    color: var(--dark-gray);
    font-size: 14px;
}

.file-action button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-action button:hover {
    background-color: #0066CC;
}

/* 错误弹窗样式 */
.error-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    display: none;
}

.error-content {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 24px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.error-content i {
    font-size: 48px;
    color: var(--error-color);
}

.error-content h3 {
    font-size: 20px;
    font-weight: 600;
}

.error-content button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
}

/* 友情链接样式 */
.friend-links {
    margin-top: 30px;
}

.friend-links-container {
    text-align: center;
    padding: 10px 0;
}

.friend-links-container h3 {
    font-weight: normal;
    font-size: 14px;
    margin-bottom: 8px;
    color: #666666;
    display: inline;
    margin-right: 10px;
}

.friend-links-list {
    display: inline;
}

.friend-link {
    color: #888888;
    text-decoration: none;
    font-size: 14px;
    padding: 0 5px;
    transition: all 0.3s ease;
}

.friend-link:hover {
    color: #555555;
    text-decoration: none;
    transform: translateY(-1px);
}

.link-divider {
    color: #CCCCCC;
    font-size: 14px;
}

/* 页脚样式 */
footer {
    margin-top: 40px;
    text-align: center;
    color: #777777;
    font-size: 14px;
    padding: 20px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .upload-section, .processing-section, .result-section {
        padding: 24px;
    }
    
    .upload-container {
        padding: 24px 16px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-info {
        margin-left: 0;
    }
    
    .file-list-header, .file-item {
        grid-template-columns: 2fr 1fr 1fr;
        padding: 12px 16px;
    }
    
    .friend-links-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
    
    .friend-links-container h3 {
        margin-right: 0;
        margin-bottom: 5px;
        display: block;
    }
    
    .friend-links-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
}