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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏样式 */
.sidebar {
    width: 280px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

.logo {
    padding: 30px 20px;
    background: rgba(0,0,0,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 300;
}

.nav ul {
    list-style: none;
    padding: 20px 0;
}

.nav li {
    margin-bottom: 5px;
}

.nav a {
    display: block;
    padding: 15px 25px;
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.nav a:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border-left-color: #3498db;
}

.nav a.nav-active {
    background: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border-left-color: #3498db;
}

/* 主内容区样式 */
.main-content {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.search-header {
    background: white;
    padding: 25px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-bottom: 1px solid #eee;
}

.search-box {
    display: flex;
    margin-bottom: 15px;
    max-width: 800px;
}

#search-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px 0 0 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#search-input:focus {
    outline: none;
    border-color: #3498db;
}

#search-btn {
    padding: 14px 30px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

#search-btn:hover {
    background: linear-gradient(135deg, #2980b9, #2573a7);
    transform: translateY(-1px);
}

.filters select {
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

/* 数据统计区域 */
.data-section {
    background: white;
    margin: 20px;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.data-info {
    text-align: center;
    padding: 20px;
}

.data-info h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.data-info p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* 搜索结果样式 */
.results-section {
    flex: 1;
    padding: 0 30px 30px;
}

.results-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

.results-container h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 1.3rem;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 15px;
}

.image-result {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
    overflow: hidden;
}

.image-result:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #3498db;
}

.image-thumbnail {
    width: 100%;
    height: 180px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.image-thumbnail img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.image-result:hover .image-thumbnail img {
    transform: scale(1.05);
}

/* 缩略图错误状态 */
.thumbnail-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
    color: #e74c3c;
}

.error-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.error-text {
    font-size: 14px;
}

.image-info {
    text-align: center;
}

.image-info h4 {
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-keywords {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.keyword-tag {
    display: inline-block;
    background: #ecf0f1;
    color: #34495e;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.keyword-tag:hover {
    background: #3498db;
    color: white;
    transform: scale(1.05);
}

/* 复制内容按钮样式 */
.copy-content-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: background 0.3s;
}

.copy-content-btn:hover {
    background: #219653;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: transparent;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.close-btn {
    color: white;
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.close-btn:hover {
    background: rgba(231, 76, 60, 0.8);
}

.modal-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    padding: 20px 30px;
    z-index: 10;
}

.modal-header h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 300;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 100px;
}

.image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    animation: zoomIn 0.3s ease;
}

.nav-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 10;
}

.nav-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(52, 152, 219, 0.9);
    border-color: #3498db;
    transform: scale(1.1);
}

/* 计数器样式 */
.counter {
    color: white;
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

.image-error {
    text-align: center;
    color: #e74c3c;
    font-size: 1.2rem;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-style: italic;
}

.error-message {
    background: #e74c3c;
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
    }
    
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .close-btn {
        top: 10px;
        right: 15px;
        font-size: 30px;
        width: 40px;
        height: 40px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .image-container {
        padding: 70px 15px 80px;
    }
    
    .nav-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .counter {
        font-size: 1rem;
    }
}

/*added */
/* 大图查看器样式 */
.image-viewer-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}

.image-viewer-container.grabbing {
    cursor: grabbing;
}

.image-zoom-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
}

.image-zoom-container img {
    max-width: none;
    max-height: none;
    object-fit: contain;
    pointer-events: none;
}

/* 缩放控制按钮 */
.zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 8px;
}

.zoom-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.zoom-btn:hover {
    background: white;
    transform: scale(1.1);
}

.zoom-level {
    color: white;
    text-align: center;
    font-size: 14px;
    margin-top: 5px;
}

/* 重置按钮 */
.reset-btn {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
}

.reset-btn:hover {
    background: rgba(52, 152, 219, 0.9);
}

/* 导航控制 */
.nav-controls {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    z-index: 10;
}

.nav-btn {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(52, 152, 219, 0.9);
    border-color: #3498db;
    transform: scale(1.1);
}

/* 图片计数器 */
.image-counter {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
}

/* 添加建议项的悬停样式 */
.suggestion-item {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
    position: relative;
}

.suggestion-item:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

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

.suggestion-header strong {
    font-size: 1rem;
    font-weight: 600;
}

.suggestion-type {
    font-size: 0.75em;
    background: #e74c3c;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.suggestion-item:hover .suggestion-type {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}
.suggestion-file {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-left: 8px;
}

.suggestion-content {
    font-size: 0.9em;
    opacity: 0.8;
    margin-bottom: 5px;
    line-height: 1.4;
}

.suggestion-item:hover .suggestion-content {
    opacity: 1;
}

.suggestion-score {
    font-size: 0.8em;
    color: #7f8c8d;
    text-align: right;
}

.suggestion-item:hover .suggestion-score {
    color: rgba(255, 255, 255, 0.8);
}

/* 搜索结果容器样式 */
#fuzzy-suggestions {
    display: grid;
    gap: 12px;
    margin-top: 15px;
}

/* 无结果样式 */
.no-results {
    text-align: center;
    padding: 30px;
    color: #7f8c8d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

/* 添加点击搜索文件的提示 */
.suggestion-hint {
    font-size: 0.8em;
    color: #7f8c8d;
    margin-top: 5px;
    font-style: italic;
}

.suggestion-item:hover .suggestion-hint {
    color: rgba(255, 255, 255, 0.8);
}

/* 模糊搜索建议容器 */
.fuzzy-suggestions-container {
    margin-top: 20px;
}

.suggestion-section {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.suggestion-section h4 {
    margin: 0 0 12px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

/* 关键词建议按钮 */
.keyword-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.keyword-suggestion-btn {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    color: #1976d2;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.keyword-suggestion-btn:hover {
    background: #bbdefb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 建议项操作按钮 */
.suggestion-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.suggestion-action-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-action-btn:hover {
    background: #e9ecef;
    color: #495057;
}

/* 作者过滤样式 */
.filters {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

#filter-author {
    min-width: 200px;
    height: 35px;
}

#select-all-authors, #clear-authors {
    padding: 5px 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

#select-all-authors:hover, #clear-authors:hover {
    background: #0056b3;
}

/* 图片作者信息样式 */
.image-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.image-author {
    font-size: 12px;
    color: #666;
    font-style: italic;
}