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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

#app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.view {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1, .header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

/* 按钮样式 */
.btn-primary {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.btn-back, .btn-menu {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    min-width: 40px;
}

/* 文件列表样式 */
.file-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 10px;
}

.file-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.file-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.file-item:active {
    transform: translateY(-2px);
}

.file-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

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

.file-size {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
}

.file-date {
    font-size: 0.7rem;
    color: #999;
    margin-top: 3px;
}

.delete-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,0,0,0.1);
    border: none;
    color: #e53e3e;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    font-size: 0.8rem;
}

.file-item:hover .delete-btn {
    display: block;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    margin: 10px 0;
    font-size: 1rem;
}

.empty-state p:first-of-type {
    font-size: 1.2rem;
    font-weight: 500;
    color: #333;
}

/* PDF阅读器样式 */
.pdf-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #333;
    position: relative;
    overflow: auto;
}

#pdfCanvas {
    max-width: 100%;
    max-height: 100%;
    background: white;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.2rem;
    z-index: 10;
}

/* 控制栏样式 */
.controls {
    background: white;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.btn-control {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-control:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.btn-control:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

#pageInfo {
    font-weight: 500;
    color: #333;
    min-width: 80px;
    text-align: center;
}

/* 缩放控制样式 */
.zoom-controls {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    gap: 10px;
    z-index: 50;
}

.btn-zoom {
    background: #667eea;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-zoom:hover {
    background: #5a6fd8;
    transform: scale(1.1);
}

#zoomLevel {
    font-size: 0.8rem;
    color: #333;
    font-weight: 500;
    margin: 5px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        padding: 12px 15px;
    }
    
    .header h1, .header h2 {
        font-size: 1rem;
    }
    
    .btn-primary {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
        padding: 5px;
    }
    
    .file-item {
        padding: 15px 10px;
    }
    
    .file-icon {
        font-size: 2rem;
    }
    
    .file-name {
        font-size: 0.8rem;
    }
    
    .controls {
        padding: 10px;
        gap: 15px;
    }
    
    .btn-control {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .zoom-controls {
        right: 10px;
        padding: 8px 0;
    }
    
    .btn-zoom {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .file-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .zoom-controls {
        right: 5px;
    }
    
    .btn-zoom {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
}

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

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

/* 触摸反馈 */
@media (hover: none) {
    .file-item:hover {
        transform: none;
    }
    
    .file-item:active {
        transform: scale(0.95);
    }
    
    .btn-primary:active {
        transform: scale(0.95);
    }
    
    .btn-control:active {
        transform: scale(0.95);
    }
}