:root {
    /* 定义全局默认（Skooby）主题色 */
    --color-main: 0 255 100;
    --color-dark: 0 100 40;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* 移除冗余的 theme-skooby，仅保留有差异的主题 */
body.theme-ales { --color-main: 255 50 80; --color-dark: 120 0 20; }
body.theme-tire { --color-main: 0 200 255; --color-dark: 0 80 120; }
body.theme-gman { --color-main: 180 50 255; --color-dark: 80 0 120; }

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: #050505;
    color: #ffffff;
    font-size: 16px;
    overflow: hidden; 
    transition: --color-main 0.8s ease;
    -webkit-tap-highlight-color: transparent;
}

.badge-today {
    position: absolute;
    top: 0px;
    right: 0px;
    background: #ff003c;
    color: #fff;
    font-size: 0.70rem;
    padding: 2px 8px;
    font-weight: 900;
    border-bottom-left-radius: 6px;
    border-top-right-radius: 4px;
    z-index: 20;
    letter-spacing: 0.5px;
    box-shadow: -2px 2px 8px rgba(0,0,0,0.5);
    text-transform: uppercase;
}

@keyframes pulse-red { 
    0%, 100% { opacity: 1; transform: scale(1); } 
    50% { opacity: 0.7; transform: scale(1.05); } 
}

/* --- 核心动画集 --- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes hueRotate { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } }
@keyframes foilShine { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }
@keyframes cyberBorderFlow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes scan { 0% { top: -10%; } 100% { top: 110%; } }

.fade-enter { animation: fadeIn 0.4s ease forwards; }
.hue-rotate { animation: hueRotate 6s linear infinite; }

/* --- 背景与遮罩 --- */
.bg-glow { position: fixed; inset: 0; background: radial-gradient(circle at 50% 0%, rgba(var(--color-main), 0.12) 0%, transparent 70%); z-index: -1; pointer-events: none; }
.glass-panel { background: rgba(5, 5, 5, 0.85); backdrop-filter: blur(10px); border: 1px solid rgba(var(--color-main), 0.4); box-shadow: 0 0 20px rgba(var(--color-main), 0.2); }

/* --- 预加载器 --- */
#preloader { position: fixed; inset: 0; background-color: #000; z-index: 99999; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity 0.5s ease; }
#preloader.hidden { display: none !important; }
.loading-bar-container { width: 80%; max-width: 400px; height: 4px; background: #222; border-radius: 2px; overflow: hidden; margin-top: 20px; }
.loading-bar { height: 100%; width: 0%; background: rgb(var(--color-main)); box-shadow: 0 0 10px rgb(var(--color-main)); transition: width 0.1s linear; }

/* --- UI 组件 --- */
.cyber-panel { background: rgba(10, 10, 10, 0.8); backdrop-filter: blur(16px); border: 1px solid rgba(var(--color-main), 0.2); box-shadow: 0 8px 32px rgba(0,0,0,0.6); border-radius: 8px; }

.cyber-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; background: rgba(var(--color-main), 0.05); color: rgb(var(--color-main)); border: 1px solid rgba(var(--color-main), 0.4); border-radius: 6px; font-weight: bold; cursor: pointer; transition: all 0.3s; white-space: nowrap; }
@media (hover: hover) { .cyber-btn:hover { background: rgb(var(--color-main)); color: #000; box-shadow: 0 0 15px rgba(var(--color-main), 0.5); transform: translateY(-1px); } }
.cyber-btn.active { background: rgb(var(--color-main)); color: #000; border-color: rgb(var(--color-main)); }

.btn-sci { position: relative; overflow: hidden; background: linear-gradient(45deg, rgba(0,0,0,0.8), rgba(20,20,20,0.9)); border: 1px solid rgba(var(--color-main), 0.5); color: rgb(var(--color-main)); transition: all 0.3s ease; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.btn-sci:hover { background: rgba(var(--color-main), 0.15); border-color: rgb(var(--color-main)); box-shadow: 0 0 15px rgba(var(--color-main), 0.6); text-shadow: 0 0 5px rgb(var(--color-main)); }

/* 修复了重复的焦点选择器 */
.cyber-input { background: rgba(0,0,0,0.6); border: 1px solid rgba(var(--color-main), 0.3); color: #fff; padding: 10px 14px; border-radius: 6px; width: 100%; transition: border-color 0.3s; }
.cyber-input:focus { border-color: rgb(var(--color-main)); box-shadow: 0 0 10px rgba(var(--color-main), 0.3); outline: none; }

.cyber-card { background: #0a0a0a; border: 1px solid rgba(var(--color-main), 0.15); border-radius: 8px; overflow: hidden; transition: all 0.3s ease; }
@media (hover: hover) { .cyber-card:hover { transform: translateY(-4px); border-color: rgba(var(--color-main), 0.6); box-shadow: 0 10px 20px rgba(var(--color-main), 0.15); } }

/* --- 标签与状态 --- */
.tag-ur { background-color: #ff55ff; color: #000; }
.tag-ssr { background-color: #ffcc00; color: #000; }
.tag-ss { background-color: #ff4444; color: #000; }
.tag-s { background-color: #00ffff; color: #000; }
.tag-r { background-color: #cccccc; color: #000; }

.status-overlay-dead { background-color: rgba(255, 0, 0, 0.4); }
.status-overlay-damaged { background-color: rgba(255, 200, 0, 0.3); }
.status-overlay-upgrading_blue { background-color: rgba(0, 100, 255, 0.4); }
.status-overlay-evolving { background-color: rgba(255, 100, 0, 0.4); }
.status-overlay-healthy { display: none; }

/* --- 滚动条排版 --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #050505; }
::-webkit-scrollbar-thumb { background: rgba(var(--color-main), 0.5); border-radius: 3px; }
.hide-scroll::-webkit-scrollbar { display: none; }
.hide-scroll { -ms-overflow-style: none; scrollbar-width: none; }

/* --- 瀑布流布局修复版 --- */
.waterfall-grid {
    display: block; /* 核心修复：移除 display: grid，改用块级结合列布局 */
    column-count: 2; /* 手机端 2 列 */
    column-gap: 16px;
    padding: 16px;
}
@media (min-width: 768px) { .waterfall-grid { column-count: 3; } } /* 平板 3 列 */
@media (min-width: 1024px) { .waterfall-grid { column-count: 4; } } /* 电脑 4 列 */

.waterfall-item {
    break-inside: avoid; /* 防止卡片被截断 */
    margin-bottom: 16px;
    position: relative;
    background: #0a0a0a;
    border: 1px solid rgba(var(--color-main), 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}
.waterfall-item:hover { transform: translateY(-5px); border-color: rgb(var(--color-main)); box-shadow: 0 10px 20px rgba(var(--color-main), 0.2); }
.waterfall-item.ratio-16-9 { aspect-ratio: 16 / 9; }
.waterfall-item.ratio-9-16 { aspect-ratio: 9 / 16; }
.waterfall-item img { width: 100%; display: block; height: auto; }

/* --- 播放器与覆盖物 --- */
#main-player { width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-container-16-9 { width: 100%; aspect-ratio: 16 / 9; background-color: #000; display: flex; align-items: center; justify-content: center; position: relative; }
.video-container-16-9 video { max-width: 100%; max-height: 100%; object-fit: contain; }

.play-overlay { position: absolute; left: 12px; bottom: 12px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; z-index: 10; }
.play-overlay i { font-size: 40px; color: #00ff64; }

/* --- 排版与特效实用类 --- */
.font-lcd { font-family: 'Orbitron', sans-serif; letter-spacing: 0.05em; }
.clip-path-slant { clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px); }
.rounded-xl, .rounded-lg, .rounded { border-radius: 0px !important; }

.cyber-flow-card {
    position: relative;
    background: #050505;
    padding: 1.5px;
    background-image: linear-gradient(90deg, #000 0%, var(--glow-color) 50%, #000 100%);
    background-size: 200% auto;
    animation: cyberBorderFlow 2.5s linear infinite;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}
.cyber-flow-card:hover { animation-duration: 1.2s; box-shadow: 0 0 25px var(--glow-color); }

.landing-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1s; }
.landing-slide.active { opacity: 0.6; }

/* --- 富文本定制 --- */
.prose-custom h1 { font-size: 1.8rem; font-weight: bold; margin: 1.5rem 0 1rem; border-bottom: 1px solid rgba(var(--color-main), 0.3); padding-bottom: 0.5rem; color: #fff; }
.prose-custom h1:first-child { margin-top: 0; }
.prose-custom h2 { color: rgb(var(--color-main)); font-size: 1.3rem; font-weight: bold; margin: 1.5rem 0 0.8rem; }
.prose-custom p { color: #cbd5e1; line-height: 1.8; margin-bottom: 1rem; font-size: 1.05rem; }
.prose-custom ul { list-style-type: square; margin-left: 1.5rem; color: #cbd5e1; margin-bottom: 1rem; line-height: 1.8; }