/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding: 0;
    background-color: #f0f0f0;
    padding-bottom: 60px; /* 为分页控件留出空间 */
}

/* 导航栏样式 */
.navbar {
    background-color: #333;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    z-index: 50;
    position: relative;
}

.logo {
    font-size: 20px;
    font-weight: bold;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-links a.active,
.nav-links a:hover {
    background-color: #555;
}

/* 分类导航样式 */
.category-nav {
    background-color: white;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.category-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 8px 15px;
    background-color: #f0f0f0;
    color: #333;
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.3s;
    font-size: 14px;
}

.category-btn:hover {
    background-color: #ddd;
}

.category-btn.active {
    background-color: #4CAF50;
    color: white;
}

/* 当前分类信息 */
.current-category-info {
    padding: 0 20px 15px;
    color: #333;
}

/* 上传按钮样式 */
.upload-btn {
    position: fixed;
    right: 30px;
    top: 80px;
    width: 60px;
    height: 60px;
    background-color: #4CAF50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
    transition: transform 0.3s ease;
}

.upload-btn:hover {
    transform: scale(1.1);
}

/* 上传界面样式 */
.upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.upload-container {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.form-group {
    margin-bottom: 15px;
}

.category-select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 16px;
}

.upload-hint {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
    font-style: italic;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #888;
}

.close-btn:hover {
    color: #333;
}

.upload-container h2 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.upload-container input[type="file"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.upload-container button {
    width: 100%;
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.upload-container button:hover {
    background-color: #45a049;
}

/* 分页信息 */
.pagination-info {
    text-align: center;
    padding: 15px 0;
    color: #666;
    font-size: 14px;
}

/* 图片网格样式 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 0;
    margin: 0;
    padding: 0;
    justify-items: stretch;
}

.image-item {
    width: 100%;
    height: 520px;
    overflow: hidden;
    border: none;
    padding: 0;
    margin: 0;
    transition: transform 0.3s ease;
    cursor: pointer;
    position: relative;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

/* 图片分类标签 */
.image-category-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 5;
}

/* 鼠标悬浮放大效果 */
.image-item:hover {
    transform: scale(1.03);
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.image-item:hover img {
    transform: scale(1.05);
}

/* 无图片提示 */
.no-images {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 0;
    color: #666;
    font-size: 18px;
}

/* 分页控件样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0 20px;
    flex-wrap: wrap;
    padding: 0 10px;
}

.pagination-btn {
    padding: 8px 15px;
    background-color: #333;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-btn:hover {
    background-color: #555;
}

.pagination-num {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
}

.pagination-num:hover {
    background-color: #eee;
}

.pagination-num.active {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
}

.pagination-ellipsis {
    color: #666;
    padding: 0 5px;
}

/* 幻灯片样式 */
.slideshow-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.slideshow-modal.active {
    display: flex;
}

.slideshow-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    height: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.slideshow-content {
    max-width: 100%;
    max-height: 80vh;
}

.slideshow-content img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.slideshow-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
}

.slideshow-prev, .slideshow-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 20px;
    transition: 0.3s;
}

.slideshow-prev {
    left: 0;
}

.slideshow-next {
    right: 0;
}

.slideshow-prev:hover, .slideshow-next:hover {
    background-color: rgba(0, 0, 0, 0.5);
}

.slideshow-caption {
    color: white;
    font-size: 16px;
    padding: 10px;
    text-align: center;
    margin-top: 10px;
}

.slideshow-counter {
    color: white;
    font-size: 14px;
    position: absolute;
    top: -40px;
    left: 0;
}

.slideshow-download {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s;
}

.slideshow-download:hover {
    background-color: #45a049;
}

/* 管理页面样式 */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.admin-title {
    text-align: center;
    margin: 20px 0 30px;
}

/* 分类管理样式 */
.category-management {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.category-actions {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.add-category-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.category-operation-forms {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.category-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.category-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    flex: 1;
    min-width: 150px;
}

.add-category-btn, .delete-category-btn, .rename-category-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.add-category-btn {
    background-color: #4CAF50;
    color: white;
}

.delete-category-btn {
    background-color: #f44336;
    color: white;
    width: 200px;
    height: 35px;
}

.rename-category-btn {
    background-color: #2196F3;
    color: white;
	width: 250px;
    height: 35px;
}

/* 图片筛选样式 */
.image-filter {
    margin-bottom: 20px;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 管理表格样式 */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.admin-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.admin-table tr:hover {
    background-color: #f5f5f5;
}

.admin-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.edit-btn {
    background-color: #2196F3;
    color: white;
}

.delete-btn {
    background-color: #f44336;
    color: white;
}

.edit-btn:hover {
    background-color: #0b7dda;
}

.delete-btn:hover {
    background-color: #d32f2f;
}

.rename-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.rename-input {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 200px;
}

/* 批量操作按钮 */
.bulk-actions {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
}

.move-to-category {
    display: flex;
    gap: 10px;
    align-items: center;
}

.move-category-btn {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
	width: 250px;
    height: 35px;
}

.move-category-btn:hover {
    background-color: #e68900;
}

.bulk-delete-btn, .extract-links-btn {
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.bulk-delete-btn {
    background-color: #f44336;
    color: white;
}

.bulk-delete-btn:hover {
    background-color: #d32f2f;
}

.extract-links-btn {
    background-color: #2196F3;
    color: white;
}

.extract-links-btn:hover {
    background-color: #0b7dda;
}

/* 链接提取结果样式 */
.links-result {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.links-result h3 {
    margin-bottom: 15px;
    color: #333;
}

.links-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.link-item {
    display: flex;
    gap: 10px;
    align-items: center;
}

.link-item input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copy-link-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}

.copy-link-btn:hover {
    background-color: #45a049;
}

.copy-all-btn-container {
    text-align: right;
}

.copy-all-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.copy-all-btn:hover {
    background-color: #45a049;
}

/* 密码表单样式 */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.login-title {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
}

.password-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.password-input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.login-btn {
    padding: 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.login-btn:hover {
    background-color: #45a049;
}

.error-message {
    color: #f44336;
    text-align: center;
    padding: 10px;
}

.checkbox-cell {
    width: 30px;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .admin-table th:nth-child(4),
    .admin-table td:nth-child(4) {
        display: none;
    }
}

@media (max-width: 768px) {
    .admin-table th:nth-child(2),
    .admin-table th:nth-child(5),
    .admin-table td:nth-child(2),
    .admin-table td:nth-child(5) {
        display: none;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
    
    .image-item {
        height: 260px;
    }
    
    .slideshow-prev, .slideshow-next {
        font-size: 24px;
        padding: 10px;
    }
    
    .slideshow-close {
        font-size: 30px;
    }
    
    .pagination-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .pagination-num {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .bulk-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .link-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .link-item input {
        width: 100%;
    }
    
    .copy-link-btn {
        width: 100%;
    }
    
    .category-operation-forms {
        flex-direction: column;
    }
    
    .category-form {
        width: 100%;
    }
}

@media (max-width: 400px) {
    .image-grid {
        grid-template-columns: 1fr;
    }
    
    .image-item {
        width: 100%;
        height: auto;
        aspect-ratio: 340/520;
    }
    
    .admin-actions {
        flex-direction: column;
    }
    
    .slideshow-download {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .pagination-btn {
        padding: 5px 10px;
        font-size: 13px;
    }
    
    .add-category-form {
        flex-direction: column;
        align-items: stretch;
    }
	
	/* 分类管理一行显示样式 */
.category-actions-container {
    width: 100%;
    overflow-x: auto; /* 允许在小屏幕上横向滚动 */
    padding-bottom: 10px;
}

.category-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    min-width: max-content; /* 确保内容不被压缩 */
}

.add-category-form, .category-operation-forms, .image-filter {
    flex: 1;
    min-width: 300px; /* 每个表单的最小宽度 */
}

.category-operation-forms {
    display: flex;
    gap: 15px;
    flex: 2;
}

.category-form {
    flex: 1;
    min-width: 280px;
}

/* 调整按钮和输入框的尺寸以适应一行显示 */
.category-input {
    padding: 8px 12px;
    min-width: 150px;
}

.category-select {
    padding: 8px 12px;
    min-width: 180px;
}

.add-category-btn, .delete-category-btn, .rename-category-btn {
    white-space: nowrap; /* 防止按钮文字换行 */
}

/* 确保logo和分类导航在同一行 */
.logo-container {
    display: flex;
    align-items: center;
    gap: 15px; /* 调整logo与分类导航的间距 */
    flex: 1;
    min-width: 0; /* 允许容器收缩 */
    white-space: nowrap; /* 防止整体换行 */
}

.logo {
    font-size: 20px;
    font-weight: bold;
    white-space: nowrap; /* 确保logo文字不换行 */
}

/* 分类导航样式优化 */
.category-nav-mini {
    flex: 1;
    overflow-x: auto; /* 分类过多时可横向滚动 */
    padding: 5px 0;
    max-width: calc(100% - 150px); /* 限制最大宽度，确保不会挤压logo */
}

.category-buttons {
    display: flex;
    gap: 10px; /* 分类按钮之间的间距 */
    min-width: max-content; /* 确保按钮不被压缩 */
}

.category-btn {
    padding: 6px 12px;
    font-size: 14px;
    white-space: nowrap; /* 防止分类名称换行 */
}

/* 导航栏整体样式 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    flex-wrap: nowrap; /* 关键：防止导航栏内容换行 */
}

/* 右侧导航链接 */
.nav-links {
    display: flex;
    gap: 15px;
    white-space: nowrap; /* 防止导航文字换行 */
    margin-left: 10px;
}

/* 响应式调整 */
@media (max-width: 992px) {
    .category-nav-mini {
        max-width: calc(100% - 120px);
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap; /* 小屏幕下允许换行 */
    }
    
    .logo-container {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .category-nav-mini {
        max-width: none;
        width: 100%;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }
}
}
    