/* Import Google Fonts - Space Grotesk + DM Sans */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Space+Grotesk:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Design System Colors - Light Theme (matching AI Chat) */
    --primary: #1e293b;
    --secondary: #64748B;
    --cta: #6366F1;
    --cta-secondary: #8B5CF6;
    --background: #fafbff;
    --background-gradient-1: #f0f4ff;
    --background-gradient-2: #fdf4ff;
    --background-gradient-3: #f5f3ff;
    --surface: rgba(255, 255, 255, 0.8);
    --surface-elevated: rgba(255, 255, 255, 0.95);
    --surface-glass: rgba(255, 255, 255, 0.7);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --border: rgba(226, 232, 240, 0.8);
    --border-hover: rgba(203, 213, 225, 1);
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;

    /* Gradient Colors */
    --gradient-primary: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    --gradient-secondary: linear-gradient(135deg, #ec4899 0%, #f472b6 100%);
    --gradient-accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-warm: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --gradient-cool: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    --gradient-dark: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);

    /* Shadow Effects (for light theme) */
    --glow-primary: 0 4px 20px rgba(99, 102, 241, 0.15);
    --glow-secondary: 0 4px 20px rgba(139, 92, 246, 0.15);
    --glow-accent: 0 4px 20px rgba(79, 172, 254, 0.15);

    /* Typography */
    --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Animation */
    --transition-fast: 150ms;
    --transition-base: 200ms;
    --transition-slow: 300ms;
    --ease-out: cubic-bezier(0, 0, 0.2, 1);

    /* Layout */
    --sidebar-width: 240px;
}

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

/* Hidden state */
.hidden {
    display: none !important;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--cta);
    color: white;
    padding: var(--space-md);
    text-decoration: none;
    z-index: 100;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

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

/* Animated Gradient Background - Light Theme */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, rgba(236, 72, 153, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(240, 147, 251, 0.06) 0%, transparent 50%),
        linear-gradient(135deg, #fafbff 0%, #f0f4ff 50%, #fdf4ff 100%);
    z-index: -2;
}

/* Floating Orbs Animation - Light Theme */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 25% 25%, rgba(99, 102, 241, 0.05) 0%, transparent 30%),
        radial-gradient(circle at 75% 75%, rgba(236, 72, 153, 0.05) 0%, transparent 30%);
    z-index: -1;
    animation: orbFloat 20s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(2%, 2%) scale(1.02);
    }
    50% {
        transform: translate(0, 4%) scale(1);
    }
    75% {
        transform: translate(-2%, 2%) scale(1.02);
    }
}

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

/* Main layout container - sidebar aligned to left edge */
.main-layout .container {
    max-width: none;
    padding-left: 0;
    padding-right: var(--space-xl);
}

@media (min-width: 768px) {
    .container {
        padding: 0 var(--space-xl);
    }
    .main-layout .container {
        padding-left: 0;
    }
}

/* ============================================ */
/* Navigation */
/* ============================================ */

.navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--space-lg) 0;
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: none;
    padding: 0 var(--space-xl) 0 var(--space-lg);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    text-decoration: none;
    cursor: pointer;
}

.logo {
    color: var(--cta);
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.3));
}

.nav-brand h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, #1a1a2e 0%, #6366F1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

/* Navigation search box */
.nav-search {
    flex: 1;
    max-width: 480px;
    margin: 0 var(--space-xl);
    position: relative;
}

.nav-search.reddit-style {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: all var(--transition-base) var(--ease-out);
}

.nav-search.reddit-style:hover {
    border-color: var(--cta);
    box-shadow: var(--glow-primary);
}

.nav-search.reddit-style:focus-within {
    border-color: var(--cta);
    box-shadow: var(--glow-primary);
}

.nav-search .search-icon {
    position: absolute;
    left: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.nav-search input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    padding-left: calc(var(--space-md) + 24px);
    border: none;
    border-radius: 20px;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: var(--font-body);
    outline: none;
}

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

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-base) var(--ease-out);
    font-weight: 500;
    font-size: 0.9375rem;
}

.nav-links a:hover {
    color: var(--cta);
}

.nav-links a:focus {
    outline: 2px solid var(--cta);
    outline-offset: 4px;
    border-radius: 2px;
}

.nav-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-lg);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9375rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
}

.nav-btn:focus {
    outline: 2px solid var(--cta);
    outline-offset: 4px;
}

/* ============================================ */
/* AI Ranking Page Section (Full Screen View) */
/* ============================================ */

.ranking-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    padding: var(--space-2xl);
    overflow-y: auto;
    background: var(--background);
    z-index: 40;
}

/* Ranking Section Gradient Background */
.ranking-section::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(45, 212, 191, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        linear-gradient(180deg, var(--background) 0%, var(--background-gradient-1) 100%);
    z-index: -1;
    pointer-events: none;
}

.ranking-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.ranking-page-header {
    margin-bottom: var(--space-xl);
}

.ranking-page-title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.ranking-page-title h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: #2DD4BF;
    margin: 0;
}

.ranking-page-desc {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0;
}

/* ============================================ */
/* AI Ranking Hero Section */
/* ============================================ */

.ranking-hero {
    padding: var(--space-xl) 0;
    position: relative;
    overflow: hidden;
}

.ranking-hero-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
    position: relative;
}

.ranking-hero-title {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.ranking-logo {
    color: #2DD4BF;
    filter: drop-shadow(0 0 8px rgba(45, 212, 191, 0.5));
}

.ranking-hero-title h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: #2DD4BF;
    margin: 0;
}

.ranking-hero-bg {
    position: absolute;
    right: 0;
    top: -50px;
    width: 300px;
    height: 150px;
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.2) 0%, rgba(99, 102, 241, 0.2) 50%, rgba(139, 92, 246, 0.1) 100%);
    border-radius: 20px;
    filter: blur(40px);
    z-index: -1;
}

.ranking-hero-desc {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: var(--space-xl);
}

/* Ranking Type Cards */
.ranking-type-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

@media (max-width: 768px) {
    .ranking-type-cards {
        grid-template-columns: 1fr;
    }
}

.ranking-type-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: var(--space-xl);
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
}

.ranking-type-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.ranking-type-card.active {
    border-color: #2DD4BF;
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.1) 0%, rgba(45, 212, 191, 0.05) 100%);
    box-shadow: 0 0 20px rgba(45, 212, 191, 0.2);
}

.ranking-type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--surface-elevated);
    border-radius: 12px;
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
    transition: all var(--transition-base) var(--ease-out);
}

.ranking-type-card.active .ranking-type-icon {
    background: rgba(45, 212, 191, 0.2);
    color: #2DD4BF;
}

.ranking-type-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.ranking-type-card.active h3 {
    color: #2DD4BF;
}

.ranking-type-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Ranking Category Tags */
.ranking-category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
    padding: var(--space-md);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.ranking-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
}

.ranking-tag:hover {
    border-color: #2DD4BF;
    color: #2DD4BF;
}

.ranking-tag.active {
    background: #2DD4BF;
    border-color: #2DD4BF;
    color: #0F172A;
    font-weight: 600;
}

.ranking-tag.more-tag {
    border-color: #2DD4BF;
    color: #2DD4BF;
}

.ranking-tag.more-tag svg {
    margin-left: var(--space-xs);
}

/* Ranking List Container */
.ranking-list-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

/* Ranking List Item */
.ranking-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border);
    transition: all var(--transition-base) var(--ease-out);
    cursor: pointer;
}

.ranking-list-item:last-child {
    border-bottom: none;
}

.ranking-list-item:hover {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
}

/* Ranking Number */
.ranking-list-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 10px;
    flex-shrink: 0;
}

.ranking-list-number.rank-1 {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.ranking-list-number.rank-2 {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
    color: #fff;
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.3);
}

.ranking-list-number.rank-3 {
    background: linear-gradient(135deg, #CD7F32, #B87333);
    color: #fff;
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.3);
}

.ranking-list-number.rank-normal {
    background: var(--surface-elevated);
    color: var(--text-secondary);
}

/* Ranking Item Icon */
.ranking-list-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--surface-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ranking-list-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ranking-list-icon .icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    font-weight: 700;
    font-size: 1.25rem;
}

/* Ranking Item Info */
.ranking-list-info {
    flex: 1;
    min-width: 0;
}

.ranking-list-name {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.ranking-list-tags {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.ranking-list-tags .tag {
    padding: 2px 10px;
    font-size: 0.75rem;
    border-radius: 4px;
}

.ranking-list-tags .tag.s-level {
    background: linear-gradient(135deg, #2DD4BF, #22D3EE);
    color: #0F172A;
    font-weight: 600;
}

/* Ranking Item Stats */
.ranking-list-stats {
    display: flex;
    gap: var(--space-xl);
    flex-shrink: 0;
}

.ranking-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.ranking-stat-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--surface-elevated);
}

.ranking-stat-icon.ai-icon {
    color: #2DD4BF;
}

.ranking-stat-icon.traffic-icon {
    color: #60A5FA;
}

.ranking-stat-value {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ranking-hero-title h2 {
        font-size: 1.5rem;
    }

    .ranking-list-item {
        flex-wrap: wrap;
        gap: var(--space-md);
    }

    .ranking-list-stats {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ============================================ */
/* AI Chat Entry Button in Sidebar */
/* ============================================ */

.ai-chat-entry {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border);
}

.ai-chat-nav-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

.ai-chat-nav-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(139, 92, 246, 0.18) 100%);
}

.ai-chat-nav-btn span {
    color: #818cf8;
    font-weight: 600;
}

/* ============================================ */
/* AI Chat Section - In Main Content Area */
/* ============================================ */

.ai-chat-section {
    width: 100%;
    min-height: calc(100vh - 200px);
    background: linear-gradient(135deg, #fafbff 0%, #f0f4ff 50%, #fdf4ff 100%);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 40px;
}

/* When AI chat is visible, use two-column layout (no right sidebar) */
.layout-wrapper.three-column:has(.ai-chat-section:not(.hidden)) {
    grid-template-columns: var(--sidebar-width) 1fr;
}

.ai-chat-section .ai-chat-wrapper {
    max-width: 984px;
    width: 100%;
    padding: 20px 24px 40px;
    text-align: center;
    margin-top: auto;
}

/* Title */
.ai-chat-section .chat-title {
    font-size: 2.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1a1a2e 0%, #4F46E5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0;
    margin-top: 20px;
    letter-spacing: -0.03em;
}

/* New AI Chat - Dropdown Model Selector */
.ai-chat-dropdown-wrapper {
    position: relative;
    display: inline-block;
    flex-shrink: 0;
}

.ai-chat-model-btn {
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #9ca3af;
    transition: all 0.2s;
    user-select: none;
    white-space: nowrap;
    border: 1.5px solid transparent;
}

.ai-chat-model-btn:hover { background-color: #f3f4f6; color: #6b7280; }

.ai-chat-dropdown-wrapper.active .ai-chat-model-btn {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: 600;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.ai-chat-dropdown-wrapper.active .ai-chat-model-btn .ai-chat-brand-icon {
    filter: drop-shadow(0 0 2px rgba(37, 99, 235, 0.4));
}

.ai-chat-dropdown-content {
    display: none;
    background-color: #ffffff;
    min-width: 140px;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
    border-radius: 8px;
    padding: 8px 0;
    border: 1px solid #e5e7eb;
}

.ai-chat-dropdown-content::before {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: #fff transparent transparent transparent;
}

.ai-chat-sub-item {
    color: #374151;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.ai-chat-sub-item:hover {
    background-color: #f3f4f6;
    color: #2563eb;
}

.ai-chat-sub-item.selected {
    background-color: #eff6ff;
    color: #2563eb;
    font-weight: bold;
}

/* Chat History */
#ai-chat-history { width: 100%; display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px; }
.ai-chat-message-row { display: flex; width: 100%; }
.ai-chat-message-row.user { justify-content: flex-end; }
.ai-chat-message-row.ai { justify-content: flex-start; }

.ai-chat-message-bubble { padding: 15px 20px; border-radius: 12px; line-height: 1.6; font-size: 16px; position: relative; word-wrap: break-word; max-width: 80%; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.ai-chat-message-row.user .ai-chat-message-bubble { background-color: #2563eb; color: white; border-radius: 12px 12px 0 12px; display: inline-block; }
.ai-chat-message-row.ai .ai-chat-message-bubble { background: #fff; border: 1px solid #e5e7eb; color: #1f2937; border-radius: 12px 12px 12px 0; width: 100%; }
.ai-chat-message-bubble.loading::after { content: "正在思考..."; color: #9ca3af; font-style: italic; }

.ai-chat-model-tag { font-size: 12px; color: #6b7280; margin-bottom: 8px; font-weight: bold; display: flex; align-items: center; gap: 5px; border-bottom: 1px solid #eee; padding-bottom: 5px; margin-bottom: 10px; }

/* Markdown content in AI chat */
.ai-chat-content { text-align: left; }
.ai-chat-content p { margin: 0 0 10px 0; }
.ai-chat-content p:last-child { margin-bottom: 0; }
.ai-chat-content h1, .ai-chat-content h2, .ai-chat-content h3, .ai-chat-content h4 { margin: 16px 0 8px 0; font-weight: 700; line-height: 1.4; }
.ai-chat-content h1 { font-size: 1.4em; }
.ai-chat-content h2 { font-size: 1.25em; }
.ai-chat-content h3 { font-size: 1.1em; }
.ai-chat-content ul, .ai-chat-content ol { margin: 8px 0; padding-left: 24px; }
.ai-chat-content li { margin: 4px 0; }
.ai-chat-content code { background: #f3f4f6; color: #e11d48; padding: 2px 6px; border-radius: 4px; font-size: 0.9em; font-family: 'Consolas', 'Monaco', monospace; }
.ai-chat-content pre { background: #1e1e2e; color: #cdd6f4; border-radius: 8px; padding: 14px 16px; margin: 10px 0; overflow-x: auto; line-height: 1.5; }
.ai-chat-content pre code { background: none; color: inherit; padding: 0; font-size: 0.88em; }
.ai-chat-content blockquote { border-left: 3px solid #2563eb; margin: 10px 0; padding: 8px 14px; background: #f0f4ff; color: #4b5563; border-radius: 0 6px 6px 0; }
.ai-chat-content table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 0.92em; }
.ai-chat-content th, .ai-chat-content td { border: 1px solid #e5e7eb; padding: 8px 12px; text-align: left; }
.ai-chat-content th { background: #f9fafb; font-weight: 600; }
.ai-chat-content a { color: #2563eb; text-decoration: none; }
.ai-chat-content a:hover { text-decoration: underline; }
.ai-chat-content hr { border: none; border-top: 1px solid #e5e7eb; margin: 12px 0; }
.ai-chat-content img { max-width: 100%; border-radius: 8px; }

/* Input Container */
.ai-chat-input-container { background: white; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.05); padding: 20px; border: 1px solid #e5e7eb; transition: border-color 0.3s; position: sticky; bottom: 20px; z-index: 10; margin-bottom: 20px; }
.ai-chat-input-container:focus-within { border-color: #2563eb; }
.ai-chat-input-wrapper { position: relative; }
#ai-chat-user-input { width: 100%; border: none; resize: none; font-size: 16px; color: #374151; outline: none; min-height: 80px; padding-right: 50px; font-family: inherit; background: transparent; }
#ai-chat-user-input::placeholder { color: #9ca3af; }

/* Input Tools */
.ai-chat-input-tools {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 10px;
    position: relative;
}

.ai-chat-model-selector {
    flex: 1;
    margin-right: 15px;
}

.ai-chat-model-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.ai-chat-model-group:last-child {
    margin-bottom: 0;
}

.ai-chat-group-label {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 500;
    padding: 3px 8px;
    background: #f3f4f6;
    border-radius: 4px;
    flex-shrink: 0;
    letter-spacing: 0.5px;
    user-select: none;
}

.ai-chat-action-icons { display: flex; gap: 15px; align-items: center; flex-shrink: 0; padding-bottom: 2px; }
.ai-chat-icon-btn { color: #6b7280; cursor: pointer; font-size: 18px; transition: color 0.2s; }
.ai-chat-icon-btn:hover { color: #374151; }
.ai-chat-send-btn { background: linear-gradient(135deg, #f472b6 0%, #fb7185 100%); color: white; border: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform 0.1s; box-shadow: 0 2px 5px rgba(244, 114, 182, 0.4); }
.ai-chat-send-btn:active { transform: scale(0.95); }
.ai-chat-send-btn:disabled { background: #e5e7eb; cursor: not-allowed; box-shadow: none; }

.ai-chat-brand-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ai-chat-brand-icon svg {
    width: 100%;
    height: 100%;
}

/* Feature Grid */
.ai-chat-feature-grid { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center; width: 100%; margin-top: 20px; margin-bottom: 20px; }
.ai-chat-feature-card { background: white; border: 1px solid #e5e7eb; padding: 10px 20px; border-radius: 8px; display: flex; align-items: center; gap: 8px; color: #4b5563; font-size: 14px; cursor: pointer; transition: 0.2s; user-select: none; }
.ai-chat-feature-card:hover { border-color: #2563eb; color: #2563eb; }
.ai-chat-feature-card.blue i { color: #3b82f6; } .ai-chat-feature-card.green i { color: #10b981; } .ai-chat-feature-card.red i { color: #ef4444; } .ai-chat-feature-card.orange i { color: #f97316; } .ai-chat-feature-card.purple i { color: #8b5cf6; }

/* Suggested Questions */
.ai-chat-suggestions { width: 100%; max-width: 800px; margin: 0 auto 30px; text-align: center; }
.ai-chat-suggestions-title { font-size: 1.5rem; font-weight: 700; color: #1f2937; margin-bottom: 24px; }
.ai-chat-suggestions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ai-chat-suggestion-item {
    padding: 14px 16px;
    background: #f3f4f6;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    text-align: left;
    line-height: 1.5;
}
.ai-chat-suggestion-item:hover {
    background: #e0e7ff;
    color: #2563eb;
}

/* Toast */
#ai-chat-toast { visibility: hidden; min-width: 250px; background-color: #333; color: #fff; text-align: center; border-radius: 8px; padding: 12px; position: fixed; z-index: 2000; left: 50%; bottom: 30px; transform: translateX(-50%); font-size: 14px; opacity: 0; transition: opacity 0.3s, bottom 0.3s; }
#ai-chat-toast.show { visibility: visible; opacity: 1; bottom: 50px; }

@keyframes aiChatPopUp { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ============================================ */
/* Utility Tools Section (便民工具) */
/* ============================================ */

/* Utility Tools Grid */
.utility-grid-section {
    padding: var(--space-md) 0;
}

.utility-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.utility-card {
    background: var(--card-bg, #f8fafc);
    border-radius: 16px;
    padding: 28px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.utility-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.utility-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.utility-card-title {
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
}

.utility-card-desc {
    font-size: 13.5px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 18px;
}

.utility-card-link {
    font-size: 14px;
    font-weight: 500;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-block;
    transition: all 0.2s ease;
}

.utility-card:nth-child(1) .utility-card-link { color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.utility-card:nth-child(2) .utility-card-link { color: #22c55e; background: rgba(34, 197, 94, 0.1); }
.utility-card:nth-child(3) .utility-card-link { color: #8b5cf6; background: rgba(139, 92, 246, 0.1); }
.utility-card:nth-child(4) .utility-card-link { color: #3b82f6; background: rgba(59, 130, 246, 0.1); }
.utility-card:nth-child(5) .utility-card-link { color: #dc2626; background: rgba(220, 38, 38, 0.1); }

.utility-card:hover .utility-card-link {
    transform: translateX(4px);
}

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

@media (max-width: 600px) {
    .utility-grid {
        grid-template-columns: 1fr;
    }
}

/* Utility Tool Embed */
.utility-tool-section {
    width: 100%;
    background: white;
    border-radius: 16px;
    overflow: visible;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.utility-iframe {
    width: 100%;
    border: none;
    background: transparent;
    overflow: hidden;
    display: block;
}

/* ============================================ */
/* Promo Banner Section */
/* ============================================ */

.promo-banner-section {
    padding: 0 0 var(--space-lg) 0;
    position: relative;
    margin-bottom: var(--space-md);
    width: 100%;
    max-width: none;
}

.promo-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}

.promo-banner {
    display: none;
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 50%, #1D4ED8 100%);
    border-radius: 16px;
    padding: var(--space-2xl);
    min-height: 280px;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.5s ease;
    width: 100%;
}

.promo-banner.active {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Decorative background elements */
.promo-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 60%;
    height: 200%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    border-radius: 50%;
    pointer-events: none;
}

.promo-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #A3E635, #22D3EE, #A3E635);
}

/* Banner Content */
.promo-banner-content {
    flex: 1;
    z-index: 1;
    max-width: 70%;
}

.promo-header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.promo-icon {
    font-size: 1.25rem;
}

.promo-tag {
    background: rgba(255, 255, 255, 0.9);
    color: #1D4ED8;
    padding: 4px var(--space-md);
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

.promo-emoji {
    font-size: 1.25rem;
}

.promo-main {
    margin-bottom: var(--space-sm);
}

.promo-main h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    color: white;
    line-height: 1.4;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.promo-main .highlight {
    background: #A3E635;
    color: #0F172A;
    padding: 0 var(--space-xs);
    border-radius: 4px;
    display: inline-block;
}

.promo-main .dots {
    color: #A3E635;
    font-weight: 400;
}

.promo-main .sub-text {
    background: linear-gradient(90deg, transparent, rgba(163, 230, 53, 0.3), transparent);
    padding: 0 var(--space-sm);
    position: relative;
}

.promo-main .sub-text::before {
    content: '...';
    color: #A3E635;
    margin-right: var(--space-xs);
}

.promo-footer {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.promo-footer p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.7rem;
    margin: 0;
    display: none;
}

.promo-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: #A3E635;
    color: #0F172A;
    border: none;
    padding: var(--space-md) var(--space-xl);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
    box-shadow: 0 2px 8px rgba(163, 230, 53, 0.4);
}

.promo-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(163, 230, 53, 0.5);
    background: #BEF264;
}

.promo-btn span {
    font-size: 0.7rem;
}

/* Banner Image */
.promo-banner-image {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 25%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.robot-placeholder {
    font-size: 5rem;
    opacity: 0.9;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
    animation: float 3s ease-in-out infinite;
}

/* Carousel Indicators */
.promo-indicators {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.promo-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: var(--border);
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
    padding: 0;
}

.promo-indicator:hover {
    background: var(--text-secondary);
}

.promo-indicator.active {
    background: #2563EB;
    width: 20px;
    border-radius: 4px;
}

/* Carousel Navigation */
.promo-nav {
    position: absolute;
    top: 90px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #1D4ED8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base) var(--ease-out);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.promo-nav svg {
    width: 16px;
    height: 16px;
}

.promo-nav:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.promo-prev {
    left: var(--space-md);
}

.promo-next {
    right: var(--space-md);
}

/* Responsive */
@media (max-width: 1024px) {
    .promo-prev {
        left: var(--space-sm);
    }

    .promo-next {
        right: var(--space-sm);
    }
}

@media (max-width: 768px) {
    .promo-banner {
        padding: var(--space-xl);
        min-height: 240px;
    }

    .promo-banner-content {
        max-width: 100%;
    }

    .promo-banner-image {
        display: none;
    }

    .promo-main h2 {
        font-size: 1.5rem;
    }

    .promo-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
    }

    .promo-nav {
        width: 40px;
        height: 40px;
    }
}

/* ============================================ */
/* Hero Section */
/* ============================================ */

.hero {
    padding: var(--space-2xl) 0 var(--space-xl);
    text-align: center;
}

.hero.compact {
    padding: var(--space-lg) 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
    .hero {
        padding: 4rem 0 3rem;
    }
    .hero.compact {
        padding: var(--space-md) 0;
    }
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    line-height: 1.6;
}

.hero-search {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    gap: var(--space-sm);
}

/* Reddit-style search box */
.hero-search.reddit-style {
    position: relative;
    max-width: 100%;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 0;
    gap: 0;
    transition: all var(--transition-base) var(--ease-out);
}

.hero-search.reddit-style:hover {
    border-color: var(--cta);
}

.hero-search.reddit-style:focus-within {
    border-color: var(--cta);
    box-shadow: 0 0 0 2px rgba(3, 105, 161, 0.1);
}

.hero-search.reddit-style .search-icon {
    position: absolute;
    left: var(--space-lg);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.hero-search.reddit-style input {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    padding-left: calc(var(--space-lg) + 28px);
    border: none;
    border-radius: 24px;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: var(--font-body);
    outline: none;
}

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

.hero-search input {
    flex: 1;
    padding: var(--space-lg);
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-body);
    transition: border-color var(--transition-base) var(--ease-out),
                box-shadow var(--transition-base) var(--ease-out);
}

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

.hero-search input:focus {
    outline: none;
    border-color: var(--cta);
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.1);
}

.search-btn {
    padding: var(--space-lg);
    background: var(--cta);
    border: none;
    border-radius: 12px;
    color: white;
    cursor: pointer;
    transition: transform var(--transition-fast) var(--ease-out),
                background-color var(--transition-base) var(--ease-out);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
}

.search-btn:hover {
    background: #0284C7;
    transform: translateY(-2px);
}

.search-btn:active {
    transform: translateY(0);
}

/* ============================================ */
/* Main Layout with Sidebar */
/* ============================================ */

.main-layout {
    padding: var(--space-xl) 0;
}

.layout-wrapper {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    gap: var(--space-2xl);
    align-items: start;
}

/* Three column layout */
.layout-wrapper.three-column {
    grid-template-columns: var(--sidebar-width) 1fr 280px;
    gap: var(--space-xl);
}

@media (max-width: 1024px) {
    .layout-wrapper.three-column {
        grid-template-columns: var(--sidebar-width) 1fr;
    }
    .layout-wrapper.three-column .right-sidebar {
        display: none;
    }
}

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

/* ============================================ */
/* Sidebar */
/* ============================================ */

.sidebar {
    position: sticky;
    top: calc(72px + var(--space-lg));
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: var(--space-lg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.left-sidebar {
    position: sticky;
    top: calc(80px + var(--space-lg));
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-left: none;
    border-radius: 0 16px 16px 0;
    padding: var(--space-md) 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    margin-left: 0;
    min-height: calc(100vh - 80px - var(--space-lg) - 20px);
}

.right-sidebar {
    position: sticky;
    top: calc(120px + var(--space-lg));
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: var(--space-lg);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.right-sidebar::-webkit-scrollbar {
    width: 6px;
}

.right-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

@media (max-width: 1024px) {
    .sidebar {
        position: static;
        margin-bottom: var(--space-xl);
    }
    .left-sidebar, .right-sidebar {
        position: static;
        max-height: none;
    }
}

.sidebar-header h2 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

.category-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 var(--space-sm);
}

/* Nav Button Layout - Horizontal style */
.nav-icon-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.nav-icon-btn span {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.nav-icon-btn:hover {
    background: rgba(99, 102, 241, 0.08);
}

.nav-icon-btn:hover span {
    color: var(--text-primary);
}

.nav-icon-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

.nav-icon-btn.active span {
    color: #818cf8;
    font-weight: 600;
}

.nav-icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.nav-icon-btn:hover .nav-icon-circle {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 1024px) {
    .category-nav {
        flex-direction: column;
    }
}

/* Category Group */
.category-group {
    display: flex;
    flex-direction: column;
}

.category-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    border: none;
    border-radius: 0;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
    text-align: left;
    width: 100%;
}

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

.category-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

.category-item:focus {
    outline: none;
    background: rgba(99, 102, 241, 0.08);
}

.category-item.active,
.category-item[aria-pressed="true"] {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(236, 72, 153, 0.08) 100%);
    color: #6366F1;
    border-left: 3px solid #ec4899;
}

.category-item.active .category-icon,
.category-item[aria-pressed="true"] .category-icon {
    color: #6366F1;
}

/* Dropdown arrow */
.category-item .dropdown-arrow {
    margin-left: auto;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.category-item.has-submenu[aria-expanded="true"] .dropdown-arrow {
    transform: rotate(180deg);
}

/* Subcategory list */
.subcategory-list {
    display: flex;
    flex-direction: column;
    padding-left: calc(var(--space-lg) + 20px + var(--space-md));
    overflow: hidden;
}

.subcategory-item {
    display: block;
    padding: var(--space-sm) var(--space-md);
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
    text-align: left;
    width: 100%;
    margin: 2px 0;
    text-decoration: none;
}

.subcategory-item:hover {
    background: var(--surface-elevated);
    color: var(--text-primary);
}

.subcategory-item:focus {
    outline: none;
    background: var(--surface-elevated);
}

.subcategory-item.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    color: #A5B4FC;
    font-weight: 500;
}

/* ============================================ */
/* Tools Grid */
/* ============================================ */

.main-content {
    min-height: 400px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-lg);
}

@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
}

.tool-card {
    background: white;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: var(--space-lg);
    transition: all var(--transition-base) var(--ease-out);
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

/* Card gradient border effect */
.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.5), rgba(236, 72, 153, 0.5), rgba(139, 92, 246, 0.5));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity var(--transition-base) var(--ease-out);
    pointer-events: none;
}

.tool-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: transparent;
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15), 0 8px 16px rgba(0, 0, 0, 0.08);
}

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

/* Hidden elements by default */
.tool-card .tool-rating,
.tool-card .tool-description,
.tool-card .tool-tags,
.tool-card .tool-link {
    display: none;
}

/* Show elements on hover */
.tool-card:hover .tool-rating,
.tool-card:hover .tool-description,
.tool-card:hover .tool-tags,
.tool-card:hover .tool-link {
    display: flex;
}

.tool-card:hover .tool-description {
    display: block;
}

.tool-header-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--space-sm);
}
.tool-header-inline .tool-name {
    margin: 0;
    flex: 1;
}
.tool-header-inline .tool-icon {
    margin: 0;
    flex-shrink: 0;
}

.tool-icon {
    margin-bottom: var(--space-sm);
    color: var(--cta);
}

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

.tool-icon img {
    display: block;
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

/* Icon fallback styles */
.icon-fallback {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    border-radius: 8px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.icon-fallback.large {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
    border-radius: 12px;
}

.icon-fallback.small {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    border-radius: 4px;
}

.tool-name {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
}

.tool-category {
    color: #A5B4FC;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tool-rating {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    animation: fadeIn var(--transition-base) var(--ease-out);
}

.stars {
    display: flex;
    gap: 2px;
    color: #F59E0B;
}

.stars.large {
    gap: 4px;
}

.rating-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.rating-text.large {
    font-size: 1rem;
}

.tool-feature-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
    justify-content: center;
    align-items: center;
}
.feature-tag {
    font-size: 13px;
    padding: 2px 6px;
    color: #6366f1;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08));
    border-radius: 4px;
    letter-spacing: 0.3px;
}
.feature-tag + .feature-tag::before {
    content: none;
}

.tool-description {
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    flex-grow: 1;
    line-height: 1.5;
    font-size: 0.875rem;
    animation: fadeIn var(--transition-base) var(--ease-out);
}

.tool-tags {
    display: flex;
    gap: var(--space-xs);
    flex-wrap: wrap;
    margin-bottom: var(--space-sm);
    animation: fadeIn var(--transition-base) var(--ease-out);
}

.tag {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    color: #A5B4FC;
    padding: var(--space-xs) var(--space-md);
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.tool-link {
    color: #A5B4FC;
    background: transparent;
    border: 1px solid rgba(99, 102, 241, 0.5);
    padding: var(--space-sm) var(--space-md);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    transition: all var(--transition-base) var(--ease-out);
    font-size: 0.875rem;
    font-family: var(--font-body);
    cursor: pointer;
    animation: fadeIn var(--transition-base) var(--ease-out);
}

.tool-link:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    gap: var(--space-md);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.tool-link:focus {
    outline: 2px solid var(--cta);
    outline-offset: 4px;
}

/* ============================================ */
/* Tool Detail View */
/* ============================================ */

.tool-detail {
    max-width: 900px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    padding: var(--space-sm) 0;
    margin-bottom: var(--space-xl);
    cursor: pointer;
    transition: color var(--transition-base) var(--ease-out);
}

.back-btn:hover {
    color: var(--cta);
}

.tool-detail-header {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: var(--space-2xl);
    margin-bottom: var(--space-xl);
    display: flex;
    gap: var(--space-xl);
    align-items: start;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .tool-detail-header {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
}

.tool-detail-icon {
    color: var(--cta);
    flex-shrink: 0;
}

.tool-detail-icon img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 12px;
}

.tool-detail-info {
    flex: 1;
}

.tool-detail-name {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.tool-detail-category {
    color: #A5B4FC;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tool-detail-rating {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

@media (max-width: 768px) {
    .tool-detail-rating {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

.tool-detail-tags {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-xl);
}

.visit-external-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    padding: var(--space-md) var(--space-xl);
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition-base) var(--ease-out);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.visit-external-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.tool-detail-description {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.tool-detail-description h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.tool-detail-description p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ============================================ */
/* Review Sections */
/* ============================================ */

.review-section {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.review-section h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.review-section h2 svg {
    color: #A5B4FC;
}

.pros-cons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
}

.pros-box, .cons-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.pros-box h3, .cons-box h3 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.pros-box h3 {
    color: var(--success);
}

.cons-box h3 {
    color: var(--error);
}

.pros-box ul, .cons-box ul {
    list-style: none;
}

.pros-box li, .cons-box li {
    padding-left: var(--space-xl);
    margin-bottom: var(--space-md);
    position: relative;
    color: var(--text-secondary);
    line-height: 1.6;
}

.pros-box li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
}

.cons-box li::before {
    content: '×';
    position: absolute;
    left: 0;
    color: var(--error);
    font-weight: 700;
}

.features-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-md);
}

.features-list li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: var(--space-md);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.features-list li::before {
    content: '▸';
    color: var(--cta);
    font-weight: 700;
}

.tutorial-tips {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.tip-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-lg);
    display: flex;
    align-items: start;
    gap: var(--space-lg);
}

.tip-number {
    background: var(--gradient-primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.tip-text {
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
}

.comparison-grid {
    display: grid;
    gap: var(--space-lg);
}

.comparison-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-lg);
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.comparison-header h4 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.comparison-score {
    background: var(--gradient-primary);
    color: white;
    padding: var(--space-xs) var(--space-md);
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.875rem;
}

.comparison-bar {
    background: var(--border);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.comparison-fill {
    background: var(--gradient-primary);
    height: 100%;
    transition: width var(--transition-slow) var(--ease-out);
}

.comparison-strength {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: var(--space-sm);
}

.comparison-format {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================ */
/* User Reviews */
/* ============================================ */

.user-reviews-section {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: var(--space-xl);
}

.user-reviews-section > h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--space-xl);
    color: var(--text-primary);
}

.add-review-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.add-review-box h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-lg);
    color: var(--text-primary);
}

.review-form .form-group {
    margin-bottom: var(--space-lg);
}

.review-form label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.star-input {
    display: flex;
    gap: var(--space-sm);
}

.star-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform var(--transition-fast) var(--ease-out);
    color: var(--text-muted);
}

.star-btn:hover {
    transform: scale(1.2);
    color: #F59E0B;
}

.star-btn svg {
    display: block;
}

.review-form textarea,
.review-form input[type="text"] {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition-base) var(--ease-out);
}

.review-form textarea:focus,
.review-form input[type="text"]:focus {
    outline: none;
    border-color: var(--cta);
}

.review-form textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: var(--space-md) var(--space-xl);
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
}

.user-reviews-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.no-reviews {
    text-align: center;
    color: var(--text-muted);
    padding: var(--space-2xl);
}

.user-review-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-lg);
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.review-author {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.author-info h4 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.review-date {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.review-rating-small {
    display: flex;
    gap: 2px;
    color: #F59E0B;
}

.review-comment {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ============================================ */
/* Modal */
/* ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 26, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: var(--space-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-sm);
    transition: color var(--transition-base) var(--ease-out);
}

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

.submit-tool-form .form-group {
    margin-bottom: var(--space-lg);
}

.submit-tool-form label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.submit-tool-form input,
.submit-tool-form select,
.submit-tool-form textarea {
    width: 100%;
    padding: var(--space-md);
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--background);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color var(--transition-base) var(--ease-out);
}

.submit-tool-form input:focus,
.submit-tool-form select:focus,
.submit-tool-form textarea:focus {
    outline: none;
    border-color: var(--cta);
}

.submit-tool-form select {
    cursor: pointer;
}

.submit-tool-form textarea {
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    margin-top: var(--space-xl);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: var(--space-md) var(--space-xl);
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
}

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

/* ============================================ */
/* No Results */
/* ============================================ */

.no-results {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    text-align: center;
    color: var(--text-muted);
}

.no-results svg {
    margin-bottom: var(--space-xl);
    opacity: 0.5;
}

.no-results-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

.no-results-text {
    font-size: 1rem;
}

/* ============================================ */
/* Notification */
/* ============================================ */

.notification {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--space-lg) var(--space-xl);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), var(--glow-primary);
    z-index: 200;
    transition: bottom var(--transition-slow) var(--ease-out);
    color: var(--text-primary);
    font-weight: 500;
}

.notification.show {
    bottom: var(--space-xl);
}

/* ============================================ */
/* Footer */
/* ============================================ */

.footer {
    background: rgba(15, 15, 26, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: var(--space-2xl) 0 var(--space-lg);
    margin-top: var(--space-2xl);
}

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

.footer-section h3 {
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-weight: 600;
}

.footer-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9375rem;
}

.footer-section nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.footer-section a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-base) var(--ease-out);
    font-size: 0.9375rem;
}

.footer-section a:hover {
    color: #A5B4FC;
}

.footer-section a:focus {
    outline: 2px solid var(--cta);
    outline-offset: 2px;
    border-radius: 2px;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-xl);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================ */
/* Right Sidebar - Rankings */
/* ============================================ */

.sidebar-section {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-section .sidebar-header {
    margin-bottom: var(--space-md);
}

.sidebar-header h2 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
}

.ranking-item:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

.ranking-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ranking-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.ranking-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    border-radius: 6px;
    flex-shrink: 0;
}

.ranking-number.gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #fff;
}

.ranking-number.silver {
    background: linear-gradient(135deg, #C0C0C0, #A8A8A8);
    color: #fff;
}

.ranking-number.bronze {
    background: linear-gradient(135deg, #CD7F32, #B87333);
    color: #fff;
}

.ranking-number.normal {
    background: var(--surface-elevated);
    color: var(--text-secondary);
}

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

.ranking-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ranking-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ranking-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    color: #F59E0B;
}

.ranking-reviews {
    color: var(--text-muted);
}

/* New tools list */
.new-tools-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.new-tool-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
}

.new-tool-item:hover {
    background: var(--surface-elevated);
    color: var(--text-primary);
}

.new-badge {
    background: var(--gradient-accent);
    color: #0F172A;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* ============================================ */
/* Accessibility & Animations */
/* ============================================ */

:focus-visible {
    outline: 2px solid var(--cta);
    outline-offset: 2px;
    border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (prefers-contrast: high) {
    :root {
        --border: #475569;
        --border-hover: #64748B;
    }
}

/* ============================================ */
/* Scrollbar - Dark Theme */
/* ============================================ */

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.5), rgba(139, 92, 246, 0.5));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.7), rgba(139, 92, 246, 0.7));
}

/* ============================================ */
/* JSON Tool Section */
/* ============================================ */

.json-tool-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    padding: var(--space-2xl);
    overflow: hidden;
    background: var(--background);
}

/* JSON Tool Gradient Background */
.json-tool-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        linear-gradient(180deg, var(--background) 0%, var(--background-gradient-1) 100%);
    z-index: -1;
}

.json-tool-container {
    max-width: 100%;
    width: 100%;
    height: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.json-tool-header {
    text-align: center;
    margin-bottom: var(--space-xl);
    flex-shrink: 0;
}

.json-tool-header h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.json-tool-description {
    font-size: 1rem;
    color: var(--text-secondary);
}

.json-tool-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .json-tool-content {
        grid-template-columns: 1fr;
    }
}

/* Input/Output Areas */
.json-input-area,
.json-output-area {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    min-height: 0;
    overflow: hidden;
}

.json-area-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--space-sm);
    flex-shrink: 0;
}

.json-area-header label {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.json-area-header button {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
}

.json-area-header button:hover {
    background: var(--secondary);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.json-area-header button:active {
    transform: translateY(0);
}

#jsonInput {
    width: 100%;
    height: 100%;
    min-height: 400px;
    max-height: 100%;
    flex: 1;
    padding: var(--space-md);
    background: var(--surface-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: none;
    transition: all var(--transition-base) var(--ease-out);
    overflow-x: hidden;
    overflow-y: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
}

#jsonOutput {
    width: 100%;
    height: 100%;
    min-height: 400px;
    max-height: 100%;
    flex: 1;
    padding: var(--space-md);
    background: var(--surface-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: none;
    transition: all var(--transition-base) var(--ease-out);
    overflow: auto;
    white-space: pre;
}

#jsonInput:focus,
#jsonOutput:focus {
    outline: none;
    border-color: var(--cta);
    box-shadow: var(--glow-primary);
}

#jsonOutput {
    background: var(--surface-elevated);
    cursor: default;
}

/* Action Buttons Wrapper */
.json-actions-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg) 0;
    flex-shrink: 0;
}

/* Action Buttons */
.json-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin: 0;
}

.json-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border: 2px solid transparent;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
    position: relative;
    overflow: visible;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.json-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.json-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

/* Button Variants */
.json-btn.primary {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

.json-btn.primary:hover {
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.json-btn.success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

.json-btn.success:hover {
    background: #059669;
    border-color: #059669;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.25);
}

.json-btn.warning {
    background: var(--warning);
    color: white;
    border-color: var(--warning);
}

.json-btn.warning:hover {
    background: #D97706;
    border-color: #D97706;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.25);
}

.json-btn.info {
    background: #6366F1;
    color: white;
    border-color: #6366F1;
}

.json-btn.info:hover {
    background: #4F46E5;
    border-color: #4F46E5;
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
}

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

.json-btn.secondary:hover {
    background: var(--surface);
    border-color: var(--border-hover);
    box-shadow: 0 6px 20px rgba(100, 116, 139, 0.15);
}

/* Status Message */
.json-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    animation: fadeIn var(--transition-base) var(--ease-out);
}

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

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

.json-status.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.json-status.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
}

.json-status.info {
    background: rgba(3, 105, 161, 0.1);
    border: 1px solid var(--cta);
    color: var(--cta);
}

.status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.status-icon::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .json-tool-section {
        padding: var(--space-lg);
    }

    .json-tool-header h2 {
        font-size: 1.75rem;
    }

    .json-tool-description {
        font-size: 0.9375rem;
    }

    .json-actions-wrapper {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-md);
    }

    .json-actions {
        flex-direction: row;
        justify-content: center;
        gap: var(--space-sm);
        padding: var(--space-md) 0;
    }

    .json-btn {
        flex: 1;
        justify-content: center;
        padding: var(--space-sm) var(--space-md);
        font-size: 0.875rem;
    }

    .json-status {
        justify-content: center;
        text-align: center;
    }

    #jsonInput,
    #jsonOutput {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .json-tool-section {
        padding: var(--space-md);
    }

    .json-tool-header h2 {
        font-size: 1.5rem;
    }

    .json-tool-header {
        margin-bottom: var(--space-md);
    }

    .json-actions-wrapper {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .json-actions {
        flex-direction: column;
        padding: var(--space-sm) 0;
    }

    .json-btn {
        width: 100%;
        padding: var(--space-md) var(--space-lg);
        font-size: 0.875rem;
    }

    .json-status {
        width: 100%;
    }

    #jsonInput,
    #jsonOutput {
        font-size: 0.75rem;
    }
}

/* ============================================ */
/* JSON Tree View */
/* ============================================ */

.json-output-container {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.output-controls {
    display: flex;
    gap: var(--space-sm);
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base) var(--ease-out);
}

.view-toggle-btn:hover {
    background: var(--cta);
    border-color: var(--cta);
    color: white;
    transform: translateY(-1px);
}

.view-toggle-btn.active {
    background: var(--cta);
    border-color: var(--cta);
    color: white;
}

.json-tree-view {
    display: none;
    width: 100%;
    height: 100%;
    padding: var(--space-md);
    background: var(--surface-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.json-tree-view.active {
    display: block;
}

#jsonOutput.active {
    display: block;
}

#jsonOutput:not(.active) {
    display: none;
}

/* Tree node styles */
.tree-node {
    margin-left: 20px;
}

.tree-line {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 2px 0;
    cursor: default;
}

.tree-line:hover {
    background: var(--surface-elevated);
    border-radius: 4px;
}

.tree-toggle {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
    font-weight: bold;
    font-size: 0.75rem;
    transition: transform var(--transition-fast) var(--ease-out);
}

.tree-toggle:hover {
    color: var(--cta);
    transform: scale(1.2);
}

.tree-toggle.expanded {
    transform: rotate(90deg);
}

.tree-toggle.expanded:hover {
    transform: rotate(90deg) scale(1.2);
}

.tree-key {
    font-weight: 600;
    margin-right: var(--space-xs);
}

.tree-value {
    color: var(--text-secondary);
    white-space: nowrap;
}

.tree-value.string {
    color: #34D399;
}

.tree-value.number {
    color: #60A5FA;
}

.tree-value.boolean {
    color: #F87171;
}

.tree-value.null {
    color: #9CA3AF;
    font-style: italic;
}

.tree-value.url {
    color: #A5B4FC;
    text-decoration: underline;
    cursor: pointer;
}

.tree-value.url:hover {
    color: #C4B5FD;
}

/* Bracket styles */
.tree-bracket {
    color: var(--text-muted);
    font-weight: bold;
}

/* Collapsed content indicator */
.tree-collapsed-indicator {
    color: var(--text-muted);
    font-style: italic;
}

/* Color palette for keys - using hash-based coloring */
.tree-key.color-0 { color: #F87171; }
.tree-key.color-1 { color: #FBBF24; }
.tree-key.color-2 { color: #34D399; }
.tree-key.color-3 { color: #60A5FA; }
.tree-key.color-4 { color: #A78BFA; }
.tree-key.color-5 { color: #F472B6; }
.tree-key.color-6 { color: #2DD4BF; }
.tree-key.color-7 { color: #FB923C; }
.tree-key.color-8 { color: #22D3EE; }
.tree-key.color-9 { color: #C084FC; }

/* Responsive adjustments for tree view */
@media (max-width: 768px) {
    .tree-line {
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .tree-line {
        font-size: 0.75rem;
    }
}

/* ============================================ */
/* Additional Design Enhancements */
/* ============================================ */

/* Animated hover glow effect for interactive elements */
.tool-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-base) var(--ease-out);
    pointer-events: none;
}

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

/* Subtle pulse animation for active elements */
@keyframes subtlePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
    }
}

/* Floating animation for decorative elements */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Shimmer effect for loading states */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.shimmer {
    background: linear-gradient(
        90deg,
        var(--surface) 25%,
        var(--surface-elevated) 50%,
        var(--surface) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Enhanced focus states */
*:focus-visible {
    outline: 2px solid var(--cta);
    outline-offset: 3px;
    border-radius: 4px;
    box-shadow: var(--glow-primary);
}

/* Selection styling */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

/* Hero section gradient text */
.hero-title {
    background: linear-gradient(135deg, #A5B4FC 0%, #C4B5FD 50%, #F9A8D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Category item hover effect */
.category-item:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
}

/* Subcategory item hover effect */
.subcategory-item:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
}

/* New tool item hover */
.new-tool-item:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

/* Link hover effects */
.nav-links a:hover,
.footer-section a:hover {
    background: linear-gradient(135deg, var(--cta), var(--cta-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Form inputs dark theme */
.review-form textarea,
.review-form input[type="text"],
.submit-tool-form input,
.submit-tool-form select,
.submit-tool-form textarea {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-primary);
}

.review-form textarea:focus,
.review-form input[type="text"]:focus,
.submit-tool-form input:focus,
.submit-tool-form select:focus,
.submit-tool-form textarea:focus {
    border-color: var(--cta);
    box-shadow: var(--glow-primary);
}

/* Add review box dark theme */
.add-review-box {
    background: var(--surface);
    border-color: var(--border);
}

/* User review item dark theme */
.user-review-item {
    background: var(--surface);
    border-color: var(--border);
}

/* Comparison item dark theme */
.comparison-item {
    background: var(--surface);
    border-color: var(--border);
}

/* Tip item dark theme */
.tip-item {
    background: var(--surface);
    border-color: var(--border);
}

/* Features list dark theme */
.features-list li {
    background: var(--surface);
    border-color: var(--border);
}

/* Features list item icon */
.features-list li::before {
    color: #A5B4FC;
}

/* ============================================
   摸鱼专区 Styles
   ============================================ */

.fishing-zone-section {
    padding: 20px 0;
}

.fishing-zone-header {
    margin-bottom: 24px;
}

.fishing-zone-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.fishing-zone-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Fishing game fullscreen overlay (iframe) */
.fishing-game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    background: #000;
}

.fishing-game-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* SEO 静态链接区块 */
.seo-links {
    margin-top: var(--space-2xl, 3rem);
    padding: var(--space-xl, 2rem) 0;
    border-top: 1px solid var(--border);
    background: var(--background, #fafbff);
}

.seo-links .container {
    display: flex;
    gap: var(--space-2xl, 3rem);
    flex-wrap: wrap;
}

.seo-links-section {
    flex: 1;
    min-width: 240px;
}

.seo-links-section h3 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-md, 1rem);
}

.seo-links-section ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs, 0.25rem) var(--space-md, 1rem);
}

.seo-links-section ul li a {
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.seo-links-section ul li a:hover {
    color: var(--cta);
}