/* ========================================
   PDF魔法师 - 工具页面样式
   简洁白色主题
======================================== */

/* 背景 - 纯白色 */
body {
    background: #ffffff;
}

.bg-pattern {
    display: none;
}

/* 导航栏 */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.nav-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
    color: #1a1a2e;
}

.logo-icon {
    font-size: 1.4rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    color: #666;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: #f5f5f5;
    color: #6366f1;
}

/* 工具头部 - 简洁风格 */
.tool-header {
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
    background: #ffffff;
    border-bottom: 1px solid #f5f5f5;
}

.tool-header-content {
    max-width: 600px;
    margin: 0 auto;
}

.tool-header .tool-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.25);
}

.tool-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 0.5rem;
}

.tool-header .description {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

.tool-badges {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem 0.9rem;
    background: #f0f0ff;
    color: #6366f1;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* 工具主区域 */
.tool-main {
    padding: 2rem 1.5rem;
    background: #fafafa;
}

.tool-container {
    max-width: 700px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
}

/* 上传区域 */
.upload-zone {
    border: 2px dashed #d0d0d0;
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: #6366f1;
    background: #f5f5ff;
}

.upload-zone .upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-zone h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.5rem;
}

.upload-zone p {
    font-size: 0.9rem;
    color: #888;
    margin: 0;
}

/* 文件列表 */
.file-list {
    margin-top: 1.25rem;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

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

.file-item.dragging {
    opacity: 0.5;
    border-color: #6366f1;
}

.file-item-icon {
    font-size: 1.5rem;
}

.file-item-info {
    flex: 1;
    min-width: 0;
}

.file-item-name {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
}

.file-item-size {
    font-size: 0.8rem;
    color: #999;
    margin-top: 2px;
}

.file-item-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-item-remove:hover {
    background: #ef4444;
    color: white;
}

/* 选项区域 */
.options-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 12px;
}

.options-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.option-group {
    margin-bottom: 1rem;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 0.4rem;
}

.option-group select,
.option-group input[type="text"],
.option-group input[type="number"],
.option-group input[type="url"] {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #fff;
    color: #333;
    transition: all 0.2s ease;
}

.option-group select:focus,
.option-group input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.option-group input[type="range"] {
    width: 100%;
    accent-color: #6366f1;
}

.option-group input[type="color"] {
    width: 60px;
    height: 38px;
    padding: 2px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
}

/* 转换按钮 */
.convert-btn {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

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

.convert-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 进度条 */
.progress-container {
    display: none;
    margin-top: 1.5rem;
    text-align: center;
}

.progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* 结果区域 */
.result-container {
    display: none;
    margin-top: 1.5rem;
    padding: 2rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    text-align: center;
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.result-container h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #166534;
    margin: 0 0 1rem;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.4);
}

/* 如何使用 */
.how-it-works {
    padding: 3rem 1.5rem;
    background: #ffffff;
    text-align: center;
}

.how-it-works h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 2rem;
}

.steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.step {
    flex: 1;
    min-width: 180px;
    max-width: 220px;
    text-align: center;
    padding: 1.5rem;
    background: #fafafa;
    border-radius: 14px;
    border: 1px solid #f0f0f0;
}

.step-num {
    width: 40px;
    height: 40px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.step h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 0.5rem;
}

.step p {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* 相关工具 */
.related-tools {
    padding: 3rem 1.5rem;
    background: #fafafa;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}

.related-tools h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 1.5rem;
}

.related-grid {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    max-width: 600px;
    margin: 0 auto;
}

.related-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.25rem 1.5rem;
    background: #ffffff;
    border: 1px solid #eee;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.25s ease;
    min-width: 130px;
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: #ddd;
}

.related-card .tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: #f0f0ff;
}

.related-card h4 {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin: 0;
}

/* 页脚 */
.footer {
    background: #ffffff;
    border-top: 1px solid #f0f0f0;
    padding: 2rem 1.5rem;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.footer-brand .logo-icon {
    font-size: 1.2rem;
}

.footer-brand .logo-text {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.footer-brand p {
    width: 100%;
    color: #999;
    font-size: 0.8rem;
    margin: 0.3rem 0 0;
}

.footer-info p {
    color: #999;
    font-size: 0.85rem;
    margin: 0;
}

/* 通知/提示框 */
.notice-box {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #92400e;
}

/* 后端状态指示器 */
.backend-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.backend-status.online {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

.backend-status.offline {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.backend-status.checking {
    background: #f0f0ff;
    color: #6366f1;
    border: 1px solid #c7d2fe;
}

.status-icon {
    font-size: 1rem;
}

/* 预览区域 */
.preview-container {
    margin-top: 1.5rem;
    border: 1px solid #eee;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.preview-container img,
.preview-container canvas {
    display: block;
    max-width: 100%;
    margin: 0 auto;
}

/* PDF 预览组件 */
.pdf-preview-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 12px;
}

.pdf-preview-container {
    margin-top: 1rem;
}

.pdf-preview-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.preview-nav-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 8px;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-nav-btn:hover:not(:disabled) {
    background: #f0f0ff;
    border-color: #6366f1;
    color: #6366f1;
}

.preview-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.preview-page-info {
    font-size: 0.9rem;
    color: #666;
    min-width: 80px;
    text-align: center;
}

.pdf-preview-canvas-wrapper {
    background: #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    justify-content: center;
    overflow: auto;
    max-height: 400px;
}

.pdf-preview-canvas-wrapper canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    background: #fff;
}

/* 缩略图网格 */
.pdf-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
}

.pdf-thumbnail {
    position: relative;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pdf-thumbnail:hover {
    border-color: #6366f1;
    transform: translateY(-2px);
}

.pdf-thumbnail.selected {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.pdf-thumbnail img,
.pdf-thumbnail canvas {
    width: 100%;
    height: auto;
    display: block;
}

.pdf-thumbnail-page {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
}

/* 响应式 */
@media (max-width: 768px) {
    .nav-container {
        padding: 0.6rem 1rem;
    }
    
    .tool-header {
        padding: 2rem 1rem 1.5rem;
    }
    
    .tool-header .tool-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    
    .tool-header h1 {
        font-size: 1.5rem;
    }
    
    .tool-main {
        padding: 1rem;
    }
    
    .tool-container {
        padding: 1.5rem;
        border-radius: 12px;
    }
    
    .upload-zone {
        padding: 2rem 1.5rem;
    }
    
    .steps {
        flex-direction: column;
        align-items: center;
    }
    
    .step {
        max-width: none;
        width: 100%;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-brand {
        justify-content: center;
    }
    
    .footer-brand p {
        text-align: center;
    }
}

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

.result-container {
    animation: fadeIn 0.4s ease;
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}
