/* Online Tools Manager - Main Styles */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --surface-hover: #f1f5f9;
    --border-color: #e2e8f0;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s ease;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    
    --container-max: 1280px;
    --header-height: 72px;
    --tools-per-row: 3;
}

/* ========================================
   Reset & Base
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

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

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

/* ========================================
   Layout
   ======================================== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.page-wrapper {
    min-height: calc(100vh - var(--header-height));
    padding-top: var(--header-height);
}

/* ========================================
   Header
   ======================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.site-title a {
    color: inherit;
}

.site-title a:hover {
    color: var(--primary-color);
}

/* ========================================
   Mega Nav Menu — 顶部多列下拉菜单
   ======================================== */
.main-navigation {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-left: 1.5rem;
}

/* 一级菜单容器 */
.otm-meganav {
    display: flex;
    list-style: none;
    gap: 0.125rem;
    margin: 0;
    padding: 0;
}

.otm-meganav-item {
    position: relative;       /* 下拉面板相对于导航项定位 */
}

.otm-meganav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: var(--transition);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}

.otm-meganav-link:hover {
    color: var(--primary-color);
    background: var(--primary-light);
    text-decoration: none;
}

.otm-meganav-item.active .otm-meganav-link {
    color: var(--primary-color);
    background: var(--primary-light);
}

.otm-meganav-arrow {
    font-size: 0.625rem;
    transition: transform 0.2s;
}

.otm-meganav-item.active .otm-meganav-arrow {
    transform: rotate(180deg);
}

/* 下拉面板容器 */
.otm-meganav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    transform: translateX(calc(-1 * var(--dropdown-offset, 0px)));
    width: auto;
    min-width: 260px;
    max-width: min(100vw - 32px, 720px);
    max-height: calc(100vh - var(--header-height) - 16px);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    animation: otmFadeIn 0.15s ease;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.otm-meganav-dropdown::-webkit-scrollbar {
    display: none;
}

.otm-meganav-item.active .otm-meganav-dropdown {
    display: block;
}

@keyframes otmFadeIn {
    from { opacity: 0; transform: translateX(calc(-1 * var(--dropdown-offset, 0px))) translateY(-4px); }
    to   { opacity: 1; transform: translateX(calc(-1 * var(--dropdown-offset, 0px))) translateY(0); }
}

/* 下拉内层：紧凑卡片式布局 */
.otm-meganav-dropdown-inner {
    display: flex;
    padding: 1rem 1rem;
    gap: 1.25rem;
}

/* 列 */
.otm-meganav-col {
    flex: 0 0 auto;
    min-width: 140px;
}

/* 分类分组 */
.otm-meganav-group {
    margin-bottom: 1.25rem;
}

.otm-meganav-group:last-child {
    margin-bottom: 0;
}

/* 分类标题（黑体） */
.otm-meganav-group-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    padding: 0 0 0.375rem 0;
    border-bottom: 2px solid var(--primary-light);
    letter-spacing: 0.01em;
}

.otm-meganav-group-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s;
}

.otm-meganav-group-title a:hover {
    color: var(--primary-color);
}

.otm-meganav-group-title i {
    margin-right: 0.375rem;
    color: var(--primary-color);
    font-size: 0.8rem;
}

/* 工具列表 */
.otm-meganav-tools {
    list-style: none;
    margin: 0;
    padding: 0;
}

.otm-meganav-tools li {
    margin: 0;
}

.otm-meganav-tools a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
    border-radius: var(--radius-sm);
    transition: all 0.12s ease;
    text-decoration: none;
    line-height: 1.4;
}

.otm-meganav-tools a:hover {
    color: var(--primary-color);
    background: var(--primary-light);
    text-decoration: none;
}

.otm-meganav-tools a i {
    font-size: 0.75rem;
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color 0.12s;
}

.otm-meganav-tools a:hover i {
    color: var(--primary-color);
}

.otm-meganav-tools a span {
    white-space: nowrap;
}

/* 平铺模式（无子分类时的网格） */
.otm-meganav-tools-flat {
    display: block;
}

/* "更多" 链接 */
.otm-meganav-more a {
    color: var(--primary-color) !important;
    font-weight: 500;
    font-size: 0.8rem;
    padding: 0.375rem 0.5rem;
    margin-top: 0.25rem;
}

.otm-meganav-more a:hover {
    background: var(--primary-light);
}

/* 下拉遮罩（点击空白关闭） */
.otm-meganav-overlay {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.15);
    z-index: 998;
}

.otm-meganav-overlay.show {
    display: block;
}

/* ========================================
   Mobile mega-nav 适配
   ======================================== */
@media (max-width: 1024px) {
    .otm-meganav {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .otm-meganav-item {
        position: relative;
    }

    .otm-meganav-link {
        padding: 0.75rem 1rem;
        width: 100%;
        justify-content: space-between;
        border-radius: 0;
        border-bottom: 1px solid var(--border-color);
    }

    .otm-meganav-dropdown {
        position: static;
        left: auto;
        transform: none;
        width: 100%;
        max-width: none;
        min-width: 0;
        max-height: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-color);
        overflow-y: visible;
        --dropdown-offset: 0px;
    }

    .otm-meganav-dropdown-inner {
        flex-direction: column;
        padding: 0.75rem 1.5rem;
        gap: 1rem;
    }

    .otm-meganav-col {
        flex: none;
        width: 100%;
        max-width: none;
        min-width: 0;
    }

    .otm-meganav-overlay {
        display: none !important;
    }
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    padding: 0.5rem;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.header-search {
    position: relative;
}

.header-search input {
    width: 240px;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    background: var(--bg-color);
    transition: var(--transition);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--surface-color);
    width: 300px;
}

.header-search .search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Hero 搜索 — xtools 深色半透明风格 */
.hero-search--xtools input {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    box-shadow: none;
}

.hero-search--xtools input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.hero-search--xtools input:focus {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.hero-search--xtools .search-icon {
    color: rgba(255, 255, 255, 0.45);
}

/* ========================================
   Hero Section
   ======================================== */
.hero-section {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    padding: 4rem 0;
    margin-top: calc(-1 * var(--header-height));
    padding-top: calc(var(--header-height) + 4rem);
    scroll-margin-top: calc(var(--header-height) + 1rem);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -15%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99,102,241,0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* Hero Section — xtools 深色风格 */
.hero-section.hero-section--xtools {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #334155 100%);
}

.hero-section.hero-section--xtools::before {
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
}

.hero-section.hero-section--xtools::after {
    background: radial-gradient(circle, rgba(59,130,246,0.1) 0%, transparent 70%);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-search {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.hero-search input {
    width: 100%;
    padding: 1rem 1.5rem 1rem 3rem;
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    font-size: 1rem;
    box-shadow: var(--shadow-xl);
    transition: var(--transition);
}

.hero-search input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25), var(--shadow-xl);
    border-color: rgba(255, 255, 255, 0.4);
}

.hero-search .search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.125rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 3rem;
}

.hero-stat {
    text-align: center;
    padding: 0.75rem 1.5rem;
    background: rgba(255,255,255,0.1);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
}

.hero-stat-value {
    font-size: 2rem;
    font-weight: 700;
    display: block;
    line-height: 1.2;
}

.hero-stat-label {
    font-size: 0.8125rem;
    opacity: 0.75;
    margin-top: 0.25rem;
    display: block;
}

/* ========================================
   Home Page: Sidebar + Category Tool Cards
   ======================================== */
.tools-home-section {
    padding: 2rem 0 4rem;
}

.tools-home-section .container {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

/* Left Sidebar */
.home-sidebar {
    width: 160px;
    flex-shrink: 0;
    position: sticky;
    top: calc(var(--header-height) + 1rem);
}

.home-cat-nav {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.home-cat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.home-cat-item i {
    width: 16px;
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.7;
}

.home-cat-item:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.home-cat-item.active {
    background: linear-gradient(135deg, #eff6ff, #f0f9ff);
    color: var(--primary-color);
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(37,99,235,0.15);
}

.home-cat-item.active i {
    opacity: 1;
}

/* Main Content Special Sections: Hot Tools & Favorites */
.home-special-section {
    margin-bottom: 2rem;
    animation: fadeInUp 0.35s ease both;
    scroll-margin-top: calc(var(--header-height) + 1.25rem);
}

.home-special-section .home-section-title {
    display: flex;
    align-items: center;
}

/* Visit count on hot tool cards */
.htc-views {
    position: absolute;
    bottom: 0.25rem;
    right: 0.5rem;
    font-size: 0.6rem;
    color: var(--text-muted);
    z-index: 2;
    opacity: 0;
    transition: all 0.2s ease;
}

.home-tool-card-wrapper:hover .htc-views {
    opacity: 0.7;
}

.home-special-empty {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 0.5rem 0;
    line-height: 1.5;
}

/* Right Content Area */
.home-content {
    flex: 1;
    min-width: 0;
}

.home-category-section {
    margin-bottom: 2rem;
    animation: fadeInUp 0.35s ease both;
    scroll-margin-top: calc(var(--header-height) + 1.25rem);
}

.home-category-section:nth-child(2) { animation-delay: 0.05s; }
.home-category-section:nth-child(3) { animation-delay: 0.1s; }
.home-category-section:nth-child(4) { animation-delay: 0.15s; }
.home-category-section:nth-child(5) { animation-delay: 0.2s; }

.home-section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.875rem;
    letter-spacing: -0.01em;
    padding-left: 0.125rem;
}

/* 二级子分类标题 */
.home-sub-section-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #7c3aed;
    margin: 0.75rem 0 0.5rem 0;
    padding: 0.375rem 0.75rem;
    background: #f5f3ff;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    border: 1px solid #ede9fe;
    letter-spacing: -0.01em;
}

.home-sub-section-title i {
    font-size: 0.75rem;
}

/* 空分类提示 */
.home-empty-hint {
    color: var(--text-muted);
    padding: 1rem 0;
    font-size: 0.875rem;
}

/* Compact tool cards in rows */
.home-tools-row {
    display: grid;
    grid-template-columns: repeat(var(--tools-per-row), 1fr);
    gap: 0.875rem;
}

.home-tool-card-wrapper {
    position: relative;
    min-width: 0;
}

.home-tool-card {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 0.875rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition-slow);
    cursor: pointer;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.home-tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.htc-badge {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}

.htc-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

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

.htc-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.htc-fav {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    color: #94a3b8;
    font-size: 0.9375rem;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    padding: 4px;
    z-index: 2;
    border-radius: var(--radius-sm);
}

.home-tool-card-wrapper:hover .htc-fav {
    opacity: 1;
}

.htc-fav:hover {
    color: #eab308;
    transform: scale(1.25);
}

.htc-fav.favorited {
    color: #eab308;
    opacity: 1;
}

/* ========================================
   Tools Grid
   ======================================== */
.tools-section {
    padding: 2rem 0 4rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: var(--surface-color);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: var(--transition-slow);
}

.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.tool-card-image {
    height: 160px;
    background: linear-gradient(135deg, var(--primary-light), #eef2ff, #f0f9ff);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.tool-card-image::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.tool-card-icon {
    font-size: 3rem;
    color: var(--primary-color);
    opacity: 0.7;
    transition: var(--transition-slow);
}

.tool-card:hover .tool-card-icon {
    opacity: 1;
    transform: scale(1.15);
}

.tool-card-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 6px rgba(37,99,235,0.3);
}

.tool-card-body {
    padding: 1.25rem;
}

.tool-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.tool-card-title a {
    color: inherit;
}

.tool-card-title a:hover {
    color: var(--primary-color);
}

.tool-card-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.tool-card-category {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.tool-card-category i {
    color: var(--primary-color);
}

.tool-card-link {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-color);
}

.tool-card-link:hover {
    gap: 0.5rem;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    text-decoration: none;
}

.pagination .page-numbers:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-1px);
}

.pagination .page-numbers.current {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 2px 6px rgba(37,99,235,0.3);
}

/* ========================================
   Single Tool Page
   ======================================== */
.single-tool-hero {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    padding: 3rem 0;
    margin-top: calc(-1 * var(--header-height));
    padding-top: calc(var(--header-height) + 3rem);
    color: white;
    position: relative;
    overflow: hidden;
}

.single-tool-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -15%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.single-tool-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.single-tool-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.single-tool-header:hover .single-tool-icon {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2);
}

.single-tool-info h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.single-tool-info p {
    opacity: 0.85;
    font-size: 1.0625rem;
    line-height: 1.6;
}

.single-tool-content {
    padding: 2rem 0;
}

.tool-iframe {
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 600px;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* Tool Sidebar */
.tool-sidebar {
    margin-top: 1.5rem;
}

.tool-sidebar-card {
    background: var(--surface-color);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    transition: var(--transition);
}

.tool-sidebar-card:hover {
    box-shadow: var(--shadow-sm);
}

.tool-sidebar-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.tool-info-list {
    list-style: none;
}

.tool-info-list li {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9375rem;
}

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

.tool-info-list .label {
    color: var(--text-secondary);
}

.tool-info-list .value {
    font-weight: 500;
    color: var(--text-primary);
}

/* Related Tools */
.related-tools {
    padding: 4rem 0;
    background: var(--bg-color);
    margin-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* ========================================
   Archive Pages
   ======================================== */
.archive-header {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
    padding: 3rem 0;
    margin-top: calc(-1 * var(--header-height));
    padding-top: calc(var(--header-height) + 3rem);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.archive-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.archive-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.archive-description {
    opacity: 0.9;
    font-size: 1.125rem;
}

.archive-content {
    padding: 3rem 0;
}

/* ========================================
   Built-in xtools Pages
   ======================================== */
.xtool-hero,
.xtools-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 40%, #334155 100%);
    padding: 3.5rem 0 3rem;
    margin-top: calc(-1 * var(--header-height));
    padding-top: calc(var(--header-height) + 3.5rem);
    color: white;
    position: relative;
    overflow: hidden;
}

.xtool-hero::before,
.xtools-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.xtool-hero::after,
.xtools-hero::after {
    content: '';
    position: absolute;
    bottom: -60%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59,130,246,0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.xtool-hero .container,
.xtools-hero .container {
    max-width: 800px;
    position: relative;
    z-index: 1;
}

.xtool-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.xtool-icon {
    width: 72px;
    height: 72px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
    transition: var(--transition);
}

.xtool-header:hover .xtool-icon {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

.xtool-info h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.375rem;
    letter-spacing: -0.025em;
}

.xtool-info p {
    opacity: 0.8;
    font-size: 0.9375rem;
    line-height: 1.6;
}

.xtool-breadcrumb {
    font-size: 0.8125rem;
    opacity: 0.55;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.xtool-breadcrumb a {
    color: rgba(255,255,255,0.65);
}

.xtool-breadcrumb a:hover {
    color: white;
}

.xtools-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    text-align: center;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.xtools-hero-desc {
    font-size: 1.0625rem;
    opacity: 0.75;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.xtools-search {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

.xtools-search input {
    width: 100%;
    padding: 0.875rem 1.25rem 0.875rem 3rem;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-full);
    font-size: 0.9375rem;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(8px);
    color: white;
    transition: var(--transition-slow);
}

.xtools-search input::placeholder {
    color: rgba(255,255,255,0.45);
}

.xtools-search input:focus {
    outline: none;
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 0 0 4px rgba(255,255,255,0.08);
}

.xtools-search .search-icon {
    position: absolute;
    left: 1.125rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.45);
    font-size: 0.9375rem;
}

.xtool-content {
    padding: 0;
}

.xtool-iframe {
    width: 100%;
    height: calc(100vh - 180px);
    min-height: 500px;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--surface-color);
    box-shadow: var(--shadow-md);
}

/* xtools 直接渲染区（替代iframe） */
/* .xtool-render-area 已废弃：插件直接渲染，不再需要容器样式 */

/* ============ 工具面板通用样式 ============ */
.tool-panel {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease;
}

.tool-panel:hover {
    box-shadow: var(--shadow-md);
}

.tool-textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
    background: var(--bg-color);
    color: var(--text-primary);
    transition: var(--transition);
}
.tool-textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
    background: var(--surface-color);
}
.tool-textarea::placeholder {
    color: var(--text-muted);
}

.tool-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    background: var(--bg-color);
    color: var(--text-primary);
    transition: var(--transition);
}
.tool-input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
    background: var(--surface-color);
}
.tool-input::placeholder {
    color: var(--text-muted);
}

.tool-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.tool-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.tool-input-group label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.tool-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    align-items: center;
    margin: 0.75rem 0;
    padding: 0.5rem 0;
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    letter-spacing: -0.01em;
}
.tool-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.tool-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.tool-btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    box-shadow: 0 2px 6px rgba(37,99,235,0.3);
}
.tool-btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #1e40af);
    box-shadow: 0 4px 12px rgba(37,99,235,0.4);
}

.tool-btn-secondary {
    background: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.tool-btn-secondary:hover {
    background: var(--surface-hover);
    border-color: #cbd5e1;
}

.tool-btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}
.tool-btn-outline:hover {
    background: var(--primary-light);
}

.tool-option {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.tool-option-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    padding: 0.625rem 0;
}

.tool-check {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--text-primary);
}

.tool-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.tool-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1.25rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin: 0.75rem 0;
}
.stat-item {
    text-align: center;
    padding: 0.75rem 1.25rem;
    background: var(--surface-color);
    border-radius: var(--radius-md);
    min-width: 90px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}
.stat-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}
.stat-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: var(--font-mono);
    line-height: 1.3;
}
.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.tool-status-bar {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-family: var(--font-mono);
    min-height: 1.5rem;
    border-radius: var(--radius-md);
}

.tool-preview {
    min-height: 100px;
    padding: 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: auto;
    line-height: 1.6;
}

.tool-color-preview {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius-lg);
}

/* Flash animation */
.flash-success {
    animation: flashGreen 0.6s ease;
}
@keyframes flashGreen {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 0 3px rgba(34,197,94,0.4); }
}

/* Diff styles */
.diff-eq { display: block; color: var(--text-primary); padding: 2px 12px; }
.diff-del { display: block; background: rgba(239,68,68,0.1); color: #ef4444; padding: 2px 12px; border-left: 3px solid #ef4444; }
.diff-add { display: block; background: rgba(34,197,94,0.1); color: #22c55e; padding: 2px 12px; border-left: 3px solid #22c55e; }
.diff-preview {
    max-height: 500px;
    overflow: auto;
    background: #1e1e2e;
    color: #cdd6f4;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.7;
}

/* ASCII table */
.ascii-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}
.ascii-table th {
    background: var(--bg-color);
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1;
    font-weight: 600;
    color: var(--text-primary);
}
.ascii-table td {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-mono);
    color: var(--text-primary);
}
.ascii-table tr:hover td {
    background: var(--bg-color);
}
.ascii-table-wrap {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    max-height: 500px;
    overflow-y: auto;
}

/* Loading spinner */
.tool-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.tool-loading i {
    display: inline-block;
    animation: spin 1s linear infinite;
    font-size: 2rem;
    color: var(--primary-color);
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* xtools 列表页 */
.xtools-content {
    padding: 2.5rem 0 4rem;
}

.xtools-category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-bottom: 2.5rem;
    padding: 1.25rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.xtools-cat-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.xtools-cat-link small {
    background: var(--surface-color);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
}

.xtools-cat-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.xtools-cat-link.xtools-cat-all {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
}

.xtools-category-section {
    margin-bottom: 2.5rem;
}

.xtools-category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.xtools-category-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-light), #eef2ff);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.125rem;
    flex-shrink: 0;
}

.xtools-category-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.xtools-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-left: auto;
    padding: 0.25rem 0.75rem;
    background: var(--bg-color);
    border-radius: var(--radius-full);
    font-weight: 500;
}

.xtools-expand-link {
    font-size: 0.8125rem;
    color: var(--primary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.xtools-expand-link:hover {
    background: var(--primary-light);
    gap: 0.5rem;
}

.xtools-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.xtool-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    transition: var(--transition-slow);
    text-decoration: none;
}

.xtool-item:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

.xtool-item-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-light), #eef2ff);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.125rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.xtool-item:hover .xtool-item-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

.xtool-item-info h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.xtool-item-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background: linear-gradient(180deg, var(--text-primary) 0%, #0f172a 100%);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand {
    max-width: 300px;
}

.footer-brand .site-title {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.footer-section h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: white;
    letter-spacing: -0.01em;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9375rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
}

.footer-links a:hover {
    color: white;
    transform: translateX(3px);
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-slow);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.btn:hover {
    transform: translateY(-2px);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    color: white;
}

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

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

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.4);
}

.btn-outline:hover {
    background: white;
    color: var(--primary-color);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* ========================================
   Forms
   ======================================== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--surface-color);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* ========================================
    Utilities
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden { display: none !important; }

/* ========================================
    Select / Dropdown styling (for tool panels)
   ======================================== */
.tool-panel select,
.tool-input-group select {
    padding: 0.625rem 2rem 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-color) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 0.75rem center;
    appearance: none;
    cursor: pointer;
    transition: var(--transition);
}

.tool-panel select:focus,
.tool-input-group select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.tool-panel input[type="number"] {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-color);
    transition: var(--transition);
}

.tool-panel input[type="number"]:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.tool-panel input[type="file"] {
    padding: 0.75rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--bg-color);
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.tool-panel input[type="file"]:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

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

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

.xtools-category-section {
    animation: fadeInUp 0.4s ease both;
}

.xtools-category-section:nth-child(2) { animation-delay: 0.05s; }
.xtools-category-section:nth-child(3) { animation-delay: 0.1s; }
.xtools-category-section:nth-child(4) { animation-delay: 0.15s; }
.xtools-category-section:nth-child(5) { animation-delay: 0.2s; }
.xtools-category-section:nth-child(6) { animation-delay: 0.25s; }

.tool-render-area,
.tool-panel {
    animation: fadeIn 0.3s ease both;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    /* Home page sidebar layout */
    .tools-home-section .container {
        flex-direction: column;
    }

    .home-sidebar {
        width: 100%;
        position: static;
    }

    .home-cat-nav {
        flex-direction: row;
        flex-wrap: wrap;
        overflow-x: auto;
        gap: 0.5rem;
    }

    .home-cat-item {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
        white-space: nowrap;
    }

    .home-tools-row {
        --tools-per-row: 2;
        gap: 0.625rem;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .main-navigation {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--surface-color);
        padding: 1rem;
        transform: translateX(-100%);
        transition: var(--transition);
        overflow-y: auto;
        display: block;
    }
    
    .main-navigation.active {
        transform: translateX(0);
    }
    
    .otm-meganav {
        flex-direction: column;
        gap: 0;
    }

    .otm-meganav-item {
        position: relative;
    }
    
    .otm-meganav-link {
        padding: 0.75rem 0;
        width: 100%;
        border-bottom: 1px solid var(--border-color);
        border-radius: 0;
    }
    
    .otm-meganav-dropdown {
        position: static;
        left: auto;
        transform: none;
        width: 100%;
        max-width: none;
        min-width: 0;
        max-height: none;
        box-shadow: none;
        border: none;
        border-radius: 0;
        border-bottom: none;
        animation: none;
        overflow-y: visible;
        --dropdown-offset: 0px;
    }
    
    .otm-meganav-dropdown-inner {
        flex-direction: column;
        padding: 0.5rem 1rem 1rem 1rem;
        gap: 1rem;
    }
    
    .otm-meganav-col {
        flex: none;
        width: 100%;
        max-width: none;
        min-width: 0;
    }
    
    .otm-meganav-overlay {
        display: none !important;
    }
    
    .header-search {
        display: none;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .home-tools-row {
        --tools-per-row: 1;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .single-tool-header {
        flex-direction: column;
        text-align: center;
    }
    
    .tool-iframe {
        height: 500px;
    }
    
    .xtool-iframe {
        height: 500px;
        border-radius: 0;
    }
    
    .xtool-header {
        flex-direction: column;
        text-align: center;
    }
    
    .xtools-hero-title {
        font-size: 1.5rem;
    }
    
    .xtools-tools-grid {
        grid-template-columns: 1fr;
    }
    
    .xtools-category-nav {
        gap: 0.375rem;
        padding: 0.75rem;
    }
    
    .xtools-cat-link {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .tool-panel {
        padding: 1.25rem;
    }
    
    .xtool-hero, .xtools-hero {
        padding: 2.5rem 0 2rem;
        padding-top: calc(var(--header-height) + 2.5rem);
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .home-tools-row {
        --tools-per-row: 1;
    }
    
    .tool-card-image {
        height: 120px;
    }
    
    .xtools-hero-title {
        font-size: 1.75rem;
    }
    
    .xtools-hero-desc {
        font-size: 0.9375rem;
    }
    
    .xtool-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .xtool-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
    }
    
    .xtool-info h1 {
        font-size: 1.375rem;
    }
    
    .xtool-breadcrumb {
        justify-content: center;
    }
    
    .xtools-category-nav {
        padding: 0.75rem;
        gap: 0.375rem;
    }
    
    .tool-panel {
        padding: 1.25rem;
    }
    
    .tool-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }
    
    .stat-item {
        min-width: 70px;
        padding: 0.5rem 0.75rem;
    }
    
    .stat-num {
        font-size: 1.25rem;
    }
}