/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background:
        radial-gradient(circle at 18% 8%, rgba(24, 144, 255, 0.10), transparent 34%),
        radial-gradient(circle at 88% 18%, rgba(82, 196, 26, 0.08), transparent 30%),
        linear-gradient(180deg, #f7fbff 0%, #f4f7fb 48%, #eef4fa 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 32px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.contact-card {
    position: fixed;
    top: 20px;
    right: 22px;
    z-index: 50;
    width: 128px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(24, 144, 255, 0.18);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 35, 60, 0.12);
    backdrop-filter: blur(12px);
    text-align: center;
}

.contact-card .contact-title {
    color: #1f1f1f;
    font-size: 0.78rem;
    line-height: 1.35;
    font-weight: 600;
    margin-bottom: 8px;
}

.contact-card img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 42px 0 34px;
}

.header.tool-header {
    text-align: left;
    padding: 20px 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1890ff;
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.back-link:hover {
    color: #40a9ff;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.tool-header .logo {
    justify-content: flex-start;
}

.logo i {
    font-size: 2.5rem;
    color: #1677ff;
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: 600;
    color: #1f1f1f;
}

.subtitle {
    font-size: 1rem;
    color: #666;
    font-weight: 400;
}

.free-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding: 8px 14px;
    color: #0f7a43;
    background: #ecfff4;
    border: 1px solid #b7ebc8;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
}

.free-badge i {
    color: #18a058;
}

/* 主内容区 */
.main-content {
    flex: 1;
}

/* 工具区块 */
.tool-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.3rem;
    color: #1f1f1f;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: #1890ff;
}

/* 工具网格 */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.tool-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid rgba(24, 144, 255, 0.10);
    box-shadow: 0 10px 28px rgba(15, 35, 60, 0.07);
    backdrop-filter: blur(10px);
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(24, 144, 255, 0.14);
    border-color: #1890ff;
}

.tool-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tool-icon i {
    transition: color 0.3s;
}

.tool-icon.pdf2word i:first-child { color: #ff4d4f; }
.tool-icon.pdf2word i:last-child { color: #1890ff; }
.tool-icon.word2pdf i:first-child { color: #1890ff; }
.tool-icon.word2pdf i:last-child { color: #ff4d4f; }
.tool-icon.pdf2image i:first-child { color: #ff4d4f; }
.tool-icon.pdf2image i:last-child { color: #52c41a; }
.tool-icon.image2pdf i:first-child { color: #52c41a; }
.tool-icon.image2pdf i:last-child { color: #ff4d4f; }
.tool-icon.merge i { color: #722ed1; }
.tool-icon.split i { color: #fa8c16; }
.tool-icon.compress i { color: #13c2c2; }

.tool-card h3 {
    font-size: 1.1rem;
    color: #1f1f1f;
    margin-bottom: 8px;
    font-weight: 600;
}

.tool-card p {
    font-size: 0.85rem;
    color: #999;
}

/* 上传区域 */
.upload-section {
    margin-bottom: 30px;
}

.upload-area {
    background: rgba(255, 255, 255, 0.94);
    border: 2px dashed #d9d9d9;
    border-radius: 10px;
    padding: 60px 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #1890ff;
    background: #f0f7ff;
}

.upload-area.dragover {
    border-color: #1890ff;
    background: #e6f7ff;
    transform: scale(1.01);
}

.upload-icon {
    font-size: 3.5rem;
    color: #bfbfbf;
    margin-bottom: 20px;
}

.upload-area:hover .upload-icon {
    color: #1890ff;
}

.upload-area h3 {
    font-size: 1.3rem;
    color: #262626;
    margin-bottom: 10px;
    font-weight: 500;
}

.upload-area p {
    color: #8c8c8c;
    font-size: 1rem;
}

.browse-link {
    color: #1890ff;
    font-weight: 500;
    text-decoration: none;
}

#fileInput {
    display: none;
}

.supported-formats {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    color: #8c8c8c;
    font-size: 0.9rem;
}

/* 文件列表 */
.file-list-section {
    background: rgba(255, 255, 255, 0.94);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 10px 28px rgba(15, 35, 60, 0.07);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.section-header h3 {
    color: #262626;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.section-header h3 i {
    color: #1890ff;
}

.btn-clear {
    background: #fff1f0;
    color: #ff4d4f;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.file-item:hover {
    background: #f5f5f5;
    border-color: #d9d9d9;
}

.file-icon {
    font-size: 2rem;
    margin-right: 15px;
    color: #1890ff;
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: #262626;
    margin-bottom: 4px;
    word-break: break-all;
}

.file-size {
    font-size: 0.85rem;
    color: #8c8c8c;
}

.file-remove {
    background: none;
    border: none;
    color: #bfbfbf;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    transition: color 0.2s;
}

.file-remove:hover {
    color: #ff4d4f;
}

/* 设置区域 */
.split-settings, .compress-settings {
    background: white;
    border-radius: 12px;
    padding: 20px 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.split-settings label, .compress-settings label {
    font-weight: 500;
    color: #262626;
    margin-right: 10px;
}

.split-settings select, .compress-settings select,
.split-settings input {
    padding: 10px 15px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 0.95rem;
    min-width: 200px;
}

.split-settings input {
    width: 100%;
    margin-top: 10px;
}

.split-settings small {
    color: #8c8c8c;
    display: block;
    margin-top: 5px;
}

.compress-settings small {
    color: #8c8c8c;
    display: block;
    margin-top: 10px;
}

.compression-estimate {
    display: none;
    color: #1890ff;
    font-weight: 600;
    margin-left: 12px;
    white-space: nowrap;
}

.compression-estimate.show {
    display: inline-block;
}

/* 操作按钮 */
.action-section {
    text-align: center;
    margin-bottom: 30px;
}

.btn-convert {
    padding: 15px 50px;
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

.btn-convert:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(24, 144, 255, 0.4);
}

.btn-convert:disabled {
    background: #bfbfbf;
    cursor: not-allowed;
    box-shadow: none;
}

/* 进度条 */
.progress-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-header h3 {
    color: #262626;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.progress-header h3 i {
    color: #1890ff;
}

.progress-text {
    font-weight: 600;
    color: #1890ff;
}

.progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1890ff 0%, #096dd9 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* 结果区域 */
.results-section {
    background: #f6ffed;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #b7eb8f;
}

.results-section .section-header h3 i {
    color: #52c41a;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #b7eb8f;
}

.result-item.success {
    border-left: 4px solid #52c41a;
}

.result-item.error {
    border-left: 4px solid #ff4d4f;
    background: #fff1f0;
    border-color: #ffa39e;
}

.result-icon {
    font-size: 1.8rem;
    margin-right: 15px;
}

.result-item.success .result-icon {
    color: #52c41a;
}

.result-item.error .result-icon {
    color: #ff4d4f;
}

.result-info {
    flex: 1;
}

.result-name {
    font-weight: 500;
    color: #262626;
    margin-bottom: 4px;
}

.result-status {
    font-size: 0.85rem;
}

.result-item.success .result-status {
    color: #52c41a;
}

.result-item.error .result-status {
    color: #ff4d4f;
}

.btn-download {
    background: #1890ff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-download:hover {
    background: #40a9ff;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 30px 0;
    color: #8c8c8c;
}

.footer p {
    margin-bottom: 5px;
}

.footer-note {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #262626;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast i {
    color: #52c41a;
}

.toast.error i {
    color: #ff4d4f;
}

/* 三大入口样式 */
.tool-grid.three-cols {
    grid-template-columns: repeat(3, 1fr);
}

.tool-card.main-entry {
    position: relative;
    padding: 40px 30px;
    text-align: center;
}

.tool-card.main-entry .tool-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.tool-card.main-entry .tool-icon.primary {
    background: linear-gradient(135deg, #1890ff, #36cfc9);
    color: white;
}

.tool-card.main-entry .tool-icon.secondary {
    background: linear-gradient(135deg, #722ed1, #eb2f96);
    color: white;
}

.tool-card.main-entry .tool-icon.tertiary {
    background: linear-gradient(135deg, #fa8c16, #fadb14);
    color: white;
}

.tool-card.main-entry h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.tool-card.main-entry p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.entry-badge {
    display: inline-block;
    background: #f0f0f0;
    color: #666;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 96px 15px 18px;
    }

    .contact-card {
        top: 12px;
        right: 12px;
        width: 86px;
        padding: 7px;
        border-radius: 8px;
    }

    .contact-card .contact-title {
        font-size: 0.66rem;
        margin-bottom: 5px;
    }
    
    .tool-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .tool-grid.three-cols {
        grid-template-columns: 1fr;
    }
    
    .tool-card {
        padding: 20px 15px;
    }
    
    .tool-icon {
        font-size: 2rem;
    }
    
    .logo h1 {
        font-size: 1.6rem;
    }
    
    .upload-area {
        padding: 40px 25px;
    }
}

@media (max-width: 480px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }

    .header {
        padding-top: 16px;
    }

    .contact-card {
        width: 78px;
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-item, .result-item {
    animation: fadeIn 0.3s ease;
}
