/* ========================================== */
/* 📜 核心字体与主环境控制区 */
/* ========================================== */
:root { 
    --current-theme: #ffdde1; 
    color-scheme: light; 
}

/* 🌟 核心魔法：强制所有元素包含边框计算大小 */
*, *::before, *::after {
    box-sizing: border-box;
}

body { 
    /* 💡 改为最稳定、加载最快的全平台系统默认字体链 */
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #fff5f7; 
    background-image: radial-gradient(#ffdde1 2px, transparent 2px); 
    background-size: 30px 30px; 
    margin: 0; padding: 20px; min-height: 100vh; display: block; 
    color: #333;
}

/* ========================================== */
/* 🌌 动态背景层 */
/* ========================================== */
.dynamic-bg {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw; height: 100vh; z-index: 0; 
    background-size: cover !important; 
    background-position: center 20% !important; 
    background-repeat: no-repeat !important;
    transition: opacity 1s ease-in-out;
    pointer-events: none;
}
@media screen and (max-width: 850px) { .dynamic-bg { display: none; } }

/* ========================================== */
/* 💻 电脑桌面端大架构主体区块 */
/* ========================================== */
.app-window {
    width: 100%; max-width: 1400px; margin: 0 auto; 
    background: transparent; backdrop-filter: none; border: none; box-shadow: none; padding: 0;
    display: flex; flex-direction: column; position: relative; z-index: 1; 
}

.main-layout { display: flex; flex: 1; background: transparent; border-radius: 30px; }

/* 📂 侧边栏 */
.sidebar {
    width: 250px; min-width: 250px; max-width: 250px; flex-shrink: 0; padding: 25px 0 25px 15px; z-index: 3;
    border-right: 3px solid var(--current-theme); display: flex; flex-direction: column; align-items: flex-end; transition: border-color 0.4s ease;
    position: sticky; top: 20px; height: calc(100vh - 40px); overflow-y: auto; overflow-x: hidden; border-radius: 30px 0 0 30px; align-self: flex-start; 
}
.sidebar::-webkit-scrollbar { width: 0px; } 

.tab-btn { display: flex; align-items: center; justify-content: space-between; background: rgba(255, 255, 255, 0.95); border: 3px solid var(--tab-color); border-right: none; padding: 12px 15px; border-radius: 20px 0 0 20px; margin-bottom: 12px; margin-right: -3px; cursor: pointer; font-size: 15px; font-weight: 900; color: var(--tab-color); transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); width: 82%; position: relative; }
.tab-btn::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: inherit; box-shadow: -3px 3px 10px rgba(0,0,0,0.03); z-index: -1; }
.tab-btn:hover { width: 90%; filter: brightness(0.95); }
.tab-btn.active { width: 100%; background: var(--tab-color); color: #ffffff; z-index: 5; box-shadow: -5px 5px 15px rgba(0,0,0,0.1); }
.tab-left { display: flex; align-items: center; gap: 10px; overflow: hidden; width: 100%; }
.tab-icon { width: 30px; height: 30px; object-fit: contain; border-radius: 50%; background: #fff; padding: 2px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); flex-shrink: 0; }
.tab-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }

/* 🖼️ 内容区 */
.content-area { flex: 1; background: transparent; padding: 30px 40px; position: relative; z-index: 2; border-radius: 0 30px 30px 0; height: auto; overflow: visible; }
.content-area::-webkit-scrollbar { width: 8px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb { background-color: var(--current-theme); border-radius: 10px; }

.agency-section { display: none; animation: slideUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.agency-section.active { display: block; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.agency-title-search { display: none; font-size: 18px; font-weight: 900; color: #fff; padding: 6px 18px; border-radius: 20px; margin-bottom: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); width: fit-content; }

/* 👑 各大企划横幅 */
div[class*="-banner"] { border-radius: 20px; padding: 25px 20px; text-align: center; margin-bottom: 50px; position: relative; overflow: hidden; border: 3px solid var(--current-theme); }
.pro765-banner { background: linear-gradient(135deg, #f34f6d, #ff8da1) !important; box-shadow: 0 10px 25px rgba(243, 79, 109, 0.3) !important; }
.sidem-banner { background: linear-gradient(135deg, #0fbe94, #5ef0ce) !important; box-shadow: 0 10px 25px rgba(15, 190, 148, 0.3) !important; }
.ml-banner { background: linear-gradient(135deg, #ffc30b, #FFDE7C) !important; box-shadow: 0 10px 25px rgba(255, 195, 11, 0.3) !important; }
.cg-banner { background: linear-gradient(135deg, #4b7bd5, #a3c1ff) !important; box-shadow: 0 10px 25px rgba(75, 123, 213, 0.3) !important; }
.sc-banner { background: linear-gradient(135deg, #8dbbff, #bce2ff) !important; box-shadow: 0 10px 25px rgba(141, 187, 255, 0.3) !important; }
.gk-banner { background: linear-gradient(135deg, #ff9800, #ffb74d) !important; box-shadow: 0 10px 25px rgba(255, 152, 0, 0.3) !important; }
.pro876-banner { background: linear-gradient(135deg, #656a75, #8b92a0) !important; box-shadow: 0 10px 25px rgba(101, 106, 117, 0.3) !important; }

div[class*="-banner"] h2, div[class*="-banner"] h3 { margin: 0; font-size: 28px; font-weight: 900; letter-spacing: 2px; color: #ffffff !important; text-shadow: 2px 2px 4px rgba(0,0,0,0.2) !important; }
div[class*="-banner"] p { margin: 10px 0 0 0; font-size: 15px; font-weight: bold; color: #ffffff !important; text-shadow: 1px 1px 2px rgba(0,0,0,0.2) !important; }

/* 🌟 中部分类大框 */
.ml-unit-section, .cg-unit-section, .sc-unit-section, .gk-unit-section { margin-bottom: 60px; padding: 30px 25px 20px; border-radius: 25px; border: 3px solid var(--unit-color, #d6e8ff); position: relative; z-index: 1; scroll-margin-top: 80px; }
.ml-unit-section::before, .cg-unit-section::before, .sc-unit-section::before, .gk-unit-section::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255, 255, 255, 0.6); opacity: 1; z-index: -1; border-radius: 22px; backdrop-filter: blur(3px); }
.ml-unit-title, .cg-unit-title, .sc-unit-title, .gk-unit-title { display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 900; color: #fff; background: var(--unit-color, #3f51b5); padding: 8px 25px; border-radius: 30px; margin-top: -55px; margin-bottom: 30px; box-shadow: 0 6px 15px rgba(0,0,0,0.15); border: 3px solid #fff; }
.ml-unit-logo, .cg-unit-logo, .sc-unit-logo, .gk-unit-logo { height: 28px; object-fit: contain; }

/* 📸 偶像卡片 */
.ml-grid, .cg-grid, .sc-grid, .gk-grid, .default-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 45px 25px; padding: 10px 10px 40px; }
.idol-card { position: relative; text-decoration: none; display: flex; flex-direction: column; align-items: center; transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); cursor: pointer; }
.idol-card:hover { transform: translateY(-8px) scale(1.05) rotate(-2deg); z-index: 10; }
.idol-card.hidden { display: none !important; }

.idol-img, .ml-grid img, .cg-grid img, .sc-grid img, .gk-grid img, .default-grid img { width: 100% !important; max-width: 100% !important; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; border: 4px solid var(--idol-color, var(--current-agency-color, #ffe4e8)); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15); background-color: #fff; transition: 0.3s; }
.idol-card:hover .idol-img { box-shadow: 0 12px 25px var(--idol-color, var(--current-agency-color, #ff8b94)); }

.idol-name { position: absolute; bottom: -18px; font-size: 14px; font-weight: 900; color: var(--idol-color, var(--current-agency-color, #555)); background: rgba(255,255,255,0.95); padding: 6px 15px; border-radius: 20px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); white-space: nowrap; max-width: 95%; overflow: hidden; text-overflow: ellipsis; border: 2px solid var(--idol-color, var(--current-agency-color, #ffe4e8)); transition: 0.3s; text-shadow: 0 0 3px rgba(255,255,255,0.8); }
.idol-card:hover .idol-name { color: #fff !important; background: var(--idol-color, var(--current-agency-color, #ff8b94)) !important; border-color: #fff !important; transform: scale(1.05); text-shadow: none; }

/* ✨ 全局浅色字体保护名单 ✨ */
.idol-card[data-name*="雪步"] .idol-name,
.idol-card[data-name*="雪歩"] .idol-name,
.idol-card[data-name*="诗花"] .idol-name,
.idol-card[data-name*="詩花"] .idol-name,
.idol-card[data-name*="心白"] .idol-name,
.idol-card[data-name*="玲音"] .idol-name,
.idol-card[data-name*="千雪"] .idol-name,
.idol-card[data-name*="雾子"] .idol-name,
.idol-card[data-name*="霧子"] .idol-name,
.idol-card[data-name*="莉莉娅"] .idol-name,
.idol-card[data-name*="及川雫"] .idol-name { color: #333333 !important; border-color: #cccccc !important; }

.idol-card[data-name*="雪步"]:hover .idol-name,
.idol-card[data-name*="雪歩"]:hover .idol-name,
.idol-card[data-name*="诗花"]:hover .idol-name,
.idol-card[data-name*="詩花"]:hover .idol-name,
.idol-card[data-name*="心白"]:hover .idol-name,
.idol-card[data-name*="玲音"]:hover .idol-name,
.idol-card[data-name*="千雪"]:hover .idol-name,
.idol-card[data-name*="雾子"]:hover .idol-name,
.idol-card[data-name*="霧子"]:hover .idol-name,
.idol-card[data-name*="莉莉娅"]:hover .idol-name,
.idol-card[data-name*="及川雫"]:hover .idol-name { color: #111111 !important; background: #f0f0f0 !important; border-color: #888888 !important; }

/* 🎀 灰姑娘特供导航栏 */
.cg-nav-bar { position: sticky; top: 15px; z-index: 100; display: flex; justify-content: center; gap: 15px; margin-bottom: 40px; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px); padding: 10px 20px; border-radius: 30px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.cg-nav-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 25px; border-radius: 30px; font-weight: 900; text-decoration: none; border: 2px solid; transition: 0.2s; background: #fff;}
.cg-nav-btn img { height: 22px; object-fit: contain; }
.cg-nav-btn:hover { transform: translateY(-3px); box-shadow: 0 6px 15px rgba(0,0,0,0.15); }
.cg-nav-btn.cute { border-color: #ff5085; color: #ff5085; }
.cg-nav-btn.cute:hover, .cg-nav-btn.active.cute { background: #ff5085; color: #fff; }
.cg-nav-btn.cool { border-color: #0062ff; color: #0062ff; }
.cg-nav-btn.cool:hover, .cg-nav-btn.active.cool { background: #0062ff; color: #fff; }
.cg-nav-btn.passion { border-color: #ff9d00; color: #ff9d00; }
.cg-nav-btn.passion:hover, .cg-nav-btn.active.passion { background: #ff9d00; color: #fff; }

.cg-toggle-container { text-align: center; margin: 30px 0 10px; position: relative; z-index: 1; }
.cg-toggle-container::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; border-top: 2px dashed var(--unit-color); opacity: 0.4; z-index: -1; }
.cg-toggle-btn { background: #fff; color: var(--unit-color); border: 2px solid var(--unit-color); padding: 8px 25px; border-radius: 20px; font-weight: 900; font-size: 14px; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 10px rgba(0,0,0,0.05); display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.cg-toggle-btn:hover { background: var(--unit-color); color: #fff; }
.cg-unvoiced-grid { display: none; margin-top: 30px; }
.cg-unvoiced-grid.show { display: block; } 

/* 🖱️ 悬浮固定组件样式表 */
.change-bg-btn { position: fixed; right: 35px; bottom: 30px; background: rgba(255, 255, 255, 0.95); color: var(--current-theme); border: 4px solid var(--current-theme); padding: 15px 30px; border-radius: 40px; font-weight: 900; font-size: 18px; cursor: pointer; box-shadow: 0 10px 25px rgba(0,0,0,0.2); z-index: 9998; transition: all 0.2s; display: flex; align-items: center; gap: 10px; }
.change-bg-btn:hover { background: var(--current-theme); color: white; transform: translateY(-3px) scale(1.05); box-shadow: 0 12px 30px rgba(0,0,0,0.3); }
.bg-source-btn { position: fixed; left: 35px; bottom: 30px; background: rgba(255, 255, 255, 0.85); color: #333; border: 3px solid rgba(255, 255, 255, 0.6); padding: 12px 25px; border-radius: 30px; font-weight: 900; font-size: 15px; cursor: pointer; text-decoration: none; box-shadow: 0 6px 15px rgba(0,0,0,0.1); z-index: 9998; transition: all 0.3s; display: flex; align-items: center; gap: 8px; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bg-source-btn:hover { background: var(--tab-color, #ffdde1); color: white !important; border-color: #fff; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }
.bg-source-btn span.icon { font-size: 18px; }
.fab-search { position: fixed; right: 45px; bottom: 120px; width: 65px; height: 65px; background: var(--current-theme); border-radius: 50%; border: 4px solid #fff; color: white; display: flex; justify-content: center; align-items: center; box-shadow: 0 8px 25px rgba(0,0,0,0.3); z-index: 9999; cursor: grab; transition: transform 0.2s; }
.fab-search:active { cursor: grabbing; transform: scale(0.9); }
.fab-search svg { width: 30px; height: 30px; pointer-events: none; }
.search-overlay { position: fixed; top: -100px; left: 50%; transform: translateX(-50%); width: 90%; max-width: 500px; background: rgba(255,255,255,0.98); padding: 12px 20px; border-radius: 30px; box-shadow: 0 15px 35px rgba(0,0,0,0.2); z-index: 9998; display: flex; align-items: center; gap: 10px; transition: top 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); border: 3px solid var(--current-theme); }
.search-overlay.active { top: 25px; }
.search-overlay input { border: none; outline: none; flex: 1; font-size: 16px; font-weight: bold; background: transparent; color: #333; }
.close-search-btn { background: #f4f4f4; color: #888; border: none; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; cursor: pointer; transition: 0.2s; }
img, a { -webkit-user-drag: none; }
body.is-dragging * { user-select: none !important; -webkit-user-select: none !important; }

/* ========================================== */
/* 📱 平板/大宽屏专属 (651px ~ 1100px)        */
/* ========================================== */
@media screen and (max-width: 1100px) {
    body { padding: 0; }
    .app-window { border-radius: 0; min-height: 100vh; }
    .main-layout { flex-direction: column; border-radius: 0; }
    .sidebar { width: 250px; min-width: 250px; max-width: 250px; padding: 30px 15px; border-right: none; border-bottom: 3px solid var(--current-theme); flex-direction: column; flex-wrap: nowrap; align-items: center; position: fixed; top: 0; left: 0; height: 100vh; background: rgba(255,255,255,0.98); z-index: 1000; border-radius: 0; }
    .sidebar::-webkit-scrollbar { width: 0px; display: none; } 
    .tab-btn { flex-shrink: 0; width: 100% !important; margin-bottom: 20px; margin-right: 0px; border-radius: 20px; border: 4px solid var(--tab-color); border-bottom: 6px solid var(--tab-color); transform: translateY(0); padding: 20px 15px; }
    .tab-left { display: flex; flex-direction: column; gap: 12px; width: 100%; align-items: center; justify-content: center; }
    .tab-icon { width: 65px !important; height: 65px !important; transform: none !important; margin: 0 auto; }
    .tab-text { font-size: 20px !important; max-width: 100% !important; text-align: center; white-space: normal; line-height: 1.3; font-weight: 900; }
    .tab-badge { display: none; } 
    .content-area { padding: 30px 25px 30px 275px; border-radius: 0; }
    div[class*="-banner"] { margin-bottom: 40px !important; padding: 25px 20px !important; }
    div[class*="-banner"] h2, div[class*="-banner"] h3 { font-size: 26px; }
    .cg-nav-bar { top: 20px; gap: 20px; padding: 12px 20px; border-radius: 30px;}
    .cg-nav-btn { padding: 12px 30px; font-size: 18px;}
    .cg-nav-btn img { height: 28px; }
    
    .ml-unit-section, .cg-unit-section, .sc-unit-section, .gk-unit-section { 
        margin-top: 45px !important; 
        margin-bottom: 60px !important; 
        padding: 35px 20px 30px !important; scroll-margin-top: 80px; 
    }
    .ml-unit-title, .cg-unit-title, .sc-unit-title, .gk-unit-title { 
        font-size: 22px; padding: 12px 25px; margin-top: -60px !important; 
    }
    
    .ml-grid, .cg-grid, .sc-grid, .gk-grid, .default-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 45px 20px !important; }
    .idol-name { font-size: 16px; padding: 8px 16px; bottom: -20px; }
    .change-bg-btn, .bg-source-btn { display: none !important; }
}

/* ========================================== */
/* 📱 小屏手机专属 (< 650px) ✨完美修复顶框，塑造最佳呼吸感！✨ */
/* ========================================== */
@media screen and (max-width: 650px) {
    .sidebar { width: 60px; min-width: 60px; max-width: 60px; padding: 10px 2px; }
    .tab-btn { padding: 6px 0px; margin-bottom: 8px; border-radius: 8px; border-width: 2px; border-bottom-width: 2px;}
    .tab-icon { width: 24px !important; height: 24px !important; }
    .tab-text { font-size: 10px !important; line-height: 1.1; letter-spacing: -0.5px; transform: scale(0.9); }
    
    .content-area { padding: 10px 4px 15px 65px; } 
    
    div[class*="-banner"] { margin-bottom: 15px !important; padding: 12px 4px !important; border-radius: 12px; }
    div[class*="-banner"] h2, div[class*="-banner"] h3 { font-size: 14px !important; letter-spacing: 0 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .cg-nav-bar { gap: 8px; top: 10px; margin-bottom: 20px; padding: 6px 12px; border-radius: 18px;}
    .cg-nav-btn { padding: 6px 12px; font-size: 12px; border-width: 1px;}
    .cg-nav-btn img { height: 14px; }
    
    .ml-unit-section, .cg-unit-section, .sc-unit-section, .gk-unit-section { 
        margin-top: 30px !important; 
        margin-bottom: 30px !important; 
        padding: 10px 4px 15px !important; 
        scroll-margin-top: 55px; border-width: 2px; border-radius: 15px; 
    }
    
    .ml-unit-title, .cg-unit-title, .sc-unit-title, .gk-unit-title { 
        font-size: 13px; padding: 4px 10px; 
        margin-top: 0px !important; 
        margin-bottom: 12px !important; 
        border-width: 2px; 
    }
    
.ml-grid, .cg-grid, .sc-grid, .gk-grid, .default-grid { 
        grid-template-columns: repeat(3, 1fr); 
        gap: 28px 4px !important; 
        padding: 0 0 25px 0 !important; 
    }
    .idol-card { margin-bottom: 0px !important; }
    
    .idol-img, .ml-grid img, .cg-grid img, .sc-grid img, .gk-grid img, .default-grid img { width: 85% !important; max-width: 85% !important; margin: 0 auto; border-width: 3px !important; }
	.idol-name { font-size: 11px; padding: 3px 6px; bottom: -26px; border-width: 2px !important; }
    .fab-search { right: 10px; bottom: 25px; width: 40px; height: 40px; border-width: 2px;}
    .fab-search svg { width: 18px; height: 18px; }
}

/* ========================================== */
/* 🌓 智能黑夜模式专属配置 */
/* ========================================== */
@media (prefers-color-scheme: dark) {
    .pro765-banner { background: linear-gradient(135deg, #f34f6d, #111111) !important; border-color: #555 !important; }
    .sidem-banner { background: linear-gradient(135deg, #0fbe94, #111111) !important; border-color: #555 !important; }
    .ml-banner { background: linear-gradient(135deg, #ffc30b, #111111) !important; border-color: #555 !important; }
    .cg-banner { background: linear-gradient(135deg, #4b7bd5, #111111) !important; border-color: #555 !important; }
    .sc-banner { background: linear-gradient(135deg, #8dbbff, #111111) !important; border-color: #555 !important; }
    .gk-banner { background: linear-gradient(135deg, #ff9800, #111111) !important; border-color: #555 !important; }
    div[class*="876"] { background: linear-gradient(135deg, #656a75, #111111) !important; border-color: #555 !important; }

    div[class*="-banner"] h2, div[class*="-banner"] h3 { color: #ffffff !important; text-shadow: 2px 2px 6px rgba(0,0,0,0.9) !important; }
    div[class*="-banner"] p { color: #eeeeee !important; }
    
    .cg-nav-bar { background: linear-gradient(135deg, rgba(75, 123, 213, 0.8), rgba(15, 15, 15, 0.9)) !important; border: 2px solid #555 !important; }
    .cg-toggle-btn { background-color: #111 !important; color: var(--unit-color) !important; border-color: var(--unit-color) !important; }
    .cg-toggle-btn:hover { background-color: var(--unit-color) !important; color: #fff !important; }
}