/* view202604.css - 从 view202604.blade.php 提取的样式 */

: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; /* 改为 block，由内部 container 处理 flex */
    }
}

.nav-container {
    display: flex; 
    align-items: center; 
    justify-content: space-between; /* 核心：左右撑开 */
    padding: 0 20px; 
    height: 100%;
    width: 100%;
}

.logo { 
    font-size: 19px; 
    font-weight: 800; 
    color: #4a3700; 
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    flex-shrink: 0; /* 防止 logo 被挤压 */
}

.menu-toggle { 
    cursor: pointer; 
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 40px;
    /* 移除之前的 margin-left: auto，因为 space-between 已经处理了对齐 */
}

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

.main-content { padding: 40px; transition: var(--trans); }

/* 容器处理：移除所有 Grid 干扰 */
.grid-container {
    display: block !important;
    position: relative;
    width: 100%;
    margin: 0 auto;
}

/* 卡片基础样式：百分比必须精确 */
.card {
    float: left;
    /* 关键：使用 padding 来制造列与列之间的视觉间距 */
    /* 这样卡片的实际占用宽度依然是 25% 或 33.3%，能完美对齐右侧 */
    padding: 12px; 
    box-sizing: border-box;
    background: transparent; /* 背景透明，让内部容器显示白色 */
    box-shadow: none; 
    opacity: 0; transform: translateY(20px);
    transition: all 0.4s ease;
}

/* 在 .card 内部创建一个内容容器，实现视觉上的卡片 */
.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: all 0.4s ease;
}

.card:hover .card-content { 
    /* 去掉动画效果，只添加灰色的阴影效果 */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
}

.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. 右侧侧边栏 / 抽屉 ========= */
.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;
}

.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 { width: 25%; }

/* 2. 中大屏 (1200px - 1400px)：3列 (100% / 3) */
@media (max-width: 1400px) {
    :root { --side-width: 240px; }
    .card { width: 33.333%; }
}

/* 3. 中屏 (768px - 1200px)：2列 (100% / 2) */
@media (max-width: 1200px) {
    :root { --side-width: 200px; }
    .card { width: 50%; }
}

/* 4. 小屏幕/平板 (481px ~ 767px): 2列 + 布局切换 */
@media (max-width: 767px) {
    nav { display: block; }
    main { grid-template-columns: 1fr; margin-top: 80px; }
    .main-content { padding: 15px; }
    
    .card { 
        width: 50%; 
    }

    /* 侧边栏转为抽屉模式 */
    .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 { 
        width: 100%; 
        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;
}

.fade-up { animation: fadeUp 0.6s forwards; }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
