/* Online Tools Manager - Main Styles */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --primary-color: #4C8DF4;
    --primary-hover: #3B7BDE;
    --primary-light: rgba(76, 141, 244, 0.1);
    --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.2rem;
    --radius-lg: 0.4rem;
    --radius-xl: 0.3rem;
    --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: 60px;
    --tools-per-row: 3;

    /* 卡片（section）之间的统一垂直间距，应用于全站各 section 卡片之间 */
    --section-gap: 0.1rem;
}

/* ========================================
   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 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, 255);
    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 {
    background: #FFFFFF;
    box-shadow: var(--shadow-md);
}

/* 头部不固定模式 */
.site-header.header-no-sticky {
    position: relative !important;
}

.page-wrapper:has(.site-header.header-no-sticky) {
    padding-top: 0 !important;
}

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

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

.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;
}

/* 存在 logo 图片时隐藏站点标题文字，仅显示图片 */
.site-branding.has-logo .site-title {
    display: none;
}

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

.site-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-logo-img {
    display: block;
    max-height: 50px;
    width: auto;
    object-fit: contain;
}

.site-logo-img--dark {
    display: none;
}

@media (prefers-color-scheme: dark) {
    .site-logo-img:not(.site-logo-img--dark) {
        display: none;
    }
    .site-logo-img--dark {
        display: block;
    }
}

/* ========================================
   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-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;
    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 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;
}

/* 尊重减少动态效果偏好 */
@media (prefers-reduced-motion: reduce) {
    .otm-meganav-dropdown {
        animation: none;
    }
    .otm-meganav-arrow {
        transition: none;
    }
}

/* ========================================
   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-nav-zone {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    min-width: 0;
}

/* 通宽模式：内容铺满视口宽度，但左右保留 1.5rem 内边距，
   品牌不再贴边（有左侧空间），搜索框也不到屏幕最右边缘 */
.site-header.header-fullwidth .header-inner {
    max-width: none;
    padding: 0 1.5rem;
}

/* 导航居中：菜单在导航区内水平居中，品牌位置不受影响 */
.site-header.nav-center .main-navigation {
    margin-left: auto;
    margin-right: 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(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    box-shadow: none;
}

.hero-search--xtools input::placeholder {
    color: rgba(226, 232, 240, 0.5);
}

.hero-search--xtools input:focus {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.12);
}

.hero-search--xtools .search-icon {
    color: rgba(226, 232, 240, 0.5);
}

/* ========================================
   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(148,163,184,0.10) 0%, transparent 70%);
}

.hero-section.hero-section--xtools::after {
    background: radial-gradient(circle, rgba(100,116,139,0.10) 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;
}

/* ========================================
   Hero — onenav 风格搜索设置
   背景模式 / 蒙层 / 渐变 / 上移 / 大搜索框布局
   ======================================== */
.otm-hero {
    background-color: #3b82f6; /* 无背景图时的兜底色 */
}
.hero-section.otm-hero::before,
.hero-section.otm-hero::after {
    display: none; /* 停用默认装饰圆（左下/右上），改为按需启用；提权避免被旧规则覆盖 */
}

/* 背景模式：颜色（三色渐变 + 流动动画） */
.hero-section.otm-hero--css-color {
    background-size: 400%;
    background-position: 0% 100%;
    animation: otm-hero-gradient 7.5s ease-in-out infinite;
}
@keyframes otm-hero-gradient {
    50% { background-position: 100% 0; }
}

/* 背景模式：自定义图片 / bing 每日图片 */
.otm-hero--css-img,
.otm-hero--css-bing {
    background-color: #1b1d1f;
    background-size: cover;
    background-position: center;
}

/* 背景模式：无背景 */
.otm-hero--no-bg {
    background: none !important;
}
.otm-hero--no-bg .hero-title,
.otm-hero--no-bg .otm-big-title {
    color: var(--primary-color);
    text-shadow: none;
}
.otm-hero--no-bg .hero-subtitle {
    color: var(--text-primary);
    opacity: 1;
}

/* 蒙层：图片/bing 增强前景可读性 */
.otm-hero--css-img::before,
.otm-hero--css-bing::before {
    display: block;
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(rgba(0,0,0,0) 0%, rgba(0,0,0,.5) 100%),
                radial-gradient(rgba(0,0,0,0) 33%, rgba(0,0,0,.3) 166%),
                linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 75%, rgba(0,0,0,.4) 100%);
    pointer-events: none;
}

/* 暗色主题压暗背景（跟随系统，可关闭） */
@media (prefers-color-scheme: dark) {
    .otm-hero:not(.otm-hero--unchanged):not(.otm-hero--no-bg)::before {
        display: block;
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,.7);
        pointer-events: none;
    }
    .otm-hero:not(.otm-hero--unchanged) .otm-hero-canvas-bg {
        opacity: 0.6;
    }
}

/* 背景渐变：底部过渡到页面背景色 */
.otm-hero--bg-gradual::after {
    display: block;
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 380px;
    background-image: linear-gradient(to top, var(--bg-color) 0%, transparent 80%);
    pointer-events: none;
}

/* 内容上移：搜索框下面内容覆盖到背景上 */
.otm-hero--post-top {
    padding-bottom: 100px;
    margin-bottom: -80px;
}

/* canvas 特效背景 */
.otm-hero-canvas-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* 大搜索框布局（仿 OneNav header-big） */
.otm-hero--big {
    display: flex;
    align-items: center;
}
.otm-hero--big .hero-content {
    width: 100%;
}
.otm-big-search {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 800px;
    margin: 0 auto;
    --big-search-height: 360px;
    --big-mobile-height: 260px;
    min-height: var(--big-search-height);
    color: #fff;
}
@media (max-width: 767.98px) {
    .otm-big-search {
        min-height: var(--big-mobile-height);
    }
}
.otm-big-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 6px;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 0 15px rgba(35,37,40,.6);
}
.otm-hero--big .hero-search {
    max-width: 800px;
}
.otm-hero--big .hero-search input {
    padding: 1.1rem 1.5rem 1.1rem 3rem;
    font-size: 1.05rem;
    box-shadow: 0 8px 30px rgba(0,0,0,.2);
}

/* 站内搜索推荐词（仿 onenav search-group：纯文字、轻量、无冗余标签） */
.otm-station-words {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin-top: 1.1rem;
}
.otm-station-words a {
    color: rgba(255,255,255,.75);
    font-size: 0.875rem;
    text-decoration: none;
    padding: 0.25rem 0.375rem;
    transition: color 0.2s;
    text-shadow: 0 0 10px rgba(35,37,40,.5);
}
.otm-station-words a:hover {
    color: #fff;
}

/* 无背景模式下站内推荐使用常规配色 */
.otm-hero--no-bg .otm-station-words a {
    color: var(--text-secondary);
    text-shadow: none;
}
.otm-hero--no-bg .otm-station-words a:hover {
    color: var(--primary-color);
}

/* 移动端适配 */
@media (max-width: 767.98px) {
    .otm-big-title {
        font-size: 1.75rem;
        letter-spacing: 3px;
    }
}

/* ========================================
   Hero — 搜索引擎切换（big 引擎菜单 / 简洁引擎下拉）
   ======================================== */
/* big 布局：搜索框上方引擎 tab 菜单 */
.otm-search-menu {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.9rem;
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
}
.otm-search-menu-item {
    display: inline-block;
    padding: 0.4rem 1.1rem;
    cursor: pointer;
    color: rgba(255,255,255,.8);
    font-size: 0.95rem;
    border-radius: 999px;
    transition: background 0.25s, color 0.25s;
    text-shadow: 0 0 10px rgba(35,37,40,.5);
}
.otm-search-menu-item:hover {
    color: #fff;
    background: rgba(255,255,255,.12);
}
.otm-search-menu-item.active {
    color: #fff;
    background: rgba(255,255,255,.2);
}

/* big 搜索框右侧提交按钮 */
.otm-search-submit {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.otm-search-submit:hover {
    background: var(--primary-hover);
}
.otm-hero--big .hero-search input {
    padding-right: 3.5rem;
}

/* 简洁 + 引擎下拉：搜索框左侧引擎选择 */
.hero-search--engine .otm-engine-select {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    max-width: 96px;
    outline: none;
    padding: 0.25rem 0.25rem 0.25rem 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.hero-search--engine .otm-engine-select option {
    color: #333;
    background: #fff;
}
.hero-search--engine input {
    padding-left: 6.5rem !important;
}
.hero-search--engine .search-icon {
    left: 5.75rem;
}

/* 无背景模式下引擎控件使用常规配色 */
.otm-hero--no-bg .otm-search-menu-item {
    color: var(--text-primary);
    text-shadow: none;
}
.otm-hero--no-bg .otm-search-menu-item.active {
    background: var(--surface-hover);
    color: var(--primary-color);
}
.otm-hero--no-bg .hero-search--engine .otm-engine-select {
    color: var(--text-primary);
}

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

.tools-home-section .container {
    display: flex;
    gap: 1.5rem;
    align-items: stretch;
    /* 与底部菜单 .otm-footer-menu .container 同宽(1600px)，使左侧导航与页脚菜单左对齐 */
    max-width: 1600px;
}

/* Left Sidebar */
.home-sidebar {
    width: 220px;
    flex-shrink: 0;
    /* 拉伸至与右侧内容等高，使两者底部对齐；sticky 改放到内层 .home-cat-nav */
    overflow: visible;
    z-index: 10;
}

.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;
    overflow: visible;
    position: sticky;
    top: calc(var(--header-height) + 1rem);
}

.home-cat-item-wrap {
    position: relative;
}

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

.home-cat-item i {
    width: 22px;
    text-align: center;
    font-size: 1.1rem;
    opacity: 0.9;
    transition: var(--transition);
}

.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;
}

/* 左侧分类导航 hover 子分类弹窗 */
.home-cat-submenu {
    position: absolute;
    left: calc(100% + 0.5rem);
    top: -0.5rem;
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    min-width: 280px;
    max-width: 340px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.75rem;
    box-shadow: var(--shadow-lg);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.home-cat-submenu::before {
    content: '';
    position: absolute;
    left: -5px;
    top: calc(0.5rem + 14px);
    width: 10px;
    height: 10px;
    background: var(--surface-color);
    border-left: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    transform: rotate(45deg);
}

.home-cat-item-wrap:hover .home-cat-submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.home-cat-submenu-item {
    display: block;
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius-md);
    background: var(--bg-color);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: var(--transition);
}

.home-cat-submenu-item:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Main Content Special Sections: Hot Tools & Favorites */
.home-special-section {
    margin-bottom: var(--section-gap);
    animation: fadeInUp 0.35s ease both;
    scroll-margin-top: calc(var(--header-height) + 1.25rem);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.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;
    /* 让 active panel 能够 stretch 到与左侧 .home-cat-nav 等高，
       使两个卡片顶部与底部都严格对齐 */
    display: flex;
    flex-direction: column;
}

/* Homepage Widget Sidebar (only shows when configured in admin) */
.home-widget-sidebar {
    width: 300px;
    flex-shrink: 0;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: calc(var(--header-height) + 1rem);
}

.home-widget-sidebar > .otm-widget:not(:last-child) {
    margin-bottom: var(--section-gap);
}

/* 标签切换：仅显示当前激活面板，其余隐藏（页面高度缩减为单个面板） */
.home-panel {
    display: none;
}

.home-panel.active {
    display: block;
    animation: fadeInUp 0.35s ease both;
    /* stretch 到 .home-content 高度（= .home-cat-nav 高度），使底部严格对齐 */
    flex: 1 1 auto;
    min-height: 0;
    /* 覆盖 .home-special-section / .home-category-section 的 margin-bottom，
       否则 margin 占位导致底部留缝，无法与左侧 nav 底部对齐 */
    margin-bottom: 0;
}

.home-category-section {
    margin-bottom: var(--section-gap);
    animation: fadeInUp 0.35s ease both;
    scroll-margin-top: calc(var(--header-height) + 1.25rem);
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.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;
    scroll-margin-top: calc(var(--header-height) + 1.5rem);
}

.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: 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 0.8rem;
    margin-top: calc(-1 * var(--header-height));
    padding-top: calc(var(--header-height) + 2.6rem);
    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;
}

/* 文章 hero：图标内嵌特色图时填满图标框 */
.xtool-icon-post .xtool-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-xl);
}

/* 文章信息行（日期/作者/分类/浏览），复用工具 meta 区块的居中卡片 */
.otm-post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1.25rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}
.otm-post-meta .post-info-item i {
    color: var(--primary-color);
    margin-right: 0.35rem;
}
/* hero 内的文章信息块：融入 hero 深色背景，去掉卡片外观 */
.xtool-hero .xtool-hero-meta {
    background: transparent;
    border: none;
    box-shadow: none;
    margin-top: 1rem;
    padding: 0;
}
.xtool-hero .xtool-hero-meta .otm-post-meta {
    justify-content: flex-start;
    color: rgba(255, 255, 255, 0.85);
}
.xtool-hero .xtool-hero-meta .otm-post-meta .post-info-item i {
    color: rgba(255, 255, 255, 0.7);
}
.xtool-hero .xtool-hero-meta .otm-post-meta a {
    color: rgba(255, 255, 255, 0.9);
}
.xtool-hero .xtool-hero-meta .otm-post-meta a:hover {
    color: #fff;
}

.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-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ========================================
   Tool Page: Left Tool + Right Widgets Layout
   ======================================== */
.xtool-layout {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.xtool-main {
    flex: 1;
    min-width: 0;
    position: relative;
}

/* =========================================================
   工具顶部横幅（广告与代码）—— 主题级独立区块，位于工具上方
   左=可编辑广告/代码区，右=复用主题的全屏 / 展开侧边栏按钮
   .xtool-banner-wrap 与底部菜单 .container 同宽(1600px，左右各 1.5rem 内边距)，
   使横幅卡片与页脚菜单卡片左右对齐。
   ========================================================= */
.xtool-banner-wrap {
    max-width: 1600px;
    margin: 1rem auto 0;
    padding: 0 1.5rem;
}
.xtool-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0.625rem 1rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md, 8px);
}
.xtool-banner-text {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    word-break: break-word;
    overflow: hidden;
}
.xtool-banner-text :where(a, strong, b) { color: var(--text-primary); }
.xtool-banner-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
/* 横幅内的主题按钮：覆盖默认 absolute 定位，回归正常流 */
.xtool-banner .xtool-fullscreen-toggle,
.xtool-banner .xtool-expand-toggle {
    position: static;
    top: auto;
    right: auto;
    opacity: 1;
    flex-shrink: 0;
}

/* =========================================================
   工具界面右上角工具条（展开侧边栏 / 全屏）
   注：这两个按钮现已上移到顶部横幅 .xtool-banner 内（见上）。
   以下为基础样式（含 hover 高亮），位置由横幅控制。
   ========================================================= */
.xtool-fullscreen-toggle,
.xtool-expand-toggle {
    position: absolute;
    top: 0;
    z-index: 20;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.1s ease;
    font-size: 0.75rem;
}
.xtool-fullscreen-toggle { right: 44px; }   /* 位于展开按钮左侧 */
.xtool-expand-toggle { right: 0; }
.xtool-fs-solo { right: 0; }            /* 无侧边栏时独占右上角 */

.xtool-fullscreen-toggle:hover,
.xtool-expand-toggle:hover {
    opacity: 1;
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(var(--primary-rgb, 76, 141, 244), 0.06);
}

/* 展开状态：隐藏侧边栏，箭头翻转 */
.xtool-layout.expanded .xtool-sidebar {
    display: none;
}
.xtool-expand-toggle.is-expanded i {
    transform: rotate(180deg);
}

/* =========================================================
   全屏状态：仅展示 #xtool-container 部分
   ========================================================= */
body.otm-tool-fullscreen { overflow: hidden; }
body.otm-tool-fullscreen .site-header,
body.otm-tool-fullscreen .xtool-hero,
body.otm-tool-fullscreen .xtool-sidebar,
body.otm-tool-fullscreen .site-footer,
body.otm-tool-fullscreen #wpadminbar {
    display: none !important;
}
body.otm-tool-fullscreen .xtool-expand-toggle {
    display: none;
}
/* 全屏时横幅吸顶，确保退出全屏按钮始终可点 */
body.otm-tool-fullscreen .xtool-banner-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100001;
    max-width: none;
    margin: 0;
    padding: 0;
}
body.otm-tool-fullscreen .xtool-banner {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    max-height: 4rem;
    overflow: auto;
}
body.otm-tool-fullscreen .xtool-layout {
    position: fixed;
    inset: 0;
    z-index: 99999;
    max-width: none;
    margin: 0;
    padding: 4rem 0 0;
    background: var(--bg-color, #f1f5f9);
}
body.otm-tool-fullscreen .xtool-main { height: 100vh; min-height: 100vh; }
body.otm-tool-fullscreen #xtool-container { height: 100vh; }

/* 布局容器接管宽度约束后，内部 #xtool-container 不再重复留白 */
.xtool-layout .xtool-main #xtool-container {
    max-width: none;
    padding: 0;
}

.xtool-sidebar {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: sticky;
    top: calc(var(--header-height) + 1rem);
}

/* ========================================
   Widgets（白卡片 + 蓝条标题）
   ======================================== */
.otm-widget {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.otm-widget-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.otm-widget-title::before {
    content: '';
    width: 4px;
    height: 1rem;
    border-radius: 2px;
    background: linear-gradient(180deg, #3b82f6, #2563eb);
    flex-shrink: 0;
}

/* 搜索小工具 */
.otm-widget-search-form {
    display: flex;
    gap: 0.5rem;
}

.otm-widget-search-input {
    flex: 1;
    min-width: 0;
    height: 38px;
    padding: 0 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-primary);
    background: var(--bg-color);
    outline: none;
    transition: var(--transition);
}

.otm-widget-search-input:focus {
    border-color: var(--primary-color);
    background: var(--surface-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.otm-widget-search-btn {
    height: 38px;
    padding: 0 1rem;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary-color);
    color: #ffffff;
    font-size: 0.875rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}

.otm-widget-search-btn:hover {
    background: var(--primary-hover);
}

/* 工具列表小工具（不显示图标，纯文字 + 圆点 + 浏览量） */
.otm-widget-tool-list-ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.otm-widget-tool-list-ul li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.375rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.otm-widget-tool-list-ul li a::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--primary-color);
    flex-shrink: 0;
    opacity: 0.65;
}

.otm-widget-tool-list-ul li a:hover {
    background: var(--surface-hover);
    color: var(--primary-color);
}

.otm-widget-tool-list-ul li a .tool-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.otm-widget-tool-list-ul li a .tool-views {
    color: var(--text-muted);
    font-size: 0.75rem;
    flex-shrink: 0;
}

@media (max-width: 992px) {
    .xtool-layout {
        flex-direction: column;
    }

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

/* ========================================
   主内容区额外内容：标签+点赞分享收藏+上下篇 / 相关推荐
   位于工具内容下方，全宽布局，分区块
   ======================================== */
.otm-content-extras {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.otm-content-extra-section {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

/* 标签+操作+上下篇 区块 */
.otm-tool-meta-section {
    text-align: center;
}

/* 工具标签（随机颜色 pill，白字，靠左显示） */
.otm-tool-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.otm-tag-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: 0.35rem 0.5rem 0.35rem 0;
    border-right: 2px solid var(--border-color);
    margin-right: 0.25rem;
    color: var(--text-muted);
    font-size: 1rem;
    flex-shrink: 0;
}

.otm-tool-tag {
    display: inline-block;
    padding: 0.375rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    cursor: default;
}

.otm-tool-tag:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* 点赞/分享/收藏操作区（截图风格：竖向图标+文字） */
.otm-tool-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.otm-action-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
}

.otm-action-btn i {
    font-size: 1.375rem;
    margin-bottom: 0.25rem;
    transition: var(--transition);
}

.otm-action-btn:hover {
    color: var(--primary-color);
}

.otm-action-btn:hover i {
    transform: scale(1.1);
}

.otm-action-btn.liked {
    color: #f43f5e;
}

.otm-action-btn.liked i {
    color: #f43f5e;
}

.otm-action-btn.shared {
    color: #10b981;
}

.otm-action-btn.favorited {
    color: #f59e0b;
}

.otm-action-btn.favorited i {
    color: #f59e0b;
}

/* ========== Toast 弹窗提示 ========== */
#otm-toast-container {
    position: fixed;
    left: 50%;
    bottom: 2rem;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    pointer-events: none;
}

.otm-toast {
    background: rgba(15, 23, 42, 0.92);
    color: #fff;
    padding: 0.7rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 80vw;
    text-align: center;
}

.otm-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.otm-toast-success {
    background: rgba(16, 185, 129, 0.95);
}

.otm-toast-info {
    background: rgba(15, 23, 42, 0.92);
}

.otm-action-count {
    font-size: 0.75rem;
}

.otm-action-label {
    font-size: 0.75rem;
}

/* 上下篇导航 */
.otm-tool-adjacent {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.otm-adjacent-prev,
.otm-adjacent-next {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.otm-adjacent-prev {
    align-items: flex-start;
    text-align: left;
}

.otm-adjacent-next {
    align-items: flex-end;
    text-align: right;
}

.otm-adjacent-prev:hover,
.otm-adjacent-next:hover {
    filter: brightness(0.95);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.adjacent-name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
    max-width: 100%;
}

.adjacent-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* 相关推荐区块（独立区块，标题不用小工具蓝色竖条样式） */
.otm-related-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.otm-related-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.otm-related-grid li a {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
    border: 1px solid transparent;
    min-width: 0;
}

.otm-related-grid li a:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.otm-related-grid li a .related-tool-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.otm-related-grid li a .related-tool-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.otm-related-grid li a:hover .related-tool-desc {
    color: var(--primary-color);
    opacity: 0.7;
}

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

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

    .otm-tool-actions {
        flex-direction: column;
    }

    .otm-action-btn {
        width: 100%;
    }
}

.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);
}

.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 1rem;
}

/* 分类列表页双栏布局：左侧工具列表 + 右侧小工具 */
.xtools-list-layout {
    /* 与底部菜单 .otm-footer-menu .container 同宽(1600px)，左侧内容与页脚菜单左对齐 */
    max-width: 1600px;
}

.xtools-list-layout .xtool-main {
    min-width: 0;
}

/* 使分类导航块在 flex 容器内正常伸缩 */
.xtools-list-layout .xtools-category-nav {
    flex-wrap: wrap;
}

.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 Menu
   ======================================== */
.otm-footer-menu {
    background: transparent;
    /* 与上方内容、下方友情链接/页脚之间统一使用 --section-gap 间距 */
    padding: var(--section-gap) 0 0;
}

.otm-footer-menu .container {
    max-width: 1600px;
}

.otm-footer-menu-inner {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
}

.otm-footer-menu-tabs {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 0;
    background: #ffffff;
    padding: 0 1rem;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

.otm-footer-menu-tabs::-webkit-scrollbar {
    height: 3px;
}

.otm-footer-menu-tabs::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.otm-footer-menu-tab {
    position: relative;
    flex: 0 0 auto;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    color: #666666;
    font-size: 0.875rem;
    font-weight: 400;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.otm-footer-menu-tab:hover {
    color: #333333;
}

.otm-footer-menu-tab.active {
    color: #2563eb;
    font-weight: 500;
}

.otm-footer-menu-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    background: #2563eb;
}

.otm-footer-menu-panels {
    padding: 0.6rem 1.5rem 1.5rem;
}

.otm-footer-menu-panel {
    display: none;
}

.otm-footer-menu-panel.active {
    display: block;
    animation: otm-fade-in 0.2s ease;
}

@keyframes otm-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.otm-footer-menu-tools {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem 1.5rem;
}

.otm-footer-menu-tool {
    display: block;
    color: #555555;
    font-size: 0.8125rem;
    line-height: 1.6;
    text-decoration: none;
    transition: color 0.15s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.otm-footer-menu-tool:hover {
    color: #2563eb;
}

.otm-footer-menu-empty {
    padding: 2rem;
    text-align: center;
    color: #999999;
    font-size: 0.875rem;
}

.otm-footer-menu-more {
    margin-top: 1.25rem;
    text-align: right;
}

.otm-footer-menu-more-link {
    color: #2563eb;
    font-size: 0.8125rem;
    text-decoration: none;
}

.otm-footer-menu-more-link:hover {
    text-decoration: underline;
}

@media (max-width: 1200px) {
    .otm-footer-menu-tools {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .otm-footer-menu-tools {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Home widget sidebar becomes full width below content */
    .home-widget-sidebar {
        width: 100%;
        position: static;
        order: 99;
    }

    .tools-home-section .container {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .otm-footer-menu {
        padding: 0.75rem 0;
    }

    .otm-footer-menu-tabs {
        padding: 0 0.75rem;
    }

    .otm-footer-menu-tab {
        padding: 0.75rem 0.875rem;
        font-size: 0.8125rem;
    }

    .otm-footer-menu-panels {
        padding: 1rem 0.75rem;
    }

    .otm-footer-menu-tools {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem 1rem;
    }

    .otm-footer-menu-tool {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .otm-footer-menu-tools {
        grid-template-columns: 1fr;
    }
}


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

.footer-beian {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.footer-beian .beian-item {
    color: var(--text-muted);
    font-size: 0.8125rem;
}

/* ========================================
   Footer Redesign (otm_footer_settings)
   左侧：四部分（描述 / 运行 / 版权+备案+附加链接 / 图片）
   右侧：自定义按钮组
   ======================================== */
/* 页脚 container 与底部菜单/友情链接同宽(1600px)，使左侧文本与 .otm-footer-menu-inner 最左侧对齐 */
.site-footer .container {
    max-width: 1600px;
}

.otm-footer-grid {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
}

.otm-footer-brand-col {
    flex: 1 1 auto;
    min-width: 0;
}

.otm-footer-desc p {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9375rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}
.otm-footer-desc p:last-child {
    margin-bottom: 0;
}

.otm-footer-runtime {
    margin-top: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 9999px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8125rem;
    background: rgba(255, 255, 255, 0.04);
}
.otm-footer-runtime .otm-runtime-title {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: rgba(255, 255, 255, 0.75);
}
.otm-footer-runtime .otm-runtime-title i {
    color: #60a5fa;
}
.otm-footer-runtime .otm-runtime-text {
    color: #fff;
    font-weight: 600;
}

.otm-footer-copyright {
    margin-top: 0.875rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.8;
}
.otm-footer-copyright a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}
.otm-footer-copyright a:hover {
    color: white;
}
.otm-footer-cr-text {
    color: rgba(255, 255, 255, 0.85);
}

.otm-footer-driven {
    margin-top: 0.875rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-muted);
    font-size: 0.8125rem;
}
.otm-footer-driven a {
    display: inline-flex;
    align-items: center;
}
.otm-footer-driven-img {
    max-height: 32px;
    width: auto;
    vertical-align: middle;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.otm-footer-driven a:hover .otm-footer-driven-img {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
}

.otm-footer-actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 180px;
    align-items: stretch;
}

.otm-footer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: transform 0.2s ease, opacity 0.2s ease;
    text-align: center;
    white-space: nowrap;
}
.otm-footer-btn:hover {
    transform: scale(1.05);
    opacity: 0.95;
    color: #fff;
}

@media (max-width: 768px) {
    .otm-footer-grid {
        flex-direction: column;
    }
    .otm-footer-actions {
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        min-width: 0;
    }
    .otm-footer-btn {
        flex: 1 1 auto;
        min-width: 110px;
    }
}

/* ========================================
   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: #ffffff 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.96rem;
        white-space: nowrap;
    }

    .home-cat-submenu {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }

    .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 0.5rem;
        padding-top: calc(var(--header-height) + 0.6rem);
    }
}

@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;
    }
}
/* ================================
   友情链接 / 合作伙伴
   挂在 .site-footer 之后,
   样式对应:inline(默认横排)/card(网格卡片)
   ================================ */
.site-friendlinks {
    /* 上下间距统一使用 --section-gap */
    padding: var(--section-gap) 0 0;
    margin-bottom: var(--section-gap);
    color: var(--text-primary, #334155);
}

/* 直接复用 .otm-footer-menu-inner 白卡样式，确保宽度完全一致 */
.site-friendlinks .container {
    max-width: 1600px;
    margin: 0 auto;
}
.site-friendlinks .fl-card {
    padding: 1.5rem;
}

.fl-block + .fl-block {
    margin-top: 1.25rem;
}

.fl-block-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    padding-bottom: 0.5rem;
    margin-bottom: 0.875rem;
}

.fl-block-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary, #334155);
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
}

.fl-block-subtitle {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--text-secondary, #64748b);
}

.fl-apply-link {
    font-size: 0.8125rem;
    color: var(--text-secondary, #64748b);
    text-decoration: none;
    transition: color .15s;
}
.fl-apply-link:hover {
    color: var(--text-primary, #334155);
    text-decoration: underline;
}

/* —— 默认(标签卡片) —— */
.fl-links--inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}
.fl-link-inline {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    background: var(--bg-color, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 999px;
    color: var(--text-primary, #334155);
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
}
.fl-link-inline:hover {
    background: var(--surface-hover, #f1f5f9);
    border-color: var(--text-muted, #94a3b8);
    color: var(--text-primary, #334155);
}
.fl-sep {
    display: none;
}

/* —— 卡片(网格) —— */
.fl-links--card {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}
.fl-link-card {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    background: var(--bg-color, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    color: var(--text-primary, #334155);
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.fl-link-card:hover {
    border-color: var(--primary-color, #4a90d9);
    box-shadow: 0 2px 8px rgba(74, 144, 217, .08);
    transform: translateY(-1px);
}
.fl-link-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
    background: var(--surface-hover, #f1f5f9);
    flex-shrink: 0;
}
.fl-link-icon--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--text-secondary, #64748b);
    background: var(--primary-light, #e8f0fe);
    color: var(--primary-color, #4a90d9);
    font-weight: 600;
}
.fl-link-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.fl-link-name {
    font-size: 0.875rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fl-link-desc {
    font-size: 0.75rem;
    color: var(--text-secondary, #64748b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* —— 合作伙伴卡片 —— */
.fl-partners {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}
.fl-partner-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0.75rem;
    background: var(--bg-color, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    color: var(--text-primary, #334155);
    text-decoration: none;
    transition: border-color .15s, transform .15s;
}
.fl-partner-card:hover {
    border-color: var(--primary-color, #4a90d9);
    transform: translateY(-1px);
}
.fl-partner-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--surface-hover, #f1f5f9);
    margin-bottom: 0.5rem;
}
.fl-partner-icon--fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    background: var(--primary-light, #e8f0fe);
    color: var(--primary-color, #4a90d9);
    font-weight: 600;
}
.fl-partner-body {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.fl-partner-name {
    font-size: 0.875rem;
    font-weight: 500;
}
.fl-partner-desc {
    font-size: 0.75rem;
    color: var(--text-secondary, #64748b);
    margin-top: 0.125rem;
}

@media (max-width: 640px) {
    .fl-links--card { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .fl-partners    { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .fl-block-head  { flex-wrap: wrap; gap: 0.5rem; }
}

/* ========================================
   文章页 (single.php) 样式
   参考 itlooker.cn CoreNext 主题文章页布局
   ======================================== */

/* 面包屑 */
.otm-breadcrumb {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}
.otm-breadcrumb .container {
    max-width: 1280px;
}
.crumbs-warp-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.crumbs-warp-left a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}
.crumbs-warp-left a:hover {
    color: var(--primary-color);
}
.crumbs-warp-left .crumb-sep {
    font-size: 0.625rem;
    color: var(--text-muted);
}
.crumbs-warp-left .current {
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 320px;
}

/* 文章标题区元信息 */
.post-info-warp {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.875rem !important;
}
.post-info-item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}
.post-info-item i {
    color: var(--text-muted);
}
.post-info-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}
.post-info-item a:hover {
    color: var(--primary-color);
}

/* 文章正文排版 */
.otm-article {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0.1rem 1.25rem;
    box-shadow: var(--shadow-sm);
}
.otm-article-content {
    color: var(--text-primary);
    font-size: 0.9375rem;
    line-height: 1.8;
}
.otm-article-content p {
    margin-bottom: 1rem;
}
.otm-article-content h2,
.otm-article-content h3,
.otm-article-content h4 {
    margin-top: 1.75rem;
    margin-bottom: 0.875rem;
    color: var(--text-primary);
    font-weight: 600;
}
.otm-article-content h2 { font-size: 1.25rem; }
.otm-article-content h3 { font-size: 1.125rem; }
.otm-article-content h4 { font-size: 1rem; }
.otm-article-content ul,
.otm-article-content ol {
    margin: 0 0 1rem 1.5rem;
}
.otm-article-content li {
    margin-bottom: 0.375rem;
}
.otm-article-content blockquote {
    border-left: 4px solid var(--primary-color);
    background: var(--primary-light);
    padding: 0.875rem 1.125rem;
    margin: 0 0 1rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-secondary);
}
.otm-article-content blockquote p:last-child {
    margin-bottom: 0;
}
.otm-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 0.5rem 0;
}
.otm-article-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary-color);
}
.otm-article-content a:hover {
    border-bottom-style: solid;
}
.otm-article-content pre {
    background: var(--text-primary);
    color: #e2e8f0;
    padding: 1rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    line-height: 1.6;
}
.otm-article-content code {
    background: var(--surface-hover);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.85em;
}
.otm-article-content pre code {
    background: transparent;
    padding: 0;
}
.otm-article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}
.otm-article-content th,
.otm-article-content td {
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.otm-article-content th {
    background: var(--surface-hover);
    font-weight: 600;
}
.otm-article-content .page-links {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* 文章特色图片 */
.otm-article .entry-thumbnail {
    margin-bottom: 1.5rem;
}
.otm-article .entry-thumbnail img {
    width: 100%;
    border-radius: var(--radius-md);
}

/* 文章上下篇空状态 */
.otm-adjacent-empty {
    color: var(--text-muted);
    font-style: italic;
    justify-content: center;
    opacity: 0.6;
}

/* ========================================
   评论区 (comments.php)
   复用 otm-content-extra-section 卡片风格
   ======================================== */

/* ---- 整体容器 ---- */
.otm-comments-section {
    margin-top: 0;
}

/* ---- 单一卡片容器（发表评论 + 评论列表 共用） ---- */
.otm-comments-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}
/* 表单块与列表块同处一个卡片，块间用分隔线分隔 */
.otm-comment-form-wrap {
    padding-bottom: 1.5rem;
}
.otm-comment-list-wrap {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}
.otm-comment-list-wrap:first-child {
    border-top: none;
    padding-top: 0;
}
.otm-comment-form-wrap .otm-related-title,
.otm-comment-list-wrap .otm-related-title {
    margin-top: 0 !important;
    margin-bottom: 1.125rem !important;
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.otm-comment-form-wrap .otm-related-title i,
.otm-comment-list-wrap .otm-related-title i {
    color: var(--primary-color);
    font-size: 0.9375rem;
}
.otm-comment-count {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.8125rem;
}

/* ---- 按钮（适配主题主色蓝） ---- */
.otm-cn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.otm-cn-btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
.otm-cn-btn-primary:hover {
    background: var(--primary-hover, var(--primary-color));
    border-color: var(--primary-hover, var(--primary-color));
    color: #fff;
}
.otm-cn-btn-primary:active {
    transform: translateY(1px);
}

/* ---- 未登录提示 ---- */
.otm-comment-login-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-color);
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-sm);
}
.otm-comment-login-notice p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
}
.otm-login-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---- 登录后的评论表单（紧凑布局） ---- */
.otm-comment-form {
    margin-top: 0;
}
.otm-form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.otm-form-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.otm-form-avatar img {
    border-radius: 50%;
    display: block;
    width: 48px;
    height: 48px;
}
.otm-form-user-name {
    font-size: 0.6875rem;
    color: var(--text-muted);
    max-width: 52px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}
.otm-form-fields {
    flex: 1;
    min-width: 0;
}
.otm-form-fields textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    line-height: 1.65;
    background: #fff;
    color: var(--text-primary);
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}
.otm-form-fields textarea::placeholder {
    color: var(--text-muted);
}
.otm-form-fields textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74,144,217,0.12);
}
.otm-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.75rem;
}
.otm-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5625rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}
.otm-cancel-reply {
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s ease;
}
.otm-cancel-reply:hover {
    color: var(--text-secondary);
}

/* ---- 评论列表 ---- */
.otm-comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.otm-comment-list .children {
    list-style: none;
    margin: 0 0 0 3rem;
    padding: 0;
}

.otm-comment-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s ease;
}
.otm-comment-item:first-child {
    padding-top: 0.25rem;
}
.otm-comment-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.otm-comment-body {
    display: flex;
    gap: 0.875rem;
    align-items: flex-start;
}
.otm-comment-avatar img {
    border-radius: 50%;
    display: block;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}
.otm-comment-main {
    flex: 1;
    min-width: 0;
}

/* 第一行：作者名 + 徽章 */
.otm-comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
}
.otm-comment-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}
.otm-comment-author a {
    color: inherit;
    text-decoration: none;
}
.otm-comment-author a:hover {
    color: var(--primary-color);
}
/* 管理员/用户徽章 */
.otm-comment-badges {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.otm-badge-admin {
    color: #f59e0b;
    font-size: 0.75rem;
}
.otm-badge-user {
    color: var(--primary-color);
    font-size: 0.7rem;
}

/* 第二行：UA / 时间 / 回复 —— 用 .otm-comment-actions 统一管理 */
.otm-comment-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-top: 0.35rem;
    margin-bottom: 0.4rem;
    font-size: 0.8125rem;
}

/* UA 标签（浏览器/系统信息） */
.otm-comment-actions .comment-agent,
.otm-comment-actions .comment-platform {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
}
.otm-comment-actions .comment-agent i,
.otm-comment-actions .comment-platform i {
    color: var(--text-muted);
    font-size: 0.7rem;
}

/* 时间 */
.otm-comment-time {
    color: var(--text-muted);
    font-size: 0.7875rem;
}

/* 回复按钮：默认隐藏，hover 评论时显示 */
.otm-comment-reply {
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.otm-comment-item:hover .otm-comment-reply {
    opacity: 1;
    transform: translateX(0);
}
.otm-comment-reply a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.75rem;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.7875rem;
    font-weight: 500;
    border: 1px solid rgba(74,144,217,0.28);
    border-radius: 9999px;
    transition: all 0.2s ease;
    line-height: 1.5;
}
.otm-comment-reply a:hover {
    color: #fff;
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* ---- 内嵌回复表单 ---- */
.otm-inline-reply-wrap {
    display: none;
    margin-top: 1rem;
}
.otm-inline-reply-box {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.125rem 1.25rem;
    margin-left: calc(44px + 0.875rem); /* 与头像对齐 */
}
.otm-inline-reply-box .otm-form-avatar img {
    width: 40px;
    height: 40px;
}
.otm-inline-reply-box .otm-form-user-name {
    font-size: 0.6875rem;
}
.otm-inline-reply-box .otm-form-fields textarea {
    min-height: 80px;
    font-size: 0.875rem;
}
.otm-replying-to {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
}
.otm-replying-to strong {
    color: var(--text-primary);
}

/* 评论正文 */
.otm-comment-content {
    color: var(--text-primary);
    font-size: 0.90625rem;
    line-height: 1.72;
    word-wrap: break-word;
}
.otm-comment-content p:last-child {
    margin-bottom: 0;
}

/* ---- 空状态 ---- */
.otm-empty-comments {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}
.otm-empty-icon {
    width: 120px;
    height: 100px;
    opacity: 0.55;
    margin-bottom: 0.75rem;
}
.otm-empty-comments p {
    margin: 0;
    font-size: 0.9375rem;
}

/* ---- 分页 ---- */
.otm-comments-section .nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}
.otm-comments-section .nav-links a,
.otm-comments-section .nav-links span {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4375rem 1rem;
    font-size: 0.8125rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}
.otm-comments-section .nav-links a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.otm-comments-section .nav-links .current,
.otm-comments-section .nav-links .dots {
    border-color: transparent;
    color: var(--text-muted);
}
.no-comments {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    padding: 1.25rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0;
}
.no-comments i {
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .otm-article {
        padding: 0.1rem 1.25rem;
    }
    .otm-comments-card {
        padding: 1rem;
    }
    .otm-comment-form-wrap {
        padding-bottom: 1rem;
    }
    .otm-comment-list-wrap {
        padding-top: 1rem;
    }
    .otm-form-row {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    .otm-form-avatar {
        flex-direction: row;
    }
    .otm-comment-list .children {
        margin-left: 1.5rem;
    }
    .otm-comment-login-notice {
        flex-direction: column;
        text-align: center;
    }
}
