/* === 首页 Feature Section 样式 === */
.feature-section { display: flex; height: 450px; overflow: hidden; margin-bottom: 30px; animation: fadeInUp 0.8s ease backwards; border-radius: var(--radius); position: relative; background: var(--card-bg); }
.chess-left { flex: 1; position: relative; overflow: hidden; background-color: #fff; border-right: 1px solid rgba(0,0,0,0.05); }
.chess-bg-layer { position: absolute; top: -40%; left: -40%; width: 220%; height: 220%; z-index: 1; transform: rotate(-45deg); opacity: 0.65; pointer-events: none; display: flex; flex-direction: column; justify-content: center; gap: 25px; }
.chess-text-content { position: relative; z-index: 10; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 40px 50px; background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.7) 60%, rgba(255,255,255,0.4) 100%); }
.chess-title { font-size: 42px; font-weight: 900; color: #1a1a1a; line-height: 1.2; margin-bottom: 10px; letter-spacing: -1px; }
.chess-subtitle { font-size: 15px; color: #666; margin-bottom: 35px; letter-spacing: 0.5px; font-family: monospace; background: rgba(0,0,0,0.05); display: inline-block; padding: 4px 10px; border-radius: 4px; width: fit-content; }

.icon-scroll { display: flex; gap: 20px; width: fit-content; }
.icon-scroll.row-1 { animation: scrollLeft 30s linear infinite; }
.icon-scroll.row-2 { animation: scrollRight 35s linear infinite; margin-left: -150px; }
.icon-item { width: 130px; height: 130px; border-radius: 24px; display: flex; align-items: center; justify-content: center; font-size: 64px; flex-shrink: 0; color: #fff; box-shadow: 0 15px 35px rgba(0,0,0,0.2), 0 5px 15px rgba(0,0,0,0.1); text-shadow: 0 2px 10px rgba(0,0,0,0.1); background-color: #ddd; }

.icon-scroll .icon-item:nth-child(8n+1) { background: #ff7675; } 
.icon-scroll .icon-item:nth-child(8n+2) { background: #74b9ff; } 
.icon-scroll .icon-item:nth-child(8n+3) { background: #55efc4; }
.icon-scroll .icon-item:nth-child(8n+4) { background: #a29bfe; } 
.icon-scroll .icon-item:nth-child(8n+5) { background: #fdcb6e; } 
.icon-scroll .icon-item:nth-child(8n+6) { background: #6c5ce7; }
.icon-scroll .icon-item:nth-child(8n+7) { background: #e17055; } 
.icon-scroll .icon-item:nth-child(8n+8) { background: #00cec9; }

.chess-tags { display: flex; gap: 12px; z-index: 10; }
.tag-item { padding: 12px 28px; border-radius: 12px; color: #fff; font-size: 16px; font-weight: 700; transition: all 0.3s; cursor: pointer; border: 1px solid rgba(255,255,255,0.2); backdrop-filter: blur(5px); }
.tag-item:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.15); }
.tag-project { background: linear-gradient(135deg, #4096ff, #66b1ff); } 
.tag-university { background: linear-gradient(135deg, #ff7d00, #ff9f40); } 
.tag-life { background: linear-gradient(135deg, #00c48c, #36d399); }

.feature-right { flex: 1; position: relative; overflow: hidden; background: rgba(255,255,255,0.6); border-left: 1px solid rgba(0,0,0,0.02); backdrop-filter: blur(10px); }
.slider-track { display: flex; height: 100%; width: 100%; transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.slider-item { min-width: 100%; height: 100%; display: flex; flex-direction: column; padding: 0; position: relative; text-decoration: none; color: inherit; }
.slide-img-wrap { height: 65%; width: 100%; overflow: hidden; position: relative; }
.slide-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.slider-item:hover .slide-img-wrap img { transform: scale(1.05); }
.slide-content { height: 35%; padding: 25px 30px; display: flex; flex-direction: column; justify-content: center; background: rgba(255,255,255,0.4); }
.slide-tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #4096ff; margin-bottom: 8px; }
.slide-title { font-size: 22px; font-weight: 800; line-height: 1.3; color: #333; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slide-meta { font-size: 13px; color: #888; }
.slider-btn { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; background: rgba(255,255,255,0.9); border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10; box-shadow: 0 4px 15px rgba(0,0,0,0.1); border: none; transition: all 0.3s; opacity: 0; }
.feature-right:hover .slider-btn { opacity: 1; }
.slider-btn:hover { background: #000; color: #fff; transform: translateY(-50%) scale(1.1); }
.prev-btn { left: 20px; } .next-btn { right: 20px; }
.slider-dots { position: absolute; bottom: 20px; right: 30px; display: flex; gap: 8px; z-index: 10; }
.dot { width: 8px; height: 8px; background: rgba(0,0,0,0.2); border-radius: 50%; cursor: pointer; transition: all 0.3s; }
.dot.active { background: #000; width: 24px; border-radius: 4px; }
@keyframes scrollLeft { 0% { transform: translateX(0); } 100% { transform: translateX(-33.33%); } }
@keyframes scrollRight { 0% { transform: translateX(-33.33%); } 100% { transform: translateX(0); } }

/* === 首页内容区和侧边栏样式 === */
.main-grid { display: grid; grid-template-columns: 1fr 300px; gap: 30px; align-items: start; }
.content-left { animation: fadeInUp 0.8s ease 0.2s backwards; }
.category-bar { height: 60px; display: flex; align-items: center; padding: 0 20px; margin-bottom: 20px; overflow-x: auto; white-space: nowrap; -ms-overflow-style: none; scrollbar-width: none; background: var(--card-bg); }
.category-bar::-webkit-scrollbar { display: none; }
.cat-item { margin-right: 30px; font-weight: 600; color: var(--text-sub); cursor: pointer; position: relative; padding: 10px 0; transition: color 0.3s; flex-shrink: 0; }
.cat-item:hover, .cat-item.active { color: var(--text-main); }
.cat-item.active::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 20px; height: 3px; background: #000; border-radius: 2px; }
.article-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.article-card { display: flex; flex-direction: column; overflow: hidden; height: 420px; transition: transform 0.3s, box-shadow 0.3s; cursor: pointer; }
.article-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.ac-thumb { height: 200px; overflow: hidden; position: relative; flex-shrink: 0; }

/* 【核心修复】：为封面图强制添加宽高 100% 和裁剪适配，消灭白边 */
.ac-thumb img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.5s; 
    display: block; 
}
.article-card:hover .ac-thumb img { transform: scale(1.1); }

.ac-info { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.ac-meta { font-size: 12px; color: #999; margin-bottom: 8px; display: flex; justify-content: space-between; }
.ac-cat-tag { background: #000; color: #fff; padding: 2px 8px; border-radius: 4px; font-weight: bold; font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.ac-title { font-size: 18px; font-weight: bold; margin-bottom: 10px; line-height: 1.4; color: var(--text-main); transition: color 0.3s; }
.ac-desc { font-size: 14px; color: #666; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: auto; }
.ac-footer { margin-top: 15px; padding-top: 15px; border-top: 1px solid rgba(0,0,0,0.06); display: flex; justify-content: space-between; align-items: center; }
.ac-read-btn { font-size: 13px; font-weight: 700; color: var(--text-main); display: flex; align-items: center; gap: 5px; }
.ac-stats { display: flex; gap: 15px; font-size: 12px; color: #888; }
.stat-item { display: flex; align-items: center; gap: 4px; }

/* === 首页侧边栏样式 === */
.sidebar { display: flex; flex-direction: column; gap: 20px; animation: fadeInUp 0.8s ease 0.4s backwards; }
.profile-card { height: 320px; padding: 30px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.avatar { width: 100px; height: 100px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 5px 15px rgba(0,0,0,0.1); margin-bottom: 15px; overflow: hidden; }
.author-name { font-size: 20px; font-weight: bold; margin-bottom: 5px; }
.author-bio { font-size: 13px; color: #666; margin-bottom: 20px; max-width: 80%; }
.social-links { display: flex; gap: 15px; }
.social-btn { width: 40px; height: 40px; border-radius: 50%; background: #f0f0f0; display: flex; align-items: center; justify-content: center; transition: all 0.3s; color: #333; }
.social-btn:hover { background: #000; color: #fff; transform: translateY(-3px); }

.wechat-flip-container { width: 100%; height: 100px; perspective: 1000px; }
.wechat-card { position: relative; width: 100%; height: 100%; text-align: center; transition: transform 0.6s; transform-style: preserve-3d; border-radius: var(--radius); }
.wechat-flip-container:hover .wechat-card { transform: rotateY(180deg); }
.wc-front, .wc-back { position: absolute; width: 100%; height: 100%; top: 0; left: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); border: var(--card-border); }
.wc-front { background: #000; color: #fff; flex-direction: column; z-index: 2; transform: rotateY(0deg); }
.wc-front h4 { font-size: 16px; margin-bottom: 5px; } .wc-front p { font-size: 12px; opacity: 0.8; }
.wc-back { background: #fff; color: #000; transform: rotateY(180deg); }
.wc-back-content { display: flex; align-items: center; justify-content: center; gap: 20px; width: 100%; }
.wc-text { text-align: right; font-size: 13px; font-weight: bold; line-height: 1.4; }
.wc-qr { width: 60px; height: 60px; border-radius: 4px; overflow: hidden; }

.widget-title { font-size: 16px; font-weight: bold; margin-bottom: 15px; border-left: 3px solid #000; padding-left: 10px; }
.friend-links, .tags-card { padding: 20px; }
.friend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.friend-item { font-size: 13px; padding: 8px; background: rgba(255,255,255,0.4); border-radius: 8px; text-align: center; transition: 0.3s; }
.friend-item:hover { background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 12px; padding: 5px 12px; border: 1px solid #eee; border-radius: 20px; transition: 0.3s; cursor: pointer;}
.tag:hover { background: #000; color: #fff; border-color: #000; }

/* === 首页聊天室样式 === */
.chatroom-card { height: 400px; padding: 0; display: flex; flex-direction: column; }
.chat-header { padding: 15px; border-bottom: 1px solid rgba(0,0,0,0.05); font-weight: bold; font-size: 14px; background: rgba(255,255,255,0.5); border-radius: var(--radius) var(--radius) 0 0; }
.chat-messages { flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; scrollbar-width: none; -ms-overflow-style: none; }
.chat-messages::-webkit-scrollbar { width: 0px; height: 0px; background: transparent; }
.chat-input-area { padding: 10px; border-top: 1px solid rgba(0,0,0,0.05); display: flex; gap: 10px; background: rgba(255,255,255,0.5); border-radius: 0 0 var(--radius) var(--radius); position: relative; }
.chat-input { flex: 1; padding: 8px 12px; border: 1px solid #ddd; border-radius: 20px; font-size: 12px; outline: none; }
.chat-send { background: #000; color: #fff; border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; transition: 0.2s; }
.chat-send:hover { transform: scale(1.1); }
.emoji-btn { background: none; border: none; font-size: 18px; cursor: pointer; color: #666; padding: 0 5px; display: flex; align-items: center; transition: 0.2s; }
.emoji-btn:hover { color: #000; transform: scale(1.1); }
.emoji-picker { position: absolute; bottom: 50px; left: 10px; width: 260px; height: 180px; background: #fff; border: 1px solid #eee; border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.1); padding: 10px; display: none; grid-template-columns: repeat(8, 1fr); gap: 5px; overflow-y: auto; z-index: 100; scrollbar-width: none; }
.emoji-picker.active { display: grid; }
.emoji-item { font-size: 20px; cursor: pointer; text-align: center; padding: 5px; border-radius: 4px; }
.emoji-item:hover { background: #f0f0f0; }
.chat-msg { display: flex; gap: 10px; max-width: 85%; }
.chat-msg.self { align-self: flex-end; flex-direction: row-reverse; }
.chat-avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; }
.chat-bubble { background: #fff; padding: 8px 12px; border-radius: 12px; font-size: 12px; line-height: 1.5; color: #333; box-shadow: 0 2px 5px rgba(0,0,0,0.02); position: relative; }
.chat-msg.self .chat-bubble { background: #000; color: #fff; border-radius: 12px 0 12px 12px; }
.chat-msg:not(.self) .chat-bubble { border-radius: 0 12px 12px 12px; }
.chat-name { font-size: 10px; color: #999; margin-bottom: 2px; }
.chat-msg.self .chat-name { text-align: right; }

/* === 文章详情代码块样式 === */
.article-content pre { position: relative; background: #282c34; border-radius: 8px; padding: 30px 15px 15px 15px; margin: 20px 0; overflow-x: auto; color: #abb2bf; font-family: 'Consolas', 'Monaco', 'Courier New', monospace; border: 1px solid #3e4451; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.article-content pre::before { content: ''; position: absolute; top: 12px; left: 12px; width: 10px; height: 10px; border-radius: 50%; background: #ff5f56; box-shadow: 15px 0 0 #ffbd2e, 30px 0 0 #27c93f; }
.article-content code { font-family: inherit; font-size: 14px; background: transparent; padding: 0; color: inherit; }
.copy-code-btn { position: absolute; top: 6px; right: 8px; background: rgba(255, 255, 255, 0.1); color: #fff; border: none; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer; transition: 0.2s; opacity: 0; z-index: 10; }
.article-content pre:hover .copy-code-btn { opacity: 1; }
.copy-code-btn:hover { background: rgba(255, 255, 255, 0.2); }

/* === 分页器样式 === */
.pagination-container { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 40px 0; width: 100%; flex-wrap: wrap; }
.pg-btn { min-width: 36px; height: 36px; padding: 0 6px; border-radius: 8px; background: rgba(255, 255, 255, 0.6); border: 1px solid rgba(255, 255, 255, 0.4); backdrop-filter: blur(4px); color: #555; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 14px; transition: all 0.2s; user-select: none; }
.pg-btn:hover:not(.disabled):not(.active) { background: #fff; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0,0,0,0.08); color: #000; border-color: #fff; }
.pg-btn.active { background: #333; color: #fff; border-color: #333; cursor: default; }
.pg-btn.disabled { opacity: 0.5; cursor: not-allowed; background: rgba(200, 200, 200, 0.1); }
.pg-dots { color: #999; font-size: 12px; letter-spacing: 2px; margin: 0 2px; }
.pg-jump-wrap { display: flex; align-items: center; margin-left: 10px; gap: 5px; }
.pg-input { width: 40px; height: 36px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.4); background: rgba(255,255,255,0.6); text-align: center; font-size: 13px; outline: none; transition: 0.2s; }
.pg-input:focus { background: #fff; border-color: #333; }

/* === 移动端首页适配 === */
@media (max-width: 1024px) {
    .feature-section { height: auto; flex-direction: column; }
    .chess-left { flex: none; width: 100%; border-right: none; height: 380px; padding: 0; }
    
    /* 【核心修复】：顶部文案和标签居中，优化按钮排列 */
    .chess-text-content {
        padding: 30px 20px;
        align-items: center; /* 文本整体水平居中 */
        text-align: center;
    }
    .chess-title { font-size: 36px; }
    .chess-subtitle { margin-bottom: 25px; }
    
    .chess-tags { 
        width: 100%; 
        max-width: 400px; /* 限制最大宽度 */
        justify-content: center; /* 按钮整体居中 */
        gap: 12px; 
    }
    .tag-item { 
        flex: 1; /* 均匀瓜分宽度 */
        padding: 10px 0; /* 取消写死的左右宽度 */
        font-size: 14px; 
        text-align: center; /* 文字居中 */
    }

    .feature-right { display: none; }
    .main-grid { grid-template-columns: 1fr; gap: 20px; }
    .sidebar { display: none; }
    .chatroom-card { display: none !important; }
    .article-list { grid-template-columns: 1fr 1fr; gap: 10px; }
    .article-card { height: auto; min-height: auto; }
    .ac-thumb { height: 120px; }
    .ac-info { padding: 12px; }
    .ac-title { font-size: 14px; margin-bottom: 6px; }
    .ac-desc { font-size: 12px; -webkit-line-clamp: 2; margin-bottom: 8px; }
    .ac-footer { margin-top: 8px; padding-top: 8px; }
    .ac-read-btn { font-size: 12px; white-space: nowrap; }
}

@media (max-width: 768px) {
    .pagination-container { display: flex !important; opacity: 1 !important; visibility: visible !important; gap: 15px; margin: 20px 0 40px 0; }
    .pg-jump-wrap { display: none !important; }
}