/* view202604.css - 完整优化版 */

:root {
    --side-width: 280px; 
    --bg-site: #f4f7f9;
    --apple-blue: #0071e3;
    --apple-text: #1d1d1f;
    --apple-secondary: #86868b;
    --radius-card: 22px;
    --trans: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --nav-grad-deep: linear-gradient(135deg, #ffca28 0%, #ffa000 100%);
    --warning-red: #ff3b30; 
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
    background: var(--bg-site);
    color: var(--apple-text);
    overflow-x: hidden;
}

/* ========= 1. 顶部导航栏 ========= */
nav {
    position: fixed; 
    top: 0; 
    left: 20px;
    width: calc(100% - 40px);
    height: 64px;
    background: var(--nav-grad-deep);
    z-index: 1200;
    display: none; 
    border-radius: 0 0 22px 22px;
    box-shadow: 0 4px 25px rgba(255, 160, 0, 0.25);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-top: none;
    overflow: hidden;
}

@media (max-width: 768px) {
    nav { display: block; }
}

.nav-container {
    display: flex; 
    align-items: center; 
    justify-content: space-between;
    padding: 0 20px; 
    height: 100%;
}

.logo { 
    font-size: 19px; 
    font-weight: 800; 
    color: #4a3700; 
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
}

/* ========= 2. 主体布局与卡片基础 ========= */
main {
    display: grid;
    grid-template-columns: 1fr var(--side-width);
    min-height: 100vh;
}

.main-content { 
    padding: 40px; 
    transition: var(--trans);
    min-height: 100vh;
    position: relative; /* 给 Masonry 一个定位基准 */
}

.grid-container {
    display: block !important;
    position: relative;
    width: 100%;
}

.grid-container:after {
    content: '';
    display: block;
    clear: both;
}

.card {
    float: left;
    padding: 12px; 
    box-sizing: border-box;
    background: transparent;
    opacity: 0; 
    /* 1. 基础状态：只设置位移，强制缩放为 1 */
    transform: translateY(20px) scale(1); 
    /* 使用更平滑的 Apple 进场曲线，去掉 all，只针对 opacity 和 transform */
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.23, 1, 0.32, 1); 
}

/* 2. 激活状态：向上贴合，保持缩放不变 */
.card.fade-up {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

/* 3. 卡片内容容器：移除 transition: all */
.card-content {
    background: #fff;
    border-radius: var(--radius-card);
    padding: 28px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    height: 100%;
    /* 核心修改：只对阴影和背景进行过渡，避免浏览器因计算盒子模型产生的微小缩放错觉 */
    transition: box-shadow 0.4s ease, background 0.4s ease;
}

/* 4. 悬停效果：确保 hover 时也没有缩放 */
.card:hover .card-content { 
    box-shadow: 0 8px 24px rgba(0,0,0,0.08); 
    transform: none !important;
}

.card-content h3 { font-size: 17px; line-height: 1.5; margin-bottom: 12px; }
.card-translation { font-size: 13px; color: var(--apple-secondary); margin-bottom: 20px; }

.card-author {
    display: flex; align-items: center; justify-content: flex-end; gap: 14px;
    padding-top: 18px; border-top: 1px solid rgba(0,0,0,0.04);
}
.author-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* ========= 3. 特殊样式：系统推荐链接卡片 (system-link-card) ========= */
/* 支持a标签作为卡片容器 */
a.system-link-card {
    text-decoration: none;
    color: inherit;
    display: block;
    cursor: pointer;
}

.system-link-card .card-content {
    /* 左上白色到右下浅黄色的渐变背景 */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 248, 200, 0.9) 100%);
    border: 1px solid rgba(255, 200, 50, 0.3);
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(255, 200, 50, 0.05);
    /* 5. 系统链接卡片同步优化 */
    /* 同样移除 transition: all */
    transition: box-shadow 0.4s ease, border-color 0.4s ease, background 0.4s ease;
}

/* 移除粗边框伪元素 */
.system-link-card .card-content:before {
    display: none;
}

/* 右上角推荐徽章 */
.system-link-card .card-content:after {
    content: 'Hot';
    position: absolute;
    top: 12px;
    right: -25px;
    background: rgba(255, 200, 50, 0.8);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    padding: 2px 30px;
    transform: rotate(45deg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: background 0.4s ease;
}

/* 悬停状态：加深渐变背景 */
.system-link-card:hover .card-content {
    /* 保持用户满意的悬停渐变背景色效果 */
    background: linear-gradient(135deg, rgba(255, 250, 230, 1) 0%, rgba(255, 235, 150, 0.9) 100%);
    border-color: rgba(255, 160, 0, 0.5);
    box-shadow: 0 12px 30px rgba(255, 160, 0, 0.12);
    /* 5. 系统链接卡片同步优化 */
    transform: none !important;
}

.system-link-card:hover .card-content:after {
    background: rgba(255, 160, 0, 1);
}

/* 移除h3内部的a标签样式，因为整个卡片已经是链接 */
.system-link-card h3 {
    color: #856404;
    transition: all 0.3s ease;
}

.system-link-card .card-translation {
    color: #9a8466;
    font-size: 13px;
    line-height: 1.6;
}

.system-link-card .card-author {
    border-top: 1px dashed rgba(255, 200, 50, 0.2);
}

.system-link-card .author-name {
    color: #856404;
    font-weight: 700;
}

/* ========= 3. 右侧侧边栏 / 抽屉 ========= */
.side-wrapper {
    position: fixed; right: 0; top: 0; width: var(--side-width); height: 100vh;
    background: var(--bg-site); z-index: 1500;
    border-left: 1px solid rgba(0,0,0,0.05);
    transition: transform var(--trans), width var(--trans);
}

.close-drawer {
    position: absolute; 
    top: 10px; 
    right: 10px;
    width: 40px; 
    height: 40px; 
    display: none; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    z-index: 20;
    color: var(--warning-red);
    font-size: 50px; 
    background: transparent;
    transition: all 0.2s ease;
}
.close-drawer:active { 
    background: var(--warning-red); 
    color: white; 
    transform: scale(0.9); 
}

.accordion-container { display: flex; flex-direction: column; height: 100%; width: 100%; }

.accordion-item {
    flex: 1; position: relative; cursor: pointer; overflow: hidden;
    transition: flex var(--trans); display: flex; flex-direction: column;
}

.accordion-item.active { flex: 10; }

.item-inner { height: 100%; width: 100%; border-radius: 30px 0 0 0; position: relative; }

.item-1 .item-inner { background: linear-gradient(180deg, rgba(255,149,0,0.1) 0%, transparent 100%); }
.item-2 .item-inner { background: linear-gradient(180deg, rgba(0,113,227,0.1) 0%, transparent 100%); }
.item-3 .item-inner { background: linear-gradient(180deg, rgba(52,199,89,0.1) 0%, transparent 100%); }
.item-4 .item-inner { background: linear-gradient(180deg, rgba(175,82,222,0.1) 0%, transparent 100%); }

.active .item-inner { box-shadow: inset 0 0 40px rgba(255,255,255,0.5); border-left: 1px solid rgba(0,0,0,0.05); }

.item-header { height: 70px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; }
.item-title { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.chevron { font-size: 11px; opacity: 0.5; transition: transform 0.4s; }
.active .chevron { transform: rotate(180deg); }

.item-body { display: none; padding: 0 20px 20px; overflow-y: auto; flex: 1; }

.menu-list { 
    list-style: none; 
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.menu-list li {
    flex: 0 0 auto;
}
.menu-list li a {
    display: inline-block; 
    padding: 10px 16px; 
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.15) 0%, rgba(255, 149, 0, 0.08) 100%);
    border-radius: 20px; 
    margin: 0;
    text-decoration: none;
    color: var(--apple-text); 
    font-size: 13px; 
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 149, 0, 0.2);
    white-space: nowrap;
}
.menu-list li a:hover { 
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.25) 0%, rgba(255, 149, 0, 0.15) 100%);
    border-color: rgba(255, 149, 0, 0.3);
    transform: none; /* 移除凸起效果 */
}

/* ========= 标签列表样式（优化版） ========= */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px; /* 增大标签间隔 */
    margin-top: 10px;
}

.tags-list a {
    display: inline-flex;
    align-items: center;
    padding: 0;
    color: #666666;
    text-decoration: none;
    font-size: 14px; /* 增大字体 */
    font-weight: 500;
    transition: color 0.2s ease;
    white-space: nowrap;
    position: relative;
}

.tags-list a:before {
    content: "#";
    margin-right: 5px; /* 增大图标与文字间距 */
    color: #888888;
    font-weight: 600;
    font-size: 15px; /* 增大#符号字体 */
    transition: color 0.2s ease;
}

.tags-list a:hover {
    color: #333333;
    transform: none;
}

.tags-list a:hover:before {
    color: #0071e3;
}

/* ========= 友情链接列表样式（极简版） ========= */
.links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-top: 10px;
}

.links-list a {
    display: inline-flex;
    align-items: center;
    padding: 0;
    
    /* 核心修改：灰色文字，无下划线，无边框，无背景 */
    color: #888888; 
    text-decoration: none !important; 
    
    /* 核心修改：强制不换行 */
    white-space: nowrap; 
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis; /* 文字过长显示省略号 */

    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
    position: relative;
    max-width: 100%;
}

.links-list a:hover {
    /* 悬停时文本颜色变深 */
    color: #333333; 
    text-decoration: none;
}

.links-list a:after {
    content: '↗';
    margin-left: 4px;
    font-size: 11px;
    color: #aaaaaa;
    opacity: 0.7;
    transition: color 0.2s ease;
    flex-shrink: 0; /* 确保小图标不被挤压 */
}

.links-list a:hover:after {
    color: #666666;
}

/* ========= 系统链接列表样式（突出显示版） ========= */
.system-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 149, 0, 0.1);
}

/* 闪光动画关键帧 - 从左上角到右下角 */
@keyframes flashEffect {
    0% {
        background-position: -100% -100%;
    }
    10% {
        background-position: 100% 100%;
    }
    100% {
        background-position: 100% 100%;
    }
}

.system-list a {
    display: block;
    width: 100%;
    padding: 16px 20px;
    border-radius: 16px;
    text-decoration: none;
    color: var(--apple-text);
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    text-align: center;
    
    /* 闪光效果背景 */
    background: 
        /* 闪光层 - 白色渐变对角线 */
        linear-gradient(
            135deg,
            transparent 0%,
            transparent 40%,
            rgba(255, 255, 255, 0.1) 45%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0.1) 55%,
            transparent 60%,
            transparent 100%
        ),
        /* 主渐变背景层 */
        linear-gradient(135deg, rgba(0, 113, 227, 0.15) 0%, rgba(0, 113, 227, 0.08) 100%);
    
    background-size: 300% 300%, 100% 100%;
    background-position: -100% -100%, 0 0;
    background-repeat: no-repeat;
    
    /* 初始不显示闪光，5秒后开始动画 */
    animation: flashEffect 0.8s ease-in-out 5s forwards;
}

/* 为不同位置的链接设置不同的渐变颜色 */
.system-list a:nth-child(1) {
    background: 
        linear-gradient(
            135deg,
            transparent 0%,
            transparent 40%,
            rgba(255, 255, 255, 0.1) 45%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0.1) 55%,
            transparent 60%,
            transparent 100%
        ),
        linear-gradient(135deg, rgba(0, 113, 227, 0.15) 0%, rgba(0, 113, 227, 0.08) 100%);
    background-size: 300% 300%, 100% 100%;
    background-position: -100% -100%, 0 0;
    border-color: rgba(0, 113, 227, 0.2);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.1);
}

.system-list a:nth-child(2) {
    background: 
        linear-gradient(
            135deg,
            transparent 0%,
            transparent 40%,
            rgba(255, 255, 255, 0.1) 45%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0.1) 55%,
            transparent 60%,
            transparent 100%
        ),
        linear-gradient(135deg, rgba(52, 199, 89, 0.15) 0%, rgba(52, 199, 89, 0.08) 100%);
    background-size: 300% 300%, 100% 100%;
    background-position: -100% -100%, 0 0;
    border-color: rgba(52, 199, 89, 0.2);
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.1);
}

.system-list a:nth-child(3) {
    background: 
        linear-gradient(
            135deg,
            transparent 0%,
            transparent 40%,
            rgba(255, 255, 255, 0.1) 45%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0.1) 55%,
            transparent 60%,
            transparent 100%
        ),
        linear-gradient(135deg, rgba(175, 82, 222, 0.15) 0%, rgba(175, 82, 222, 0.08) 100%);
    background-size: 300% 300%, 100% 100%;
    background-position: -100% -100%, 0 0;
    border-color: rgba(175, 82, 222, 0.2);
    box-shadow: 0 4px 12px rgba(175, 82, 222, 0.1);
}

.system-list a:nth-child(4) {
    background: 
        linear-gradient(
            135deg,
            transparent 0%,
            transparent 40%,
            rgba(255, 255, 255, 0.1) 45%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0.1) 55%,
            transparent 60%,
            transparent 100%
        ),
        linear-gradient(135deg, rgba(255, 59, 48, 0.15) 0%, rgba(255, 59, 48, 0.08) 100%);
    background-size: 300% 300%, 100% 100%;
    background-position: -100% -100%, 0 0;
    border-color: rgba(255, 59, 48, 0.2);
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.1);
}

.system-list a:nth-child(5) {
    background: 
        linear-gradient(
            135deg,
            transparent 0%,
            transparent 40%,
            rgba(255, 255, 255, 0.1) 45%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0.1) 55%,
            transparent 60%,
            transparent 100%
        ),
        linear-gradient(135deg, rgba(255, 149, 0, 0.15) 0%, rgba(255, 149, 0, 0.08) 100%);
    background-size: 300% 300%, 100% 100%;
    background-position: -100% -100%, 0 0;
    border-color: rgba(255, 149, 0, 0.2);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.1);
}

/* 悬停效果 - 移除上移效果，只改变背景和阴影 */
.system-list a:hover {
    background-position: 100% 100%, 0 0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    /* 移除 transform: translateY(-2px); */
}

.system-list a:after {
    content: '🚀';
    margin-left: 8px;
    font-size: 14px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.system-list a:hover:after {
    opacity: 1;
    transform: translateX(3px);
}

/* 响应式调整 */
@media (max-width: 767px) {
    .system-list a {
        padding: 14px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .system-list a {
        padding: 12px 14px;
        font-size: 13px;
    }
}

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

/* ========= 4. 响应式断点 ========= */

/* --- 响应式断点细分 --- */

/* 1. 大屏 (>1400px)：4列 (100% / 4) */
/* .card 宽度已在文件末尾统一定义 */

/* 2. 中大屏 (1200px - 1400px)：3列 (100% / 3) */
@media (max-width: 1400px) {
    :root { --side-width: 240px; }
    /* .card 宽度已在文件末尾统一定义 */
}

/* 3. 中屏 (768px - 1200px)：2列 (100% / 2) */
@media (max-width: 1200px) {
    :root { --side-width: 200px; }
    /* .card 宽度已在文件末尾统一定义 */
}

/* 4. 小屏幕/平板 (481px ~ 767px): 2列 + 布局切换 */
@media (max-width: 767px) {
    nav { display: block; }
    main { grid-template-columns: 1fr; margin-top: 80px; }
    .main-content { padding: 15px; }
    
    /* .card 宽度已在文件末尾统一定义 */

    /* 侧边栏转为抽屉模式 */
    .side-wrapper {
        transform: translateX(100%);
        width: 280px;
        position: fixed;
        background: #fff; /* 抽屉模式使用白色背景 */
        padding-top: 80px; /* 为关闭按钮留出空间 */
    }
    
    /* 确保激活状态能正确显示 */
    .side-wrapper.active { 
        transform: translateX(0); 
        box-shadow: -15px 0 40px rgba(0,0,0,0.1); 
    }
    
    /* 显示关闭按钮 */
    .close-drawer { 
        display: flex; 
    }
}

/* 5. 手机端 ( < 480px): 1列 */
@media (max-width: 480px) {
    .card { 
        padding: 10px 0; /* 手机端减小左右间距 */
    }
}

/* 大屏调整 */
@media (min-width: 1601px) {
    :root { --side-width: 280px; }
}

@media (max-width: 1600px) {
    :root { --side-width: 260px; }
}

/* Masonry 容器样式 */
.grid-container:after {
    content: '';
    display: block;
    clear: both;
}

/* 确保网格容器有明确的定位上下文 */
#cardGrid {
    position: relative;
    width: 100% !important;
    min-height: 100px; /* 初始占位 */
    margin: 0 auto;
    transition: width 0.3s ease; /* 配合侧边栏动画平滑缩放 */
}

/* 添加或修改加载器样式 */
#infinite-loader {
    width: 100%;
    clear: both; /* 强制它在瀑布流下方 */
    display: block;
    margin-top: 30px;
    padding: 40px 0;
    text-align: center;
    position: relative; /* 确保它在文档流中占位 */
    z-index: 10;
    grid-column: 1 / -1; /* 如果在 grid 内部，强制横跨所有列 */
    visibility: visible !important;
}

/* 强制 Masonry 的列宽参考元素 */
.masonry-grid-sizer, .card { width: 25%; } /* 大屏 4 列 */

@media (max-width: 1400px) {
    .masonry-grid-sizer, .card { width: 33.333%; } /* 3 列 */
}
@media (max-width: 1200px) {
    .masonry-grid-sizer, .card { width: 50%; } /* 2 列 */
}
@media (max-width: 480px) {
    .masonry-grid-sizer, .card { width: 100%; } /* 1 列 */
}

/* ========= 系统链接卡片样式 ========= */
.system-link-card .card-content {
    /* 左上白色到右下浅黄色的渐变背景 */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 248, 200, 0.9) 100%);
    border: 1.5px solid rgba(255, 200, 50, 0.25);
    position: relative;
    overflow: hidden;
}

.system-link-card .card-content:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ffeb96 0%, #ffc832 100%);
    border-radius: var(--radius-card) var(--radius-card) 0 0;
}

.system-link-card h3 a {
    color: #d4a017;
    transition: color 0.3s ease;
}

.system-link-card h3 a:hover {
    color: #b8860b;
}

.system-link-card .card-translation {
    color: #8b7355;
}

.system-link-card .author-name {
    color: #d4a017;
}

.system-link-card .author-title {
    color: #8b7355;
}

/* 系统链接卡片悬停效果 - 移除上移效果，只改变阴影和边框 */
.system-link-card:hover .card-content {
    /* 保持用户满意的悬停渐变背景色效果 */
    background: linear-gradient(135deg, rgba(255, 250, 230, 1) 0%, rgba(255, 235, 150, 0.9) 100%);
    box-shadow: 0 8px 25px rgba(255, 200, 50, 0.2);
    border-color: rgba(255, 200, 50, 0.35);
}

/* 响应式调整 */
@media (max-width: 767px) {
    .system-link-card .card-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .system-link-card .card-content {
        padding: 16px;
    }
}
