/* 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%;
}

/* 工具网格 - 响应式布局 */
.tools-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* 工具卡片 */
.tool-card-v2 {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #f0f0f0;
}

.tool-card-v2:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.tool-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.tool-icon-v2 {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.favicon-container {
    width: 100%;
    height: 100%;
}

.favicon-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tool-info {
    flex: 1;
    min-width: 0;
}

.tool-info h4 {
    font-size: 18px;
    margin-bottom: 6px;
    color: #2c3e50;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-info .tool-url {
    font-size: 13px;
    color: #95a5a6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tool-description {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 16px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.tool-stats-group {
    display: flex;
    gap: 16px;
    align-items: center;
}

.tool-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #7f8c8d;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 6px 10px;
    border-radius: 6px;
}

.tool-stats:hover {
    color: #667eea;
    background-color: rgba(102, 126, 234, 0.1);
}

.tool-edit-actions {
    display: none;
}

/* 无工具提示 */
.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-card-v2 {
    animation: fadeInUp 0.5s ease forwards;
}

/* 响应式设计 */
@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 {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .tool-card-v2 {
        padding: 20px;
    }

    .back-to-categories-btn, .back-to-top-btn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .back-to-categories-btn {
        bottom: 75px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .tools-grid-v2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) and (max-width: 1399px) {
    .tools-grid-v2 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .tools-grid-v2 {
        grid-template-columns: repeat(4, 1fr);
    }
}