/* 全局样式 */
:root {
    --primary-color: #2563eb;
    --secondary-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --border-radius: 8px;
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #374151;
    background: linear-gradient(-45deg, #667eea, #764ba2, #4facfe, #00f2fe, #6a5acd, #9370db);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
    padding-top: 80px;
    min-height: 100vh;
}

@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 导航栏样式 */
.navbar {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: #fff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff !important;
}

/* 英雄区域样式 */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::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 1000 1000"><polygon fill="rgba(255,255,255,0.05)" points="0,0 1000,300 1000,1000 0,700"/></svg>');
    background-size: cover;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.min-vh-50 {
    min-height: 50vh;
}

.hero-search .input-group {
    max-width: 500px;
}

.hero-stats > div {
    text-align: center;
}

.hero-stats h3 {
    font-weight: 700;
    color: #fbbf24;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: var(--box-shadow-lg);
    transform: translateY(-2px);
}

/* 侧边栏基础样式 */
.sidebar {
    padding: 0;
    transition: all 0.3s ease;
}

.sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.sidebar-content::-webkit-scrollbar {
    width: 4px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.sidebar-header h6 {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.sidebar-header small {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
}

.category-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.2rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 0.9rem;
}

.category-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.category-nav .nav-link.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.4), rgba(147, 51, 234, 0.4));
    color: #fff;
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.2);
    font-weight: 600;
    transform: translateX(4px);
}

.category-nav .nav-link .badge {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
}

.category-section {
    scroll-margin-top: 80px;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.category-section h2 {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 工具卡片 */
.tool-card {
    transition: all 0.3s ease;
}

.tool-card:hover {
    border-color: var(--primary-color);
}

.tool-icon {
    border-radius: 4px;
    object-fit: cover;
}

/* 布局确保 */
.container-fluid {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100%;
}

.row {
    margin-left: -15px;
    margin-right: -15px;
}

[class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
    position: relative;
}

/* 响应式侧边栏 */
@media (min-width: 768px) {
    .sidebar {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.10);
        border-radius: 10px;
        box-shadow: none;
        position: fixed;
        top: 70px;
        left: 20px;
        transform: none;
        width: 220px;
        max-height: calc(100vh - 100px);
        z-index: 1000;
        overflow: hidden;
        transition: all 0.3s ease;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .sidebar-content {
        position: relative;
        height: 100%;
        overflow-y: auto;
        padding: 1.2rem 0.8rem;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
        transition: opacity 0.3s ease;
    }
    
    .main-content {
        background: transparent;
        border: none;
        box-shadow: none;
        margin-left: 250px;
        margin-right: 20px;
        margin-top: 70px;
        margin-bottom: 20px;
        padding: 0.5rem 0.5rem 1.5rem 0.5rem;
        min-height: 100vh;
    }
}

@media (max-width: 767px) {
    .sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
        margin: 10px;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 12px;
    }
    
    .sidebar-content {
        position: static;
        max-height: none;
        overflow-y: visible;
        padding: 0;
    }
    
    .sidebar-header {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .main-content {
        margin: 10px;
        padding: 1rem;
        background: transparent;
        border: none;
        box-shadow: none;
        padding-top: 80px;
    }
    
    .category-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
        max-height: 200px;
        overflow-y: auto;
    }
    
    .category-nav .nav-link {
        margin-right: 0;
        margin-bottom: 0;
        flex-shrink: 0;
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        white-space: nowrap;
    }
    
    .category-section {
        margin-bottom: 2rem;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.06);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .sidebar {
        padding: 1.5rem 0.75rem;
        margin: 8px;
    }
    
    .main-content {
        padding: 1.5rem;
        margin: 8px;
    }
}

/* 分类卡片 */
.category-card {
    border-left: 4px solid var(--primary-color);
}

.category-card .card-body {
    padding: 2rem 1.5rem;
}

.category-icon i {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* 工具卡片简化效果 */
.tool-card {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.tool-card:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.2) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.08) !important;
}

.tool-card .card-title {
    color: #fff;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.tool-card.featured .card-title {
    color: #ffd700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.tool-card .card-text {
    color: rgba(255, 255, 255, 0.95);
}

.tool-card .badge {
    background: rgba(255, 193, 7, 0.8) !important;
    color: #000;
    font-weight: 500;
}

.tool-card small {
    color: rgba(255, 255, 255, 0.9);
}

.tool-card .btn-outline-primary {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.tool-card .btn-outline-primary:hover {
    background: rgba(37, 99, 235, 0.8);
    border-color: rgba(37, 99, 235, 0.8);
    color: #fff;
    transform: scale(1.05);
}

.tool-icon {
    border-radius: 4px;
    object-fit: cover;
}

/* 渐变背景 */
.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 按钮样式 */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-1px);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
    color: white;
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

/* 徽章样式 */
.badge {
    border-radius: 20px;
    font-weight: 500;
}

.badge.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

/* 列表组样式 */
.list-group-item {
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.list-group-item:hover {
    border-left-color: var(--primary-color);
    background-color: #f8fafc;
}

/* 表单样式 */
.form-control {
    border-radius: var(--border-radius);
    border: 1px solid #d1d5db;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-group .form-control {
    border-right: none;
}

.input-group .btn {
    border-left: none;
}

/* 搜索结果样式 */
.search-results .card {
    border-left: 3px solid var(--primary-color);
}

/* 页脚样式 */
footer {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
}

footer .social-links a {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

footer .social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    
    .hero-section {
        padding: 3rem 0;
    }
    
    .display-4 {
        font-size: 2rem;
    }
    
    .hero-stats {
        justify-content: space-around;
        margin-top: 2rem;
    }
    
    .category-card .card-body {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 576px) {
    .hero-search .input-group {
        flex-direction: column;
    }
    
    .hero-search .btn {
        border-radius: var(--border-radius);
        margin-top: 0.5rem;
    }
    
    .tool-card .card-body {
        padding: 1rem;
    }
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 加载动画 */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.875rem;
}

/* 面包屑样式 */
.breadcrumb {
    background-color: transparent;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--primary-color);
}

/* 分页样式 */
.page-link {
    border-radius: var(--border-radius);
    border: 1px solid #d1d5db;
    color: var(--primary-color);
    margin: 0 2px;
}

.page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}
