/* ========================================
   AI Navigator Pro - 专业智能工具导航
   设计理念：简洁、专业、数据驱动、视觉优化
   ======================================== */

/* CSS 变量定义 */
:root {
    /* 默认浅色主题 - 更清新的配色 */
    --bg-body: #f5f7fa;
    --bg-card: #FFFFFF;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #a0aec0;
    --border-color: #e2e8f0;
    --accent-blue: #3b82f6;
    --accent-purple: #7c3aed;
    --accent-pink: #ec4899;
    --accent-orange: #f97316;
    --accent-green: #10b981;
    --accent-cyan: #06b6d4;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.15);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --border-radius: 10px;
    --border-radius-sm: 6px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-2xl: 32px;
}

/* 黑夜模式 */
.dark-mode {
    --bg-body: #0f172a !important;
    --bg-card: #1e293b !important;
    --bg-secondary: #0f3460;
    --bg-tertiary: #1a1a2e;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 12px 32px rgba(0, 0, 0, 0.6);
}

/* 重置样式 */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color var(--transition-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   头部导航样式
   ======================================== */
.header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    z-index: 1000;
    transition: all var(--transition-normal);
}

.dark-mode .header {
    background: rgba(30, 41, 59, 0.9);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    padding: 0 var(--spacing-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
    animation: logoPulse 3s ease-in-out infinite;
}

.logo-icon svg {
    width: 32px;
    height: 32px;
    display: block;
}

@keyframes logoPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
    }

    50% {
        filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.8));
    }
}

.logo-text {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo-text-link {
    text-decoration: none;
    color: inherit;
}

/* 搜索框样式 */
.search-container {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.search-input {
    width: 100%;
    height: 38px;
    padding: 0 16px 0 42px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--bg-card);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.6;
}

/* 导航链接 */
.nav-links {
    display: flex;
    gap: var(--spacing-xl);
    flex-shrink: 0;
}

.nav-link {
    position: relative;
    padding: 8px 0;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 17px;
    font-weight: 600;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-purple));
    border-radius: 2px;
    transition: width var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-blue);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    background: var(--bg-body);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

/* 设置按钮 */
.settings-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-body);
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.settings-btn:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
}

.settings-btn:hover svg {
    color: white;
}

.settings-btn svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

/* ========================================
   设置面板样式
   ======================================== */
.settings-panel {
    position: fixed;
    top: 0;
    right: -340px;
    width: 320px;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    z-index: 2000;
    transition: right var(--transition-normal);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
}

.settings-panel.open {
    right: 0;
}

.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.settings-overlay.show {
    opacity: 1;
    visibility: visible;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.settings-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    width: 32px;
    height: 32px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.setting-section {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.setting-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

/* 布局选项 */
.layout-options {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--spacing-sm);
}

.layout-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    background: var(--bg-body);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.layout-btn:hover {
    border-color: var(--accent-blue);
}

.layout-btn.active {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
}

.layout-icon {
    font-size: 18px;
    color: var(--text-secondary);
}

.layout-btn.active .layout-icon {
    color: var(--accent-blue);
}

.layout-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.layout-desc {
    font-size: 10px;
    color: var(--text-muted);
}

/* 模式切换 */
.mode-toggle {
    display: flex;
    gap: var(--spacing-sm);
}

.mode-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: var(--bg-body);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mode-btn:hover {
    border-color: var(--accent-blue);
}

.mode-btn.active {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-blue);
}

.mode-icon {
    font-size: 16px;
}

/* 颜色选择器 */
.color-palette {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-sm);
}

.color-btn {
    aspect-ratio: 1;
    border: 3px solid transparent;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.color-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.color-btn.active {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* 重置按钮样式 */
.reset-btn {
    width: 100%;
    padding: 12px;
    background: #fff0f0;
    border: 1px solid #ffcccc;
    border-radius: var(--border-radius-sm);
    color: #e74c3c;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--transition-normal);
}

.reset-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    transform: translateY(-2px);
}

.reset-icon {
    font-size: 16px;
    font-weight: bold;
}

/* ========================================
   侧边栏样式
   ======================================== */
.sidebar {
    position: fixed;
    left: 0;
    top: 56px;
    bottom: 0;
    width: 220px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(12px);
    overflow-y: auto;
    z-index: 100;
    transition: transform var(--transition-normal);
}

.dark-mode .sidebar {
    background: rgba(30, 41, 59, 0.88);
}

.sidebar-header {
    padding: var(--spacing-md) var(--spacing-lg);
}

.sidebar-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.category-nav {
    padding: 8px;
    font-family: 'Microsoft YaHei', 'Segoe UI', 'PingFang SC', sans-serif;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition-fast);
    margin-bottom: 2px;
}

.category-link .category-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.category-link:hover {
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-blue);
}

.category-link.active {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue);
    border-left: 3px solid var(--accent-blue);
}

.category-count {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--bg-body);
    border-radius: 10px;
    font-size: 11px;
    color: var(--text-muted);
    display: none;
}

/* 二级分类展开样式 */
.category-item {
    position: relative;
}

.category-item.has-subcategories .category-link {
    cursor: pointer;
}

.category-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform var(--transition-fast);
    opacity: 0.6;
}

.category-item.expanded .category-arrow {
    transform: rotate(180deg);
}

.subcategories-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

.category-item.expanded .subcategories-list {
    max-height: 500px;
}

.subcategory-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 6px 28px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    transition: all var(--transition-fast);
    border-left: 2px solid transparent;
}

.subcategory-link:hover {
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
}

.subcategory-icon {
    font-size: 10px;
    opacity: 0.6;
}

.subcategory-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-secondary);
}

/* 子分类标题锚点的滚动偏移，避免被头部遮挡 */
.subcategory-title {
    scroll-margin-top: 120px;
}

/* ========================================
   收藏区域样式 - 全新设计
   ======================================== */
.favorites-section {
    display: none;
    margin-bottom: 12px;
    /* 减小下边距 */
    padding: 12px;
    /* 减小内边距 */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.favorites-section.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.favorites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    /* 减小间距 */
    padding-bottom: 6px;
    /* 减小间距 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.favorites-header h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #FFFFFF;
}

.favorites-header h2::before {
    content: '★';
    display: inline-block;
    color: #FACC15;
    font-size: 16px;
}

.favorites-count {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: #FFFFFF;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.favorites-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    align-content: flex-start;
}

.favorites-grid .tool-card {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    width: auto;
    flex-shrink: 0;
}

.favorites-grid .tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.favorites-grid .tool-header {
    gap: 8px;
    margin-bottom: 0;
    align-items: center;
}

.favorites-grid .tool-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 10px;
}

.favorites-grid .tool-icon img {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: cover;
}

.favorites-grid .tool-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 0;
}

.favorites-grid .tool-desc {
    display: none;
}

.favorites-grid .favorite-btn {
    width: 16px;
    height: 16px;
    top: 2px;
    right: 2px;
    background: rgba(239, 68, 68, 0.1);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.favorites-grid .tool-card:hover .favorite-btn {
    opacity: 1;
}

.favorites-grid .favorite-btn svg {
    width: 10px;
    height: 10px;
}

.dark-mode .favorites-grid .tool-name {
    color: #1a202c;
}

/* ========================================
   主内容区样式
   ======================================== */
.main-content {
    margin-left: 220px;
    padding: 0 var(--spacing-xl) 100px;
    min-height: 100vh;
}

.hero-container {
    display: flex;
    gap: 20px;
    margin-bottom: var(--spacing-xl);
    align-items: stretch;
    max-width: 100%;
}

.hero-section {
    flex: 1;
    min-width: 0;
    margin-bottom: 0 !important;
    text-align: center !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-xl);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.hero-news {
    flex: 0 1 auto;
    width: auto;
    min-width: 320px;
    max-width: 55%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
}

.news-grid-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 2px;
}

.news-list a {
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    transition: color var(--transition-fast);
}

.news-list a:hover {
    color: var(--accent-blue);
}

.news-grid-layout li {
    border-bottom: 1px dashed var(--border-color) !important;
    min-width: 0;
    /* 重要：允许内容在 Grid 中缩减以触发省略号 */
}

.news-grid-layout li:nth-last-child(-n+2) {
    border-bottom: none !important;
}

.dark-mode .hero-section,
.dark-mode .hero-news {
    background: rgba(30, 41, 59, 0.85);
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.news-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.news-header a {
    font-size: 12px;
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 500;
}

.news-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.news-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 7px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 13px;
    gap: 12px;
}

.news-list li:last-child {
    border-bottom: none;
}



.news-list span {
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
}

@media (max-width: 1100px) {
    .hero-container {
        flex-direction: column;
        gap: 20px;
    }

    .hero-news {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: none;
    }
}

@media (max-width: 768px) {
    .news-grid-layout {
        grid-template-columns: 1fr;
        column-gap: 0;
    }

    .news-grid-layout li:nth-last-child(2) {
        border-bottom: 1px dashed var(--border-color) !important;
    }
}

@media (max-width: 640px) {

    .hero-section,
    .hero-news {
        padding: var(--spacing-lg) 15px;
        /* 侧边增加一点边距 */
    }

    .hero-section h1 {
        font-size: 22px;
    }
}

.hero-section h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-wrap: balance;
}

.hero-section p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    max-width: 850px;
    text-wrap: balance;
    margin-bottom: 0;
}

.hero-p-gap {
    margin-top: 16px;
}

/* ========================================
   分类区块样式
   ======================================== */
.category-section {
    margin-bottom: var(--spacing-xl);
    scroll-margin-top: 120px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(59, 130, 246, 0.08);
    border-radius: var(--border-radius-sm);
}

.category-icon {
    font-size: 22px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
}

.category-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.category-description {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

/* 二级分类标题样式 */
.subcategory-block {
    margin-bottom: var(--spacing-lg);
}

.subcategory-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    padding: 6px 10px 6px 12px;
    background: rgba(59, 130, 246, 0.06);
    border-left: 3px solid var(--accent-blue);
}

.subcategory-block.hidden {
    display: none;
}

/* 子分类胶囊导航 */
.subcategory-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(148, 163, 184, 0.15);
    border-radius: 999px;
    margin-bottom: var(--spacing-sm);
}

.subcategory-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #e5e7eb;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 12px;
    line-height: 1.2;
    transition: all var(--transition-fast);
}

.subcategory-tab:hover {
    filter: brightness(0.98);
}

.subcategory-tab.active {
    background: var(--accent-amber);
    color: #ffffff;
}

.dark-mode .subcategory-tabs {
    background: rgba(148, 163, 184, 0.12);
}

.dark-mode .subcategory-tab {
    background: #334155;
    color: #cbd5e1;
}

.dark-mode .subcategory-tab.active {
    background: var(--accent-amber);
    color: #111827;
}

/* 工具网格布局 - 大图标模式 (每行4个) */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

/* 小图标模式 (每行6个，显示描述) */
.tools-grid.small {
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.tools-grid.small .tool-card {
    padding: 12px;
    text-align: left;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tools-grid.small .tool-header {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 0;
}

.tools-grid.small .tool-icon {
    width: 40px;
    height: 40px;
    margin: 0;
    flex-shrink: 0;
}

.tools-grid.small .tool-icon img {
    width: 40px;
    height: 40px;
}

.tools-grid.small .tool-info {
    text-align: left;
    flex: 1;
    min-width: 0;
}

.tools-grid.small .tool-name {
    font-size: 14px;
    margin-bottom: 4px;
}

.tools-grid.small .tool-desc {
    display: -webkit-box;
    font-size: 12px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tools-grid.small .tool-tags,
.tools-grid.small .tool-tag {
    display: none !important;
}

/* 卡片式布局 (每行10个) */
.tools-grid.compact {
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
}

.tools-grid.compact .tool-card {
    padding: 8px;
}

.tools-grid.compact .tool-icon,
.tools-grid.compact .tool-icon img {
    width: 32px;
    height: 32px;
}

.tools-grid.compact .tool-header {
    align-items: center;
    height: 32px;
    /* 与图标高度一致 */
    gap: 8px;
    /* 减小间距 */
}

.tools-grid.compact .tool-info {
    display: flex;
    align-items: center;
    height: 100%;
}

.tools-grid.compact .tool-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

.tools-grid.compact .tool-desc {
    display: none;
}

.tools-grid.compact .tool-tags,
.tools-grid.compact .tool-tag {
    display: none !important;
}

.tool-icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e2e8f0;
    color: var(--text-secondary);
    border-radius: inherit;
    font-weight: 600;
    font-size: 18px;
}

/* ========================================
   工具卡片样式
   ======================================== */
.tool-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 12px;
    /* 优化：缩短时间并指定属性，提升响应速度 */
    transition: transform 0.1s cubic-bezier(0.2, 0, 0.2, 1),
        box-shadow 0.1s cubic-bezier(0.2, 0, 0.2, 1),
        border-color 0.1s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--card-accent, var(--accent-blue)), transparent);
    opacity: 0;
    transition: opacity 0.1s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    /* 稍微增加位移量，反馈更明显 */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15), 0 0 0 1px var(--card-accent);
    border-color: var(--card-accent);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0, rgba(255, 255, 255, 0.06) 2px, transparent 2px, transparent 6px);
    opacity: 0;
    mix-blend-mode: screen;
    pointer-events: none;
}

.tool-card:hover::after {
    opacity: 1;
    animation: gridMove 1.6s linear infinite;
}

/* 收藏星标 */
.favorite-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    z-index: 10;
    opacity: 0;
}

.tool-card:hover .favorite-btn {
    opacity: 1;
}

.favorite-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    transform: scale(1.1);
}

.favorite-btn svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 2;
    transition: all var(--transition-fast);
}

.favorite-btn.active svg {
    fill: var(--accent-red);
    stroke: var(--accent-red);
}

.tool-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

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

.tool-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: var(--bg-body);
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}


.tool-icon img {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    object-fit: cover;
}

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

.tool-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition-fast);
}

.tool-card:hover .tool-name {
    color: var(--accent-blue);
}

.tool-desc {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-tags {
    display: none !important;
}

.tool-tag {
    display: none !important;
}

/* ========================================
   回到顶部按钮
   ======================================== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.back-to-top svg {
    width: 22px;
    height: 22px;
    color: white;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* ========================================
   底部样式 - 优化版
   ======================================== */
.footer {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    background: #f8fafc;
    /* 增加浅色背景 */
    padding: 32px 20px 24px;
    /* 减少内边距 */
    margin-top: 60px;
    margin-left: 220px;
    /* 默认侧边栏宽度 */
    font-size: 13px;
    /* 稍微调小字体 */
    color: #64748b;
    transition: margin-left var(--transition-normal);
}


.footer-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand h3 {
    font-size: 20px;
    /* 调小标题 */
    font-weight: 800;
    margin: 0 0 4px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.footer-brand p {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 16px;
    /* 减少间距 */
    font-weight: 500;
}

.footer-desc {
    max-width: 600px;
    margin: 0 auto 20px;
    /* 大幅减少间距 */
    line-height: 1.6;
    color: #64748b;
    font-size: 13px;
}

.footer-bottom {
    padding-top: 20px;
    /* 减少顶部内边距 */
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    /* 保持垂直排列 */
    align-items: center;
    gap: 8px;
    /* 减少元素间距 */
}

.footer-links {
    display: flex;
    gap: 24px;
    align-items: center;
}

.footer-links a {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #3b82f6;
}

.footer-links span {
    color: #cbd5e1;
    font-size: 12px;
}

@media (max-width: 1024px) {
    .footer {
        margin-left: 0 !important;
    }
}


/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 1400px) {
    .tools-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .tools-grid.compact {
        grid-template-columns: repeat(4, 1fr);
    }

    .tools-grid.small {
        grid-template-columns: repeat(6, 1fr);
    }

    .favorites-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1200px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tools-grid.compact {
        grid-template-columns: repeat(3, 1fr);
    }

    .tools-grid.small {
        grid-template-columns: repeat(4, 1fr);
    }

    .favorites-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content,
    .footer {
        margin-left: 0;
    }

    .header-content {
        padding: 0 var(--spacing-md);
    }

    .nav-links {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 56px;
        left: 0;
        width: 100%;
        background: var(--bg-card);
        padding: 20px;
        gap: 15px;
        z-index: 2000;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-10px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-links.show {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translateY(0) !important;
    }

    .nav-link {
        padding: 10px 0;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-link::after {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header-content {
        padding: 0 var(--spacing-sm);
        gap: var(--spacing-sm);
        justify-content: flex-start;
    }

    .logo {
        margin-right: auto;
    }

    .search-container {
        flex: 1;
        min-width: 0;
        margin: 0;
    }

    @media (max-width: 480px) {
        .search-container {
            display: none;
        }
    }

    .mobile-menu-btn,
    .settings-btn {
        flex-shrink: 0;
    }

    .settings-panel {
        width: 300px;
        right: -300px;
    }
}

@media (max-width: 768px) {
    .header {
        height: 52px;
    }

    .logo-text {
        display: block;
        font-size: 18px;
    }

    .logo {
        gap: 6px;
        flex-shrink: 0;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
    }

    .logo-icon svg {
        width: 26px;
        height: 26px;
    }

    .main-content {
        padding: 20px var(--spacing-md) 40px;
    }

    .hero-section {
        padding: var(--spacing-lg);
    }

    .hero-section h1 {
        font-size: 22px;
    }

    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .tools-grid.compact {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .tools-grid.small {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .favorites-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .category-header {
        flex-wrap: nowrap;
        gap: 6px;
    }

    .category-title {
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .category-description {
        margin-left: auto;
        width: auto;
        white-space: nowrap;
    }

    .settings-panel {
        width: 100%;
        right: -100%;
    }

    .color-palette {
        grid-template-columns: repeat(5, 1fr);
    }

    .layout-options {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tools-grid.compact {
        grid-template-columns: repeat(2, 1fr);
    }

    .tools-grid.small {
        grid-template-columns: repeat(2, 1fr);
    }

    .favorites-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .layout-options {
        grid-template-columns: 1fr;
    }

    .mode-toggle {
        flex-direction: column;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gridMove {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 160px 0;
    }
}

.tool-card {
    animation: fadeInUp 0.3s ease forwards;
}

.tool-card:nth-child(1) {
    animation-delay: 0.03s;
}

.tool-card:nth-child(2) {
    animation-delay: 0.06s;
}

.tool-card:nth-child(3) {
    animation-delay: 0.09s;
}

.tool-card:nth-child(4) {
    animation-delay: 0.12s;
}

.tool-card:nth-child(5) {
    animation-delay: 0.15s;
}

.tool-card:nth-child(6) {
    animation-delay: 0.18s;
}

/* 搜索高亮效果 */
.tool-card.hidden {
    display: none;
}

/* 空状态提示 */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.no-results-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.no-results h3 {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

.dark-mode ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ========================================
   通用 UI 组件
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    filter: brightness(1.1);
}

.btn-secondary {
    background: var(--bg-body);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* 表单样式 */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--bg-card);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* 反馈专用样式 */
.feedback-container {
    max-width: 1000px;
    margin: 40px auto;
}

.feedback-section {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: var(--spacing-2xl);
    margin-bottom: var(--spacing-xl);
}

.feedback-section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: var(--spacing-xl);
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.feedback-section-title i {
    color: var(--accent-blue);
}

.feedback-card {
    background: var(--bg-body);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    transition: all var(--transition-fast);
}

.feedback-card:hover {
    border-color: var(--accent-blue);
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
}

.feedback-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.feedback-card-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.feedback-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}

.feedback-card-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.status-open {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-blue);
}

.status-closed {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

.alert {
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.alert-error {
    background: rgba(239, 64, 64, 0.1);
    color: var(--accent-red);
    border: 1px solid rgba(239, 64, 64, 0.2);
}