/* Category page styles - Version 3.0 */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
}

.category-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 导航栏 */
nav {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* 分类头部 - 满屏设计 */
.category-header-full {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 20px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.category-header-full::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: 200px;
    opacity: 0.3;
}

.category-header-content {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.category-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.category-title {
    flex: 1;
    min-width: 300px;
}

.category-title h1 {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-title p {
    font-size: 18px;
    opacity: 0.95;
    max-width: 600px;
    line-height: 1.8;
}

.category-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.btn-danger {
    background: rgba(220, 53, 69, 0.9);
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(220, 53, 69, 0.5);
}

.btn-danger:hover {
    background: rgba(220, 53, 69, 1);
    transform: translateY(-2px);
}

.category-stats-bar {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
}

.stat-item i {
    font-size: 20px;
    opacity: 0.9;
}

/* 容器 */
.category-container {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    width: 100%;
}

/* 无工具提示 */
.no-tools {
    text-align: center;
    padding: 80px 20px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.no-tools i {
    font-size: 64px;
    color: #bdc3c7;
    margin-bottom: 20px;
}

.no-tools p {
    font-size: 18px;
    color: #7f8c8d;
}

/* 页脚 */
footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 40px 0;
    margin-top: 60px;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 12px;
}

.footer-section ul li a {
    color: #bdc3c7;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-section ul li a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: #bdc3c7;
}

/* 回到顶部按钮 */
.back-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top-btn i {
    color: white;
    font-size: 20px;
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.back-to-top-btn:active {
    transform: translateY(-2px);
}

/* 返回工具集列表按钮 */
.back-to-categories-btn {
    position: fixed;
    bottom: 90px;
    right: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
    text-decoration: none;
}

.back-to-categories-btn i {
    color: white;
    font-size: 20px;
}

.back-to-categories-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.back-to-categories-btn:active {
    transform: translateY(-2px);
}

/* 动画 */
@keyframes slideOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 工具网格覆盖tool.css的设置，使用更灵活的响应式布局 */
.tools-grid-v2 {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.tools-grid-v2 .tool-card-v2 {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .category-header-full {
        padding: 40px 15px;
    }

    .category-title h1 {
        font-size: 28px;
    }

    .category-title p {
        font-size: 16px;
    }

    .category-actions {
        width: 100%;
    }

    .category-actions .btn {
        flex: 1;
        justify-content: center;
    }

    .category-stats-bar {
        gap: 20px;
    }

    .stat-item {
        font-size: 14px;
    }

    .category-container {
        padding: 30px 15px;
    }

    .tools-grid-v2 {
        gap: 16px;
    }

    .back-to-categories-btn, .back-to-top-btn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .back-to-categories-btn {
        bottom: 75px;
    }
}

/* 子工具集容器样式 */
.sub-categories-container {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid #e0e0e0;
}

.sub-categories-title {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sub-categories-title i {
    color: #667eea;
}

/* 子工具集区块样式 */
.sub-category-section {
    margin-bottom: 40px;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
}

.sub-category-section:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.sub-category-header-bar {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecef 100%);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.sub-category-title {
    font-size: 20px;
    color: #2c3e50;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.sub-category-title i {
    color: #667eea;
}

.sub-category-count {
    font-size: 14px;
    color: #7f8c8d;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sub-category-count i {
    color: #667eea;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* 第一级子工具集 */
.sub-category-level-1 {
    border-left: 4px solid #667eea;
}

.sub-category-level-1 .sub-category-header-bar {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

/* 第二级子工具集 */
.sub-category-level-2 {
    margin: 20px 24px;
    border-left: 4px solid #764ba2;
    background-color: #fafafa;
}

.sub-category-level-2 .sub-category-header-bar {
    background: linear-gradient(135deg, #764ba210 0%, #667eea10 100%);
    padding: 16px 20px;
}

.sub-category-level-2 .sub-category-title {
    font-size: 18px;
}

.sub-category-level-2 .tools-grid-v2 {
    padding: 20px;
}

/* 子工具集内的工具网格 */
.sub-category-section > .tools-grid-v2 {
    padding: 24px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .sub-categories-container {
        margin-top: 40px;
        padding-top: 30px;
    }

    .sub-categories-title {
        font-size: 24px;
    }

    .sub-category-header-bar {
        padding: 16px 20px;
    }

    .sub-category-title {
        font-size: 18px;
    }

    .sub-category-level-2 {
        margin: 16px 20px;
    }

    .sub-category-level-2 .sub-category-header-bar {
        padding: 14px 16px;
    }

    .sub-category-level-2 .sub-category-title {
        font-size: 16px;
    }

    .sub-category-section > .tools-grid-v2,
    .sub-category-level-2 .tools-grid-v2 {
        padding: 16px;
    }
}

/* ==================== 快速导航栏样式 ==================== */

/* 主布局 */
.main-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    padding: 40px 60px;
    width: 100%;
}

/* 快速导航栏 */
.quick-nav {
    position: sticky;
    top: 20px;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    z-index: 100;
    transition: all 0.3s ease;
    align-self: start;
}

.quick-nav.collapsed {
    width: 60px;
    padding: 15px 10px;
}

.quick-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.quick-nav-title {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
}

.quick-nav.collapsed .quick-nav-title {
    display: none;
}

.toggle-nav-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.toggle-nav-btn:hover {
    background: #764ba2;
    transform: rotate(180deg);
}

.quick-nav-section {
    margin-bottom: 25px;
}

.quick-nav-section:last-child {
    margin-bottom: 0;
}

.quick-nav-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-left: 5px;
}

.quick-nav.collapsed .quick-nav-section-title {
    display: none;
}

.quick-nav-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s ease;
}

.quick-nav.collapsed .quick-nav-items {
    gap: 5px;
}

.quick-nav-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    white-space: nowrap;
    text-decoration: none;
}

.quick-nav.collapsed .quick-nav-item {
    padding: 10px;
    justify-content: center;
}

.quick-nav-item:hover {
    background: #f0f2f5;
    color: #667eea;
}

.quick-nav-item.active {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    color: #667eea;
    font-weight: 500;
    border-left: 3px solid #667eea;
}

.quick-nav-item i {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.quick-nav-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-nav.collapsed .quick-nav-item span,
.quick-nav.collapsed .quick-nav-item .count {
    display: none;
}

.quick-nav-item .count {
    background: #e3f2fd;
    color: #2196F3;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.quick-nav-item.active .count {
    background: #667eea;
    color: white;
}

/* 内容区域 */
.content-area {
    flex: 1;
    min-width: 0;
    width: 100%;
}

.category-section {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 3px solid #667eea;
}

.category-header h2 {
    font-size: 1.5rem;
    color: #333;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

.category-header h2 i {
    color: #667eea;
}

.category-description {
    color: #666;
    font-size: 0.95rem;
    margin-left: auto;
}

/* 子工具集容器调整 */
.sub-categories-container {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .quick-nav {
        position: static;
        margin-bottom: 20px;
        max-height: none;
    }

    .quick-nav.collapsed {
        width: auto;
        padding: 20px;
    }

    .quick-nav.collapsed .quick-nav-title {
        display: block;
    }

    .quick-nav.collapsed .quick-nav-item span,
    .quick-nav.collapsed .quick-nav-item .count {
        display: inline;
    }

    .quick-nav-items {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .toggle-nav-btn {
        display: none;
    }
    
    .category-container {
        display: none;
    }
}

@media (max-width: 768px) {
    .main-layout {
        padding: 20px 15px;
        gap: 20px;
    }
    
    .category-section {
        padding: 20px;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .category-header h2 {
        font-size: 1.3rem;
    }
    
    .category-description {
        margin-left: 0;
    }
}

/* 子菜单样式 */
.quick-nav-item {
    position: relative;
}

.sub-category-menu {
    position: absolute;
    left: 100%;
    top: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 10px 0;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.quick-nav-item:hover .sub-category-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.sub-category-menu-item {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.sub-category-menu-item:hover {
    background: #f0f2f5;
    color: #667eea;
}

.sub-category-menu-item i {
    font-size: 0.8rem;
    color: #999;
}

.sub-category-menu-item .count {
    background: #e3f2fd;
    color: #2196F3;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: auto;
}

/* 折叠状态下不显示下拉菜单 */
.quick-nav.collapsed .sub-category-menu {
    display: none;
}
