/* public/assets/css/base.css */
:root {
    --primary-color: #0066cc;
    --primary-hover: #005bb5;
    --primary-rgb: 0, 102, 204; /* 新增 RGB 变量供透明度阴影使用 */
    --bg-body: #f8fafc;
    --bg-surface: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-md: 8px;
    --radius-lg: 12px;
    --spacing-container: 24px;
    --header-height: 64px;
}

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

body { font-family: ui-sans-serif, system-ui, -apple-system, sans-serif; background-color: var(--bg-body); color: var(--text-main); line-height: 1.6; }
a { color: var(--primary-color); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }

/* ==== 全局布局 ==== */
.pudiu-header { background-color: var(--bg-surface); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 100; height: auto; min-height: var(--header-height); display: flex; align-items: center; }
.header-inner { max-width: 1440px; margin: 0 auto; padding: 0 var(--spacing-container); display: flex; justify-content: space-between; align-items: center; width: 100%; flex-wrap: nowrap; gap: 12px; }
.logo-link { display: flex; align-items: center; gap: 8px; text-decoration: none; flex: 1; min-width: 0; overflow: hidden; }
.logo-text { font-weight: 700; color: var(--text-main); font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-badge { background: var(--primary-color); color: #fff; padding: 2px 8px; border-radius: 12px; font-size: 0.75rem; font-weight: bold; flex-shrink: 0; }
.header-right-group { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }

.app-layout { max-width: 1440px; margin: 24px auto; padding: 0 var(--spacing-container); display: grid; grid-template-columns: 240px minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.left-sidebar, .right-sidebar { position: sticky; top: calc(var(--header-height) + 24px); height: calc(100vh - var(--header-height) - 48px); overflow-y: auto; }
.left-sidebar::-webkit-scrollbar, .right-sidebar::-webkit-scrollbar { display: none; }
.left-sidebar, .right-sidebar { -ms-overflow-style: none; scrollbar-width: none; }

/* ==== 搜索框 ==== */
.search-wrapper { position: relative; display: flex; align-items: center; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 20px; padding: 0 16px 0 12px; transition: all 0.2s ease; }
.search-wrapper:focus-within { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1); }
.search-icon { font-size: 0.9rem; opacity: 0.6; margin-right: 6px; flex-shrink: 0; }
#globalSearchInput { border: none; background: transparent; outline: none; padding: 8px 0; font-size: 0.95rem; width: 180px; transition: width 0.2s ease; color: var(--text-main); }
#globalSearchInput:focus { width: 220px; }
.mobile-search-toggle { display: none; background: none; border: none; font-size: 1.2rem; cursor: pointer; padding: 4px; }
.search-results-box { position: absolute; top: 100%; left: 0; right: 0; margin-top: 12px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-md); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1); max-height: 350px; overflow-y: auto; z-index: 1000; display: none; }
.search-result-item { display: block; padding: 12px 16px; color: var(--text-main); text-decoration: none; border-bottom: 1px solid var(--border-color); font-size: 0.95rem; transition: background 0.2s; }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #f1f5f9; color: var(--primary-color); padding-left: 20px; }

/* ==== 左侧菜单 (高大上极致交互版) ==== */
.side-menu { list-style: none; }
.menu-group { margin-bottom: 8px; }

.menu-title { 
    display: flex; justify-content: space-between; align-items: center; 
    padding: 12px 14px; 
    font-weight: 600; 
    color: var(--text-main); 
    border-radius: var(--radius-lg); 
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    flex-wrap: nowrap; 
    border: 1px solid transparent;
}
.menu-title:hover { 
    background-color: var(--bg-surface); 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    border-color: var(--border-color);
    transform: translateY(-1px);
    color: var(--primary-color);
}
.menu-title span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 85%; }
.menu-title .arrow { transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); font-size: 0.75rem; color: var(--text-muted); opacity: 0.6; }
.menu-title:hover .arrow { opacity: 1; color: var(--primary-color); }
.menu-group.collapsed .arrow { transform: rotate(-90deg); }

.sub-menu { list-style: none; padding-left: 12px; margin-top: 4px; overflow: hidden; transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.sub-menu li { margin-bottom: 2px; }
.sub-menu li:last-child { margin-bottom: 0; }
.menu-group.collapsed .sub-menu { max-height: 0; margin-top: 0; }

.sub-menu a { 
    position: relative;
    display: block; 
    padding: 10px 14px; 
    color: var(--text-muted); 
    border-radius: var(--radius-md); 
    font-size: 0.95rem; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
    transition: all 0.2s ease;
}
.sub-menu a:hover { 
    background-color: rgba(var(--primary-rgb), 0.05); 
    color: var(--primary-color); 
    padding-left: 18px; 
}
.sub-menu a.active { 
    background-color: rgba(var(--primary-rgb), 0.1); 
    color: var(--primary-color); 
    font-weight: 600; 
}
.sub-menu a.active::before {
    content: ''; position: absolute; left: 4px; top: 50%; transform: translateY(-50%);
    height: 16px; width: 3px; border-radius: 2px; background-color: var(--primary-color);
}

/* ==== 幻灯片 ==== */
.slider-container { position: relative; width: 100%; height: 200px; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 24px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.slider-track { display: flex; height: 100%; transition: transform 0.5s ease-in-out; flex-wrap: nowrap; margin: 0; padding: 0; }
.slider-slide { display: flex; flex-direction: column; align-items: center; justify-content: center; background-size: cover; background-position: center; color: #fff; font-size: 1.1rem; font-weight: bold; text-shadow: 0 2px 4px rgba(0,0,0,0.5); text-decoration: none; padding: 0 24px; box-sizing: border-box; overflow: hidden; }
@media (min-width: 768px) { .slider-slide { font-size: 1.5rem; padding: 0 40px; } }
.slider-slide-text { display: block; width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.slider-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 10; pointer-events: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.5); pointer-events: auto; cursor: pointer; transition: 0.3s; }
.dot.active { background: #fff; transform: scale(1.2); }

/* ==== 工具列表与网格 (高大上流体卡片升级) ==== */
.category-section { margin-bottom: 32px; }
.category-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); }
.category-header-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; margin-right: 16px; font-size: 1.25rem; color: var(--text-main); }
.category-header-title .cat-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-count { font-size: 0.85rem; background: var(--border-color); color: var(--text-muted); padding: 2px 10px; border-radius: 12px; font-weight: 500; flex-shrink: 0; }
.view-more { font-size: 0.9rem; color: var(--primary-color); font-weight: 500; white-space: nowrap; flex-shrink: 0; }

.tool-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
    gap: 24px; 
    margin-top: 16px; 
}
.tool-card { 
    display: flex; flex-direction: column; align-items: center; justify-content: center; 
    gap: 16px; padding: 28px 16px; 
    background: var(--bg-surface); 
    border: 1px solid rgba(148, 163, 184, 0.15); 
    border-radius: 20px; 
    text-decoration: none; color: var(--text-main); 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03); 
    position: relative; overflow: hidden; z-index: 1; min-width: 0;
}
.tool-card:hover { 
    transform: translateY(-6px); 
    border-color: var(--primary-color); 
    box-shadow: 0 20px 30px -10px rgba(var(--primary-rgb), 0.15), 0 8px 15px -5px rgba(var(--primary-rgb), 0.05); 
    z-index: 2; 
}
.tool-icon { 
    width: 64px; height: 64px; border-radius: 18px; 
    display: flex; align-items: center; justify-content: center; 
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05) 0%, rgba(var(--primary-rgb), 0.15) 100%); 
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); 
    flex-shrink: 0; overflow: hidden;
}
.tool-card:hover .tool-icon { transform: scale(1.12) rotate(4deg); }
.tool-icon img { width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.08)); }
.tool-icon.text-icon { color: var(--primary-color) !important; background: rgba(var(--primary-rgb), 0.1) !important; font-size: 1.5rem !important; font-weight: bold; text-transform: uppercase; }

.tool-name { 
    font-size: 1.05rem; font-weight: 700; text-align: center; line-height: 1.3; 
    transition: color 0.3s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}
.tool-card:hover .tool-name { color: var(--primary-color); }

/* ==== 独立组件排版类 ==== */
.breadcrumb { margin-bottom: 24px; font-size: 0.9rem; color: var(--text-muted); display: flex; align-items: center; gap: 10px; background: var(--bg-surface); padding: 12px 20px; border-radius: var(--radius-lg); border: 1px solid var(--border-color); overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.breadcrumb::-webkit-scrollbar { display: none; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: 0.2s; flex-shrink: 0; }
.breadcrumb a:hover { color: var(--primary-color); }
.breadcrumb span.sep { opacity: 0.5; flex-shrink: 0; }
.breadcrumb span.current { color: var(--text-main); font-weight: 600; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1; min-width: 0; }

.friendly-links-container { max-width: 1440px; margin: 24px auto 0; padding: 16px var(--spacing-container); border-top: 1px solid var(--border-color); display: flex; align-items: center; gap: 16px; font-size: 0.85rem; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.friendly-links-container::-webkit-scrollbar { display: none; }
.friendly-links-label { font-weight: 600; color: var(--text-main); flex-shrink: 0; }
.friendly-links-list { display: flex; gap: 24px; }
.friendly-links-list a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.friendly-links-list a:hover { color: var(--primary-color); }

.search-summary { color: var(--text-muted); margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; flex-wrap: wrap; }
.search-keyword { color: var(--primary-color); margin-left: 4px; max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }

.related-tools-section { margin-bottom: 32px; }
.related-tools-title { font-size: 1.1rem; color: var(--text-main); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* ==== 工具面板通用 ==== */
.tool-surface { background-color: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: var(--spacing-container); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.tool-surface h1 { font-size: 1.5rem; margin-bottom: 8px; }
.tool-surface p { color: var(--text-muted); margin-bottom: 16px; }
.btn-primary { background: var(--primary-color); color: #fff; border: none; padding: 10px 20px; border-radius: var(--radius-md); cursor: pointer; transition: background-color 0.2s; }
.btn-primary:hover { background: var(--primary-hover); }

/* ==== 侧边栏 Widget ==== */
.widget-card { background-color: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.widget-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; border-bottom: 2px solid #f1f5f9; padding-bottom: 12px; color: var(--text-main); }
.hot-list { display: flex; flex-direction: column; gap: 10px; }
.hot-item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius-md); transition: all 0.2s ease; text-decoration: none; border: 1px solid transparent; }
.hot-item:hover { background-color: #f8fafc; border-color: #e2e8f0; transform: translateX(4px); box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.hot-icon { width: 36px; height: 36px; background: #f1f5f9; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; font-weight: 700; color: #64748b; flex-shrink: 0; transition: all 0.2s; }
.hot-item:hover .hot-icon { background: var(--primary-color); color: #fff; }
.hot-info { display: flex; flex-direction: column; flex-grow: 1; overflow: hidden; }
.hot-name { font-size: 0.95rem; font-weight: 600; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hot-desc { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-hot { background: #fef2f2; color: #ef4444; font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; font-weight: 700; border: 1px solid #fecaca; flex-shrink: 0; line-height: 1; }

/* ==== 真·物理翻页时钟组件 ==== */
.pudiu-clock-wrapper { display: flex; justify-content: center; align-items: center; gap: 4px; padding: 10px 0; margin-bottom: 8px; }
.pudiu-time-group { display: flex; gap: 3px; }
.p-colon { font-size: 1.5rem; font-weight: bold; color: var(--text-main); margin-bottom: 4px; animation: p-blink 1s infinite; }
@keyframes p-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.2; } }

.p-flip-unit { position: relative; width: 32px; height: 48px; background: #1e293b; border-radius: 6px; perspective: 400px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }
.p-card { position: absolute; left: 0; width: 100%; height: 50%; background: #1e293b; color: #fff; overflow: hidden; transform-style: preserve-3d; }
.p-card span { position: absolute; left: 0; width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 1.8rem; font-weight: 700; height: 48px; line-height: 48px; text-align: center; }

.p-top-bg { top: 0; border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom: 1px solid rgba(0,0,0,0.5); transform-origin: bottom; }
.p-top-bg span { top: 0; }
.p-bottom-bg { bottom: 0; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; transform-origin: top; }
.p-bottom-bg span { bottom: 0; }

.p-top-flip { top: 0; border-top-left-radius: 6px; border-top-right-radius: 6px; border-bottom: 1px solid rgba(0,0,0,0.5); transform-origin: bottom; z-index: 2; }
.p-top-flip span { top: 0; }
.p-bottom-flip { bottom: 0; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; transform-origin: top; z-index: 2; transform: rotateX(90deg); }
.p-bottom-flip span { bottom: 0; }

.p-top-flip.flip-down { animation: pFlipTop 0.25s cubic-bezier(0.37, 0, 0.63, 1) forwards; }
.p-bottom-flip.flip-down { animation: pFlipBottom 0.25s cubic-bezier(0.37, 0, 0.63, 1) 0.25s forwards; }

@keyframes pFlipTop { 0% { transform: rotateX(0deg); } 100% { transform: rotateX(-90deg); } }
@keyframes pFlipBottom { 0% { transform: rotateX(90deg); } 100% { transform: rotateX(0deg); } }

/* ==== 黑夜模式 ==== */
[data-theme="dark"] { --bg-body: #0f172a; --bg-surface: #1e293b; --text-main: #f8fafc; --text-muted: #94a3b8; --border-color: #334155; }
[data-theme="dark"] .mobile-tabbar { background: rgba(30, 41, 59, 0.85); border-color: #334155; box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2); }
[data-theme="dark"] .search-result-item:hover { background: #334155; }
[data-theme="dark"] .p-flip-unit { box-shadow: 0 0 0 1px #334155; }
[data-theme="dark"] .p-card { background: #0f172a; }

/* 针对侧边栏黑夜模式特定修复 */
[data-theme="dark"] .menu-title:hover { background-color: #1e293b; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
[data-theme="dark"] .sub-menu a:hover { background-color: rgba(255, 255, 255, 0.05); }

/* 黑夜模式 - 卡片样式特殊处理 */
[data-theme="dark"] .tool-card { background: var(--bg-surface) !important; border-color: rgba(255, 255, 255, 0.05) !important; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
[data-theme="dark"] .tool-card:hover { border-color: var(--primary-color) !important; background: rgba(30, 41, 59, 0.8) !important; box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.5), 0 0 15px rgba(var(--primary-rgb), 0.2); }
[data-theme="dark"] .tool-name { color: #f8fafc !important; }
[data-theme="dark"] .tool-card:hover .tool-name { color: #60a5fa !important; }
[data-theme="dark"] .tool-icon.text-icon { color: #ffffff !important; }
[data-theme="dark"] .cat-name, [data-theme="dark"] .category-header-title { color: #f1f5f9 !important; }
[data-theme="dark"] .left-sidebar .menu-group a, [data-theme="dark"] .left-sidebar .menu-title span { color: #cbd5e1 !important; }
[data-theme="dark"] .left-sidebar .menu-group a:hover, [data-theme="dark"] .left-sidebar .menu-group a.active { color: #ffffff !important; }

/* ==== 媒体查询 (响应式) ==== */
@media (max-width: 1024px) { .app-layout { grid-template-columns: 240px minmax(0, 1fr); } .right-sidebar { display: none; } }
@media (max-width: 768px) { 
    body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    .app-layout { grid-template-columns: minmax(0, 1fr); } 
    .left-sidebar { display: none; }
    .pudiu-header { padding: 10px 0; }
    .header-right-group { gap: 10px; }
    .logo-text { font-size: 1rem; }
    .tool-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } /* 移动端改回双排 */
    .pc-only { display: none !important; }
    #themeToggleBtn { display: none !important; }
    .mobile-search-toggle { display: block; }
    .search-wrapper { display: none; position: absolute; top: 100%; left: 0; right: 0; padding: 16px var(--spacing-container); background: var(--bg-surface); border-bottom: 1px solid var(--border-color); z-index: 100; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); border-radius: 0 0 16px 16px; }
    .search-wrapper.active { display: flex; animation: slideDown 0.2s ease-out; }
    #globalSearchInput { width: 100% !important; background: #f1f5f9; padding: 12px 16px; border-radius: 12px; font-size: 1rem; }
    .search-results-box { position: absolute; top: 100%; left: 16px; right: 16px; width: auto; margin-top: 8px; border-radius: 12px; border: 1px solid var(--border-color); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15); max-height: 50vh; overflow-y: auto; z-index: 1001; }
    .search-result-item { padding: 14px 16px; font-size: 1rem; }
}
@media (max-width: 360px) { .logo-text { display: none; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   强制修复：移动端底部导航栏显示逻辑
   ========================================= */
.mobile-tabbar { display: none !important; }
@media (max-width: 768px) {
    .mobile-tabbar {
        display: flex !important; position: fixed; bottom: 0; left: 0; right: 0;
        height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
        background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid var(--border-color); z-index: 1000; justify-content: space-around; align-items: center;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    }
    .tabbar-item { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; height: 100%; color: var(--text-muted); text-decoration: none; transition: color 0.2s; -webkit-tap-highlight-color: transparent; }
    .tabbar-icon { width: 24px; height: 24px; margin-bottom: 4px; transition: transform 0.2s; }
    .tabbar-label { font-size: 0.7rem; font-weight: 500; }
    .tabbar-item.active, .tabbar-item:active { color: var(--primary-color); }
    .tabbar-item.active .tabbar-icon, .tabbar-item:active .tabbar-icon { transform: scale(1.1); }
    [data-theme="dark"] .mobile-tabbar { background: rgba(30, 41, 59, 0.85) !important; border-color: #334155 !important; box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2) !important; }
}

/* ==== 广告系统布局 ==== */
.pudiu-ad-container { position: relative; overflow: hidden; transition: background-color 0.2s, border-color 0.2s; text-align: center; }
.pudiu-ad-top { width: 100%; max-width: 1000px; margin: 0 auto 24px auto; background: var(--bg-body); border: 1px dashed var(--border-color); border-radius: 16px; padding: 20px; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pudiu-ad-banner { width: 100%; max-width: 1000px; margin: 0 auto 24px auto; background: var(--bg-body); border: 1px dashed var(--border-color); border-radius: 16px; padding: 20px; min-height: 100px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pudiu-ad-sidebar { width: 100%; min-height: 300px; background: var(--bg-body); border: 1px dashed var(--border-color); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin-bottom: 16px;}
.pudiu-ad-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; opacity: 0.7; font-weight: 600; color: var(--primary-color); }
.ad-fallback { display: none; width: 100%; height: 100%; background: linear-gradient(135deg, #f0f9ff, #e0f2fe); border-radius: 12px; padding: 16px; flex-direction: column; justify-content: center; align-items: center; text-decoration: none; border: 1px solid #bae6fd; transition: transform 0.2s, box-shadow 0.2s; }
.ad-fallback:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -4px rgba(56, 189, 248, 0.3); }
.ad-fallback strong { color: var(--primary-color); font-size: 1.1rem; margin-bottom: 4px; }
.ad-fallback span { color: var(--text-muted); font-size: 0.85rem; }
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
ins.adsbygoogle[data-ad-status="unfilled"] ~ .ad-fallback { display: flex !important; }
[data-theme="dark"] .ad-fallback { background: linear-gradient(135deg, #1e293b, #0f172a); border-color: var(--border-color); }

/* ==== Footer ==== */
.tool-extended-footer { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border-color); }
.tool-interact { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; background: var(--bg-surface); padding: 20px 24px; border-radius: 16px; border: 1px solid var(--border-color); box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02); margin-bottom: 32px; }
.rating-container { display: flex; align-items: center; gap: 12px; }
.rating-container span:first-child { font-weight: 600; color: var(--text-main); }
.star-rating { display: flex; gap: 4px; font-size: 1.5rem; cursor: pointer; color: #cbd5e1; }
.rating-msg { font-size: 0.85rem; color: #10b981; font-weight: 500; display: none; }
.share-container { display: flex; align-items: center; gap: 12px; }
.share-container span:first-child { font-size: 0.9rem; color: var(--text-muted); }
.share-btn { padding: 8px 16px; border: 1px solid var(--border-color); background: var(--bg-body); color: var(--text-main); font-weight: 500; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: 0.2s; }
.share-btn:hover { background: var(--border-color); }
.share-btn.success { background: rgba(16, 185, 129, 0.1) !important; border-color: #34d399 !important; color: #10b981 !important; }
.tool-seo-article { margin-bottom: 32px; background: var(--bg-body); padding: 24px; border-radius: 16px; border: 1px solid var(--border-color); }
.tool-seo-article h3 { font-size: 1.1rem; color: var(--text-main); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.tool-seo-article p.desc-text { color: var(--text-muted); font-size: 0.95rem; line-height: 1.8; margin-bottom: 16px; }
.privacy-note { background: rgba(59, 130, 246, 0.05); border-left: 4px solid #3b82f6; padding: 12px 16px; color: #475569; font-size: 0.9rem; margin: 0; border-radius: 0 8px 8px 0; }
[data-theme="dark"] .privacy-note { background: rgba(59, 130, 246, 0.1); color: #94a3b8; }

/* ==== Cookie 授权弹窗 ==== */
.cookie-banner { position: fixed; bottom: 24px; left: 24px; max-width: 400px; background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 20px; box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15); z-index: 9999; display: flex; flex-direction: column; gap: 16px; transform: translateY(150%); opacity: 0; transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease; }
.cookie-banner.show { transform: translateY(0); opacity: 1; }
.cookie-text { font-size: 0.9rem; color: var(--text-muted); line-height: 1.6; }
.cookie-text a { color: var(--primary-color); text-decoration: underline; font-weight: 500; }
.cookie-actions { display: flex; gap: 12px; justify-content: flex-end; }
.cookie-btn { padding: 8px 16px; border-radius: var(--radius-md); font-size: 0.9rem; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: 0.2s; }
.cookie-btn-accept { background: var(--primary-color); color: #fff; }
.cookie-btn-accept:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 102, 204, 0.2); }
.cookie-btn-decline { background: transparent; border-color: var(--border-color); color: var(--text-main); }
.cookie-btn-decline:hover { background: var(--border-color); }
@media (max-width: 768px) { .cookie-banner { bottom: calc(76px + env(safe-area-inset-bottom)); left: 16px; right: 16px; max-width: none; } }
[data-theme="dark"] .cookie-banner { box-shadow: 0 10px 25px -5px rgba(0,0,0,0.6); }

/* ==== 修复及特殊逻辑 ==== */
.pc-qr-box span:not(:last-child),
#qrcode-container span:not(:last-child) { display: none !important; }

/* 【移动端优化】修复工具名称过长被截断的问题 */
@media (max-width: 768px) {
    .tool-card {
        padding: 16px 12px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 12px !important;
        height: auto !important;
        min-height: 125px !important;
    }
    .tool-name {
        white-space: normal !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        font-size: 0.9rem !important;
        line-height: 1.35 !important;
        text-align: center !important;
        width: 100% !important;
    }
    .tool-icon {
        width: 48px !important;
        height: 48px !important;
        font-size: 1.2rem !important;
    }
    .tool-icon img { width: 28px !important; height: 28px !important; }
}

/* ==========================================
   🚀 边缘吸附式快捷抽屉 (蓝/灰蓝实体块版)
   ========================================== */
.edge-drawer {
    position: fixed;
    right: 0;
    top: 65%;
    transform: translateY(-50%);
    z-index: 1050;
    display: flex;
    align-items: center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.edge-drawer.is-collapsed {
    transform: translate(100%, -50%);
}

/* 挂在外面的小把手 (白天：蓝实体块) */
.edge-toggle-handle {
    position: absolute;
    left: -28px; 
    width: 28px;
    height: 64px;
    /* 强制使用品牌主色（蓝实体块） */
    background: var(--primary-color, #0066cc); 
    border: 1px solid var(--primary-color, #0066cc);
    border-right: none;
    border-radius: 12px 0 0 12px; 
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* 加深蓝色阴影，让悬浮感更强 */
    box-shadow: -4px 0 12px rgba(0, 102, 204, 0.4);
    /* 箭头使用纯白色，对比度拉满 */
    color: #ffffff; 
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.edge-toggle-handle:hover {
    width: 34px; 
    left: -34px;
    background: var(--primary-hover, #005bb5); 
}

/* 把手上的箭头动画 */
.edge-drawer .handle-icon { width: 18px; height: 18px; transition: transform 0.4s; }
.edge-drawer.is-collapsed .handle-icon { transform: rotate(0deg); }
.edge-drawer:not(.is-collapsed) .handle-icon { transform: rotate(180deg); }

/* 抽屉面板内容 */
.edge-drawer-content {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-right: none;
    border-radius: 16px 0 0 16px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: -10px 10px 25px rgba(0, 0, 0, 0.08);
}

/* 抽屉内的功能按钮 */
.edge-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-size: 0.75rem;
    font-weight: 500;
}

.edge-btn svg { width: 22px; height: 22px; }

.edge-btn:hover {
    background: rgba(var(--primary-rgb, 0, 102, 204), 0.08);
    color: var(--primary-color);
    transform: translateX(-2px);
}

.feedback-btn { color: var(--primary-color); }

/* ==========================================
   🌙 黑夜模式专属适配 (黑夜：灰蓝实体块)
   ========================================== */
[data-theme="dark"] .edge-toggle-handle {
    /* 黑夜模式下使用深灰蓝色 */
    background: #1e293b !important;
    border-color: #334155 !important;
    box-shadow: -4px 0 15px rgba(0, 0, 0, 0.6);
    /* 箭头用亮蓝色，在深灰蓝底色上非常精致且不刺眼 */
    color: #60a5fa; 
}
[data-theme="dark"] .edge-toggle-handle:hover {
    background: #0f172a !important; 
    color: #ffffff; 
}
[data-theme="dark"] .edge-drawer-content {
    background: #1e293b;
    border-color: #334155;
    box-shadow: -10px 10px 25px rgba(0,0,0,0.6);
}
[data-theme="dark"] .edge-btn:hover {
    background: rgba(255,255,255,0.05);
    color: #60a5fa;
}

/* ==========================================
   📱 移动端防遮挡适配
   ========================================== */
@media (max-width: 768px) {
    .edge-drawer { 
        top: auto; 
        bottom: calc(80px + env(safe-area-inset-bottom)); 
        transform: translateY(0); 
    }
    .edge-drawer.is-collapsed { 
        transform: translate(100%, 0); 
    }
}
/* ==========================================
   侧边栏手风琴折叠动画专用样式 (强制覆盖)
   ========================================== */
.menu-group .sub-menu {
    /* 强制为 block，将显示/隐藏的控制权完全交给 JS 的 maxHeight */
    display: block !important; 
    overflow: hidden;
    /* 贝塞尔曲线，让折叠动画有自然的“缓动”效果 */
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-group.collapsed .sub-menu {
    /* 折叠时高度严格归零 */
    max-height: 0 !important;
}

/* 优化侧边栏标题鼠标交互 */
.menu-group .menu-title {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

/* 箭头旋转动画 */
.menu-group .menu-title .arrow {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.menu-group.collapsed .menu-title .arrow {
    transform: rotate(-90deg); /* 折叠时箭头朝右 */
}