/* ===== 全局样式 ===== */
:root {
    --primary: #4e54c8;
    --primary-light: #8f94fb;
    --dark-bg: #0f0f23;
    --card-bg: #ffffff;
    --card-border: #e9ecef;
    --text-main: #212529;
    --text-muted: #6c757d;
    --body-bg: #f4f6fb;
    --radius: 14px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 32px rgba(78,84,200,0.18);
    --nav-bg: linear-gradient(135deg, #1a1a3e 0%, #2d2d7c 60%, #4e54c8 100%);
    --footer-bg: linear-gradient(135deg, #1a1a3e, #2d2d7c);
    --cat-nav-bg: #ffffff;
    --cat-nav-border: var(--card-border);
    --input-bg: #ffffff;
    --table-head-bg: #f8f9fa;
    --admin-main-bg: #f4f6fb;
    --admin-topbar-bg: #ffffff;
    --admin-card-bg: #ffffff;
    --progress-color: #8f94fb;
}

/* ===== 暗黑模式 ===== */
[data-theme="dark"] {
    --card-bg: #1e1e3a;
    --card-border: #2a2a55;
    --text-main: #e2e4f0;
    --text-muted: #8a8ab8;
    --body-bg: #0f0f23;
    --shadow: 0 2px 12px rgba(0,0,0,0.4);
    --shadow-hover: 0 8px 32px rgba(78,84,200,0.4);
    --cat-nav-bg: #13132d;
    --cat-nav-border: #2a2a55;
    --input-bg: #1e1e3a;
    --table-head-bg: #1a1a38;
    --admin-main-bg: #0d0d22;
    --admin-topbar-bg: #13132d;
    --admin-card-bg: #1a1a38;
    --progress-color: #a78bfa;
}
[data-theme="dark"] body { background: var(--body-bg); color: var(--text-main); }
[data-theme="dark"] .tool-card { background: var(--card-bg); border-color: var(--card-border); }
[data-theme="dark"] .tool-card:hover { border-color: rgba(143,148,251,0.4); }
[data-theme="dark"] .tool-name { color: var(--text-main); }
[data-theme="dark"] .tool-desc { color: var(--text-muted); }
[data-theme="dark"] .tool-card-footer { border-color: var(--card-border); }
[data-theme="dark"] .cat-nav { background: var(--cat-nav-bg); border-color: var(--cat-nav-border); }
[data-theme="dark"] .cat-pill { background: #1a1a38; color: var(--text-muted); }
[data-theme="dark"] .cat-pill:hover { background: #252550; }
[data-theme="dark"] .section-title { color: var(--text-main); }
[data-theme="dark"] .section-divider { border-color: #2a2a55; }
[data-theme="dark"] .tool-detail-card { background: var(--card-bg); border-color: var(--card-border); }
[data-theme="dark"] .tool-detail-header { background: linear-gradient(135deg, #1a1a3e, #161635); border-color: var(--card-border); }
[data-theme="dark"] .tool-detail-name { color: var(--text-main); }
[data-theme="dark"] .tool-detail-desc { color: #c0c4e0; }
[data-theme="dark"] .tool-detail-body h5 { color: var(--text-main); }
[data-theme="dark"] .sidebar-card { background: var(--card-bg); border-color: var(--card-border); }
[data-theme="dark"] .sidebar-title { color: var(--text-main); border-color: var(--card-border); }
[data-theme="dark"] .breadcrumb { background: var(--card-bg); }
[data-theme="dark"] .pagination .page-link { background: var(--card-bg); border-color: var(--card-border); color: var(--primary-light); }
[data-theme="dark"] .pagination .page-item.disabled .page-link { background: #1a1a38; color: var(--text-muted); }
[data-theme="dark"] .info-list li { border-color: #2a2a55; }
[data-theme="dark"] .related-tool-item:hover { background: #252550; }
[data-theme="dark"] .filter-pill { background: #1a1a38; color: var(--text-muted); }
[data-theme="dark"] .filter-pill:hover { background: #252550; color: var(--primary-light); }
[data-theme="dark"] .search-bar-lg .form-control,
[data-theme="dark"] .search-bar-lg .input-group-text { background: var(--input-bg); border-color: var(--card-border); color: var(--text-main); }
[data-theme="dark"] .tag-link { background: #252550; color: var(--primary-light); }
[data-theme="dark"] .tag-link:hover { background: var(--primary); color: white; }

body {
    background: var(--body-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-main);
    transition: background 0.3s, color 0.3s;
}

/* ===== 顶部导航栏 ===== */
.top-nav-wrapper {
    background: linear-gradient(135deg, #1a1a3e 0%, #2d2d7c 60%, #4e54c8 100%);
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.top-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 12px 0;
}

/* 网站名称 */
.top-nav-brand {
    flex-shrink: 0;
}

.top-nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 700;
    transition: opacity 0.2s;
}

.top-nav-logo:hover {
    color: white;
    opacity: 0.9;
}

.top-nav-logo i {
    font-size: 1.5rem;
}

/* 导航菜单 */
.top-nav-menu {
    flex: 1;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
    align-items: center;
}

.nav-menu .nav-item {
    position: relative;
}

.nav-menu .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-menu .nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: white;
}

.nav-menu .nav-link.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

.nav-menu .nav-link i {
    font-size: 1rem;
}

/* 工具分类下拉菜单 */
.nav-category-dropdown .dropdown-menu {
    min-width: 220px;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 0;          /* 去掉间距，防止悬停时菜单意外消失 */
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    background: rgba(26, 26, 62, 0.98);
    backdrop-filter: blur(10px);
    padding: 8px;
}

/* 悬停桥接：li 向下延伸悬停区，覆盖菜单项与下拉框之间的任何间隙 */
.nav-category-dropdown,
.nav-news-dropdown {
    position: relative;
}
.nav-category-dropdown::after,
.nav-news-dropdown::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 10px;
}

/* 悄悄悬停自动展开 */
.nav-category-dropdown:hover .dropdown-menu,
.nav-news-dropdown:hover .dropdown-menu {
    display: block;
}
.nav-category-dropdown .dropdown-toggle::after,
.nav-news-dropdown .dropdown-toggle::after {
    transition: transform 0.2s;
}
.nav-category-dropdown:hover .dropdown-toggle::after,
.nav-news-dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.category-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: rgba(255,255,255,0.9);
    border-radius: 8px;
    font-size: 0.88rem;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.category-dropdown-menu .dropdown-item:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    transform: translateX(4px);
}

.category-dropdown-menu .dropdown-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.category-dropdown-menu .dropdown-item .badge {
    font-size: 0.7rem;
    padding: 3px 8px;
}

/* 搜索框 */
.top-nav-search {
    flex-shrink: 0;
    min-width: 280px;
}

.search-form .input-group {
    border-radius: 50px;
    overflow: hidden;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.2s;
}

.search-form .input-group:focus-within {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
    box-shadow: 0 0 0 3px rgba(78, 84, 200, 0.3);
}

.search-form .input-group-text {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    padding: 8px 14px;
}

.search-form .form-control {
    background: transparent;
    border: none;
    color: white;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.search-form .form-control::placeholder {
    color: rgba(255,255,255,0.5);
}

.search-form .form-control:focus {
    background: transparent;
    color: white;
    box-shadow: none;
}

.search-form .btn-primary {
    border-radius: 0 50px 50px 0;
    padding: 8px 20px;
    font-size: 0.88rem;
    border: none;
    background: linear-gradient(135deg, #4e54c8, #8f94fb);
}

.search-form .btn-primary:hover {
    background: linear-gradient(135deg, #3d42b5, #7d82e8);
}

/* 暗黑模式切换按钮 */
.dark-toggle {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.dark-toggle:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(20deg);
}

/* ===== 移动端导航栏 (#mobileNav) ===== */
#mobileNav {
    background: linear-gradient(135deg, #1a1a3e 0%, #2d2d7c 60%, #4e54c8 100%);
    box-shadow: 0 2px 16px rgba(0,0,0,0.3);
    padding: 8px 0;
    z-index: 1031;
}

/* 移动端 Logo */
.mobile-nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-weight: 700;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.mobile-nav-brand i {
    font-size: 1.3rem;
    flex-shrink: 0;
}
.mobile-nav-sitename {
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mobile-nav-brand:hover {
    color: rgba(255,255,255,0.9);
}

/* 移动端右侧操作区 */
.mobile-nav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.mobile-nav-actions .navbar-toggler {
    color: white;
    padding: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px !important;
}
.mobile-nav-actions .dark-toggle {
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
}

/* 移动端折叠菜单 */
#mobileNav .navbar-collapse {
    background: rgba(20, 20, 55, 0.98);
    border-radius: 12px;
    margin-top: 10px;
    padding: 10px 8px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    backdrop-filter: blur(12px);
}
#mobileNav .navbar-nav .nav-link {
    color: rgba(255,255,255,0.85) !important;
    padding: 10px 14px !important;
    border-radius: 8px;
    font-size: 0.92rem;
    margin: 2px 0;
    transition: background 0.2s;
}
#mobileNav .navbar-nav .nav-link:hover,
#mobileNav .navbar-nav .nav-link.active {
    background: rgba(255,255,255,0.12) !important;
    color: white !important;
}
#mobileNav .navbar-nav .nav-link.ps-4 {
    padding-left: 28px !important;
}

/* 移动端菜单内搜索栏 */
#mobileNav .navbar-collapse .input-group {
    border-radius: 50px;
    overflow: hidden;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
}
#mobileNav .navbar-collapse .form-control {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    padding: 10px 12px;
}
#mobileNav .navbar-collapse .form-control::placeholder {
    color: rgba(255,255,255,0.5);
}
#mobileNav .navbar-collapse .form-control:focus {
    background: transparent;
    box-shadow: none;
    color: white;
}
#mobileNav .navbar-collapse .btn-primary {
    border-radius: 0 50px 50px 0;
    padding: 0 16px;
}
#mobileNav .navbar-collapse .input-group-text {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
}

/* ===== 旧导航栏样式（保留兼容） ===== */
#mainNav {
    background: linear-gradient(135deg, #1a1a3e 0%, #2d2d7c 60%, #4e54c8 100%);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
    padding: 12px 0;
}

#mainNav .navbar-brand {
    font-size: 1.3rem;
    letter-spacing: 0.5px;
}

#mainNav .nav-link {
    font-size: 0.88rem;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.2s;
    white-space: nowrap;
}
#mainNav .nav-link:hover, #mainNav .nav-link.active {
    background: rgba(255,255,255,0.15);
}

.search-input::placeholder { color: rgba(255,255,255,0.6); }
.search-input:focus { background: rgba(255,255,255,0.2) !important; color: white; box-shadow: none; }

/* ===== Hero 区域 ===== */
.hero-section {
    background: linear-gradient(135deg, #1a1a3e 0%, #2d2d7c 50%, #4e54c8 100%);
    color: white;
    padding: 60px 0 50px;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(143,148,251,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(78,84,200,0.2) 0%, transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.9);
    padding: 4px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    backdrop-filter: blur(5px);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

.gradient-text {
    background: linear-gradient(90deg, #a78bfa, #60a5fa, #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 0;
}

.hero-search-box {
    max-width: 600px;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.hero-search-box .input-group-text {
    border-radius: 50px 0 0 50px;
    padding: 0 16px;
}
.hero-search-box .form-control {
    font-size: 1rem;
}
.hero-search-box .btn {
    border-radius: 0 50px 50px 0;
    font-weight: 600;
    min-width: 90px;
}

/* 热门标签 */
.badge-tag {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.85);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    margin: 3px;
    text-decoration: none;
    transition: all 0.2s;
}
.badge-tag:hover {
    background: rgba(255,255,255,0.25);
    color: white;
}

/* ===== 分类导航 ===== */
.cat-nav {
    background: white;
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 62px;
    z-index: 100;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-muted);
    background: #f0f2f5;
    border: 1.5px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
}
.cat-pill:hover {
    color: var(--cat-color, var(--primary));
    background: color-mix(in srgb, var(--cat-color, var(--primary)) 10%, white);
    border-color: color-mix(in srgb, var(--cat-color, var(--primary)) 30%, white);
}
.cat-pill.active {
    color: white;
    background: var(--cat-color, var(--primary));
    border-color: var(--cat-color, var(--primary));
    box-shadow: 0 2px 8px color-mix(in srgb, var(--cat-color, var(--primary)) 40%, transparent);
}

/* ===== Section ===== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin: 0;
}
.section-divider {
    border-color: #e9ecef;
    margin: 2rem 0;
}

/* ===== 工具卡片（重新排版设计） ===== */
/* 同行卡片等高 */
.cat-section .row,
.content-area > .row {
    align-items: stretch;
}
.cat-section .row [class*="col-"],
.content-area > .row [class*="col-"] {
    display: flex;
    flex-direction: column;
}
.tool-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
}
.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(78, 84, 200, 0.15);
    border-color: rgba(78, 84, 200, 0.3);
}
.tool-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.tool-card-inner {
    padding: 20px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* 顶部图标区（居中布局）*/
.tool-card-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    min-height: 72px;
}

/* 图标样式升级 */
.tool-icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.25s;
}
.tool-card:hover .tool-icon-wrap {
    transform: scale(1.08);
}
.tool-icon-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 8px;
}
.tool-icon-fallback {
    font-size: 1.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* 徽章区（左上角浮动）*/
.tool-badges {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: row;
    gap: 4px;
    align-items: flex-start;
}
.badge-hot {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    font-size: 0.62rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(238, 90, 36, 0.3);
    letter-spacing: 0.3px;
}
.badge-free {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
    font-size: 0.62rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 184, 148, 0.3);
    letter-spacing: 0.3px;
}
.badge-paid {
    background: linear-gradient(135deg, #74b9ff, #0984e3);
    color: white;
    font-size: 0.62rem;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(9, 132, 227, 0.3);
    letter-spacing: 0.3px;
}

/* 内容区 */
.tool-card-body { flex: 1; }
.tool-name {
    font-size: 0.98rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-main);
    line-height: 1.4;
    transition: color 0.2s;
}
.tool-card:hover .tool-name {
    color: var(--primary);
}
.tool-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 底部操作区 */
.tool-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-top: 1px solid var(--card-border);
    background: rgba(245, 247, 255, 0.3);
    border-radius: 0 0 16px 16px;
}
[data-theme="dark"] .tool-card-footer {
    background: rgba(30, 30, 58, 0.5);
}
.tool-cat {
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}
.tool-views {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
}

/* 去使用按钮 */
.btn-use {
    background: linear-gradient(135deg, #4e54c8, #6c63ff);
    color: white;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(78, 84, 200, 0.25);
    border: none;
}
.btn-use:hover {
    background: linear-gradient(135deg, #6c63ff, #4e54c8);
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(78, 84, 200, 0.35);
    color: white;
}
.btn-use i {
    transition: transform 0.2s;
}
.btn-use:hover i {
    transform: translateX(2px);
}

.tool-visit {
    color: var(--primary);
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.2s;
}
.tool-card:hover .tool-visit { opacity: 1; }

/* ===== 工具详情页 ===== */
.tool-detail-card {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.tool-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 28px 28px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #fafbff, #f0f2ff);
}
.tool-detail-icon-wrap {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    border: 2px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}
.tool-detail-icon {
    width: 56px;
    height: 56px;
    object-fit: contain;
}
.tool-detail-icon-text {
    font-size: 2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tool-detail-name {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}
.tool-cat-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}
.tool-detail-body {
    padding: 24px 28px;
}
.tool-detail-desc {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
}
.tool-detail-actions {
    padding: 0 28px 24px;
}
.tag-link {
    display: inline-block;
    background: #f0f2ff;
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.82rem;
    text-decoration: none;
    margin: 2px;
    transition: all 0.2s;
}
.tag-link:hover {
    background: var(--primary);
    color: white;
}

/* ===== 侧边栏 ===== */
.sidebar-card {
    background: white;
    border-radius: 14px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    padding: 20px;
}
.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}
.info-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f8f8f8;
    font-size: 0.88rem;
    overflow: hidden;
}
.info-list li:last-child { border-bottom: none; }
.info-list li i { font-size: 1rem; flex-shrink: 0; }
.info-list li a { color: var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.related-tool-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    margin-bottom: 4px;
}
.related-tool-item:hover { background: #f8f8ff; color: inherit; }
.related-tool-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    overflow: hidden;
}
.related-tool-icon img { width: 28px; height: 28px; object-fit: contain; }
.related-tool-name { font-size: 0.88rem; font-weight: 600; }
.related-tool-desc { font-size: 0.75rem; color: var(--text-muted); }

/* 相关评测文章 */
.related-article-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
    margin-bottom: 4px;
}
.related-article-item:hover { background: #f8f8ff; color: inherit; }
.related-article-info { flex: 1; min-width: 0; }
.related-article-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.related-article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.news-cat-tag-sm {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 4px;
    background: #eef2ff;
    color: #4f46e5;
    font-weight: 500;
}
[data-theme="dark"] .related-article-item:hover { background: #252550; }
[data-theme="dark"] .related-article-title { color: var(--text-main); }
[data-theme="dark"] .news-cat-tag-sm { background: #2d2d7c; color: #a5b4fc; }

/* ===== 搜索页 ===== */
.search-bar-lg {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.search-bar-lg .input-group-text {
    border: 1px solid #dee2e6;
    border-right: none;
}
.search-bar-lg .form-control {
    border: 1px solid #dee2e6;
    border-left: none;
}
.filter-pill {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 0.82rem;
    text-decoration: none;
    color: var(--text-muted);
    background: #f0f2f5;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.filter-pill:hover { background: #e8ebff; color: var(--primary); }
.filter-pill.active { background: var(--primary); color: white; }

/* ===== 页脚 ===== */
.site-footer {
    background: linear-gradient(135deg, #1a1a3e, #2d2d7c);
    color: rgba(255,255,255,0.75);
}
.site-footer p { margin: 0; }
.site-footer strong { color: white; }
.site-footer a { color: rgba(255,255,255,0.6); text-decoration: none; }
.site-footer a:hover { color: rgba(255,255,255,0.95); }
/* 覆盖 Bootstrap text-muted 在深色背景下静不可见的问题 */
.site-footer .text-muted { color: rgba(255,255,255,0.55) !important; }

/* ===== 面包屑 ===== */
.breadcrumb {
    background: white;
    border-radius: 8px;
    padding: 10px 16px;
    box-shadow: var(--shadow);
    font-size: 0.88rem;
}
.breadcrumb-item a { color: var(--primary); text-decoration: none; }

/* ===== 分页 ===== */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    color: var(--primary);
}
.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ===== 管理后台 ===== */
.admin-sidebar {
    background: linear-gradient(180deg, #1a1a3e 0%, #2d2d7c 100%);
    min-height: 100vh;
    width: 240px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s;
}
.admin-sidebar .sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-sidebar .sidebar-logo a {
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
}
.admin-nav {
    padding: 12px 0;
}
.admin-nav .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 10px 20px;
    border-radius: 0;
    transition: all 0.2s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-nav .nav-link:hover, .admin-nav .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.12);
    border-left: 3px solid #8f94fb;
    padding-left: 17px;
}
.admin-nav .nav-link i { font-size: 1rem; width: 18px; }

.admin-main {
    margin-left: 240px;
    min-height: 100vh;
    background: #f4f6fb;
}
.admin-topbar {
    background: white;
    padding: 12px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}
.admin-content {
    padding: 24px;
}

/* 统计卡片 */
.stat-card {
    background: white;
    border-radius: 14px;
    padding: 20px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    gap: 16px;
}
.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.stat-num {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 2px;
}
.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 管理表格 */
.admin-table-card {
    background: white;
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.admin-table-card .card-header {
    background: white;
    border-bottom: 1px solid #f0f0f0;
    padding: 16px 20px;
    font-weight: 700;
    font-size: 1rem;
}

/* 登录页 */
.login-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a3e 0%, #2d2d7c 50%, #4e54c8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo {
    text-align: center;
    margin-bottom: 28px;
}
.login-logo .logo-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin-bottom: 12px;
}

/* ===== 响应式 - 平板设备 (992px以下) ===== */
@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.show {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .admin-topbar .sidebar-toggle {
        display: inline-flex !important;
    }
    
    /* 左侧分类栏隐藏 */
    .cat-sidebar {
        display: none !important;
    }
    
    /* 内容区占满全宽 */
    .content-area {
        padding: 16px 12px 32px;
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    /* 页面布局调整为单列 */
    .page-layout {
        flex-direction: column;
    }
    
    /* 迷你横幅调整 */
    .mini-banner {
        padding: 16px 14px;
    }
    
    .mini-banner-inner {
        flex-direction: column;
        gap: 12px;
    }
    
    .mini-banner-title {
        text-align: center;
        width: 100%;
    }
    
    .mini-banner-title h2 {
        font-size: 1.1rem;
    }
    
    .mini-banner-title p {
        font-size: 0.75rem;
    }
    
    .mini-banner-search {
        width: 100%;
        max-width: 100%;
    }
    
    .mini-banner-stats {
        justify-content: center;
        width: 100%;
    }
    
    /* 新闻页布局调整 */
    .news-layout {
        flex-direction: column;
    }
    
    .news-main {
        flex: 1;
        min-width: 0;
    }
    
    .news-sidebar {
        width: 100%;
        margin-top: 20px;
    }
}

/* ===== 响应式 - 手机设备 (768px以下) ===== */
@media (max-width: 768px) {
    /* 修复导航栏错位 */
    #mainNav {
        padding: 10px 0 !important;
        position: relative !important;
        z-index: 1030 !important;
    }
    
    #mainNav .container {
        position: relative !important;
    }
    
    #mainNav .navbar-brand {
        font-size: 1.1rem !important;
        margin-right: auto !important;
    }
    
    /* 移动端汉堡菜单 */
    .navbar-toggler {
        padding: 6px 10px !important;
        font-size: 1rem !important;
        border: none !important;
        background: rgba(255,255,255,0.1) !important;
        border-radius: 6px !important;
    }
    
    /* 强制隐藏PC端导航链接 */
    .navbar-collapse.d-lg-block {
        display: none !important;
    }
    
    /* 导航折叠菜单样式 */
    .navbar-collapse {
        background: rgba(26, 26, 62, 0.98) !important;
        margin-top: 10px !important;
        border-radius: 10px !important;
        padding: 12px !important;
        backdrop-filter: blur(10px) !important;
        box-shadow: 0 8px 32px rgba(0,0,0,0.4) !important;
        border: 1px solid rgba(255,255,255,0.1) !important;
    }
    
    .navbar-collapse .nav-link {
        padding: 12px 16px !important;
        margin: 4px 0 !important;
        border-radius: 8px !important;
        color: white !important;
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
    }
    
    .navbar-collapse .nav-link:hover,
    .navbar-collapse .nav-link.active {
        background: rgba(255, 255, 255, 0.15) !important;
        color: white !important;
    }
    
    .navbar-collapse .dropdown-divider {
        border-color: rgba(255,255,255,0.2) !important;
        margin: 8px 0 !important;
    }
    
    /* Hero区域 - 修复错位 */
    .hero-section { 
        padding: 25px 0 20px !important;
        position: relative !important;
    }
    
    .hero-title { 
        font-size: 1.4rem !important;
        margin-bottom: 8px !important;
        line-height: 1.4 !important;
        text-align: center !important;
    }
    
    .hero-subtitle { 
        font-size: 0.8rem !important;
        margin-bottom: 12px !important;
        line-height: 1.5 !important;
        text-align: center !important;
    }
    
    .hero-search-box { 
        max-width: 100% !important;
        margin: 0 auto !important;
        position: relative !important;
    }
    
    .hero-search-box .input-group {
        border-radius: 50px !important;
        overflow: hidden !important;
    }
    
    /* 工具卡片 - 移动端优化 */
    .tool-card {
        margin-bottom: 0 !important;
        height: 100% !important;
    }
    
    .tool-card-inner {
        padding: 14px 12px !important;
    }
    
    .tool-card-top {
        min-height: 60px !important;
        margin-bottom: 10px !important;
    }
    
    .tool-icon-wrap {
        width: 50px !important;
        height: 50px !important;
        border-radius: 14px !important;
    }
    
    .tool-icon-img {
        width: 34px !important;
        height: 34px !important;
    }
    
    .tool-icon-fallback {
        font-size: 1.4rem !important;
    }
    
    .tool-card-body {
        padding: 0 !important;
        text-align: center !important;
    }
    
    .tool-card-title {
        font-size: 0.85rem !important;
        margin-bottom: 6px !important;
        line-height: 1.3 !important;
    }
    
    .tool-card-desc {
        font-size: 0.72rem !important;
        margin-bottom: 10px !important;
        -webkit-line-clamp: 2 !important;
        max-height: 2.8em !important;
        line-height: 1.4 !important;
    }
    
    .tool-card-footer {
        padding: 8px 0 0 !important;
        margin-top: auto !important;
    }
    
    .tool-cat {
        font-size: 0.68rem !important;
        padding: 3px 8px !important;
    }
    
    .tool-views {
        font-size: 0.68rem !important;
    }
    
    .btn-use {
        font-size: 0.72rem !important;
        padding: 5px 10px !important;
    }
    
    /* 管理后台 */
    .admin-content { 
        padding: 16px; 
    }
    .cat-nav { 
        top: 58px; 
    }
    
    /* 迷你横幅 - 修复移动端错位 */
    .mini-banner {
        padding: 14px 12px !important;
        border-radius: 14px !important;
        margin-bottom: 18px !important;
        position: relative !important;
    }
    
    .mini-banner-inner {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
        align-items: center !important;
    }
    
    .mini-banner-title {
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 0 !important;
    }
    
    .d-none.d-md-block.mini-banner-title {
        display: block !important;
    }
    
    .mini-banner-title h2 {
        font-size: 1rem !important;
        margin-bottom: 6px !important;
        line-height: 1.3 !important;
    }
    
    .mini-banner-title p {
        font-size: 0.72rem !important;
        margin-bottom: 0 !important;
        line-height: 1.4 !important;
        opacity: 0.9 !important;
    }
    
    .mini-banner-search {
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 0 !important;
    }
    
    .mini-banner-search .input-group {
        border-radius: 50px !important;
        overflow: hidden !important;
        width: 100% !important;
    }
    
    .mini-banner-search .input-group-text {
        padding: 10px 12px !important;
        font-size: 0.9rem !important;
    }
    
    .mini-banner-search .form-control {
        font-size: 0.85rem !important;
        padding: 10px 12px !important;
        border: none !important;
    }
    
    .mini-banner-search .btn {
        padding: 0 18px !important;
        font-size: 0.85rem !important;
        white-space: nowrap !important;
    }
    
    .mini-banner-search .mt-2 {
        margin-top: 8px !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
    
    .badge-tag {
        font-size: 0.7rem !important;
        padding: 4px 10px !important;
        margin: 3px !important;
    }
    
    .mini-banner-stats {
        width: 100% !important;
        justify-content: center !important;
        gap: 20px !important;
    }
    
    /* 分类区块 - 移动端优化 */
    .cat-section {
        margin-bottom: 24px !important;
    }
    
    .cat-section-header {
        margin-bottom: 12px !important;
        padding-bottom: 10px !important;
        border-bottom: 2px solid var(--card-border) !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    .cat-section-title {
        font-size: 0.95rem !important;
        line-height: 1.3 !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-wrap: wrap !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    .cat-section-title i {
        font-size: 1rem !important;
        flex-shrink: 0 !important;
    }
    
    .cat-section-count {
        font-size: 0.75rem !important;
        padding: 3px 10px !important;
        flex-shrink: 0 !important;
    }
    
    .cat-section-more {
        font-size: 0.8rem !important;
        padding: 4px 10px !important;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
    
    /* 工具卡片网格 - 移动端2列 */
    .row > [class*="col-"] {
        margin-bottom: 12px !important;
    }
    
    .cat-section .row [class*="col-"],
    .content-area > .row [class*="col-"] {
        display: flex !important;
    }
    
    /* 新闻页 */
    .news-page-header {
        padding: 12px 0;
    }
    
    .news-page-title {
        font-size: 1.4rem;
    }
    
    .news-cats {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .news-cat-pill {
        font-size: 0.78rem;
        padding: 5px 10px;
    }
    
    /* 新闻卡片 */
    .news-card {
        flex-direction: column;
    }
    
    .news-card-cover {
        width: 100%;
        height: 180px;
        border-radius: 8px 8px 0 0;
    }
    
    .news-card-body {
        padding: 12px;
    }
    
    .news-card-title {
        font-size: 0.95rem;
    }
    
    .news-card-summary {
        font-size: 0.82rem;
        -webkit-line-clamp: 2;
    }
    
    /* 侧边栏 */
    .news-sidebar-card {
        padding: 14px;
    }
    
    .news-sidebar-title {
        font-size: 0.9rem;
    }
    
    /* 页脚 */
    .site-footer {
        padding: 20px 0;
    }
    
    .site-footer .col-md-4 {
        margin-bottom: 12px;
    }
    
    .site-footer p,
    .site-footer small {
        font-size: 0.75rem;
    }
    
    /* 回到顶部按钮 */
    #back-to-top {
        bottom: 20px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* ===== 响应式 - 小屏手机 (576px以下) ===== */
@media (max-width: 576px) {
    /* Hero区域 */
    .hero-title { 
        font-size: 1.3rem !important;
    }
    
    /* 工具卡片 - 小屏优化 */
    .tool-card-inner { 
        padding: 12px 10px !important;
    }
    
    .tool-card-top {
        min-height: 54px !important;
        margin-bottom: 8px !important;
    }
    
    .tool-icon-wrap { 
        width: 46px !important;
        height: 46px !important;
    }
    
    .tool-icon-img {
        width: 30px !important;
        height: 30px !important;
    }
    
    .tool-icon-fallback {
        font-size: 1.3rem !important;
    }
    
    .tool-card-title { 
        font-size: 0.82rem !important;
        margin-bottom: 5px !important;
    }
    
    .tool-card-desc {
        font-size: 0.7rem !important;
        -webkit-line-clamp: 2 !important;
        margin-bottom: 8px !important;
    }
    
    .tool-card-footer {
        padding-top: 6px !important;
    }
    
    .tool-cat {
        font-size: 0.66rem !important;
        padding: 2px 6px !important;
    }
    
    .tool-views {
        font-size: 0.66rem !important;
    }
    
    .btn-use {
        font-size: 0.7rem !important;
        padding: 4px 8px !important;
    }
    .section-title { 
        font-size: 0.92rem !important;
    }
    
    /* 工具卡片footer */
    .tool-card-footer {
        padding: 8px 10px;
    }
    
    .tool-cat {
        font-size: 0.68rem;
        padding: 3px 8px;
    }
    
    .tool-views {
        font-size: 0.68rem;
    }
    
    .btn-use {
        font-size: 0.72rem;
        padding: 5px 10px;
    }
    
    /* 分页 */
    .pagination .page-link {
        font-size: 0.82rem;
        padding: 0.35rem 0.6rem;
    }
    
    /* 新闻卡片 */
    .news-card-cover {
        height: 150px;
    }
    
    .news-card-meta {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
    }
    
    .news-cat-tag {
        font-size: 0.72rem;
        padding: 2px 6px;
    }
    
    /* 面包屑 */
    .breadcrumb {
        font-size: 0.78rem;
        padding: 8px 12px;
    }
    
    /* 首页新闻 */
    .home-news-card {
        flex-direction: column;
    }
    
    .home-news-cover {
        width: 100%;
        height: 160px;
        border-radius: 8px 8px 0 0;
    }
    
    .home-news-body {
        padding: 10px;
    }
    
    .home-news-title {
        font-size: 0.88rem;
    }
    
    .home-news-summary {
        font-size: 0.78rem;
        -webkit-line-clamp: 2;
    }
    
    /* 暗黑切换按钮 */
    .dark-toggle {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    /* 移动端搜索框 */
    #mobileNavMenu .input-group {
        max-width: 100%;
    }
    
    #mobileNavMenu .form-control {
        font-size: 0.82rem;
    }
}

/* ===== 动画 ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.tool-card {
    animation: fadeInUp 0.4s ease both;
}
.tool-card:nth-child(1) { animation-delay: 0.05s; }
.tool-card:nth-child(2) { animation-delay: 0.1s; }
.tool-card:nth-child(3) { animation-delay: 0.15s; }
.tool-card:nth-child(4) { animation-delay: 0.2s; }
.tool-card:nth-child(n+5) { animation-delay: 0.25s; }

/* ===== 覆盖遮罩 ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}
.sidebar-overlay.show { display: block; }

/* ===== 顶部加载进度条 ===== */
#page-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--progress-color), #60a5fa);
    z-index: 9999;
    transition: width 0.2s ease;
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 8px var(--primary-light);
}

/* ===== 回到顶部按钮 ===== */
#back-to-top {
    position: fixed;
    bottom: 32px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.3s, transform 0.3s;
    box-shadow: 0 4px 16px rgba(78,84,200,0.4);
    z-index: 1050;
}
#back-to-top.show { opacity: 1; transform: translateY(0); }
#back-to-top:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(78,84,200,0.5); }

/* ===== 暗黑切换按钮 ===== */
.dark-toggle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s;
    font-size: 1rem;
    flex-shrink: 0;
}
.dark-toggle:hover { background: rgba(255,255,255,0.2); transform: rotate(15deg); }

/* ===== 卡片光晕 hover 效果 ===== */
.tool-card {
    position: relative;
    overflow: hidden;
}
.tool-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 60%;
    height: 200%;
    background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.12) 50%, transparent 70%);
    transform: skewX(-15deg);
    transition: left 0.6s ease;
    pointer-events: none;
    z-index: 1;
}
.tool-card:hover::before { left: 120%; }
.tool-card-link, .tool-card-inner { position: relative; z-index: 2; }

/* 精选卡片发光边框 */
.tool-card.is-featured {
    border-color: rgba(255,183,0,0.35);
    box-shadow: 0 0 0 1px rgba(255,183,0,0.15), var(--shadow);
}
.tool-card.is-featured:hover {
    border-color: rgba(255,183,0,0.55);
    box-shadow: 0 0 0 2px rgba(255,183,0,0.2), var(--shadow-hover);
}

/* 分类数量徽标 */
.cat-pill .cat-count {
    font-size: 0.65rem;
    background: rgba(0,0,0,0.12);
    color: inherit;
    padding: 1px 5px;
    border-radius: 50px;
    margin-left: 4px;
    font-weight: 600;
}
.cat-pill.active .cat-count { background: rgba(255,255,255,0.25); }

/* ===== Hero 浮动粒子 ===== */
.hero-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0.12;
    animation: heroFloat 8s ease-in-out infinite;
}
@keyframes heroFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    33% { transform: translateY(-20px) scale(1.05); }
    66% { transform: translateY(10px) scale(0.95); }
}

/* 渐变文字动画 */
.gradient-text {
    background: linear-gradient(90deg, #a78bfa, #60a5fa, #34d399, #a78bfa);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 5s linear infinite;
}
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* ===== 卡片骨架屏 ===== */
.skeleton-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1.5px solid var(--card-border);
    padding: 16px;
    min-height: 160px;
}
.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #e8ebf4 25%, #d0d5e8 50%, #e8ebf4 75%);
    background-size: 400% 100%;
    animation: skeleton-wave 1.5s ease-in-out infinite;
    margin-bottom: 8px;
}
@keyframes skeleton-wave {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
[data-theme="dark"] .skeleton-line { background: linear-gradient(90deg, #1e1e3a 25%, #252550 50%, #1e1e3a 75%); background-size: 400% 100%; }

/* ===== 搜索框聚焦发光 ===== */
.hero-search-box:focus-within {
    box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 3px rgba(143,148,251,0.4) !important;
}
.hero-search-box .form-control:focus { background: white !important; color: #212529 !important; }

/* ===== 工具卡片视图数 ===== */
.tool-views {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 2px;
}

/* ===== 工具详情页 - 操作按钮组 ===== */
.tool-action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.btn-visit {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(78,84,200,0.3);
    transition: all 0.25s;
}
.btn-visit:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(78,84,200,0.4);
}
.btn-copy {
    transition: all 0.25s;
}
.btn-copy.copied {
    background: #00b894;
    border-color: #00b894;
    color: white;
}

/* ===== Toast 通知 ===== */
.app-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: rgba(30,30,58,0.95);
    color: #e2e4f0;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.88rem;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
    pointer-events: none;
}
.app-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 管理后台增强 ===== */
/* 统计卡片数字计数动效 */
.stat-num { font-variant-numeric: tabular-nums; }

/* 侧边栏改进 */
.admin-sidebar .sidebar-logo {
    padding: 18px 20px 14px;
    background: rgba(0,0,0,0.15);
}
.admin-nav .nav-link {
    position: relative;
    margin: 2px 8px;
    border-radius: 8px;
    padding: 9px 12px;
}
.admin-nav .nav-link:hover,
.admin-nav .nav-link.active {
    background: rgba(255,255,255,0.12);
    border-left: none;
    padding-left: 12px;
}
.admin-nav .nav-link.active {
    background: linear-gradient(90deg, rgba(143,148,251,0.25), rgba(143,148,251,0.05));
    color: white;
}
.admin-nav .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 3px;
    background: #8f94fb;
    border-radius: 0 3px 3px 0;
}

/* 顶部栏增强 */
.admin-topbar {
    background: var(--admin-topbar-bg);
}
[data-theme="dark"] .admin-topbar { background: var(--admin-topbar-bg); border-color: var(--card-border); }
[data-theme="dark"] .admin-main { background: var(--admin-main-bg); }
[data-theme="dark"] .admin-table-card { background: var(--admin-card-bg); border-color: var(--card-border); }
[data-theme="dark"] .admin-table-card .card-header { background: var(--admin-card-bg); border-color: var(--card-border); color: var(--text-main); }
[data-theme="dark"] .stat-card { background: var(--admin-card-bg); border-color: var(--card-border); }
[data-theme="dark"] .stat-label { color: var(--text-muted); }
[data-theme="dark"] .table { color: var(--text-main); }
[data-theme="dark"] .table-light { --bs-table-bg: var(--table-head-bg); --bs-table-color: var(--text-main); }
[data-theme="dark"] .table-hover tbody tr:hover { --bs-table-hover-bg: rgba(143,148,251,0.06); }
[data-theme="dark"] .table > :not(caption) > * > * { border-color: var(--card-border); }
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select { background: var(--input-bg); border-color: var(--card-border); color: var(--text-main); }
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus { background: var(--input-bg); color: var(--text-main); border-color: var(--primary-light); }
[data-theme="dark"] .p-3.border-bottom.bg-light { background: #161630 !important; border-color: var(--card-border) !important; }
[data-theme="dark"] .list-group-item { background: var(--admin-card-bg); border-color: var(--card-border); color: var(--text-main); }
[data-theme="dark"] .badge.bg-light { background: #252550 !important; color: var(--text-main) !important; }
[data-theme="dark"] .btn-outline-primary { color: var(--primary-light); border-color: var(--primary-light); }
[data-theme="dark"] .btn-outline-secondary { color: var(--text-muted); border-color: var(--card-border); }
[data-theme="dark"] .login-card { background: #1e1e3a; }
[data-theme="dark"] .login-card .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] .fw-bold,
[data-theme="dark"] .fw-semibold { color: var(--text-main); }
[data-theme="dark"] .text-muted { color: var(--text-muted) !important; }
[data-theme="dark"] .border-bottom { border-color: var(--card-border) !important; }
[data-theme="dark"] .border-top { border-color: var(--card-border) !important; }
[data-theme="dark"] .nav-tabs .nav-link { color: var(--text-muted); }
[data-theme="dark"] .nav-tabs .nav-link.active { background: var(--admin-card-bg); border-color: var(--card-border); color: var(--primary-light); }
[data-theme="dark"] .nav-tabs { border-color: var(--card-border); }
[data-theme="dark"] .tab-content .card { background: var(--admin-card-bg); border-color: var(--card-border); }

/* 快捷搜索提示 */
.search-kbd {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    padding: 0 5px;
    font-size: 0.7rem;
    line-height: 1.6;
    font-family: monospace;
    color: rgba(255,255,255,0.7);
    vertical-align: middle;
    margin-left: 6px;
}

/* 卡片入场动画重置（由JS控制） */
.tool-card {
    animation: none;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.tool-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 统计卡片悬停效果 */
.stat-card {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
[data-theme="dark"] .stat-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.4); }

/* 表格行悬停更平滑 */
.table-hover tbody tr { transition: background 0.15s; }

/* Alert 消息样式 */
.alert { border-radius: 10px; border: none; }
.alert-success { background: linear-gradient(135deg, #d4edda, #c3e6cb); }
.alert-warning { background: linear-gradient(135deg, #fff3cd, #ffeeba); }
.alert-danger { background: linear-gradient(135deg, #f8d7da, #f5c6cb); }

/* 分类统计进度条 */
.cat-stat-bar {
    height: 4px;
    border-radius: 2px;
    background: #e9ecef;
    overflow: hidden;
    margin-top: 4px;
}
.cat-stat-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s ease;
    width: 0;
}
[data-theme="dark"] .cat-stat-bar { background: #2a2a55; }

/* ================================================
   新版布局 (ai.179393.com 风格)
   Left Sidebar + Content Area + Category Sections
   ================================================ */

/* 导航简化版 */
#mainNav .navbar-nav { display: none !important; } /* 分类移到侧栏 */

/* 页面主布局容器 */
.page-layout {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - 180px);
}

/* ===== 左侧分类侧栏 ===== */
.cat-sidebar {
    width: 210px;
    min-width: 210px;
    flex-shrink: 0;
    position: sticky;
    top: 62px;
    height: calc(100vh - 62px);
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--cat-nav-bg);
    border-right: 1px solid var(--card-border);
    z-index: 50;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
    transition: background 0.3s;
}
.cat-sidebar::-webkit-scrollbar { width: 3px; }
.cat-sidebar::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }
[data-theme="dark"] .cat-sidebar::-webkit-scrollbar-thumb { background: #2a2a55; }

.cat-sidebar-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px 16px;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #1a1a3e 0%, #2d2d7c 55%, #4e54c8 100%);
    overflow: hidden;
}
/* 光晚渐变装饰 */
.cat-sidebar-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 85% 10%, rgba(143,148,251,0.5) 0%, transparent 55%),
        radial-gradient(ellipse at -5% 90%, rgba(96,165,250,0.25) 0%, transparent 50%);
    pointer-events: none;
}
/* 小圆点纹理 */
.cat-sidebar-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.07) 1px, transparent 1px);
    background-size: 14px 14px;
    pointer-events: none;
}
.cat-sidebar-header-icon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,0.14);
    border-radius: 12px;
    font-size: 1.15rem;
    color: #fff;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.28);
    box-shadow: 0 3px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.18);
    backdrop-filter: blur(6px);
}
.cat-sidebar-header-body {
    position: relative;
    z-index: 1;
    min-width: 0;
}
.cat-sidebar-header-text {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2.5px;
    color: #fff;
    line-height: 1.25;
    text-shadow: 0 1px 6px rgba(0,0,0,0.25);
}
.cat-sidebar-header-sub {
    font-size: 0.62rem;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.6px;
    margin-top: 3px;
    font-weight: 400;
    text-transform: uppercase;
}
[data-theme="dark"] .cat-sidebar-header {
    background: linear-gradient(135deg, #0f0f2e 0%, #1a1a50 55%, #2d2f78 100%);
}

.cat-sidebar-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.865rem;
    white-space: nowrap;
    transition: all 0.15s;
    position: relative;
    border-left: 3px solid transparent;
}
.cat-sidebar-item:hover {
    background: rgba(78,84,200,0.06);
    color: var(--primary);
}
.cat-sidebar-item.active {
    background: rgba(78,84,200,0.08);
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--cat-color, var(--primary));
}
.cat-sidebar-item i {
    font-size: 0.95rem;
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    color: var(--cat-color, var(--text-muted));
    transition: color 0.15s;
}
.cat-sidebar-item:hover i,
.cat-sidebar-item.active i { color: var(--cat-color, var(--primary)); }
.cat-sidebar-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.cat-sidebar-item em {
    font-style: normal;
    font-size: 0.68rem;
    color: var(--text-muted);
    background: var(--body-bg);
    padding: 1px 6px;
    border-radius: 20px;
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
    transition: all 0.15s;
}
.cat-sidebar-item.active em {
    background: var(--cat-color, var(--primary));
    color: white;
}
[data-theme="dark"] .cat-sidebar { background: #13132d; border-color: var(--card-border); }
[data-theme="dark"] .cat-sidebar-item em { background: #1e1e3a; }
[data-theme="dark"] .cat-sidebar-item:hover { background: rgba(143,148,251,0.08); }
[data-theme="dark"] .cat-sidebar-item.active { background: rgba(143,148,251,0.12); color: var(--primary-light); }

/* ===== 右侧内容区 ===== */
.content-area {
    flex: 1;
    min-width: 0;
    padding: 20px 20px 32px;
}

/* ===== 单页样式 ===== */
.single-page-wrapper {
    max-width: 1000px;
    margin: 0 auto;
}

/* 页面头部装饰 */
.single-page-hero {
    position: relative;
    background: linear-gradient(135deg, #1a1a3e 0%, #2d2d7c 50%, #4e54c8 100%);
    border-radius: 20px 20px 0 0;
    padding: 60px 40px;
    margin-bottom: 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(78, 84, 200, 0.3);
}

.single-page-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(143,148,251,0.3) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

.single-page-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(96,165,250,0.2) 0%, transparent 70%);
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.single-page-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.single-page-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.2);
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0.4); }
    50% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255,255,255,0); }
}

.single-page-icon i {
    font-size: 2.5rem;
    color: white;
}

.single-page-title-animated {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 15px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    animation: slideInDown 0.6s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.single-page-divider {
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.8), transparent);
    margin: 0 auto;
    border-radius: 2px;
}

/* 页面主体 */
.single-page {
    background: var(--card-bg);
    border-radius: 0 0 20px 20px;
    border: 1px solid var(--card-border);
    border-top: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    padding: 40px;
    position: relative;
}

.single-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4e54c8, #8f94fb, #60a5fa, #4e54c8);
    background-size: 200% 100%;
    animation: gradientMove 3s ease infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.single-page-breadcrumb {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--card-border);
}

.single-page-breadcrumb .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.single-page-breadcrumb .breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.single-page-breadcrumb .breadcrumb-item a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.single-page-breadcrumb .breadcrumb-item.active {
    color: var(--text-muted);
}

.single-page-content {
    color: var(--text-main);
    line-height: 1.8;
    font-size: 1.05rem;
}

.single-page-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--text-main);
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary);
    position: relative;
    display: inline-block;
}

.single-page-content h2::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--primary-light);
}

.single-page-content h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--text-main);
    padding-left: 15px;
    border-left: 4px solid var(--primary);
}

.single-page-content p {
    margin-bottom: 18px;
    text-align: justify;
}

.single-page-content ul,
.single-page-content ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

.single-page-content li {
    margin-bottom: 10px;
    position: relative;
}

.single-page-content ul li::marker {
    color: var(--primary);
}

.single-page-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.single-page-content a:hover {
    color: var(--primary-light);
    border-bottom-color: var(--primary-light);
}

.single-page-content strong {
    color: var(--primary);
    font-weight: 600;
}

.single-page-content blockquote {
    border-left: 4px solid var(--primary);
    padding: 15px 20px;
    margin: 20px 0;
    background: rgba(78, 84, 200, 0.05);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.single-page-content pre {
    background: #1e1e3a;
    color: #e2e4f0;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 20px 0;
}

.single-page-content code {
    background: rgba(78, 84, 200, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--primary);
    font-size: 0.9em;
}

.single-page-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.single-page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 20px 0;
}

.single-page-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
}

.single-page-content table th,
.single-page-content table td {
    padding: 12px 16px;
    border: 1px solid var(--card-border);
}

.single-page-content table th {
    background: rgba(78, 84, 200, 0.1);
    font-weight: 600;
    color: var(--primary);
}

.single-page-content table tr:hover {
    background: rgba(78, 84, 200, 0.05);
}

/* 表单样式 */
.single-page-content form {
    margin-top: 30px;
    padding: 30px;
    background: rgba(78, 84, 200, 0.05);
    border-radius: 12px;
    border: 1px solid var(--card-border);
}

.single-page-content .form-control,
.single-page-content .form-select {
    background: var(--input-bg);
    border: 2px solid var(--card-border);
    color: var(--text-main);
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.3s;
}

.single-page-content .form-control:focus,
.single-page-content .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(78, 84, 200, 0.1);
    background: var(--input-bg);
}

.single-page-content .btn {
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s;
}

.single-page-content .btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    box-shadow: 0 4px 12px rgba(78, 84, 200, 0.3);
}

.single-page-content .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 84, 200, 0.4);
}

/* 页面底部 */
.single-page-footer {
    margin-top: 40px;
    padding-top: 30px;
    text-align: center;
}

.single-page-footer-divider {
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    margin: 0 auto 20px;
    border-radius: 2px;
}

.single-page-footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.single-page-footer-text i {
    color: var(--primary);
}

/* 暗黑模式适配 */
[data-theme="dark"] .single-page-hero {
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 50%, #2d2d7c 100%);
}

[data-theme="dark"] .single-page-content blockquote {
    background: rgba(78, 84, 200, 0.1);
}

[data-theme="dark"] .single-page-content pre {
    background: #0a0a1a;
}

[data-theme="dark"] .single-page-content form {
    background: rgba(78, 84, 200, 0.08);
}

/* 响应式 */
@media (max-width: 768px) {
    .single-page-hero {
        padding: 40px 20px;
    }
    
    .single-page-title-animated {
        font-size: 1.8rem;
    }
    
    .single-page-icon {
        width: 60px;
        height: 60px;
    }
    
    .single-page-icon i {
        font-size: 2rem;
    }
    
    .single-page {
        padding: 25px 20px;
    }
    
    .single-page-content h2 {
        font-size: 1.5rem;
    }
    
    .single-page-content h3 {
        font-size: 1.2rem;
    }
    
    .single-page-content {
        font-size: 1rem;
    }
}

/* ===== 迷你横幅 (替代大 Hero) ===== */
.mini-banner {
    background: linear-gradient(135deg, #1a1a3e 0%, #2d2d7c 45%, #4e54c8 100%);
    border-radius: 16px;
    padding: 22px 26px;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
    color: white;
}
.mini-banner::before {
    content: '';
    position: absolute;
    top: -60%; right: -8%;
    width: 380px; height: 380px;
    background: radial-gradient(circle, rgba(143,148,251,0.22) 0%, transparent 65%);
    pointer-events: none;
}
.mini-banner::after {
    content: '';
    position: absolute;
    bottom: -70%; left: -3%;
    width: 240px; height: 240px;
    background: radial-gradient(circle, rgba(96,165,250,0.14) 0%, transparent 70%);
    pointer-events: none;
}
.mini-banner-inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}
.mini-banner-title h2 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0 0 3px;
    color: white;
}
.mini-banner-title p {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.65);
    margin: 0;
}
.mini-banner-search {
    flex: 1;
    min-width: 200px;
    max-width: 420px;
}
.mini-banner-search .input-group {
    border-radius: 50px;
    overflow: hidden;
    background: rgba(255,255,255,0.97);
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.mini-banner-search .input-group-text {
    background: transparent;
    border: none;
    color: #aaa;
    padding-left: 14px;
}
.mini-banner-search .form-control {
    border: none;
    background: transparent;
    font-size: 0.88rem;
    padding: 10px 4px;
    color: #333;
}
.mini-banner-search .form-control:focus { box-shadow: none; background: transparent; }
.mini-banner-search .btn {
    border-radius: 0 50px 50px 0;
    padding: 0 18px;
    font-weight: 600;
}
.mini-banner-stats {
    display: flex;
    gap: 18px;
    flex-shrink: 0;
}
.mini-banner-stat strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: white;
    line-height: 1.1;
}
.mini-banner-stat span {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.6);
}

/* ===== 首页 Hero Banner ===== */
.home-hero {
    position: relative;
    background: linear-gradient(135deg, #1a1a3e 0%, #2d2d7c 45%, #4e54c8 100%);
    border-radius: 18px;
    padding: 28px 32px;
    margin-bottom: 24px;
    overflow: hidden;
    color: white;
    display: flex;
    gap: 32px;
    align-items: center;
}
.home-hero-deco {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 90% 10%, rgba(143,148,251,0.25) 0%, transparent 45%),
        radial-gradient(circle at 5%  90%, rgba(96,165,250,0.18)  0%, transparent 40%);
    pointer-events: none;
}
/* 左列 */
.home-hero-left {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    width: 240px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.home-hero-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.home-hero-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.home-hero-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}
.home-hero-desc {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    margin-top: 2px;
}
.home-hero-stats {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 12px;
    padding: 10px 14px;
}
.home-hero-stat {
    text-align: center;
    flex: 1;
}
.home-hero-stat strong {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}
.home-hero-stat span {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.55);
    white-space: nowrap;
}
.home-hero-stat-divider {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,0.18);
    flex-shrink: 0;
}
/* 右列 */
.home-hero-right {
    position: relative;
    z-index: 2;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.home-hero-search-label {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.65);
    font-weight: 500;
    letter-spacing: 0.3px;
}
.home-hero-form .input-group {
    border-radius: 50px;
    overflow: hidden;
    background: rgba(255,255,255,0.97);
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
.home-hero-form .input-group-text {
    background: transparent;
    border: none;
    color: #999;
    padding-left: 16px;
}
.home-hero-form .form-control {
    border: none;
    background: transparent;
    font-size: 0.9rem;
    padding: 12px 6px;
    color: #333;
}
.home-hero-form .form-control:focus { box-shadow: none; background: transparent; }
.home-hero-form .btn {
    border-radius: 0 50px 50px 0;
    padding: 0 22px;
    font-weight: 600;
    font-size: 0.9rem;
}
.home-hero-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.home-hero-tags-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
}
.home-hero-tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 50px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.85);
    font-size: 0.78rem;
    text-decoration: none;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}
.home-hero-tag:hover {
    background: rgba(255,255,255,0.22);
    color: #fff;
    border-color: rgba(255,255,255,0.4);
}
/* 移动端自适应 */
@media (max-width: 640px) {
    .home-hero { flex-direction: column; gap: 20px; padding: 22px 20px; }
    .home-hero-left { width: 100%; }
    .home-hero-stats { justify-content: space-around; }
}

/* ===== 推荐工具特别区块 ===== */
.recommended-section {
    position: relative;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 50%, #fef9ee 100%);
    border: 1.5px solid #fde68a;
    border-radius: 20px;
    padding: 24px 24px 20px;
    margin-bottom: 30px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(245,158,11,0.1);
}
[data-theme="dark"] .recommended-section {
    background: linear-gradient(135deg, #221c0a 0%, #2d2408 50%, #1c1608 100%);
    border-color: #6b4a0d;
    box-shadow: 0 4px 20px rgba(245,158,11,0.08);
}
.recommended-deco {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 95% 8%,  rgba(251,191,36,0.22) 0%, transparent 38%),
        radial-gradient(circle at 5%  92%, rgba(245,158,11,0.14) 0%, transparent 38%);
    pointer-events: none;
}
.recommended-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1.5px solid rgba(253,230,138,0.8);
}
[data-theme="dark"] .recommended-header { border-bottom-color: rgba(107,74,13,0.8); }
.recommended-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.recommended-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 16px rgba(245,158,11,0.4);
}
.recommended-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #92400e;
    line-height: 1.2;
    letter-spacing: -0.2px;
}
[data-theme="dark"] .recommended-title { color: #fcd34d; }
.recommended-subtitle {
    font-size: 0.78rem;
    color: #a16207;
    margin-top: 3px;
}
[data-theme="dark"] .recommended-subtitle { color: #b45309; }
.recommended-count-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #92400e;
    background: rgba(245,158,11,0.12);
    border: 1.5px solid rgba(245,158,11,0.35);
    padding: 6px 18px;
    border-radius: 50px;
    white-space: nowrap;
    flex-shrink: 0;
}
[data-theme="dark"] .recommended-count-badge {
    color: #fcd34d;
    background: rgba(245,158,11,0.1);
    border-color: rgba(245,158,11,0.3);
}
/* 推荐区块内工具卡片顶部加黄色上边条 */
.recommended-section .tool-card-link {
    border-top: 2.5px solid transparent;
    background-clip: padding-box;
}
.recommended-section .tool-card {
    box-shadow: 0 3px 14px rgba(245,158,11,0.08);
    border: 1px solid rgba(253,230,138,0.6);
}
.recommended-section .tool-card:hover {
    border-color: rgba(245,158,11,0.45) !important;
    box-shadow: 0 6px 24px rgba(245,158,11,0.18) !important;
}
[data-theme="dark"] .recommended-section .tool-card { border-color: rgba(107,74,13,0.4); }

/* ===== 分类区块 ===== */
.cat-section {
    margin-bottom: 30px;
}
.cat-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--card-border);
}
.cat-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}
.cat-section-title i { font-size: 1.1rem; }
.cat-section-count {
    font-size: 0.68rem;
    padding: 1px 7px;
    border-radius: 20px;
    font-weight: 500;
}
.cat-section-more {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 2px;
    transition: color 0.2s, transform 0.2s;
    white-space: nowrap;
}
.cat-section-more:hover { color: var(--primary); transform: translateX(2px); }
[data-theme="dark"] .cat-section-header { border-color: var(--card-border); }
[data-theme="dark"] .cat-section-title { color: var(--text-main); }
[data-theme="dark"] .cat-section-more:hover { color: var(--primary-light); }

/* ===== 工具卡片重构 (footer 在 link 外) ===== */
.tool-card {
    display: flex;
    flex-direction: column;
    overflow: visible; /* 允许 footer 显示在 link 外部 */
    border-radius: var(--radius);
}
.tool-card-link {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: auto !important; /* 覆盖旧 height:100% 冲突 */
    overflow: hidden; /* 内容裁切保留在链接里 */
    border-radius: var(--radius) var(--radius) 0 0;
}
.tool-card-inner {
    flex: 1; /* 充满链接高度 */
    padding: 14px 14px 10px;
    display: flex;
    flex-direction: column;
    min-height: 120px;
    height: auto !important; /* 覆盖旧 height:100% 冲突 */
}
.tool-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 10px;
    border-top: 1px solid var(--card-border);
    margin-top: 0;
    flex-shrink: 0;
    border-radius: 0 0 var(--radius) var(--radius);
    background: var(--card-bg);
}
/* 去使用按钮 */
.btn-use {
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 50px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white !important;
    border: none;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.2s;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(78,84,200,0.25);
}
.btn-use:hover {
    opacity: 0.9;
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(78,84,200,0.35);
}
[data-theme="dark"] .tool-card-footer { border-color: var(--card-border); }

/* ===== 响应式：侧栏变顶部水平滚动 ===== */
@media (max-width: 991px) {
    #mainNav .navbar-nav { display: flex !important; } /* 移动端恢复少量导航 */
    .page-layout { flex-direction: column; }
    .cat-sidebar {
        width: 100%;
        min-width: auto;
        height: auto;
        position: sticky;
        top: 56px; /* 移动端导航栏高度约 56px */
        border-right: none;
        border-bottom: 1px solid var(--card-border);
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: visible;
        padding: 6px 8px;
        gap: 4px;
        scrollbar-width: none;
        z-index: 99;
    }
    .cat-sidebar::-webkit-scrollbar { display: none; }
    .cat-sidebar-header { display: none; }
    .cat-sidebar-item {
        flex-shrink: 0;
        padding: 5px 12px;
        border-radius: 50px;
        border-left: none;
        background: #f0f2f5;
        font-size: 0.8rem;
    }
    .cat-sidebar-item.active {
        background: var(--cat-color, var(--primary));
        color: white;
        border-left: none;
    }
    .cat-sidebar-item.active i { color: white; }
    .cat-sidebar-item em { display: none; }
    [data-theme="dark"] .cat-sidebar-item { background: #1a1a38; }
    [data-theme="dark"] .cat-sidebar-item.active { background: var(--cat-color, var(--primary)); color: white; }
    .content-area { padding: 14px 14px 24px; }
    .mini-banner { padding: 16px 18px; border-radius: 12px; }
}
@media (max-width: 767px) {
    .mini-banner-title { display: none !important; }
    .mini-banner-stats { display: none !important; }
    .mini-banner-search { max-width: 100%; min-width: auto; }
    .mini-banner-inner { gap: 0; }
    .cat-section-title { font-size: 0.9rem; }
}

/* ========================================
   首页最大宽度限制（不全屏）
======================================== */
.page-layout {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================
   AI 资讯首页卡片（home-news-card）
======================================== */
/* ===== 首页资讯卡片（重新美化） ===== */
.home-news-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    position: relative;
    overflow: hidden;
}
.home-news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #e05a2b, #ff7043, #e05a2b);
    opacity: 0;
    transition: opacity 0.25s;
}
.home-news-card:hover {
    box-shadow: 0 8px 30px rgba(224, 90, 43, 0.12);
    border-color: rgba(224, 90, 43, 0.3);
    color: inherit;
    transform: translateY(-3px);
}
.home-news-card:hover::before {
    opacity: 1;
}

/* 封面图区域 */
.home-news-cover {
    width: 120px;
    min-width: 120px;
    height: 90px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #fff5f0, #ffe8e0);
    flex-shrink: 0;
    position: relative;
}
.home-news-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.home-news-card:hover .home-news-cover img {
    transform: scale(1.08);
}
.home-news-cover-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff5f0, #ffe8e0);
    color: #e05a2b;
    font-size: 2rem;
    opacity: 0.6;
}

/* 内容区域 */
.home-news-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 顶部信息条（分类 + 日期）*/
.home-news-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.home-news-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

/* 标题 */
.home-news-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}
.home-news-card:hover .home-news-title {
    color: #e05a2b;
}

/* 摘要 */
.home-news-summary {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* 底部信息条（作者 + 阅读量）*/
.home-news-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}
[data-theme="dark"] .home-news-meta {
    border-top-color: rgba(255, 255, 255, 0.08);
}

/* 分类标签优化 */
.news-cat-tag {
    font-size: 0.7rem;
    padding: 3px 9px;
    background: rgba(224, 90, 43, 0.1);
    color: #e05a2b;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
}

/* 暗黑模式 */
[data-theme="dark"] .home-news-card { background: var(--card-bg); border-color: var(--card-border); }
[data-theme="dark"] .home-news-cover { background: linear-gradient(135deg, #2a1a15, #1a1520); }
[data-theme="dark"] .home-news-cover-icon { background: linear-gradient(135deg, #2a1a15, #1a1520); color: #ff7043; }

/* ========================================
   资讯页公共布局（news-page-wrap）
======================================== */
.news-page-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px 40px;
}

/* ===== 资讯页头部 hero ===== */
.news-hero-section {
    position: relative;
    background: linear-gradient(135deg, #1a1a3e 0%, #2d2d7c 55%, #4e54c8 100%);
    padding: 52px 0 48px;
    overflow: hidden;
}
.news-hero-deco {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 85% 15%, rgba(143,148,251,0.22) 0%, transparent 45%),
        radial-gradient(circle at 5%  85%, rgba(78,84,200,0.25)  0%, transparent 45%);
    pointer-events: none;
}
.news-hero-row {
    display: flex;
    align-items: center;
    gap: 40px;
}
.news-hero-left {
    flex: 1;
    min-width: 0;
}
.news-hero-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 280px;
}
.news-hero-h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 10px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}
.news-hero-sub {
    color: rgba(255,255,255,0.6);
    font-weight: 600;
    font-size: 1.5rem;
}
.news-hero-p {
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
    margin: 0 0 20px;
}
.news-hero-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.news-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 5px 16px;
    border-radius: 50px;
    backdrop-filter: blur(4px);
    transition: background 0.2s;
}
.news-hero-badge.badge-active {
    background: rgba(255,255,255,0.22);
    border-color: rgba(255,255,255,0.4);
    color: #fff;
}
/* 右侧小卡片 */
.news-hero-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    padding: 14px 18px;
    backdrop-filter: blur(8px);
    transition: background 0.2s;
}
.news-hero-card:hover { background: rgba(255,255,255,0.14); }
.news-hero-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(78,84,200,0.3);
    color: #a5b4fc;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.news-hero-card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.news-hero-card-text strong {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 600;
}
.news-hero-card-text span {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.55);
}
/* 面包屑白色风格 */
.breadcrumb-light .breadcrumb-item a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb-light .breadcrumb-item a:hover { color: white; }
.breadcrumb-light .breadcrumb-item.active { color: rgba(255,255,255,0.45); }
.breadcrumb-light .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.3); }

/* 资讯分栏布局 */
.news-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.news-main {
    flex: 1;
    min-width: 0;
}
.news-sidebar {
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 72px;
}

/* 分类过滤 Pills */
.news-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.news-cat-pill {
    display: inline-block;
    padding: 5px 16px;
    border-radius: 50px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
}
.news-cat-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.news-cat-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* 分类标签（卡片内） */
.news-cat-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 50px;
    background: rgba(78,84,200,0.1);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
}
.news-cat-tag:hover { background: var(--primary); color: white; }

/* 资讯列表卡片 */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.news-card {
    display: flex;
    gap: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, border-color 0.2s;
}
.news-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(78,84,200,0.35);
    color: inherit;
}
.news-card-cover {
    width: 200px;
    min-width: 200px;
    height: 130px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e8ecff, #f0f4ff);
}
.news-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.news-card:hover .news-card-cover img { transform: scale(1.05); }
.news-card-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--primary);
    opacity: 0.4;
}
.news-card-body {
    flex: 1;
    min-width: 0;
    padding: 16px 16px 14px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.news-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.news-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text-main);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-card:hover .news-card-title { color: var(--primary); }
.news-card-summary {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}
.news-card-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
}

/* 资讯右侧边栏卡片 */
.news-sidebar-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 16px;
}
.news-sidebar-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
}
.news-sidebar-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--card-border);
    text-decoration: none;
    color: var(--text-main);
    transition: color 0.2s;
}
.news-sidebar-item:last-child { border-bottom: none; padding-bottom: 0; }
.news-sidebar-item:hover { color: var(--primary); }
.news-sidebar-item-title {
    font-size: 0.85rem;
    line-height: 1.4;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   文章详情页样式
======================================== */
.article-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.article-cover {
    width: 100%;
    max-height: 380px;
    overflow: hidden;
}
.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.article-content-wrap {
    padding: 28px 32px 24px;
}
.article-title {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
    margin: 12px 0 16px;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 24px;
}
.article-body {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-main);
}
.article-body h1, .article-body h2, .article-body h3 {
    font-weight: 700;
    margin: 1.5em 0 0.7em;
    color: var(--text-main);
}
.article-body h2 { font-size: 1.3rem; }
.article-body h3 { font-size: 1.1rem; }
.article-body p { margin-bottom: 1.1em; }
.article-body ul, .article-body ol {
    padding-left: 1.5em;
    margin-bottom: 1.1em;
}
.article-body li { margin-bottom: 0.4em; }
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}
.article-body blockquote {
    border-left: 4px solid var(--primary);
    padding: 10px 16px;
    margin: 16px 0;
    background: rgba(78,84,200,0.06);
    border-radius: 0 8px 8px 0;
    color: var(--text-muted);
    font-style: italic;
}
.article-body code {
    background: rgba(78,84,200,0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
    color: var(--primary);
}
.article-body pre {
    background: #1e1e3a;
    color: #e2e4f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}
.article-body pre code { background: none; color: inherit; padding: 0; }
.article-body a { color: var(--primary); }
.article-body a:hover { text-decoration: underline; }
.article-share-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-top: 20px;
    margin-top: 24px;
    border-top: 1px solid var(--card-border);
}

/* 暗黑模式资讯局部 */
[data-theme="dark"] .news-card { background: var(--card-bg); border-color: var(--card-border); }
[data-theme="dark"] .news-card-cover-placeholder { background: linear-gradient(135deg, #1a1a3e, #252560); }
[data-theme="dark"] .news-card-body { background: transparent; }
[data-theme="dark"] .news-sidebar-card { background: var(--card-bg); border-color: var(--card-border); }
[data-theme="dark"] .news-cat-pill { background: var(--card-bg); border-color: var(--card-border); color: var(--text-muted); }
[data-theme="dark"] .news-cat-pill.active { background: var(--primary); border-color: var(--primary); color: white; }
[data-theme="dark"] .article-card { background: var(--card-bg); border-color: var(--card-border); }
[data-theme="dark"] .news-sidebar-item { border-color: var(--card-border); color: var(--text-main); }
[data-theme="dark"] .news-sidebar-item:hover { color: var(--primary-light); }

/* 资讯页响应式 */
@media (max-width: 991px) {
    .news-layout {
        flex-direction: column;
    }
    .news-sidebar {
        width: 100%;
        min-width: auto;
        position: static;
    }
    .news-card-cover {
        width: 140px;
        min-width: 140px;
        height: 100px;
    }
    .article-content-wrap { padding: 20px 18px 18px; }
    .article-title { font-size: 1.3rem; }
}
@media (max-width: 575px) {
    .news-page-wrap { padding: 14px 14px 32px; }
    .news-hero-section { padding: 36px 0 32px; }
    .news-hero-right { display: none; }
    .news-hero-h1 { font-size: 1.6rem; }
    .news-card { flex-direction: column; }
    .news-card-cover { width: 100%; min-width: auto; height: 160px; }
    .news-card-body { padding: 12px 14px 12px; }
    .home-news-card { flex-direction: column; }
    .home-news-cover { width: 100%; min-width: auto; height: 140px; }
    .article-content-wrap { padding: 14px 14px 14px; }
    .article-title { font-size: 1.15rem; }
    .article-body { font-size: 0.95rem; }
}

/* ============================================================
   增强交互 & 美化细节
   ============================================================ */

/* ----- 工具卡片入场动画 ----- */
.tool-card:not(.visible) {
    opacity: 0;
    transform: translateY(16px);
}
.tool-card.visible {
    opacity: 1;
    transform: translateY(0);
}
/* 已添加 visible 的卡片恢复原始 hover 效果 */
.tool-card.visible:hover {
    transform: translateY(-6px);
}

/* ----- 收藏按钮 ----- */
.btn-fav {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: #ffffff;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 5;
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 0;
    line-height: 1;
}
.tool-card:hover .btn-fav { opacity: 1; transform: scale(1); }
.btn-fav:hover {
    background: white;
    color: #ff4757;
    transform: scale(1.2);
    box-shadow: 0 3px 12px rgba(255, 71, 87, 0.3);
}
.btn-fav.active {
    color: #ff4757;
    opacity: 1;
    transform: scale(1);
}
.btn-fav.active i::before { content: "\f415"; } /* bi-heart-fill */
[data-theme="dark"] .btn-fav { background: #1e1e3a; border-color: #3a3a6a; color: #7a7aaa; }
[data-theme="dark"] .btn-fav:hover { background: var(--card-bg); color: #ff6b81; }
[data-theme="dark"] .btn-fav.active { color: #ff6b81; }

/* ----- 收藏浮标按钮 ----- */
#fav-badge {
    position: fixed;
    bottom: 84px;
    right: 24px;
    background: linear-gradient(135deg, #ff6b81, #ff4757);
    color: white;
    border-radius: 50px;
    padding: 7px 15px;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(255,71,87,0.4);
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 6px;
    z-index: 999;
    transition: all 0.25s;
    border: none;
    outline: none;
}
#fav-badge.show { display: flex; }
#fav-badge:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,71,87,0.5); }
[data-theme="dark"] #fav-badge { box-shadow: 0 4px 16px rgba(255,71,87,0.3); }

/* ----- 文章阅读进度条 ----- */
#reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #4e54c8, #8f94fb, #a78bfa);
    z-index: 2001;
    transition: width 0.12s linear;
    pointer-events: none;
    border-radius: 0 2px 2px 0;
}

/* ----- 资讯卡片入场动画 ----- */
.news-card:not(.visible), .home-news-card:not(.visible) {
    opacity: 0;
    transform: translateY(12px);
}
.news-card.visible, .home-news-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ----- 首页 mini-banner 微调 ----- */
.mini-banner {
    border-bottom: 1px solid rgba(78,84,200,0.1);
}
[data-theme="dark"] .mini-banner {
    border-bottom-color: rgba(143,148,251,0.15);
}

/* ----- cat-section header 分隔线 ----- */
.cat-section-header {
    padding-bottom: 10px;
    border-bottom: 1.5px solid var(--card-border);
    margin-bottom: 14px;
}
[data-theme="dark"] .cat-section-header { border-bottom-color: var(--card-border); }

/* ----- 分类侧边栏激活左侧指示条 ----- */
.cat-sidebar-item { position: relative; overflow: hidden; }
.cat-sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 8px; bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--cat-color, var(--primary));
}

/* ========================================
   移动端优化增强
======================================== */

/* 移动端触摸优化 */
@media (max-width: 768px) {
    /* 增大触摸目标 */
    .btn, 
    .nav-link,
    .page-link,
    .cat-pill,
    .news-cat-pill,
    .badge-tag,
    .tag-link {
        min-height: 36px;
        padding-top: 6px;
        padding-bottom: 6px;
    }
    
    /* 移除点击高亮 */
    * {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* 滚动优化 */
    .cat-sidebar,
    .news-sidebar {
        -webkit-overflow-scrolling: touch;
    }
    
    /* 防止图片拖拽 */
    img {
        -webkit-user-drag: none;
        user-select: none;
    }
    
    /* 表单元素优化 */
    input, textarea, select {
        font-size: 16px !important; /* 防止iOS自动缩放 */
    }
    
    /* 视频自适应 */
    video,
    iframe {
        max-width: 100%;
        height: auto;
    }
}

/* 超小屏幕优化 */
@media (max-width: 400px) {
    .container,
    .container-fluid {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    /* 工具卡片网格 */
    .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
    
    /* 新闻分类标签 */
    .news-cat-pill {
        font-size: 0.72rem;
        padding: 4px 8px;
    }
    
    /* 分页紧凑 */
    .pagination .page-link {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
}

/* 横屏模式优化 */
@media (max-width: 991px) and (orientation: landscape) {
    .hero-section {
        padding: 30px 0;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .mini-banner {
        padding: 10px 14px;
    }
    
    .news-card-cover {
        height: 120px;
    }
}

/* 暗黑模式移动端优化 */
@media (max-width: 768px) {
    [data-theme="dark"] .mini-banner {
        background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 45%, #2d2d7c 100%);
    }
    
    [data-theme="dark"] .news-card {
        background: #1a1a38;
    }
    
    [data-theme="dark"] .article-card {
        background: #1a1a38;
    }
}

/* 移动端汉堡菜单优化 */
@media (max-width: 991px) {
    .navbar-collapse {
        background: rgba(26, 26, 62, 0.98);
        margin-top: 8px;
        border-radius: 8px;
        padding: 8px;
        backdrop-filter: blur(10px);
    }
    
    .navbar-collapse .nav-link {
        padding: 10px 16px;
        margin: 2px 0;
        border-radius: 6px;
    }
    
    .navbar-collapse .nav-link:hover,
    .navbar-collapse .nav-link.active {
        background: rgba(255, 255, 255, 0.1);
    }
}

/* 移动端首页新闻卡片优化 */
@media (max-width: 768px) {
    .home-news-card {
        margin-bottom: 12px;
    }
    
    .home-news-cover {
        height: 140px;
    }
    
    .home-news-body {
        padding: 10px 12px;
    }
    
    .home-news-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .home-news-meta {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* 移动端文章详情页优化 */
@media (max-width: 768px) {
    .article-title {
        font-size: 1.35rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .article-content-wrap {
        padding: 16px;
    }
    
    .article-body {
        font-size: 0.95rem;
    }
    
    .article-body h2 {
        font-size: 1.15rem;
    }
    
    .article-body h3 {
        font-size: 1.05rem;
    }
}

/* 移动端收藏按钮优化 */
@media (max-width: 768px) {
    .btn-fav {
        opacity: 1;
        transform: scale(1);
        width: 28px;
        height: 28px;
        font-size: 0.78rem;
    }
    
    #fav-badge {
        bottom: 70px;
        right: 12px;
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    #back-to-top {
        bottom: 24px;
        right: 12px;
        width: 38px;
        height: 38px;
    }
}

/* 移动端Toast通知优化 */
@media (max-width: 576px) {
    .app-toast {
        bottom: 16px;
        left: 12px;
        right: 12px;
        transform: translateX(0) translateY(12px);
        border-radius: 8px;
        font-size: 0.82rem;
        padding: 8px 14px;
        white-space: normal;
        text-align: center;
    }
    
    .app-toast.show {
        transform: translateX(0) translateY(0);
    }
}

/* ===== 工具详情页操作按钮移动端优化 ===== */
@media (max-width: 640px) {
    .tool-action-bar {
        flex-direction: column;
        gap: 8px;
    }
    .tool-action-bar .btn {
        width: 100%;
        justify-content: center;
        font-size: 0.92rem;
    }
    .tool-detail-header {
        flex-direction: column;
        gap: 14px;
        padding: 18px 16px 14px;
    }
    .tool-detail-icon-wrap {
        width: 64px;
        height: 64px;
    }
    .tool-detail-name {
        font-size: 1.4rem;
    }
    .tool-detail-body {
        padding: 16px 16px;
    }
    .tool-detail-actions {
        padding: 0 16px 18px;
    }
}

/* ===== 搜索页移动端优化 ===== */
@media (max-width: 640px) {
    .search-page-header .input-group-lg .form-control {
        font-size: 0.9rem !important;
    }
    .filter-pill {
        font-size: 0.75rem;
        padding: 4px 10px;
    }
}

/* ===== 首页 home-hero 进一步移动端优化 ===== */
@media (max-width: 480px) {
    .home-hero {
        padding: 18px 14px;
        gap: 16px;
        border-radius: 12px;
    }
    .home-hero-brand {
        gap: 8px;
    }
    .home-hero-logo {
        width: 38px;
        height: 38px;
        font-size: 1.2rem;
    }
    .home-hero-title {
        font-size: 0.95rem;
    }
    .home-hero-desc {
        font-size: 0.7rem;
    }
    .home-hero-stats {
        padding: 8px 10px;
        gap: 10px;
    }
    .home-hero-stat strong {
        font-size: 1rem;
    }
    .home-hero-form .form-control {
        font-size: 0.85rem;
        padding: 10px 4px;
    }
    .home-hero-tag {
        font-size: 0.72rem;
        padding: 3px 9px;
    }
}

/* ===== 资讯 hero 移动端优化 ===== */
@media (max-width: 640px) {
    .news-hero-section {
        padding: 28px 0 24px;
    }
    .news-hero-h1 {
        font-size: 1.5rem;
    }
    .news-hero-right {
        display: none;
    }
    .news-hero-badges {
        gap: 6px;
    }
    .news-hero-badge {
        font-size: 0.75rem;
        padding: 4px 12px;
    }
}

/* ===== 推荐工具区块移动端优化 ===== */
@media (max-width: 640px) {
    .recommended-section {
        padding: 16px 14px;
        border-radius: 14px;
    }
    .recommended-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .recommended-icon-box {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    .recommended-title {
        font-size: 0.95rem;
    }
    .recommended-subtitle {
        font-size: 0.72rem;
    }
}

/* ===== 分页移动端优化 ===== */
@media (max-width: 480px) {
    .pagination {
        gap: 2px;
    }
    .pagination .page-link {
        min-width: 34px;
        min-height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.82rem;
        padding: 0;
    }
}

/* ===== iPhone X+ 安全区域重覆增强 ===== */
@supports (padding: max(0px)) {
    .site-footer {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
    #mobileNav {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    #back-to-top {
        right: max(16px, env(safe-area-inset-right));
        bottom: max(24px, env(safe-area-inset-bottom));
    }
    #fav-badge {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(70px, calc(env(safe-area-inset-bottom) + 60px));
    }
}
@media print {
    #mainNav,
    .cat-sidebar,
    .news-sidebar,
    .site-footer,
    #back-to-top,
    #page-progress,
    #fav-badge,
    .btn,
    .pagination {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .content-area,
    .news-main {
        padding: 0;
        margin: 0;
    }
    
    .tool-card,
    .news-card,
    .article-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* 高性能动画优化 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .tool-card,
    .news-card,
    .home-news-card {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* 高清屏幕图片优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .news-card-cover img,
    .home-news-cover img,
    .article-cover img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 安全区域适配 (iPhone X+) */
@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    #mainNav {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .site-footer {
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }
    
    #back-to-top {
        right: max(24px, env(safe-area-inset-right));
        bottom: max(32px, env(safe-area-inset-bottom));
    }
}
