:root {
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-color: #3b82f6;
    --accent-color: #e11d48;
    --chat-width: 380px;
    --chat-height: 500px;
}

body, html {
    margin: 0; padding: 0; width: 100%; height: 100%; 
    background: linear-gradient(-45deg, #0f172a, #1e1b4b, #312e81, #020617);
    background-size: 400% 400%;
    animation: dynamicBG 20s ease infinite;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    color: #fff;
    overflow-y: auto; 
}

@keyframes dynamicBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==================== 
   1. 全局特效系统 
   ==================== */
/* 加载动画屏 */
#loader { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: #020617; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity 0.8s ease; }
.loader-text { font-size: 1.5rem; font-weight: 600; margin-bottom: 20px; letter-spacing: 3px; animation: pulse 1.5s infinite; color: #e2e8f0; }
.loader-bar { width: 200px; height: 2px; background: rgba(255,255,255,0.1); overflow: hidden; position: relative; border-radius: 2px;}
.loader-progress { width: 0%; height: 100%; background: var(--primary-color); animation: load 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes load { to { width: 100%; } }
@keyframes pulse { 50% { opacity: 0.6; } }

/* 赛博底层网格 */
.cyber-grid {
    position: fixed; bottom: 0; left: 0; width: 100vw; height: 50vh;
    background-image: linear-gradient(transparent 95%, rgba(59, 130, 246, 0.2) 100%),
                      linear-gradient(90deg, transparent 95%, rgba(59, 130, 246, 0.2) 100%);
    background-size: 50px 50px;
    transform: perspective(600px) rotateX(70deg);
    transform-origin: bottom center;
    z-index: 1; pointer-events: none;
    animation: gridMove 4s linear infinite;
    mask-image: linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0));
    -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0));
}
@keyframes gridMove { 0% { background-position: 0 0; } 100% { background-position: 0 50px; } }

.page-frame { position: fixed; top: 12px; bottom: 12px; left: 12px; right: 12px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 30px; pointer-events: none; z-index: 999; box-shadow: inset 0 0 30px rgba(0,0,0,0.5); }
.aurora-bg { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.6; animation: float-blob 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1); will-change: transform, filter; }
.blob.red { background: var(--accent-color); width: 45vw; height: 45vw; top: -10%; left: -10%; animation-delay: 0s; }
.blob.purple { background: #7c3aed; width: 35vw; height: 35vw; bottom: -5%; right: -5%; animation-delay: -5s; }
.blob.blue { background: var(--primary-color); width: 40vw; height: 40vw; top: 20%; left: 25%; animation-delay: -10s; }
@keyframes float-blob { 0% { transform: translate(0, 0) scale(1) rotate(0deg); filter: blur(100px) hue-rotate(0deg); } 100% { transform: translate(15%, 20%) scale(1.3) rotate(45deg); filter: blur(120px) hue-rotate(30deg); } }
.noise-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; opacity: 0.04; background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAAGFBMVEUAAAA5OTkAAABMTExERERmZmYzMzNmZmYAAAB36C1OAAAACHRSTlMAMwAozIqquzg3364AAABWSURBVDjLjYyxDcAgDNVekQGqnCANUyD2X6IEbUWT/yNfcp4vH3s5bdtCaR08H0W+CtV3p/p5p/p5p/p5p/p5p/p5p/p5p/p5p/p5p/p5p/p5p/p5p/p5/gW0tB5c5/37wAAAAABJRU5ErkJggg=='); }

/* 背景毛玻璃层：在背景之上、樱花之下 */
.background-glass {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    background: rgba(2, 6, 23, 0.08);
}

#canvas { position: fixed; top: 0; left: 0; z-index: 100; pointer-events: none; }

/* 前景毛玻璃层：在背景毛玻璃之上，模糊底层，z-index 低于樱花 */
.foreground-glass {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(2, 6, 23, 0.12);
}

/* ==================== 
   2. 核心网格布局 
   ==================== */
.bento-container,
.container {
    pointer-events: auto; /* 确保主内容区域可点击，不被前景层阻挡 */
}
.bento-container {
    position: relative; z-index: 10; 
    max-width: 1000px; 
    height: calc(100vh - 80px); 
    margin: 40px auto; 
    padding: 0 20px;
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    grid-template-rows: repeat(4, 1fr); 
    gap: 16px;
}

.bento-card {
    background: var(--glass-bg); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border); border-top: 1px solid rgba(255, 255, 255, 0.2); border-left: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px; padding: 20px; text-decoration: none; color: #fff;
    /* 优化动画属性，避免 all 带来的性能开销（卡顿），缩短为 0.2s */
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
                background 0.2s ease,
                border-color 0.2s ease,
                backdrop-filter 0.2s ease,
                -webkit-backdrop-filter 0.2s ease;
    display: flex; flex-direction: column; justify-content: center;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.3); position: relative; overflow: hidden; cursor: pointer;
    will-change: transform, box-shadow, backdrop-filter;
}
/* 只为 TECH & CREATIVE 和 音乐卡片 开启扫光特效 */
.skills-card::after, .music-card::after {
    content: ""; position: absolute; top: 0; left: -150%; width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.15), transparent);
    transform: skewX(-25deg); transition: 0s; z-index: 10; pointer-events: none;
}
.skills-card:hover::after, .music-card:hover::after {
    left: 200%; transition: 0.6s ease-in-out;
}
.bento-card:hover {
    background: rgba(255, 255, 255, 0.12); transform: translateY(-4px); border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    /* 动态模糊效果：悬浮时加深背景毛玻璃模糊度 */
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
}

/* 模块定位 */
.profile-card { 
    grid-column: span 2; grid-row: span 2; align-items: center; text-align: center; 
    /* 单独保留李业程卡片的 0.4s 丝滑长动画 */
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) !important; 
}
.link-card { grid-column: span 1; grid-row: span 1; align-items: center; text-align: center; }
.weather-card { position: relative; overflow: hidden; grid-column: span 1; grid-row: span 1; align-items: center; text-align: center; background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(0,0,0,0.2)); }
.weather-card .wt-content { transition: 0.3s; }
.weather-card:hover .wt-content { opacity: 0; transform: scale(0.9); }
.weather-hover-time { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; transition: 0.3s; background: rgba(0,0,0,0.5); backdrop-filter: blur(10px); color: #fff; font-size: 1rem; font-weight: bold; text-align: center; line-height: 1.5; padding: 10px; z-index: 10; pointer-events: none;}
.weather-card:hover .weather-hover-time { opacity: 1; transform: scale(1); }
.wt-icon { font-size: 2rem; margin-bottom: 10px; animation: floatIcon 3s ease-in-out infinite; }
@keyframes floatIcon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); text-shadow: 0 5px 15px rgba(255,255,255,0.4); } }
.music-card { grid-column: span 1; grid-row: span 1; flex-direction: column; align-items: center; justify-content: center; padding: 10px; gap: 8px; transition: 0.3s; text-align: center; }

.skills-card { grid-column: span 2; grid-row: span 1; padding: 20px; justify-content: flex-start;}
.social-card { display: none; }
.mail-card { grid-column: span 1; grid-row: span 1; align-items: center; text-align: center; }
/* 重构后的地理位置卡片背景 */
/* 市场观察卡片：拉伸为整排 */
.finance-card { grid-column: span 4; grid-row: span 1; padding: 14px 16px; flex-direction: column; gap: 8px; background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(0,0,0,0.12)); overflow: hidden; }
.finance-header { font-size: 0.9rem; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 6px; letter-spacing: 0.5px; }
.finance-icon { font-size: 1.1rem; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.6; transform: scale(1.1); } }
.finance-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; overflow: hidden; }
.fin-item { display: flex; flex-direction: column; background: rgba(255,255,255,0.03); border-radius: 10px; padding: 9px 10px; border: 1px solid rgba(255,255,255,0.06); transition: background 0.2s ease, border-color 0.2s ease; min-width: 0; overflow: hidden; }
.fin-item:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.22); transform: none; box-shadow: none; }
.fin-name { font-size: 0.74rem; color: rgba(255,255,255,0.58); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.fin-price { font-size: 1.05rem; font-weight: 700; color: #fff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.fin-change { font-size: 0.76rem; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,0.05); white-space: nowrap; }
.fin-up { color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.fin-down { color: #10b981; background: rgba(16, 185, 129, 0.1); }
.fin-etf { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 10px; background: rgba(239, 68, 68, 0.05); border: 1px solid rgba(239, 68, 68, 0.15); border-radius: 8px; padding: 9px 10px; transition: 0.2s; min-width: 0; }
.fin-etf:hover { background: rgba(239, 68, 68, 0.15); transform: translateY(-2px); }
.fin-etf-name { font-size: 0.86rem; font-weight: 700; color: #ff6b6b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.fin-etf-right { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.finance-loading { font-size: 0.8rem; color: rgba(255,255,255,0.5); text-align: center; width: 100%; padding: 20px 0; }

@media (max-width: 1200px) {
    .fin-price { font-size: 1rem; }
}

/* 音乐卡压缩为 1x1 后的内部尺寸优化 */
.music-card .record-container { width: 46px; height: 46px; }
.music-card .music-info { width: 100%; align-items: center; }
.music-card .music-text h4 { font-size: 0.76rem; margin-bottom: 2px; }
.music-card .music-text p { display: none; }
.music-card .progress-bar-bg { width: 100%; height: 5px; }
.music-card .play-btn-container { width: 34px; height: 34px; }

/* 个人资料卡 */
.avatar { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255,255,255,0.8); margin-bottom: 10px; box-shadow: 0 0 20px rgba(255,255,255,0.2); transition: 0.3s;}
.name { font-size: 4.5rem; font-weight: 800; margin: 0 0 5px 0; letter-spacing: 3px; background: linear-gradient(90deg, #fff, #a855f7, var(--primary-color), #fff); background-size: 200% auto; -webkit-background-clip: text; color: transparent; animation: textShine 1.2s linear infinite; }
@keyframes textShine { to { background-position: 200% center; } }
.motto { font-size: 1.25rem; font-family: "KaiTi", "STKaiti", serif; color: #e2e8f0; font-weight: 600; letter-spacing: 1px;}
.profile-content { transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.profile-hover { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; opacity: 0; transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); padding: 30px; box-sizing: border-box; text-align: center;}
.profile-hover p { font-size: 1.1rem; line-height: 1.6; color: #f8fafc; font-weight: 500; }
.profile-card:hover .profile-content { opacity: 0; transform: scale(0.95); }
.profile-card:hover .profile-hover { opacity: 1; }

/* 技能标签 */
.skills-title { 
    font-size: 0.8rem; text-transform: uppercase; margin-bottom: 8px; letter-spacing: 2px; 
    background: linear-gradient(90deg, rgba(255,255,255,0.4), #fff, rgba(255,255,255,0.4));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textShine 3s linear infinite;
}
.skills-grid { flex: 1; display: flex; flex-wrap: wrap; gap: 10px; align-content: center; justify-content: center; padding-top: 5px; }
.skill-tag { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); padding: 6px 12px; border-radius: 8px; font-size: 0.75rem; font-weight: 500; position: relative; overflow: hidden; animation: floatTag 4s ease-in-out infinite; }
.skill-tag:nth-child(odd) { animation-delay: 0.2s; } .skill-tag:nth-child(even) { animation-delay: 0.4s; }
@keyframes floatTag { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); border-color: rgba(255,255,255,0.25); box-shadow: 0 4px 10px rgba(0,0,0,0.15); } }
.skill-tag:hover { animation-play-state: paused; transform: scale(1.1) !important; }

/* 社交图标 */
.social-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; border-radius: 12px; transition: 0.3s; fill: #fff; opacity: 0.7;}
.social-item:hover { background: rgba(255,255,255,0.1); opacity: 1; transform: translateY(-2px);}
.social-item svg { width: 28px; height: 28px; margin-bottom: 5px; }
.social-label { font-size: 0.7rem; font-weight: 600; }

/* ==================== 
   音乐播放器高级动效与修复 
   ==================== */
.music-card.playing { border-color: rgba(225, 29, 72, 0.4); box-shadow: 0 15px 40px rgba(225, 29, 72, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2); animation: cardPulse 2s infinite alternate; }
@keyframes cardPulse { from { transform: translateY(0); } to { transform: translateY(-2px); } }

.record-container { position: relative; width: 60px; height: 60px; flex-shrink: 0; }
.vinyl-record { width: 100%; height: 100%; border-radius: 50%; background: #111; border: 3px solid #333; display: flex; align-items: center; justify-content: center; animation: spin 4s linear infinite; animation-play-state: paused; transition: 0.3s;}
.vinyl-record::after { content: ''; width: 15px; height: 15px; background: var(--accent-color); border-radius: 50%; border: 1px solid #fff; }
.music-card.playing .vinyl-record { animation-play-state: running; box-shadow: 0 0 20px rgba(225, 29, 72, 0.6); border-color: #444;}
@keyframes spin { 100% { transform: rotate(360deg); } }

.music-info { flex: 1; display: flex; flex-direction: column; justify-content: center; overflow: hidden; pointer-events: none; }
.music-text h4 { margin: 0 0 4px 0; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-text p { margin: 0 0 6px 0; font-size: 0.75rem; color: rgba(255,255,255,0.6); }

.progress-bar-bg { width: 100%; height: 6px; background: rgba(255,255,255,0.15); border-radius: 3px; cursor: pointer; position: relative; overflow: hidden; pointer-events: auto;}
.progress-bar-fill { height: 100%; width: 0%; background: var(--primary-color); border-radius: 3px; transition: width 0.1s linear; }
.music-card.playing .progress-bar-fill { box-shadow: 0 0 15px var(--primary-color), 0 0 5px #fff; }

/* 修复后的播放按钮 (使用 SVG 保证绝对居中) */
.play-btn-container {
    width: 40px; height: 40px; background: #fff; border-radius: 50%; 
    display: flex; align-items: center; justify-content: center; 
    flex-shrink: 0; transition: 0.3s; cursor: pointer; color: #000;
}
.music-card:hover .play-btn-container { transform: scale(1.1); box-shadow: 0 0 20px rgba(255,255,255,0.4); }
.play-icon-svg { width: 18px; height: 18px; fill: currentColor; transition: 0.2s; }

/* ==================== 
   重构后的地理位置卡片 (数据节点风格)
   ==================== */
.loc-node { display: flex; flex-direction: column; align-items: center; position: relative; z-index: 2;}
.node-label { font-size: 0.65rem; color: rgba(255,255,255,0.5); letter-spacing: 1px; margin-bottom: 4px; font-weight: 700;}
.node-value { font-size: 1rem; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 6px;}
.node-icon { font-size: 1.2rem; }

.loc-connector { flex: 1; height: 4px; background: rgba(255,255,255,0.1); margin: 0 20px; position: relative; border-radius: 4px; overflow: hidden;}
/* 动态流光数据线 */
.data-stream {
    position: absolute; top: 0; left: 0; height: 100%; width: 100%;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    background-size: 200% 100%;
    animation: streamFlow 3s linear infinite;
}
@keyframes streamFlow { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.travel-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -150%); font-size: 1rem; animation: floatTravel 3s ease-in-out infinite alternate;}
@keyframes floatTravel { from { transform: translate(-50%, -150%); } to { transform: translate(-50%, -180%); } }

/* 通用卡片元素 */
.card-icon { font-size: 2.2rem; margin-bottom: 8px; }
.card-title { font-size: 1rem; font-weight: 600; margin: 0; }
.card-sub { font-size: 0.75rem; color: rgba(255,255,255,0.5); margin-top: 4px; transition: 0.3s; }

/* AI与聊天框 */
.fab-ai { position: fixed; right: 40px; bottom: 40px; width: 60px; height: 60px; background: #fff; border-radius: 50%; box-shadow: 0 10px 25px rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; cursor: pointer; z-index: 150; transition: 0.3s; }
.fab-ai:hover { transform: scale(1.1); box-shadow: 0 15px 35px rgba(255,255,255,0.3); }
#chat-box { position: fixed; right: 40px; bottom: 120px; width: var(--chat-width); height: var(--chat-height); background: rgba(15, 23, 42, 0.9); backdrop-filter: blur(30px); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 24px; box-shadow: 0 20px 50px rgba(0,0,0,0.6); z-index: 200; display: flex; flex-direction: column; overflow: hidden; opacity: 0; transform: translateY(20px) scale(0.95); pointer-events: none; transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
#chat-box.active { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.chat-header { padding: 16px 20px; background: rgba(255, 255, 255, 0.05); border-bottom: 1px solid rgba(255, 255, 255, 0.08); display: flex; justify-content: space-between; align-items: center; }
.chat-title { color: #fff; font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.status-dot { width: 8px; height: 8px; background: #10a37f; border-radius: 50%; box-shadow: 0 0 8px #10a37f; }
.close-btn { background: none; border: none; color: rgba(255,255,255,0.5); font-size: 1.4rem; cursor: pointer; transition: 0.2s; }
.close-btn:hover { color: #fff; }
.chat-messages { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.message { max-width: 85%; padding: 12px 16px; border-radius: 16px; font-size: 0.9rem; line-height: 1.5; word-wrap: break-word; }
.message.user { align-self: flex-end; background: #fff; color: #000; border-bottom-right-radius: 4px; }
.message.ai { align-self: flex-start; background: rgba(255, 255, 255, 0.1); color: #eee; border: 1px solid rgba(255, 255, 255, 0.05); border-bottom-left-radius: 4px; }
.message.ai p { margin: 0 0 8px 0; } .message.ai p:last-child { margin: 0; }
.loading-dots span { display: inline-block; width: 4px; height: 4px; background: #aaa; border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; margin: 0 2px;}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; } .loading-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }
.chat-input-area { padding: 16px; background: rgba(255, 255, 255, 0.02); border-top: 1px solid rgba(255, 255, 255, 0.05); display: flex; gap: 10px; }
#user-input { flex: 1; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 20px; padding: 10px 16px; color: #fff; font-size: 0.9rem; outline: none; }
#send-chat-btn { background: #fff; color: #000; border: none; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s;}

@media (max-width: 768px) {
    body, html { overflow-y: auto; overflow-x: hidden; } 
    .page-frame { display: none; }
    .bento-container { height: auto; margin: 20px auto 100px; grid-template-columns: repeat(2, 1fr); grid-auto-rows: minmax(140px, auto); }
    .profile-card { grid-column: span 2; grid-row: span 2; }
    .music-card, .skills-card, .mail-card, .finance-card { grid-column: span 2; }
    .social-card, .weather-card { grid-column: span 1; }
    #chat-box { width: 90%; right: 5%; bottom: 100px; height: 60vh; }
    .fab-ai { right: 20px; bottom: 20px; }
}

/* ==================== 
   7. 子页面样式 (CODE / FILM / LIFE) 
   ==================== */
.container {
    position: relative; z-index: 10;
    max-width: 800px; margin: 0 auto;
    padding: 40px 20px;
}
.container.article-container { max-width: 700px; padding: 40px 20px 100px; }

/* 顶部导航：子页面固定顶栏，无痕渐变毛玻璃 */
.nav-header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex; justify-content: space-between; align-items: center;
    /* 取消左右负边距，让文字与下方列表对齐 */
    margin: -40px 0 40px 0; 
    padding: 40px 0 20px 0; 
}

/* 使用伪元素做全屏宽度的无痕渐变遮罩，消除生硬的矩形黑框 */
.nav-header::before {
    content: "";
    position: absolute;
    top: -20px; /* 向上延伸覆盖住刘海区 */
    left: -50vw; /* 延伸出 container 形成全屏宽 */
    width: 200vw;
    height: 160%; /* 高度稍微拉长，留出渐隐空间 */
    background: linear-gradient(to bottom, rgba(2, 6, 23, 0.9) 30%, rgba(2, 6, 23, 0) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* 用 mask 制造毛玻璃的柔和渐隐边缘，让滚动上来的内容丝滑消失 */
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    z-index: -1;
    pointer-events: none;
}
.page-title {
    font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em;
    background: linear-gradient(180deg, #ffffff, #a1a1a1); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.back-btn {
    text-decoration: none; color: rgba(255,255,255,0.6);
    font-size: 0.9rem; padding: 8px 16px;
    border: 1px solid var(--glass-border); border-radius: 50px;
    background: var(--glass-bg); transition: all 0.15s;
}
.back-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* 筛选器 */
.filter-section { display: flex; justify-content: flex-end; margin-bottom: 20px; }
#month-filter {
    background: var(--glass-bg); color: #fff;
    border: 1px solid var(--glass-border); padding: 8px 12px; border-radius: 8px;
    font-size: 0.9rem; outline: none; backdrop-filter: blur(10px); cursor: pointer;
}
#month-filter option { background: #1a1a1a; color: #fff; }

/* 列表卡片 */
.post-list { display: flex; flex-direction: column; gap: 20px; min-height: 200px; }
.post-card {
    display: block; text-decoration: none; background: var(--glass-bg);
    border: 1px solid var(--glass-border); border-radius: 16px; padding: 25px;
    /* 优化子页面文章列表的动画，引入动态模糊 */
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
                background 0.2s ease,
                border-color 0.2s ease,
                backdrop-filter 0.2s ease,
                -webkit-backdrop-filter 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    will-change: transform, box-shadow, backdrop-filter;
}
.post-card:hover {
    transform: translateY(-4px); background: rgba(255, 255, 255, 0.08); border-color: rgba(255,255,255,0.2);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    /* 动态模糊 */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}
.post-date { font-size: 0.8rem; color: rgba(255,255,255,0.4); margin-bottom: 8px; display: block; }
.post-title { font-size: 1.25rem; color: #fff; margin: 0 0 10px 0; font-weight: 600; }
.post-excerpt { font-size: 0.95rem; color: rgba(255,255,255,0.7); margin: 0; line-height: 1.6; }

/* 文章详情 */
.article-header { margin-bottom: 40px; }
.article-title { font-size: 2rem; font-weight: 700; margin: 0 0 10px 0; line-height: 1.3; }
.article-meta { font-size: 0.9rem; color: rgba(255,255,255,0.4); }
.article-content { font-size: 1.05rem; color: rgba(255,255,255,0.85); line-height: 1.8; }
.article-content h2 { 
    color: #fff; margin-top: 50px; margin-bottom: 25px; font-size: 1.4rem; 
    border-left: 4px solid var(--primary-color); padding-left: 15px;
}
.article-content p { margin-bottom: 20px; text-align: justify; }
.article-content strong { color: #fff; font-weight: 600; }
.article-content a {
    color: var(--accent-color); text-decoration: none; border-bottom: 1px solid rgba(225, 29, 72, 0.3);
    transition: all 0.15s ease; position: relative;
}
.article-content a:hover {
    color: #ff4d6d; border-bottom-color: #ff4d6d; background: rgba(225, 29, 72, 0.1);
    border-radius: 4px; padding: 0 4px; margin: 0 -4px;
}
.article-content a::after { content: " ↗"; font-size: 0.7em; opacity: 0.7; }

/* ==================== 
   8. 照片墙系统 (FILM 页面) 
   ==================== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding-bottom: 60px;
}
.photo-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s;
}
/* 照片采用固定宽高比防止错位，同时配合 object-fit */
.photo-card::before { content: ""; display: block; padding-top: 100%; /* 1:1 正方形网格 */ }
.photo-card img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.photo-card:hover { transform: translateY(-4px); box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); border-color: rgba(255,255,255,0.25); }
.photo-card:hover img { transform: scale(1.05); }

/* 照片悬浮层信息 */
.photo-info-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 30px 15px 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    opacity: 0; transition: opacity 0.3s;
    display: flex; flex-direction: column; justify-content: flex-end;
}
.photo-card:hover .photo-info-overlay { opacity: 1; }
.photo-date { font-size: 0.75rem; color: rgba(255,255,255,0.6); font-weight: 600; margin-bottom: 4px; }
.photo-remark-short { margin: 0; font-size: 0.9rem; color: #fff; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 放大灯光框 (Lightbox) */
.lightbox {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(2, 6, 23, 0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    z-index: 9999; display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.lightbox.active { opacity: 1; pointer-events: auto; }
.lightbox-close {
    position: absolute; top: 25px; right: 35px; color: rgba(255,255,255,0.5); font-size: 2.5rem;
    cursor: pointer; transition: 0.2s; z-index: 10000; padding: 10px; line-height: 1;
}
.lightbox-close:hover { color: #fff; transform: scale(1.1); }
.lightbox-content {
    position: relative; max-width: 90vw; max-height: 90vh;
    display: flex; flex-direction: column; align-items: center;
    transform: scale(0.95); transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.lightbox.active .lightbox-content { transform: scale(1); }
.lightbox-img {
    max-width: 100%; max-height: 75vh; border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1);
}
.lightbox-caption {
    margin-top: 20px; text-align: center; width: 100%; max-width: 800px;
    padding: 15px; background: rgba(255,255,255,0.03); border-radius: 12px; border: 1px solid rgba(255,255,255,0.05);
}
.lightbox-date { font-size: 0.85rem; color: var(--primary-color); font-weight: 600; margin-bottom: 6px; letter-spacing: 1px; }
.lightbox-remark { font-size: 1.05rem; color: #f8fafc; line-height: 1.6; font-weight: 400; }

/* ==================== 
   8. 影像美学 - 照片墙 (FILM) 
   ==================== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding-bottom: 40px;
}
.photo-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    aspect-ratio: 1 / 1;
}
.photo-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}
.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.photo-card:hover img {
    transform: scale(1.05);
}
.photo-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-sizing: border-box;
}
.photo-card:hover .photo-info-overlay {
    opacity: 1;
}
.photo-date {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 4px;
    display: block;
}
.photo-remark-short {
    font-size: 0.9rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 全屏灯光展示 (Lightbox) */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}
.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    z-index: 10000;
}
.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}
.lightbox-content {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.lightbox-img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    object-fit: contain;
}
.lightbox-caption {
    margin-top: 20px;
    color: #fff;
    text-align: center;
    max-width: 600px;
}
.lightbox-date {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 8px;
}
.lightbox-remark {
    font-size: 1.1rem;
    line-height: 1.5;
}
