/* 基础变量和重置样式 */
:root {
    /* 颜色变量 - 日间模式 */
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --background-color: #ffffff;
    --surface-color: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --hover-color: rgba(102, 126, 234, 0.1);

    /* 间距变量 */
    --container-padding: 20px;
    --section-gap: 24px;
    --card-gap: 16px;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;

    /* 字体变量 */
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-base: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-2xl: 24px;
    --font-size-3xl: 32px;

    /* 过渡动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s ease;
}

/* 夜间模式 */
[data-theme="dark"] {
    --background-color: #0f0f23;
    --surface-color: #1a1a2e;
    --card-background: #16213e;
    --text-primary: #ffffff;
    --text-secondary: #cbd5e0;
    --text-muted: #a0aec0;
    --border-color: #2d3748;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --hover-color: rgba(102, 126, 234, 0.2);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* 调试：确保主题切换生效 */
[data-theme="dark"] body {
    background-color: var(--background-color) !important;
    color: var(--text-primary) !important;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* 头部样式 */
.header {
    background: var(--card-background);
    box-shadow: 0 2px 10px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all var(--transition-normal);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: var(--section-gap);
}

/* Logo区域 */
.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    cursor: pointer;
}

.logo-link:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.logo-link:hover .logo svg {
    transform: scale(1.05);
}

.logo-link:hover .site-title {
    color: #667eea;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo svg {
    transition: transform 0.3s ease;
}

.logo svg,
.logo img {
    transition: transform var(--transition-normal);
    animation: breathe 3s ease-in-out infinite;
}

.logo:hover svg,
.logo:hover img {
    transform: scale(1.1);
    animation-play-state: paused;
}

/* 呼吸动画 */
@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    margin: 0;
    line-height: 1;
}

/* 桌面端导航 */
.desktop-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-menu a svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.nav-menu a:hover {
    color: var(--primary-color);
    background: var(--hover-color);
}

/* 头部按钮组 */
.header-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-buttons button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-buttons button:hover {
    color: var(--primary-color);
    background: var(--hover-color);
}

/* 主题切换按钮 */
.theme-toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    transition: opacity var(--transition-normal);
}

/* 默认显示太阳图标（日间模式） */
.theme-toggle .sun-icon {
    opacity: 1;
}

.theme-toggle .moon-icon {
    opacity: 0;
}

/* 夜间模式显示月亮图标 */
[data-theme="dark"] .theme-toggle .sun-icon {
    opacity: 0;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    opacity: 1;
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-primary);
    border-radius: 1px;
    transition: all var(--transition-fast);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* 移动端菜单 */
.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: transparent;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 999;
    min-height: auto;
    padding: 12px 0;
}

.mobile-menu.show {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-menu {
    list-style: none;
    padding: 16px 20px;
    background: var(--card-background);
    margin: 0 var(--container-padding);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px var(--shadow-color);
    width: auto;
    max-width: none;
    display: inline-block;
    min-width: 200px;
}

.mobile-nav-menu li {
    margin-bottom: 4px;
}

.mobile-nav-menu li:last-child {
    margin-bottom: 0;
}

.mobile-nav-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    white-space: nowrap;
    width: 100%;
    box-sizing: border-box;
}

.mobile-nav-menu a svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.mobile-nav-menu a:hover {
    background: var(--hover-color);
    color: var(--primary-color);
}

/* 主要内容区域 */
.main-content {
    min-height: 80vh;
    padding: 1rem 0;
}

/* 搜索区域 */
.search-section {
    text-align: center;
    padding: 0.1875rem 0 0.9375rem 0;
    background: white;
    color: var(--text-primary);
    border-radius: var(--border-radius-lg);
    margin: 0 var(--container-padding) 1.5rem;
    border: 1px solid var(--border-color);
}

/* 夜间模式的英雄区域样式 */
[data-theme="dark"] .search-section {
    background: #0f172a;
    color: white;
    border-color: var(--border-color);
}

.search-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin-bottom: 4px;
}

.search-subtitle {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    margin-bottom: 16px;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-box {
    width: 100%;
    padding: 16px 24px 16px 50px;
    font-size: var(--font-size-base);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    background: var(--card-background);
    color: var(--text-primary);
    outline: none;
    transition: all var(--transition-normal);
}

.search-box:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

/* 夜间模式下的搜索框样式 */
[data-theme="dark"] .search-box {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white;
}

[data-theme="dark"] .search-box:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* 夜间模式下的搜索图标 */
[data-theme="dark"] .search-icon {
    color: rgba(255, 255, 255, 0.6);
}

/* 搜索框清除按钮 */
.search-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    width: 32px;
    height: 32px;
    z-index: 10;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.search-clear-btn:hover {
    background: var(--hover-color);
    color: var(--text-primary);
}

.search-clear-btn.show {
    display: flex;
}

/* 夜间模式下的清除按钮 */
[data-theme="dark"] .search-clear-btn {
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .search-clear-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

/* 标签筛选区域 */
.filter-section {
    margin-bottom: 16px;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}

.filter-tag {
    padding: 6px 16px;
    background: var(--surface-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.filter-tag:hover,
.filter-tag.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 移除可联网标签的特殊样式，使其使用默认的筛选标签样式 */

/* 垂直分类布局 */
.categories-section {
    margin: var(--section-gap) 0 0.5rem 0;
}

.category-block {
    margin-bottom: 0.75rem;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.category-block:hover {
    box-shadow: 0 8px 32px var(--shadow-color);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
}

.category-header svg {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.category-header h2 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.sub-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.625rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-background);
}

.sub-tab-button {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
}

.sub-tab-button:hover {
    color: var(--primary-color);
    background: var(--hover-color);
    border-color: var(--primary-color);
}

.sub-tab-button.active {
    color: white;
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* 工具网格在每个分类块中 */
.category-block .tools-grid {
    padding: 0.3125rem 0.5rem 0.3125rem 0.5rem;
}

/* 无工具数据提示 */
.no-tools {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    background: var(--surface-color);
    border-radius: var(--border-radius);
    margin: 20px 0;
}

.tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    transition: all var(--transition-fast);
    font-size: var(--font-size-base);
    font-weight: 500;
    white-space: nowrap;
    position: relative;
}

.tab-button:hover {
    color: var(--primary-color);
    background: var(--hover-color);
}

.tab-button.active {
    color: var(--primary-color);
    background: var(--card-background);
    border-bottom: 2px solid var(--primary-color);
}

/* 工具卡片网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--card-gap);
    margin-bottom: 48px;
    align-items: stretch;
}

.tool-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px 20px 0.3125rem 20px;
    transition: all var(--transition-normal);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--shadow-color);
    border-color: var(--primary-color);
}

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

.tool-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    background: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    flex-shrink: 0;
}

.tool-logo .logo-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.tool-logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 4px;
}

.tool-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.tool-description {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    line-height: 1.5;
    margin-bottom: 12px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
    margin-bottom: 16px;
}

.tool-tag {
    padding: 2px 8px;
    background: var(--surface-color);
    color: var(--text-muted);
    border-radius: 12px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tool-tag:hover {
    background: var(--hover-color);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.tool-tag.premium {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: white;
}

.tool-tag.free {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.tool-tag.magic {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.tool-tag.network {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(6, 182, 212, 0.3);
}

.tool-tag.multimodal {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.tool-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.tool-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.tool-likes {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.like-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    transition: all var(--transition-fast);
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
    width: 36px;
    height: 36px;
}

.like-button:hover {
    background: rgba(229, 62, 62, 0.1);
    color: #e53e3e;
    transform: scale(1.1);
}

.like-button.liked {
    color: #e53e3e;
    background: rgba(229, 62, 62, 0.1);
}

.like-button.liked i {
    animation: heartBeat 0.6s ease-in-out;
}

.like-button:active {
    transform: scale(0.9);
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

.visit-button {
    padding: 6px 12px;
    background: #2563eb; /* 日间模式：蓝色 */
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: all var(--transition-fast);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.25);
}

.visit-button:hover {
    background: #1e40af; /* 日间模式 hover：深蓝 */
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.35);
    filter: saturate(1.1) brightness(1.05);
}

/* 工具详情弹窗 */
.tool-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.tool-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: var(--card-background);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.tool-modal.show .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* 悬浮工具提示框 */
.tool-tooltip {
    position: absolute;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    pointer-events: none;
}

.tool-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.tooltip-content {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    width: 480px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .tooltip-content {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 8px 25px rgba(0, 0, 0, 0.3);
}

.tooltip-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.tooltip-close:hover {
    color: var(--text-primary);
    background: var(--hover-color);
}

.tool-tooltip .tool-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-right: 40px;
}

.tool-tooltip .tool-logo {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.tool-tooltip .tool-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tool-tooltip .tool-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.tool-tooltip .tool-details {
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.tool-tooltip .tool-details p {
    margin: 0 0 12px 0;
    color: var(--text-secondary);
}

.tool-tooltip .tool-details p:last-of-type {
    margin-bottom: 16px;
}

.tool-tooltip .tool-url a {
    color: var(--primary-color);
    text-decoration: underline;
    word-break: break-all;
    font-size: var(--font-size-sm);
}

.tool-tooltip .tool-url a:hover {
    text-decoration: underline;
}

.tool-tooltip .tool-description,
.tool-tooltip .tool-detailed-description {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-tooltip .tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.tool-tooltip .tool-tag {
    font-size: var(--font-size-xs);
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
}

.tool-tooltip .tool-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.tool-tooltip .visit-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tool-tooltip .visit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tooltip-content {
        width: 320px;
        padding: 20px;
    }
    
    .tool-tooltip .tool-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .tool-tooltip .tool-logo {
        width: 40px;
        height: 40px;
    }
    
    .tool-tooltip .tool-name {
        font-size: var(--font-size-base);
    }
}

/* 滚动按钮 */
.scroll-buttons {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}

.scroll-btn {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.scroll-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

/* 页脚样式 */
.footer {
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 48px 0 24px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-section h4 {
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    margin-bottom: 16px;
    font-weight: 600;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    font-size: var(--font-size-sm);
}

.footer-links a:hover {
    color: var(--primary-color);
    background: var(--hover-color);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 16px;
}

.footer-info {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-link {
    font-size: 20px;
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.social-link:hover {
    transform: scale(1.2);
}

/* 实用工具类 */
.desktop-only {
    display: initial !important;
}

.mobile-only {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}



/* 外链样式 - 增强可见性和透明度 */
.external-link {
    position: relative;
    border-left: 3px solid #007bff;
    padding-left: 8px;
    background: rgba(0, 123, 255, 0.05);
}

.external-link::after {
    content: none;
    font-size: 0.75em;
    opacity: 0.7;
    margin-left: 0;
    color: #666;
    font-weight: 500;
    pointer-events: none;
}

.external-link:hover {
    background: rgba(0, 123, 255, 0.1);
}

.external-link:hover::after {
     opacity: 1;
 }

.external-link:hover .external-icon {
    opacity: 1;
}

/* 白名单链接样式 */
.whitelist-link {
    border-left-color: #28a745;
    background: rgba(40, 167, 69, 0.05);
}

.whitelist-link::after {
    content: "可信链接";
    color: #28a745;
}

.whitelist-link:hover {
    background: rgba(40, 167, 69, 0.1);
}

/* 非白名单链接样式 (nofollow) */
.nofollow-link {
    border-left-color: #ffc107;
    background: rgba(255, 193, 7, 0.05);
}

.nofollow-link::after {
    content: none;
    color: #666;
    pointer-events: none;
}

.nofollow-link:hover {
    background: rgba(255, 193, 7, 0.1);
}

/* 外链跳转页面样式 */
.redirect-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    margin: 12px 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.redirect-info {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    margin: 16px 0;
}

.redirect-url {
    word-break: break-all;
    font-family: monospace;
    background: var(--background-color);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    margin: 8px 0;
    font-size: var(--font-size-sm);
}

/* 跳转页面动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

/* 爱心按钮优化 */
.like-button {
    transition: all 0.2s ease !important;
    user-select: none;
}

.like-button:active {
    transform: scale(0.9);
}

.like-button.liked {
    animation: likeAnimation 0.3s ease;
}

@keyframes likeAnimation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}
/* 日间模式：访问按钮改为蓝色（卡片与悬浮详情统一） */
html:not([data-theme="dark"]) .visit-button,
html:not([data-theme="dark"]) .tool-tooltip .visit-button {
    background: #1677ff !important;
    color: #fff !important;
    box-shadow: 0 6px 16px rgba(22, 119, 255, 0.25);
}

html:not([data-theme="dark"]) .visit-button:hover,
html:not([data-theme="dark"]) .tool-tooltip .visit-button:hover {
    background: #1463d6 !important; /* 略深，提升悬停对比度 */
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(22, 119, 255, 0.35);
    filter: none;
}

html:not([data-theme="dark"]) .visit-button:focus-visible,
html:not([data-theme="dark"]) .tool-tooltip .visit-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.35), 0 8px 25px rgba(22, 119, 255, 0.3);
}
/* 夜间模式下保持与主题一致的渐变风格 */
[data-theme="dark"] .visit-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}
[data-theme="dark"] .visit-button:hover {
    background: var(--secondary-color);
}

/* 工具详情弹窗 */
.tool-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.tool-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: var(--card-background);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.tool-modal.show .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* 悬浮工具提示框 */
.tool-tooltip {
    position: absolute;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    pointer-events: none;
}

.tool-tooltip.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.tooltip-content {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    width: 480px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 8px 25px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .tooltip-content {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 8px 25px rgba(0, 0, 0, 0.3);
}

.tooltip-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color var(--transition-fast);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.tooltip-close:hover {
    color: var(--text-primary);
    background: var(--hover-color);
}

.tool-tooltip .tool-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-right: 40px;
}

.tool-tooltip .tool-logo {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.tool-tooltip .tool-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tool-tooltip .tool-name {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.3;
}

.tool-tooltip .tool-details {
    font-size: var(--font-size-sm);
    line-height: 1.5;
}

.tool-tooltip .tool-details p {
    margin: 0 0 12px 0;
    color: var(--text-secondary);
}

.tool-tooltip .tool-details p:last-of-type {
    margin-bottom: 16px;
}

.tool-tooltip .tool-url a {
    color: var(--primary-color);
    text-decoration: none;
    word-break: break-all;
    font-size: var(--font-size-sm);
}

.tool-tooltip .tool-url a:hover {
    text-decoration: underline;
}

.tool-tooltip .tool-description,
.tool-tooltip .tool-detailed-description {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-tooltip .tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.tool-tooltip .tool-tag {
    font-size: var(--font-size-xs);
    padding: 4px 8px;
    border-radius: var(--border-radius-sm);
    font-weight: 500;
}

.tool-tooltip .tool-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.tool-tooltip .visit-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tool-tooltip .visit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .tooltip-content {
        width: 320px;
        padding: 20px;
    }
    
    .tool-tooltip .tool-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .tool-tooltip .tool-logo {
        width: 40px;
        height: 40px;
    }
    
    .tool-tooltip .tool-name {
        font-size: var(--font-size-base);
    }
}

/* 滚动按钮 */
.scroll-buttons {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}

.scroll-btn {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.scroll-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

/* 页脚样式 */
.footer {
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 48px 0 24px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-section h4 {
    color: var(--text-primary);
    font-size: var(--font-size-lg);
    margin-bottom: 16px;
    font-weight: 600;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    font-size: var(--font-size-sm);
}

.footer-links a:hover {
    color: var(--primary-color);
    background: var(--hover-color);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 16px;
}

.footer-info {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.footer-social {
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-link {
    font-size: 20px;
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.social-link:hover {
    transform: scale(1.2);
}

/* 实用工具类 */
.desktop-only {
    display: initial !important;
}

.mobile-only {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

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

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}



/* 外链样式 - 增强可见性和透明度 */
.external-link {
    position: relative;
    border-left: 3px solid #007bff;
    padding-left: 8px;
    background: rgba(0, 123, 255, 0.05);
}

.external-link::after {
    content: none;
    font-size: 0.75em;
    opacity: 0.7;
    margin-left: 0;
    color: #666;
    font-weight: 500;
    pointer-events: none;
}

.external-link:hover {
    background: rgba(0, 123, 255, 0.1);
}

.external-link:hover::after {
     opacity: 1;
 }

.external-link:hover .external-icon {
    opacity: 1;
}

/* 白名单链接样式 */
.whitelist-link {
    border-left-color: #28a745;
    background: rgba(40, 167, 69, 0.05);
}

.whitelist-link::after {
    content: "可信链接";
    color: #28a745;
}

.whitelist-link:hover {
    background: rgba(40, 167, 69, 0.1);
}

/* 非白名单链接样式 (nofollow) */
.nofollow-link {
    border-left-color: #ffc107;
    background: rgba(255, 193, 7, 0.05);
}

.nofollow-link::after {
    content: none;
    color: #666;
    pointer-events: none;
}

.nofollow-link:hover {
    background: rgba(255, 193, 7, 0.1);
}

/* 外链跳转页面样式 */
.redirect-warning {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: var(--border-radius);
    padding: 12px 16px;
    margin: 12px 0;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.redirect-info {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    margin: 16px 0;
}

.redirect-url {
    word-break: break-all;
    font-family: monospace;
    background: var(--background-color);
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    margin: 8px 0;
    font-size: var(--font-size-sm);
}

/* 跳转页面动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

/* 爱心按钮优化 */
.like-button {
    transition: all 0.2s ease !important;
    user-select: none;
}

.like-button:active {
    transform: scale(0.9);
}

.like-button.liked {
    animation: likeAnimation 0.3s ease;
}

@keyframes likeAnimation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}