/* ===== CSS Variables & Theme ===== */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: #1a2035;
    --bg-card-hover: #1f2a45;
    --bg-input: #1a2035;
    --border-color: #1e293b;
    --border-light: #2d3a5c;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;
    --accent-blue-dark: #2563eb;
    --accent-purple: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --accent-gradient-hover: linear-gradient(135deg, #2563eb, #7c3aed);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.4);
    --transition: all 0.3s ease;
    --sidebar-width: 240px;
    --header-height: 64px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

body.light-theme, html.light-theme {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-input: #f1f5f9;
    --border-color: #e2e8f0;
    --border-light: #cbd5e1;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}
a { color: var(--accent-blue); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--accent-purple); }
img { max-width: 100%; height: auto; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select {
    font-family: inherit;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-blue); }

/* ===== Header ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(10,14,26,0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 24px;
}
body.light-theme .site-header, html.light-theme .site-header { background: rgba(255,255,255,0.85); }

.header-inner {
    width: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}
.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.main-nav {
    display: flex;
    gap: 4px;
}
.main-nav a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}
.main-nav a:hover, .main-nav a.active {
    color: var(--text-primary);
    background: rgba(59,130,246,0.1);
}

.search-box {
    flex: 1;
    max-width: 400px;
    position: relative;
}
.search-box input {
    width: 100%;
    padding: 8px 16px 8px 40px;
    border-radius: 20px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    font-size: 14px;
}
.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
}
.search-box button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px 10px;
    border-radius: 16px;
    color: var(--text-muted);
    font-size: 14px;
    transition: var(--transition);
}
.search-box button:hover {
    color: var(--accent-blue);
    background: rgba(59,130,246,0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 18px;
    transition: var(--transition);
}
.theme-toggle:hover {
    background: rgba(59,130,246,0.1);
    color: var(--accent-blue);
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 20px;
}

.mobile-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px;
    z-index: 999;
}
.mobile-nav a {
    display: block;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    border-radius: var(--radius-sm);
}
.mobile-nav a:hover { color: var(--text-primary); background: rgba(59,130,246,0.08); }

/* ===== Layout ===== */
.page-wrapper {
    display: flex;
    width: 100%;
    padding-top: var(--header-height);
    min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 24px 16px;
    border-right: 1px solid var(--border-color);
    background: var(--bg-secondary);
    z-index: 100;
}

.sidebar-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 12px;
}

.sidebar-nav, .category-list { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav a, .category-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition);
}
.sidebar-nav a:hover, .category-list a:hover {
    color: var(--text-primary);
    background: rgba(59,130,246,0.15);
}
.sidebar-nav a.active, .category-list a.active {
    background: var(--accent-gradient);
    color: #fff;
    font-weight: 700;
}
.sidebar-nav .icon, .category-list .icon { font-size: 16px; width: 20px; text-align: center; }
.sidebar-nav .count, .category-list .count {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
}
.category-list .cat-icon {
    font-size: 16px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}
.category-list i.cat-icon {
    width: auto;
    height: auto;
    margin-right: 8px;
}

/* ===== Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 24px;
    min-height: calc(100vh - var(--header-height));
}

/* ===== Banner / Hero ===== */
.hero-banner {
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    padding: 56px 40px 48px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    text-align: center;
}
.hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.08);
    border-radius: 50%;
}
.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: 10%;
    width: 250px;
    height: 250px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.hero-banner h1 {
    font-size: 34px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}
.hero-banner p {
    font-size: 16px;
    color: rgba(255,255,255,0.85);
    max-width: 560px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}
.hero-search {
    margin-top: 28px;
    position: relative;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    z-index: 1;
}
.hero-search-tabs {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 14px;
}
.hero-search-tab {
    padding: 6px 20px;
    border-radius: 20px;
    border: 1.5px solid rgba(255,255,255,0.35);
    background: transparent;
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 500;
}
.hero-search-tab:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.hero-search-tab.active {
    background: rgba(255,255,255,0.25);
    color: #fff;
    border-color: rgba(255,255,255,0.6);
    font-weight: 600;
}
.hero-search-box {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.2);
    border-radius: 28px;
    backdrop-filter: blur(10px);
    overflow: hidden;
    transition: background 0.25s ease;
}
.hero-search-box:focus-within {
    background: rgba(255,255,255,0.3);
}
.hero-search-box .search-icon {
    padding-left: 18px;
    color: rgba(255,255,255,0.7);
    font-size: 18px;
    flex-shrink: 0;
}
.hero-search-box input {
    flex: 1;
    padding: 14px 16px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 15px;
    outline: none;
}
.hero-search-box input::placeholder { color: rgba(255,255,255,0.6); }
.hero-search-btn {
    padding: 10px 26px;
    margin: 4px;
    border: none;
    border-radius: 24px;
    background: #fff;
    color: var(--accent-color, #6366f1);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.hero-search-btn:hover {
    background: rgba(255,255,255,0.9);
    transform: scale(1.03);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

/* ===== Section ===== */
.section { margin-bottom: 40px; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    margin-bottom: 20px;
}
.section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title .icon { font-size: 24px; }
.section-more {
    font-size: 14px;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 4px;
}
.section-more:hover { color: var(--accent-purple); }

/* ===== Tool Cards Grid ===== */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}
.tool-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.tool-card-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}
.tool-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.tool-logo img { width: 100%; height: 100%; object-fit: cover; }
.tool-info { flex: 1; min-width: 0; }
.tool-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tool-category {
    font-size: 12px;
    color: var(--text-muted);
}

.tool-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 14px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.tool-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}
.tool-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(59,130,246,0.1);
    color: var(--accent-blue);
    white-space: nowrap;
}
.tool-tag.hot { background: rgba(239,68,68,0.1); color: var(--danger); }
.tool-tag.free { background: rgba(16,185,129,0.1); color: var(--success); }

.tool-actions { display: flex; gap: 6px; }
.tool-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    transition: var(--transition);
}
.tool-btn-primary {
    background: var(--accent-gradient);
    color: #fff;
}
.tool-btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}
.tool-btn-fav {
    background: rgba(59,130,246,0.1);
    color: var(--accent-blue);
}
.tool-btn-fav:hover { background: rgba(59,130,246,0.2); }
.tool-btn-fav.active { color: var(--danger); background: rgba(239,68,68,0.1); }

.tool-pricing {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
}
.pricing-free { background: rgba(16,185,129,0.12); color: var(--success); }
.pricing-paid { background: rgba(245,158,11,0.12); color: var(--warning); }
.pricing-freemium { background: rgba(59,130,246,0.12); color: var(--accent-blue); }
.pricing-open { background: rgba(139,92,246,0.12); color: var(--accent-purple); }

/* ===== Featured Tools (horizontal scroll) ===== */
.featured-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
}
.featured-scroll::-webkit-scrollbar { height: 4px; }
.featured-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
}

/* ===== Stats Bar ===== */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.stat-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}
.stat-number {
    font-size: 28px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== Article Cards (horizontal: left image, right content) ===== */
.article-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}
@media (max-width: 768px) {
    .article-grid { grid-template-columns: 1fr; }
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}
.article-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.article-cover {
    width: 180px;
    min-width: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.5);
    font-size: 32px;
    overflow: hidden;
    background: var(--bg-input);
    border-radius: 0;
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; }

.article-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    min-width: 0;
}

.article-meta {
    margin-top: auto;
    font-size: 12px;
    color: var(--text-muted);
}
.article-content {
    line-height: 2.4;
}
.article-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-summary {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== Tool Detail Page ===== */
.detail-hero {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 32px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
}
.detail-logo {
    width: 96px;
    height: 96px;
    border-radius: 20px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 40px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
}
.detail-logo img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { flex: 1; }
.detail-name { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.detail-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}
.detail-meta .rating { color: var(--warning); }
.detail-desc { font-size: 15px; color: var(--text-secondary); line-height: 1.8; margin-bottom: 20px; }
.detail-actions { display: flex; gap: 12px; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}
.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 4px 16px rgba(59,130,246,0.3);
    color: #fff;
}
.btn-secondary {
    background: rgba(59,130,246,0.1);
    color: var(--accent-blue);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: rgba(59,130,246,0.2); }

.detail-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
}
.detail-content h2 { font-size: 20px; margin-bottom: 16px; }
.detail-content p { color: var(--text-secondary); line-height: 1.8; margin-bottom: 16px; }

/* ===== Article Detail ===== */
.article-detail-header {
    text-align: center;
    padding: 40px 0;
}
.article-detail-title { font-size: 32px; font-weight: 700; margin-bottom: 16px; }
.article-detail-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-muted);
}
.article-detail-cover {
    width: 100%;
    max-height: 400px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 32px;
    background: var(--bg-card);
}
.article-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-detail-body {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 40px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-secondary);
}
.article-detail-body h2, .article-detail-body h3 {
    color: var(--text-primary);
    margin: 24px 0 12px;
}
.article-detail-body p { margin-bottom: 16px; }
.article-detail-body img { border-radius: var(--radius-sm); margin: 16px 0; }

/* ===== About Page ===== */
.about-hero {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 32px;
}
.about-hero h1 { font-size: 36px; margin-bottom: 16px; }
.about-hero p { font-size: 16px; color: var(--text-secondary);  margin: 0 auto; }
.about-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.about-feature {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
}
.about-feature .icon {
    font-size: 40px;
    margin-bottom: 16px;
    display: block;
}
.about-feature h3 { font-size: 18px; margin-bottom: 8px; }
.about-feature p { font-size: 14px; color: var(--text-secondary); }

/* ===== Submit Form ===== */
.submit-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 640px;
    margin: 0 auto;
}
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.form-group input, .form-group textarea, .form-group select {
    width: 100%;
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-submit {
    display: flex;
    justify-content: flex-end;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}
.pagination button {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: var(--transition);
}
.pagination button:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.pagination button.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Filter Bar ===== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.filter-bar .filter-chip {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: var(--transition);
    cursor: pointer;
}
.filter-bar .filter-chip:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.filter-bar .filter-chip.active {
    background: rgba(59,130,246,0.12);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}
.sort-select {
    margin-left: auto;
}
.sort-select select {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
}

/* ===== Footer ===== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 40px 24px;
    margin-top: 60px;
    margin-left: var(--sidebar-width);
}
.footer-inner {
    width: 100%;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
}
.footer-brand { max-width: 300px; }
.footer-brand .logo { margin-bottom: 12px; }
.footer-brand p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.footer-links { display: flex; gap: 48px; }
.footer-col h4 { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.footer-col a {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    padding: 4px 0;
}
.footer-col a:hover { color: var(--accent-blue); }
.footer-bottom {
    width: 100%;
    padding: 24px 24px 0;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== Loading ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent-blue); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ===== Breadcrumb ===== */
.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding: 8px 0;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent-blue); }
.breadcrumb span { color: var(--text-primary); }

/* ===== Category Chips ===== */
.category-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.chip {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
}
.chip:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.chip.active {
    background: rgba(59,130,246,0.12);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* ===== Search Indicator ===== */
.search-indicator {
    padding: 10px 16px;
    margin-bottom: 16px;
    background: rgba(59,130,246,0.08);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
}
.search-indicator strong { color: var(--accent-blue); }
.search-indicator .clear-search {
    margin-left: 12px;
    font-size: 13px;
    color: var(--text-muted);
}
.search-indicator .clear-search:hover { color: var(--danger); }

/* ===== Search Box Inline ===== */
.search-box-inline {
    display: flex;
    gap: 0;
    margin-left: auto;
}
.search-box-inline input {
    border-radius: 20px 0 0 20px;
    border-right: none;
    padding: 6px 14px;
    font-size: 13px;
    min-width: 160px;
}
.search-box-inline button {
    padding: 6px 14px;
    border-radius: 0 20px 20px 0;
    background: var(--accent-blue);
    color: #fff;
    font-size: 14px;
    border: 1px solid var(--accent-blue);
}

/* ===== Loading Placeholder ===== */
.loading-placeholder {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== Pagination Links ===== */
.page-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}
.page-link:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.page-link.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
}

/* ===== View All Link ===== */
.view-all {
    font-size: 14px;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 4px;
}
.view-all:hover { color: var(--accent-purple); }

/* ===== Section Header h2 ===== */
.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ===== Category Section (Homepage) ===== */
.category-section {
    margin-bottom: 40px;
    scroll-margin-top: 80px;
}
.section-count {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 12px;
}

/* ===== Detail Page Sub-elements ===== */
.detail-hero-top {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 20px;
}
.detail-pricing { margin-top: 8px; }
.detail-body {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 32px;
    margin-top: 24px;
}
.detail-description { margin-bottom: 24px; }
.desc-short {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 16px;
}
.desc-full {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 2;
}
    .desc-full ol {
        padding-left: 20px;
        list-style: auto;
    }
.detail-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.detail-tags .tag {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    background: rgba(59,130,246,0.1);
    color: var(--accent-blue);
}
.pricing-badge {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
    display: inline-block;
}
.btn-outline {
    background: transparent;
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}
.btn-outline:hover {
    background: rgba(59,130,246,0.1);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .site-footer { margin-left: 0; }
    .tool-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}

@media (max-width: 768px) {
    .header-inner { gap: 12px; }
    .main-nav { display: none; }
    .mobile-menu-btn { display: flex; }
    .search-box { max-width: 200px; }
    .hero-banner { padding: 32px 24px; }
    .hero-banner h1 { font-size: 24px; }
    .hero-search-btn { padding: 8px 18px; font-size: 13px; }
    .tool-grid { grid-template-columns: 1fr; }
    .article-grid { grid-template-columns: 1fr; }
    /* 小屏幕卡片改回竖向 */
    .article-card { flex-direction: column; }
    .article-cover { width: 100%; min-width: unset; height: 180px; font-size: 48px; }
    .detail-hero { flex-direction: column; padding: 24px; }
    .detail-logo { width: 72px; height: 72px; font-size: 30px; }
    .detail-name { font-size: 22px; }
    .footer-inner { flex-direction: column; }
    .footer-links { flex-wrap: wrap; gap: 24px; }
    .stats-bar { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .sort-select { margin-left: 0; }
    .main-content { padding: 16px; }
}

@media (max-width: 480px) {
    .hero-banner h1 { font-size: 20px; }
    .hero-banner p { font-size: 14px; }
    .tool-card { padding: 16px; }
    .stat-item { padding: 16px; }
    .stat-number { font-size: 22px; }
}
