/* 全局样式 */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --bg-light: #f3f4f6;
    --border-color: #e2e8f0;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
}

/* 动态背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 15% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 25%);
    animation: pulse 8s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M54.627 0l.83.828-1.415 1.415L51.8 0h2.827zM5.373 0l-.83.828L5.96 2.243 8.2 0H5.374zM48.97 0l3.657 3.657-1.414 1.414L46.143 0h2.828zM11.03 0L7.372 3.657 8.787 5.07 13.857 0H11.03zm32.284 0L49.8 6.485 48.384 7.9l-7.9-7.9h2.83zM16.686 0L10.2 6.485 11.616 7.9l7.9-7.9h-2.83zM22.343 0L13.857 8.485 15.272 9.9l7.9-7.9h-.83zm5.657 0L19.514 8.485 20.93 9.9l8.485-8.485h-1.415zM32.686 0L26.2 6.485 27.616 7.9l7.9-7.9h-2.83zm5.657 0L29.857 8.485 31.272 9.9l8.485-8.485h-1.415zM38.343 0L29.857 8.485 31.272 9.9l8.485-8.485h-1.415zm5.657 0L35.514 8.485 36.93 9.9l8.485-8.485h-1.415zM44 0L35.514 8.485 36.93 9.9l8.485-8.485H44zm5.657 0L41.17 8.485l1.415 1.415 7.9-7.9h-1.415zm5.657 0l-7.071 7.071 1.414 1.414L57 0h-1.343zM0 0c1.414.001 2.828.002 4.243.003L0 4.243V0zm0 5.657l5.657-5.657c1.414.001 2.828.002 4.243.003L0 9.9V5.657z' fill='rgba(255,255,255,0.05)' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: 0;
}

@keyframes pulse {
    0% {
        opacity: 0.3;
        transform: scale(1);
    }
    100% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* 全局滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    transition: all 0.3s ease;
}

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

/* 侧边栏基础样式 */
.sidebar {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(99, 102, 241, 0.85));
    width: 240px;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 1000;
    padding: 0.375rem 0;
}

/* CSS Reset for logo */
.sidebar #sidebarLogo,
.sidebar #sidebarLogo *,
.sidebar #sidebarLogo *::before,
.sidebar #sidebarLogo *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

.sidebar #sidebarLogo svg {
    all: unset;
    display: block;
    width: 12px;
    height: 12px;
    margin-right: 0.5rem;
    stroke: currentColor;
    stroke-width: 1;
    fill: none;
    transform: scale(1);
    flex-shrink: 0;
}

/* Logo样式 */
.sidebar #sidebarLogo {
    all: unset;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 1rem 1.125rem;
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    margin-bottom: 0.75rem;
    height: auto;
}

.sidebar #sidebarLogo span {
    all: unset;
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    opacity: 0.95;
    line-height: 1.2;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 搜索框容器 */
.search-container {
    padding: 0.75rem 1rem 1.5rem;
    margin: 0;
    background: transparent;
    transition: all 0.3s ease;
}

.search-container.focused {
    background: transparent;
}

/* 搜索栏 */
.search-bar {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

/* 搜索输入框 */
.search-input {
    width: 100%;
    padding: 1rem 1.25rem 1rem 3rem;
    font-size: 1rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 14px;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.search-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.75;
    font-size: 1rem;
}

.search-input:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.12);
}

/* 搜索图标 */
.search-icon {
    position: absolute;
    left: 1.125rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    opacity: 0.7;
    pointer-events: none;
    transition: all 0.2s ease;
}

.search-input:focus + .search-icon {
    color: var(--primary-color);
    opacity: 1;
}

/* 导航菜单 */
.nav-menu {
    padding: 0 0.375rem;
}

/* 导航项 */
.nav-item {
    display: flex;
    align-items: center;
    padding: 0.875rem 1.125rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.4;
    border-radius: 4px;
    margin: 2px 0;
    transition: all 0.15s ease;
    gap: 1rem;
    white-space: nowrap;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 500;
}

.nav-item span {
    display: block;
    flex: 1;
}

/* 导航图标 */
.nav-icon {
    width: 1.375rem;
    height: 1.375rem;
    flex-shrink: 0;
    opacity: 0.85;
    transition: all 0.15s ease;
}

.nav-item:hover .nav-icon {
    opacity: 1;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

/* 导航分类标题 */
.nav-category {
    padding: 1.5rem 1.5rem 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.75rem;
}

/* 导航列表 */
.nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.5rem 0;
}

/* 导航分组 */
.nav-group {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.nav-group:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

/* 主内容区域 */
.main-content {
    margin-left: 240px;
    padding: 1rem;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
}

/* 分类标题 */
.category-title {
    position: relative;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.75rem 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 1.25rem;
    background: var(--primary-color);
    border-radius: 2px;
    opacity: 0.8;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* 工具卡片网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1.25rem;
    margin: 0 0 2rem 0;
    padding: 0.625rem;
}

/* 工具卡片 */
.tool-card {
    background: rgba(255, 255, 255, 0.85);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    min-height: 165px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.03),
        0 2px 6px rgba(0, 0, 0, 0.02);
}

.tool-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.06),
        0 8px 16px rgba(0, 0, 0, 0.03);
}

/* 卡片头部 */
.tool-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}

.tool-logo {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}

.tool-name {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* 卡片内容 */
.tool-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0 0 0.875rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
    opacity: 0.85;
}

/* 卡片底部 */
.tool-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.875rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.tool-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    max-width: 70%;
}

.tool-tag {
    padding: 0.25rem 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    letter-spacing: 0.01em;
    opacity: 0.75;
    transition: all 0.2s ease;
}

.tool-tag:hover {
    opacity: 0.95;
}

/* 工具链接按钮 */
.tool-link {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    background: rgba(99, 102, 241, 0.12);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid rgba(99, 102, 241, 0.18);
    box-shadow: 
        0 2px 6px rgba(99, 102, 241, 0.04),
        0 1px 3px rgba(99, 102, 241, 0.03);
    letter-spacing: 0.01em;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 80px;
    justify-content: center;
}

.tool-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    border-color: transparent;
    box-shadow: 
        0 4px 10px rgba(99, 102, 241, 0.12),
        0 2px 4px rgba(99, 102, 241, 0.08);
}

/* 搜索结果 */
.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.loading::after {
    content: "";
    width: 2rem;
    height: 2rem;
    border: 2px solid #e2e8f0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.navbar-brand {
    font-weight: bold;
    color: #2c3e50 !important;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,.05);
    transition: transform 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,.1);
}

.card-title {
    color: #2c3e50;
    font-weight: 600;
}

/* 按钮样式 */
.btn-primary {
    background-color: #3498db;
    border-color: #3498db;
}

.btn-primary:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.btn-outline-primary {
    color: #3498db;
    border-color: #3498db;
}

.btn-outline-primary:hover {
    background-color: #3498db;
    border-color: #3498db;
}

/* 搜索框样式 */
.form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* 工具详情页样式 */
#toolLogo {
    max-width: 200px;
    height: auto;
    margin-bottom: 1rem;
}

/* 工具信息样式 */
.tool-info {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
}

.tool-info ul {
    margin-bottom: 0;
}

.tool-info li {
    margin-bottom: 0.5rem;
}

/* 相关工具样式 */
.related-tool-card {
    height: 100%;
}

.related-tool-card .card-body {
    padding: 1rem;
}

.related-tool-card .card-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.related-tool-card .card-text {
    font-size: 0.9rem;
    color: #6c757d;
}

/* 错误消息样式 */
.error-message {
    text-align: center;
    padding: 2rem;
    color: #ef4444;
    background: #fee2e2;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
} 
