/* ============================================
   AI导航主题 - 主样式表
   配色：渐变紫蓝色系
   ============================================ */

/* ---- CSS 变量 ---- */
:root {
    /* 主色 */
    --primary-color: #667eea;
    --primary-color-end: #764ba2;
    --accent-color: #00d4ff;

    /* 功能色 */
    --color-free: #10b981;
    --color-paid: #f59e0b;
    --color-hot: #ef4444;
    --color-api: #6366f1;
    --color-opensource: #06b6d4;
    --color-new: #8b5cf6;
    --color-default: #64748b;

    /* 深色模式（默认） */
    --bg-primary: #0a0e27;
    --bg-secondary: #111638;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --bg-input: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);

    /* 间距 */
    --container-max: 1280px;
    --card-gap: 24px;
    --section-gap: 48px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* 字体 */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* 动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
    --transition-slow: 0.3s ease;
}

/* 浅色模式 - 兼容任何主题 */
.light-mode {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-input: rgba(0, 0, 0, 0.04);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-color: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.06);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-slow), color var(--transition-slow);
    position: relative;
    overflow-x: hidden;
}

/* 科技感背景 - 动态渐变光斑 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse 600px 600px at 20% 30%, rgba(102, 126, 234, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 80% 20%, rgba(118, 75, 162, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 400px 400px at 50% 80%, rgba(0, 212, 255, 0.05) 0%, transparent 70%);
    animation: bgFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* 科技感背景 - 网格纹理 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* 确保内容在背景之上 */
.site-header,
.site-main,
.site-footer {
    position: relative;
    z-index: 1;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(1deg); }
    66% { transform: translate(-20px, 20px) rotate(-1deg); }
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* ---- 渐变工具类 ---- */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-bg {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end));
}

.gradient-border {
    position: relative;
    border: 1px solid transparent;
    background-clip: padding-box;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end));
    z-index: -1;
    opacity: 0.3;
    transition: opacity var(--transition-normal);
}

.gradient-border:hover::before {
    opacity: 0.6;
}

/* ============================================
   顶部导航栏
   ============================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    transition: background var(--transition-slow);
}

/* 导航栏底部发光线 */
.site-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), var(--primary-color-end), transparent);
    opacity: 0.4;
}

.header-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 导航 */
.header-nav {
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
    -webkit-mask-image: linear-gradient(to right, transparent 0px, #000 24px, #000 calc(100% - 24px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0px, #000 24px, #000 calc(100% - 24px), transparent 100%);
}

.header-nav::-webkit-scrollbar {
    display: none;
}

/* 导航支持鼠标滚轮横向滚动 */
.header-nav.scrollable {
    cursor: grab;
}

.header-nav.scrollable:active {
    cursor: grabbing;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    white-space: nowrap;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
    text-shadow: 0 0 8px rgba(102, 126, 234, 0.3);
}

.nav-item.active .nav-link {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    text-shadow: 0 0 10px rgba(102, 126, 234, 0.4);
}

.nav-count {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    background: var(--bg-card);
    color: var(--text-muted);
}

/* 头部右侧 */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.theme-toggle:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* 深色模式：显示太阳，隐藏月亮 */
.icon-sun { display: block; }
.icon-moon { display: none; }
.light-mode .icon-sun { display: none; }
.light-mode .icon-moon { display: block; }

/* 配色选择面板 */
.color-picker-wrap {
    position: relative;
}

.color-picker-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    padding: 14px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.95);
    transition: all 0.2s ease;
}

.color-picker-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.color-picker-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.color-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.color-picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 2px solid transparent;
}

.color-picker-item:hover {
    background: var(--bg-input);
}

.color-picker-item.active {
    border-color: var(--primary-color);
    background: var(--bg-input);
}

.color-preview {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.color-picker-item span {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.color-picker-item.active span {
    color: var(--text-primary);
    font-weight: 600;
}

/* 配色切换 Toast 提示 */
.color-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 10px 24px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.color-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 投稿按钮 - 与主题切换按钮统一风格 */
.nav-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-input);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-submit-btn:hover {
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.3);
}

.nav-submit-btn svg {
    flex-shrink: 0;
}

.nav-submit-text {
    display: none;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    gap: 5px;
    border-radius: var(--radius-sm);
}

.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 1px;
    transition: all var(--transition-normal);
}

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

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

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

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* ============================================
   搜索区域
   ============================================ */
.search-section {
    padding: 48px 20px 32px;
    text-align: center;
}

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

.search-title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end), var(--accent-color));
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 4s ease infinite;
    filter: drop-shadow(0 0 20px rgba(102, 126, 234, 0.3));
}

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

.search-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
    letter-spacing: 0.5px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0 20px;
    transition: all var(--transition-normal);
}

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

.search-icon {
    flex-shrink: 0;
    color: var(--text-muted);
}

.search-input {
    flex: 1;
    padding: 16px 12px;
    border: none;
    background: none;
    outline: none;
    font-size: 15px;
    color: var(--text-primary);
    font-family: var(--font-family);
}

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

.search-clear {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}

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

/* 搜索建议 */
.search-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 40px var(--shadow-color);
    max-height: 320px;
    overflow-y: auto;
    z-index: 50;
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-suggestion-item:hover {
    background: var(--bg-card);
}

.search-suggestion-item .suggestion-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-suggestion-item .suggestion-text {
    font-size: 14px;
    color: var(--text-primary);
}

.search-suggestion-item .suggestion-text mark {
    background: none;
    color: var(--primary-color);
    font-weight: 600;
}

/* ============================================
   分类快速导航
   ============================================ */
.category-nav-section {
    padding: 0 20px 24px;
}

.category-nav {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.category-tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.category-tag.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3), 0 0 20px rgba(102, 126, 234, 0.15);
}

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

.category-count {
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.15);
}

.category-tag:not(.active) .category-count {
    background: var(--bg-input);
}

/* ============================================
   筛选与排序
   ============================================ */
.filter-section {
    padding: 0 20px 24px;
}

.filter-bar {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-left,
.filter-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 13px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-btn {
    padding: 6px 14px;
    border-radius: var(--radius-xl);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

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

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.3), 0 0 16px rgba(102, 126, 234, 0.12);
}

.sort-select {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    outline: none;
    cursor: pointer;
    font-family: var(--font-family);
    transition: border-color var(--transition-normal);
}

.sort-select:focus {
    border-color: var(--primary-color);
}

.sort-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.filter-result-count {
    max-width: var(--container-max);
    margin: 8px auto 0;
    font-size: 13px;
    color: var(--text-muted);
}

.filter-result-count strong {
    color: var(--primary-color);
}

/* ============================================
   主内容区（卡片列表 + 侧边栏）
   ============================================ */
.main-content-section {
    padding: 0 20px var(--section-gap);
}

.main-content-layout {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.main-content-left {
    flex: 1;
    min-width: 0;
}

.main-content-right {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
}

/* 侧边栏样式适配 */
.main-content-right .widget {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.main-content-right .widget-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.main-content-right .widget ul {
    list-style: none;
    padding: 0;
}

.main-content-right .widget li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

.main-content-right .widget li:last-child {
    border-bottom: none;
}

.main-content-right .widget li a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.main-content-right .widget li a:hover {
    color: var(--primary-color);
}

.main-content-right .widget .loglist li {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-content-right .widget .loglist li .time {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.main-content-right .widget .bloggerinfo img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

.main-content-right .widget .bloggerinfo .name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 15px;
}

.main-content-right .widget .bloggerinfo .info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 侧边栏搜索框 */
.widget-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition-fast);
    box-sizing: border-box;
}

.widget-search-input:focus {
    border-color: var(--primary-color);
}

/* 侧边栏标签 */
.main-content-right .widget .tag-list li {
    display: inline-block;
    border: none;
    padding: 0;
    margin: 0 6px 6px 0;
}

.main-content-right .widget .tag-list li a {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bg-input);
    font-size: 12px;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.main-content-right .widget .tag-list li a:hover {
    background: var(--primary-color);
    color: #fff;
}

/* 侧边栏评论 */
.main-content-right .widget .comm-name {
    font-weight: 600;
    color: var(--text-primary);
}

.main-content-right .widget .comm-content {
    color: var(--text-muted);
    font-size: 12px;
}

/* 侧边栏评论列表（新版） */
.widget-comment-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.comment-item {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.comment-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.comment-item-header {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.comment-item-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-item-avatar .comment-avatar-fallback {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

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

.comment-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.comment-item-date {
    font-weight: 400;
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 6px;
}

.comment-item-from {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.comment-item-from a {
    color: var(--primary-color);
}

.comment-item-content {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 8px;
    padding-left: 42px;
}

/* 侧边栏链接 */
.main-content-right .widget .link-list li {
    display: inline-block;
    border: none;
    padding: 0;
    margin: 0 8px 6px 0;
}

/* 侧边栏子分类 */
.main-content-right .widget .sort-children {
    padding-left: 14px;
    margin-top: 4px;
}
/* 侧边栏子分类 */
.main-content-right .widget .sort-children li a {
    font-size: 12px;
}

/* 侧边栏联系方式 - 方格网格 */
.contact-icons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 4px 0;
}

.contact-icon-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 4px 8px;
    border-radius: var(--radius-md);
    background: var(--bg-input);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.contact-icon-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-fast);
}

.contact-icon-item:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.contact-icon-item:hover .contact-icon-img {
    transform: scale(1.1);
}

/* hover 弹出二维码 */
.contact-qr-popup {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
    text-align: center;
    min-width: 140px;
}

.contact-qr-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--bg-card);
}

.contact-qr-popup img {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    display: block;
}

.contact-qr-popup span {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.contact-icon-item.has-qr:hover .contact-qr-popup {
    display: block;
}

/* hover 显示文字号码（无二维码时） */
.contact-val-popup {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
    text-align: center;
    white-space: nowrap;
}

.contact-val-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--bg-card);
}

.contact-val-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.contact-val-text {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.contact-icon-item.has-val:hover .contact-val-popup {
    display: block;
}

/* 隐藏文字，只显示图标 */
.contact-icon-item .contact-tip {
    display: none;
}

/* ============================================
   卡片网格
   ============================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(var(--card-columns, 3), 1fr);
    gap: 16px;
}

/* ---- 工具卡片 ---- */
.tool-card {
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
    overflow: hidden;
    animation: fadeInUp 0.4s ease both;
    position: relative;
}

/* 卡片光泽扫过效果 */
.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: left 0.6s ease;
    z-index: 1;
    pointer-events: none;
}

.tool-card:hover::before {
    left: 100%;
}

.tool-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 12px 40px var(--shadow-color), 0 0 20px rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
    background: var(--bg-card-hover);
}

.card-link {
    display: flex;
    flex-direction: column;
    padding: 14px;
    height: 100%;
    text-decoration: none;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.card-icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end));
    color: #fff;
    border-radius: var(--radius-md);
}

.card-title-area {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.rating-score {
    font-size: 12px;
    color: var(--color-paid);
    font-weight: 500;
}

.rating-count {
    font-size: 11px;
    color: var(--text-muted);
}

.card-divider {
    height: 1px;
    background: var(--border-color);
    margin: 10px 0;
}

/* 卡片统计信息 */
.card-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1;
}

.card-stat {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.card-stat svg {
    flex-shrink: 0;
    opacity: 0.6;
}

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

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.card-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--radius-xl);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* 标签颜色 */
.tag-free { background: rgba(16, 185, 129, 0.15); color: var(--color-free); }
.tag-paid { background: rgba(245, 158, 11, 0.15); color: var(--color-paid); }
.tag-hot { background: rgba(239, 68, 68, 0.15); color: var(--color-hot); }
.tag-opensource { background: rgba(6, 182, 212, 0.15); color: var(--color-opensource); }
.tag-api { background: rgba(99, 102, 241, 0.15); color: var(--color-api); }
.tag-new { background: rgba(139, 92, 246, 0.15); color: var(--color-new); }
.tag-default { background: var(--bg-input); color: var(--text-muted); }

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 64px 20px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 14px;
    color: var(--text-muted);
}

/* ============================================
   分页
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding-top: 28px;
    margin-top: 8px;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    transition: all var(--transition-normal);
}

.pagination a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.08);
}

/* 当前选中页 - 兼容多种 class 名 */
.pagination .current,
.pagination .active,
.pagination span:not(.pageinfo) {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end));
    border-color: transparent;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
    transform: scale(1.05);
}

.pagination .pageinfo {
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================================
   详情页
   ============================================ */

/* 面包屑 */
.detail-breadcrumb {
    padding: 16px 0;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
}

.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 13px;
}

.breadcrumb-item {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

a.breadcrumb-item:hover {
    color: var(--primary-color);
}

.breadcrumb-sep {
    color: var(--text-muted);
    margin: 0 4px;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

/* 详情头部 */
.detail-header {
    padding: 40px 0;
}

.detail-header-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.detail-cover {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    aspect-ratio: 16 / 9;
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end));
    color: #fff;
}

.cover-placeholder-icon {
    font-size: 64px;
    font-weight: 800;
    margin-bottom: 8px;
}

.cover-placeholder p {
    font-size: 16px;
    opacity: 0.8;
}

/* 详情信息 */
.detail-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.detail-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.detail-stars {
    display: flex;
    gap: 2px;
}

.star-icon {
    font-size: 16px;
    line-height: 1;
}

.star-full { color: var(--color-paid); }
.star-half { color: var(--color-paid); opacity: 0.6; }
.star-empty { color: var(--text-muted); }

.detail-rating-score {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-paid);
}

.detail-rating-count {
    font-size: 14px;
    color: var(--text-muted);
}

/* 元信息 */
.detail-meta {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meta-label {
    font-size: 12px;
    color: var(--text-muted);
}

.meta-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* 操作按钮 */
.detail-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end));
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.95) translateY(0);
}

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

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

.btn-secondary:active {
    transform: scale(0.95);
}

.btn-visit {
    font-size: 15px;
    padding: 12px 24px;
}

/* 详情标签 */
.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-tag {
    padding: 4px 14px;
    border-radius: var(--radius-xl);
    font-size: 13px;
    font-weight: 500;
}

/* ---- 详情区块 ---- */
.detail-section {
    padding: 0 20px;
    margin-bottom: var(--section-gap);
}

.section-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 24px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    font-size: 24px;
}

/* 核心功能 */
.features-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.feature-item {
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
}

.feature-item:hover {
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.feature-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.feature-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 定价方案 */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.pricing-card {
    padding: 24px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-normal);
}

.pricing-card:hover {
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateY(-2px);
}

.pricing-free {
    border-color: var(--color-free);
    background: rgba(16, 185, 129, 0.05);
}

.pricing-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.pricing-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.pricing-price {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 详细内容 */
.detail-content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.detail-content h1,
.detail-content h2,
.detail-content h3,
.detail-content h4 {
    color: var(--text-primary);
    margin: 24px 0 12px;
}

.detail-content h2 { font-size: 22px; }
.detail-content h3 { font-size: 18px; }

.detail-content p {
    margin-bottom: 16px;
}

.detail-content img {
    border-radius: var(--radius-md);
    margin: 16px 0;
}

.detail-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.detail-content ul,
.detail-content ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

.detail-content li {
    margin-bottom: 8px;
}

.detail-content blockquote {
    border-left: 3px solid var(--primary-color);
    padding: 12px 20px;
    margin: 16px 0;
    background: var(--bg-card);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}

.detail-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
    font-size: 13px;
    line-height: 1.6;
}

.detail-content code {
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.detail-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.detail-content th,
.detail-content td {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.detail-content th {
    background: var(--bg-card);
    font-weight: 600;
    color: var(--text-primary);
}

/* 适用场景 */
.use-cases {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.use-case-tag {
    padding: 8px 18px;
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.use-case-tag:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

/* 相关工具 */
.related-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.related-tool-card {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.related-tool-card:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* 评论区域 */
.detail-comments-section {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* 上下篇导航 */
.detail-nav-section {
    padding: 0 20px var(--section-gap);
}

.detail-nav {
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.detail-nav a {
    flex: 1;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-nav a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ============================================
   底部广告位（footer内部）
   ============================================ */
.footer-ad {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

.footer-ad-img {
    max-width: 100%;
    max-height: 60px;
    width: auto;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

.footer-ad a {
    display: inline-block;
    transition: opacity var(--transition-normal);
}

.footer-ad a:hover {
    opacity: 0.85;
}

/* ============================================
   底部
   ============================================ */
.site-footer {
    padding: 32px 0;
    border-top: 1px solid var(--border-color);
    background: var(--glass-bg);
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), var(--primary-color-end), transparent);
    opacity: 0.3;
}

.footer-inner {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.footer-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.footer-right {
    text-align: right;
}

.footer-icp,
.footer-copyright {
    font-size: 12px;
    color: var(--text-muted);
}

.footer-copyright a {
    color: var(--primary-color);
}

/* ============================================
   回到顶部
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-normal);
    z-index: 80;
}

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

.back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* ============================================
   404 页面
   ============================================ */
.error-page {
    padding: 120px 20px;
    text-align: center;
}

.error-content {
    max-width: 400px;
    margin: 0 auto;
}

.error-code {
    font-size: 120px;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
}

.error-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.error-desc {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 卡片逐个出现动画 */
.tool-card:nth-child(1) { animation-delay: 0s; }
.tool-card:nth-child(2) { animation-delay: 0.05s; }
.tool-card:nth-child(3) { animation-delay: 0.1s; }
.tool-card:nth-child(4) { animation-delay: 0.15s; }
.tool-card:nth-child(5) { animation-delay: 0.2s; }
.tool-card:nth-child(6) { animation-delay: 0.25s; }
.tool-card:nth-child(7) { animation-delay: 0.3s; }
.tool-card:nth-child(8) { animation-delay: 0.35s; }

/* 尊重用户动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   响应式设计
   ============================================ */

/* 平板 (< 1024px) */
@media (max-width: 1024px) {
    .main-content-layout {
        flex-direction: column;
    }

    .main-content-right {
        width: 100%;
        position: static;
    }

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

    .detail-header-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .detail-cover {
        max-height: 300px;
    }

    .features-list {
        grid-template-columns: 1fr;
    }

    .search-title {
        font-size: 28px;
    }
}

/* 手机 (< 640px) */
@media (max-width: 640px) {
    /* Header */
    .header-inner {
        height: 56px;
        padding: 0 16px;
        gap: 12px;
    }

    .logo-text {
        font-size: 16px;
    }

    .site-logo img {
        width: 64px !important;
        height: 24px !important;
    }

    .header-right {
        gap: 4px;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
    }

    .theme-toggle svg {
        width: 18px;
        height: 18px;
    }

    /* 导航 */
    .header-nav {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-primary);
        padding: 20px;
        overflow-y: auto;
        z-index: 95;
    }

    .header-nav.active {
        display: block;
        animation: fadeIn var(--transition-slow);
    }

    .nav-list {
        flex-direction: column;
        gap: 4px;
    }

    .nav-link {
        padding: 12px 16px;
        font-size: 15px;
        border-radius: var(--radius-md);
    }

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

    /* 搜索 */
    .search-section {
        padding: 24px 16px 16px;
    }

    .search-title {
        font-size: 22px;
    }

    .search-box {
        padding: 12px 16px;
        font-size: 15px;
    }

    /* 分类导航 */
    .category-nav-section {
        padding: 0 16px 12px;
    }

    .category-nav {
        gap: 8px;
    }

    .category-tag {
        padding: 6px 14px;
        font-size: 13px;
    }

    /* 筛选 */
    .filter-section {
        padding: 0 16px 12px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .filter-btns {
        flex-wrap: wrap;
    }

    .filter-btn {
        padding: 6px 14px;
        font-size: 13px;
    }

    .sort-select {
        width: 100%;
    }

    /* 主内容区 */
    .main-content-section {
        padding: 0 12px 24px;
    }

    .main-content-layout {
        gap: 20px;
    }

    /* 卡片 */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .card-link {
        padding: 14px;
    }

    .card-icon {
        width: 36px;
        height: 36px;
    }

    .card-title {
        font-size: 14px;
    }

    .card-stats {
        gap: 10px;
        font-size: 10px;
    }

    .card-stat svg {
        width: 10px;
        height: 10px;
    }

    .card-tags {
        gap: 4px;
    }

    .card-tag {
        padding: 2px 8px;
        font-size: 11px;
    }

    /* 分页 */
    .pagination {
        padding-top: 20px;
        gap: 6px;
    }

    .pagination a, .pagination span {
        padding: 6px 12px;
        font-size: 13px;
    }

    /* 侧边栏 */
    .main-content-right .widget {
        padding: 16px;
        margin-bottom: 16px;
    }

    .main-content-right .widget-title {
        font-size: 14px;
        padding-bottom: 8px;
        margin-bottom: 10px;
    }

    .main-content-right .widget li {
        padding: 6px 0;
        font-size: 13px;
    }

    /* 联系方式 */
    .contact-icons {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .contact-icon-item {
        padding: 8px 2px 6px;
    }

    .contact-icon-img {
        width: 24px;
        height: 24px;
    }

    .contact-qr-popup {
        display: none;
    }

    /* 评论 */
    .comment-item {
        gap: 10px;
    }

    .comment-avatar img,
    .comment-avatar .comment-avatar-fallback {
        width: 32px;
        height: 32px;
    }

    .comment-item-name {
        font-size: 13px;
    }

    .comment-item-date {
        font-size: 11px;
    }

    .comment-item-content {
        font-size: 13px;
    }

    /* 评论表单 */
    .comment-form-title {
        font-size: 16px;
    }

    .comment-form-input,
    .comment-form-textarea {
        padding: 10px 14px;
        font-size: 14px;
    }


/* 小手机 (< 380px) */
@media (max-width: 380px) {
    .search-title {
        font-size: 20px;
    }

    .card-link {
        padding: 16px;
    }

    .category-tag {
        padding: 6px 12px;
        font-size: 12px;
    }
}
}

/* ============================================
   评论样式（Emlog评论兼容）
   ============================================ */
.no-comments {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.comment-closed {
    text-align: center;
    padding: 24px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.comment-list {
    list-style: none;
}

.comment-list li {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.comment-avatar {
    flex-shrink: 0;
}

.comment-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-input);
}

.comment-avatar-fallback {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-list li.is-reply {
    padding-left: 12px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.comment-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 8px;
}

.comment-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 8px;
}

.comment-post {
    margin-top: 24px;
}

.comment-post input,
.comment-post textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-normal);
    margin-bottom: 12px;
}

.comment-post input:focus,
.comment-post textarea:focus {
    border-color: var(--primary-color);
}

.comment-post textarea {
    min-height: 100px;
    resize: vertical;
}

.comment-post button {
    padding: 10px 24px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-end));
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    transition: all var(--transition-normal);
}

.comment-post button:hover {
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* ============================================
   Toast 提示
   ============================================ */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 10px 24px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 14px;
    box-shadow: 0 8px 30px var(--shadow-color);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 200;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    border-color: var(--color-free);
}

.toast.error {
    border-color: var(--color-hot);
}
