/* --- 基础样式 --- */
:root {
    --primary: #2563eb; /* 核心蓝 */
    --text-main: #1e293b; /* 深灰文本 */
    --text-light: #64748b; /* 浅灰文本 */
    --text-muted: #64748b;
    --bg-body: #f8fafc; /* 浅色背景 */
    --border-color: #e2e8f0;
    --card-radius: 16px; /* 统一圆角 */
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    /*font-family: 'Inter', -apple-system, system-ui, sans-serif;*/
    background: var(--bg-body);
    color: var(--text-main);
    line-height: 1.8;
}
/*body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg-body); color: var(--text-main); line-height: 1.5; }*/
a { text-decoration: none; }

/* --- 固定导航与分类栏 --- */
.top-nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9); /*稍微透明一点 */
    backdrop-filter: blur(10px); /* 增加整体导航栏的磨砂感 */
    -webkit-backdrop-filter: blur(10px);
    /*border-bottom: 1px solid #e2e8f0;*/
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.menu {
    max-width: 1200px;
    margin: 0 auto;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /*padding: 18px 25px;*/
    padding: 0 20px;
}
.logo {
    /*font-size: 1.6rem;*/
    /*font-weight: 900;*/
    /*letter-spacing: -1px;*/
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}
.logo span { color: var(--primary); }
.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 30px;
}
.nav-links a {
    /*color: #64748b;*/
    /*font-size: 0.9rem;*/
    color: var(--text-main);
    font-weight: 500;
    font-size: 15px;
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
}
/*.nav-links a:hover { color: var(--primary); }*/
.nav-links a:hover, .nav-links a.active {
    color: var(--primary);
}

/* 激活状态下划线动画 */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

.lang-select {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    font-size: 13px;
    cursor: pointer;
}

/* 汉堡按钮样式 */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}

.menu-toggle .bar {
    width: 22px;
    height: 2px;
    background: var(--text-main);
    transition: 0.3s;
}

/* 分类过滤器样式 */
.filter-section {
    background: #fff; padding: 12px 0; border-bottom: 1px solid #e2e8f0;
    text-align: center; overflow-x: auto; white-space: nowrap;
}
.filter-btn {
    display: inline-block; padding: 8px 20px; margin: 0 5px;
    border-radius: 30px; border: none; background: #f8fafc;
    color: #64748b; font-size: 0.85rem; cursor: pointer; transition: 0.3s;
}
.filter-btn.active { background: var(--primary); color: #fff; box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2); }

/* --- 瀑布流容器 --- */
main {
    max-width: 1200px;
    margin: 100px auto 60px; /* 留出导航栏高度 */
    padding: 0 25px;
}
.main-ext {margin-bottom: 200px;}

.waterfall { column-count: 4; column-gap: 20px; }
.waterfall img {border-radius: 12px; transition: transform 0.3s;}

@media (max-width: 1024px) { .waterfall { column-count: 3; } }
@media (max-width: 768px) { .waterfall { column-count: 2; } }
@media (max-width: 480px) { .waterfall { column-count: 1; } }

/* --- 图片卡片与上方分类标签 --- */
.image-card {
    break-inside: avoid; margin-bottom: 20px;
    background: #fff; border-radius: 12px; overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    position: relative; /* 关键：为了定位内部标签 */
    cursor: pointer; transition: transform 0.3s ease;
}
/*.image-card:hover { transform: translateY(-5px); }*/
.image-card:hover { transform: translateY(-5px); box-shadow: 0 10px 15px rgba(0,0,0,0.1); }
.image-card img { width: 100%; display: block; }

/* 图片上方的分类标签 */
.floating-tag {
    position: absolute;
    top: 12px; left: 12px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    padding: 4px 12px; border-radius: 6px;
    font-size: 0.75rem; font-weight: 600; color: var(--primary);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10; pointer-events: none; /* 防止遮挡点击图片 */
}

/* --- 页脚与加载器 --- */
#loader { text-align: center; padding: 40px; color: #94a3b8; font-size: 0.9rem; }
footer {
    background: #1e293b;
    color: #94a3b8;
    text-align: center;
    padding: 50px 0;
    font-size: 0.85rem;
}
.foot-ext {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
}

/* ################ categroy ################  */
.page-header {
    text-align: center; margin-bottom: 50px;
}
.page-title { font-size: 2.2rem; font-weight: 800; color: var(--text-main); margin-bottom: 10px; }
.page-subtitle { color: var(--text-light); font-size: 1.1rem; }

/* --- 4. 分类卡片网格 (CSS Grid) --- */
.category-grid {
    display: grid;
    /* 响应式列：每列至少280px宽，自动填充 */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* 分类卡片样式 */
.cat-card {
    display: block; /* 让A标签变为块级以包裹内容 */
    background: #fff;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid transparent;
}

/* 悬停效果：整体上浮，阴影加深，边框变色 */
.cat-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
    border-color: rgba(37, 99, 235, 0.2);
}

/* 图片容器 */
.cat-img-wrapper {
    position: relative;
    height: 220px; /* 固定高度确保整齐 */
    overflow: hidden;
}
.cat-img-wrapper img {
    width: 100%; height: 100%;
    object-fit: cover; /* 图片裁切填满 */
    transition: transform 0.6s;
}
/* 悬停时图片微缩放 */
.cat-card:hover .cat-img-wrapper img { transform: scale(1.08); }

/* 核心风格：磨砂玻璃分类标题 (复用并放大了之前的标签风格) */
.cat-floating-header {
    position: absolute;
    top: 20px; left: 20px;
    /* 磨砂玻璃背景 */
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 8px 20px;
    border-radius: 30px;
    /* 文本样式 */
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    z-index: 2;
}

/* 卡片底部信息 */
.cat-info {
    padding: 20px;
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid #f1f5f9;
}
.cat-desc { font-size: 0.9rem; color: var(--text-light); font-weight: 500; }
.cat-count {
    font-size: 0.85rem;
    color: #fff;
    background: #94a3b8;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
}
.cat-card:hover .cat-count { background: var(--primary); } /* 悬停时计数标签变色 */

/* --- 面包屑导航 (Breadcrumbs) --- */
.breadcrumb-section {
    background: #fff;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    margin-top: 80px; /* 避开固定 header */
}
.breadcrumb-container {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
}
.breadcrumbs {
    list-style: none; display: flex; align-items: center;
    font-size: 0.85rem; color: var(--text-muted);
}
.breadcrumbs li { display: flex; align-items: center; }
/* 面包屑分隔符 */
.breadcrumbs li:not(:last-child)::after {
    content: "/"; margin: 0 10px; color: #cbd5e1;
}
.breadcrumbs a { text-decoration: none; color: var(--text-muted); transition: color 0.2s; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .current { color: var(--text-main); font-weight: 600; }


/* 页脚基础样式 */
.site-footer {
    background-color: #ffffff;
    color: #475569;
    padding: 60px 0 30px;
    border-top: 1px solid #e2e8f0;
    font-family: 'Inter', -apple-system, sans-serif;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr; /* 三栏布局 */
    gap: 40px;
}

/* 响应式调整：手机端显示为一栏 */
@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* 品牌栏 */
.footer-brand .f-logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: #1e293b;
    text-decoration: none;
    letter-spacing: -1px;
}
.footer-brand .f-logo span { color: #6366f1; }
.footer-brand p {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.6;
}

/* 列表栏 */
.footer-links h4 {
    color: #1e293b;
    font-size: 1rem;
    margin-bottom: 20px;
    font-weight: 700;
}
.footer-links ul { list-style: none; padding: 0; }
.footer-links ul li { margin-bottom: 12px; }
.footer-links ul li a {
    text-decoration: none;
    color: #64748b;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.footer-links ul li a:hover { color: #6366f1; }

/* 底部版权与归属区 */
.footer-bottom {
    max-width: 1100px;
    margin: 40px auto 0;
    padding: 30px 20px 0;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

@media (max-width: 768px) {
    .footer-bottom { justify-content: center; flex-direction: column; }
}

.copyright { font-size: 0.85rem; color: #94a3b8; }

/* Tenor 归属图片样式 */
.tenor-attribution img {
    height: 24px;
    width: auto;
    display: block;
}


/* sharing 样式 */
/*.image-card { position: relative; border-radius: 12px; overflow: hidden; }*/
.share-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex; justify-content: center; align-items: center;
    opacity: 0; transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.image-card:hover .share-overlay { opacity: 1; }

.share-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3列布局 */
    gap: 10px;
}

.s-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; justify-content: center; align-items: center;
    color: white; font-size: 14px; font-weight: bold;
    text-decoration: none; border: none; cursor: pointer;
    transition: transform 0.2s;
}

.s-icon:hover { transform: translateY(-3px); }

/* 品牌配色 */
.pin { background: #bd081c; }    /* Pinterest */
.x { background: #000000; }      /* X */
.weibo { background: #e6162d; }  /* 微博 */
.wechat { background: #07c160; } /* 微信 */
.copy { background: #64748b; }   /* 复制 */


/* article 样式 */
.article-wrapper { max-width: 800px; margin: 0 auto; padding: 60px 20px; }
.back-nav { margin-bottom: 30px; }
.back-nav a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; }

.entry-header { margin-bottom: 40px; text-align: center; }
.entry-header h1 { font-size: 2.2rem; line-height: 1.3; margin-bottom: 20px; color: #0f172a; }
.entry-meta { display: flex; justify-content: center; gap: 20px; color: var(--text-muted); font-size: 0.9rem; border-bottom: 1px solid #eee; padding-bottom: 20px; }

.entry-content h2 { font-size: 1.6rem; margin: 40px 0 20px; color: #1e293b; padding-left: 15px; border-left: 5px solid var(--brand); }
.entry-content p { margin-bottom: 20px; font-size: 1.1rem; text-align: justify; }
.entry-content b { color: var(--brand); }

/* 比较表格样式 */
.comparison-table { width: 100%; border-collapse: collapse; margin: 30px 0; font-size: 0.95rem; }
.comparison-table th, .comparison-table td { padding: 15px; border: 1px solid var(--table-border); text-align: left; }
.comparison-table th { background: #f8fafc; font-weight: 700; }
.comparison-table tr:nth-child(even) { background: #f9fafb; }

.timeline-box { background: #f1f5f9; padding: 25px; border-radius: 15px; margin: 30px 0; }
.timeline-item { margin-bottom: 15px; padding-left: 20px; border-left: 2px solid #cbd5e1; position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -6px; top: 8px; width: 10px; height: 10px; background: var(--brand); border-radius: 50%; }

/* 强调块 */
.callout { background: #f8fafc; border-left: 4px solid var(--brand); padding: 20px; margin: 30px 0; border-radius: 0 8px 8px 0; }
/* 公式展示 */
.formula { text-align: center; margin: 30px 0; padding: 20px; background: var(--code-bg); border-radius: 12px; font-family: "Cambria Math", serif; }

blockquote { font-style: italic; border-left: none; text-align: center; font-size: 1.4rem; color: var(--text-muted); margin: 40px 0; }

/* 标签样式 */
.tag-box { display: flex; gap: 10px; margin-top: 50px; padding-top: 20px; border-top: 1px solid #eee; }
.tag { background: #f1f5f9; color: var(--brand); padding: 5px 12px; border-radius: 15px; font-size: 0.85rem; text-decoration: none; }
.tag:hover { background: var(--brand); color: #fff; }

.verdict { background: #eff6ff; border-radius: 15px; padding: 30px; margin: 40px 0; border: 1px solid #dbeafe; }
.verdict h3 { color: #1e40af; margin-bottom: 15px; }

.tenor-footer { margin-top: 60px; padding-top: 30px; border-top: 1px dashed #ddd; text-align: center; }
.tenor-logo { width: 140px; margin-top: 10px; }

.post-footer-tags {
    margin: 40px 0;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}
.tag-title {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 12px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.tag-item {
    background: #f1f5f9;
    color: #6366f1;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}
.tag-item:hover {
    background: #6366f1;
    color: #ffffff;
    transform: translateY(-2px);
}
.tag-item::before {
    content: '#';
    margin-right: 2px;
    opacity: 0.7;
}

/* 语言选择器容器 */
.lang-selector-container {
    /display: flex;
    align-items: center;
    /*margin-left: 15px;*/
}

/* 下拉框基础样式 */
.lang-select {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s;
}

.lang-select:hover {
    border-color: #007bff;
}

/* 骨架屏基础结构 */
.skeleton-card {
    width: 100%;
    background: #eee;
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    position: relative;
}

/* 闪烁动画 */
.skeleton-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 模拟不同高度的瀑布流卡片 */
.sk-h1 { height: 200px; }
.sk-h2 { height: 300px; }
.sk-h3 { height: 250px; }

/* 移动端适配 (针对屏幕宽度小于 768px) */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        right: -280px; /* 默认隐藏在侧边 */
        top: 0;
        width: 240px;
        height: 100vh;
        background: #fff;
        flex-direction: column;
        padding: 20px 20px;
        gap: 25px;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -5px 0 15px rgba(0,0,0,0.05);
        z-index: 1001;
        align-items: flex-start;
    }

    .nav-links.active {
        right: 0; /* 展开菜单 */
    }

    .nav-links li {
        margin-bottom: 5px;
        border-bottom: 1px solid #f1f5f9;
        width: 100%;
        /*margin: 15px 0;*/
        /*text-align: center;*/
    }

    /* 菜单字体样式优化 */
    .nav-links a {
        display: block;
        padding: 16px 10px; /* 增加垂直内边距，方便手指点击 */
        font-size: 18px;    /* 增大字体，移动端更易读 */
        font-weight: 600;   /* 加粗字体 */
        color: #334155;
        letter-spacing: 0.5px;
        transition: all 0.2s ease;
    }

    /* 激活与悬停状态 */
    .nav-links a.active {
        color: var(--primary);
        /*background: #eff6ff;*/
        border-radius: 8px;
    }

    .nav-links a:active {
        background: #f8fafc; /* 点击时的瞬时反馈 */
    }

    /* 语言选择器优化 */
    .lang-item {
        margin-top: 20px;
        padding: 10px;
    }
    .lang-select {
        width: 100%;
        height: 48px; /* 移动端标准高度 */
        font-size: 16px; /* 关键：16px 可防止 iOS 自动缩放页面 */
        border: 1px solid #e2e8f0;
        background-color: #f8fafc;
        padding: 0 15px;
        border-radius: 10px;
        color: #475569;
        /* 自定义下拉箭头 */
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 15px center;
        background-size: 18px;
    }

    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.3);
        z-index: 900;
        backdrop-filter: blur(2px);
    }

    .menu-overlay.active {
        display: block;
    }

    /* 汉堡按钮动画（可选：变X） */
    .menu-toggle.open .bar:nth-child(1) { transform: translateY(11px) rotate(45deg); }
    .menu-toggle.open .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.open .bar:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

    /* 移动端菜单头部布局 */
    .mobile-menu-header {
        display: flex;
        justify-content: right;
        align-items: center;
        padding: 0 10px 20px 10px;
        margin-bottom: 20px;
        border-bottom: 1px solid #f1f5f9;
    }

    .mobile-logo {
        font-weight: 800;
        color: var(--primary);
        font-size: 1.2rem;
    }

    /* 关闭按钮样式（X型） */
    .close-menu {
        width: 30px;
        height: 30px;
        position: relative;
        cursor: pointer;
    }

    .close-menu span {
        display: block;
        width: 100%;
        height: 2px;
        background: #64748b;
        position: absolute;
        top: 50%;
        left: 0;
    }

    /* 将两根线条交叉形成 X */
    .close-menu span:nth-child(1) {
        transform: rotate(45deg);
    }

    .close-menu span:nth-child(2) {
        transform: rotate(-45deg);
    }

    /* PC端隐藏这个头部 */
    .nav-links .mobile-menu-header {
        display: flex;
    }
}

/* 在非移动端隐藏移动端头部 */
@media (min-width: 769px) {
    .mobile-menu-header {
        display: none !important;
    }
}