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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    z-index: 100;
}

.title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.5px;
}

.actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.zoom-level {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    min-width: 45px;
    text-align: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-download {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-download:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-zoom {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 8px;
    width: 36px;
    height: 36px;
    justify-content: center;
}

.btn-zoom:active {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(0.95);
}

.btn-page {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    font-size: 13px;
    padding: 6px 12px;
}

.btn-page:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

/* 页码导航 */
.page-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.page-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

/* PDF容器 */
.pdf-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    margin: 12px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* 加载动画 */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    color: #666;
    font-size: 14px;
}

/* PDF画布容器 */
.pdf-canvas-container {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    justify-content: flex-start;
    box-sizing: border-box;
}

.pdf-page {
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    overflow: hidden;
    background: white;
    width: 100%;
}

.pdf-page canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
}

.page-label {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    z-index: 10;
}

/* 错误内容样式 */
.error-content {
    text-align: center;
    padding: 24px;
}

.error-content svg {
    margin-bottom: 24px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.error-content h2 {
    color: #333;
    font-size: 22px;
    margin-bottom: 12px;
}

.error-content p {
    color: #666;
    font-size: 14px;
    margin-bottom: 24px;
}

/* 底部提示 */
.tips {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    text-align: center;
    flex-shrink: 0;
}

.tips p {
    font-size: 12px;
    color: #666;
}

/* 响应式设计 */
@media (min-width: 768px) {
    .container {
        max-width: 900px;
        padding: 20px;
    }
    
    .header {
        border-radius: 12px 12px 0 0;
    }
    
    .pdf-container {
        margin: 0;
        border-radius: 0;
    }
    
    .tips {
        border-radius: 0 0 12px 12px;
    }
    
    .title {
        font-size: 20px;
    }
}

/* 横屏优化 */
@media (orientation: landscape) and (max-width: 896px) {
    .header {
        padding: 8px 16px;
    }
    
    .title {
        font-size: 16px;
    }
    
    .btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .pdf-container {
        margin: 8px;
    }
    
    .tips {
        display: none;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    }
    
    .header {
        background: rgba(45, 55, 72, 0.95);
    }
    
    .title {
        color: #f7fafc;
    }
    
    .tips {
        background: rgba(45, 55, 72, 0.9);
    }
    
    .tips p {
        color: #cbd5e0;
    }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

