:root {
    /* --- 基礎背景與毛玻璃參數 --- */
    --bg-base: transparent; 
    --glass-bg: rgba(20, 20, 25, 0.3); 
    --glass-border: rgba(255, 255, 255, 0.08); 
    --glass-highlight: rgba(255, 255, 255, 0.15);
    
    /* --- 文字與角色主題色 --- */
    --text-main: #f0f0f0;
    --text-muted: #ddd; 
    --c-user: #9ca3af;
    --c-verified: #10b981;
    --c-premium: #fbbf24;
    --c-dev: #3b82f6;
    --c-insider: #ec4899;
    --c-booster: #d946ef;
    --c-mgmt: #ef4444;
    --c-honor: #00fff2;
}

/* ==============================
   1. 全局重置與基礎設定
   ============================== */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

body {
    background-color: #000; 
    color: var(--text-main);
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto; 
    padding: 60px 20px;
    position: relative; 
    
    /* 禁止網頁文字被反白選取 */
    -webkit-user-select: none;
    -moz-user-select: none;    
    -ms-user-select: none;     
    user-select: none;         
    
    /* 背景漸顯開場動畫 */
    animation: fadeInBackground 1s ease-out forwards;
}

/* --- 背景模糊與遮罩 --- */
body::before {
    content: '';
    position: fixed;
    top: -5%; 
    left: -5%; 
    width: 110%; 
    height: 110%; 
    background-image: url('background.png'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
    filter: blur(90px); 
    transform: scale(1.1); 
}

body::after {
    content: '';
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.4); 
    z-index: -1;
}

/* ==============================
   2. 全局動畫定義 (Keyframes)
   ============================== */
@keyframes fadeInBackground {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes floatUpCard {
    from {
        opacity: 0;
        transform: translateY(40px); /* 距離縮短，減少生硬感 */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scramble { 
    0% { content: "0x8F!#$9&k#@A#"; } 
    15% { content: "10010111010110"; } 
    30% { content: "█▓▒░█▓▒░█▓▒░█▓"; } 
    45% { content: "E#R$R%O^R!!_XX"; } 
    60% { content: "xX_!@#_%$01x?&"; } 
    75% { content: "10x0x1x0x11011"; } 
    90% { content: "##$$%%^^&&**!!"; } 
    100% { content: "0x8F!#$9&k#@A#"; } 
}

/* ==============================
   3. 通用 UI 元件 (按鈕/開場卡片)
   ============================== */
.glass-back-btn {
    position: fixed; 
    top: 25px;
    left: 25px;
    z-index: 1000; 
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    color: var(--text-muted); 
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 1px;
    
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-highlight);
    border-left: 1px solid var(--glass-highlight);
    border-radius: 50px; 
    
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.glass-back-btn i {
    font-size: 0.85rem;
    transition: transform 0.3s ease; 
}

.glass-back-btn:hover {
    color: #fff; 
    background: rgba(255, 255, 255, 0.1); 
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px); 
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 255, 255, 0.05); 
}

.glass-back-btn:hover i {
    transform: translateX(-4px);
}

/* --- 開場向上浮現的共同設定 --- */
.role-card,
.mgmt-standalone-card,
.mgmt-subcard,
.honors-section,
.honor-card {
    opacity: 0; 
    transform: translateY(40px); 
    /* 換上更平滑的阻尼過渡曲線 */
    animation: floatUpCard 0.8s cubic-bezier(0.25, 1, 0.3, 1) forwards;
}

/* 【核心握手邏輯】收到 JS 的 is-ready 許可後，解除動畫鎖定 */
.role-card.is-ready,
.mgmt-standalone-card.is-ready,
.mgmt-subcard.is-ready,
.honors-section.is-ready,
.honor-card.is-ready {
    opacity: 1;
    transform: translateY(0);
    animation: none; /* 解除 forwards 霸權，把控制權交還給常規 CSS */
}

/* ==============================
   4. 網頁區塊與卡片樣式
   ============================== */
.header { 
    text-align: center; 
    margin-bottom: 60px; 
    position: relative;
    z-index: 10;
}

.header h1 { 
    font-size: 3rem; 
    font-weight: 900; 
    letter-spacing: 4px; 
    text-transform: uppercase; 
    background: linear-gradient(90deg, #fff, #ddd); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    margin-bottom: 10px; 
    text-shadow: 0 0 30px rgba(0, 0, 0, 0.8); 
}

.header p { 
    color: var(--text-muted); 
    font-size: 1rem; 
    letter-spacing: 2px; 
    text-transform: uppercase; 
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8); 
}

/* --- 身份組容器 --- */
.carousel-wrapper {
    position: relative;
    max-width: 1400px;
    margin: 0 auto 40px auto;
    z-index: 10;
}

.roles-container {
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 40px; 
    padding: 20px 10px; 
}

/* --- 身份組卡片 (Role Card) --- */
.role-card {
    width: 100%;
    max-width: 420px; 
    background: var(--glass-bg); 
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); 
    border-top: 1px solid var(--glass-highlight); 
    border-left: 1px solid var(--glass-highlight);
    border-radius: 16px; 
    padding: 25px; 
    position: relative; 
    display: flex; 
    flex-direction: column;
    /* 清理 !important，恢復完美的彈性過渡 */
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.4s ease, border-color 0.4s ease;
    overflow: hidden; 
}

.role-card::before {
    content: ''; 
    position: absolute; 
    top: 0; 
    left: 0; 
    right: 0; 
    height: 4px;
    background: var(--theme-color); 
    box-shadow: 0 0 20px var(--theme-color); 
    opacity: 0.8; 
    transition: opacity 0.3s;
}

/* 只有在 is-ready 狀態下，才允許 Hover 互動 */
.role-card.is-ready:hover { 
    transform: translateY(-8px); 
    border-color: rgba(255, 255, 255, 0.2); 
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 20px calc(var(--theme-color) - 70%); 
}

.role-card.is-ready:hover::before { 
    opacity: 1; 
}

/* --- 身份組卡片內部排版 --- */
.card-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 20px; 
    padding-bottom: 15px; 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
}

.role-name { 
    font-size: 1.5rem; 
    font-weight: 800; 
    color: var(--theme-color); 
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8); 
    white-space: nowrap; 
}

.role-badge { 
    font-size: 0.75rem; 
    padding: 4px 10px; 
    border-radius: 20px; 
    background: rgba(0, 0, 0, 0.3); 
    border: 1px solid var(--theme-color); 
    color: var(--theme-color); 
    letter-spacing: 1px; 
    white-space: nowrap; 
}

.section-title { 
    font-size: 0.8rem; 
    color: var(--text-muted); 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin: 15px 0 8px 0; 
    display: flex; 
    align-items: center; 
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); 
}

.section-title i { margin-right: 8px; font-size: 0.9rem; }

.auth-box { 
    background: rgba(0, 0, 0, 0.2); 
    border: 1px solid rgba(255, 255, 255, 0.05); 
    border-radius: 8px; 
    padding: 12px; 
    font-size: 0.85rem; 
    border-left: 3px solid var(--theme-color); 
    margin-bottom: 15px; 
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.3); 
    line-height: 1.5; 
}

.brand-icons { display: flex; gap: 14px; margin: 10px 0; font-size: 1.3rem; }

.feature-list { list-style: none; flex-grow: 1; }
.feature-list li { font-size: 0.9rem; margin-bottom: 8px; display: flex; align-items: flex-start; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); word-break: keep-all; }
.feature-list li i.fa-check-circle { color: var(--c-verified); margin-right: 8px; margin-top: 3px;} 
.feature-list li i.fa-lock { color: var(--text-muted); margin-right: 8px; margin-top: 3px;} 
.feature-list li i.fa-times-circle { color: var(--c-mgmt); margin-right: 8px; margin-top: 3px;} 
.feature-list li i.fa-exclamation-triangle { color: #f59e0b; margin-right: 8px; margin-top: 3px;} 
.feature-list li i.fa-info-circle { color: #3b82f6; margin-right: 8px; margin-top: 3px;} 
.feature-list li i.fa-exclamation-circle { color: #f97316; margin-right: 8px; margin-top: 3px;} 
.feature-list li i.fa-star { color: #fbbf24; margin-right: 8px; margin-top: 3px;} 
.feature-list li i.fa-minus-circle { color: #9ca3af; margin-right: 8px; margin-top: 3px;} 
.feature-list li i.fa-circle { color: var(--text-muted); margin-right: 8px; margin-top: 6px; font-size: 0.5rem; }

.scramble-text::after { 
    content: ""; 
    animation: scramble 0.3s infinite linear; 
    font-family: monospace; 
    letter-spacing: 2px; 
    color: var(--theme-color); 
    background: rgba(0, 0, 0, 0.6); 
    padding: 0 6px; 
    border-radius: 4px; 
    text-shadow: 0 0 10px var(--theme-color); 
}

/* ==============================
   5. 管理系統板塊 (Management)
   ============================== */
.mgmt-card-wrapper {
    max-width: 1400px;
    margin: 0 auto 40px auto;
    padding: 0 10px;
    z-index: 10;
    position: relative;
}

.mgmt-standalone-card {
    background: rgba(15, 20, 25, 0.3);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-highlight);
    border-left: 1px solid var(--glass-highlight);
    box-shadow: 0 15px 50px 0 rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    padding: 40px;
}

.mgmt-card-title {
    color: var(--c-mgmt);
    font-size: 1.5rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
}

.mgmt-card-title i { margin-right: 12px; }

.private-tag {
    font-size: 0.85rem;
    color: #888;
    margin-left: 10px;
    font-weight: normal;
    font-family: monospace;
}

.mgmt-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 25px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.mgmt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.mgmt-subcard {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 2px solid var(--c-mgmt);
    padding: 20px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); /* 清理 !important */
    overflow: hidden; 
}

.mgmt-subcard.is-ready:hover {
    transform: translateY(-3px); 
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.mgmt-subcard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mgmt-subcard-title { color: var(--text-main); font-weight: bold; font-size: 1.1rem; display: flex; align-items: center; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }
.mgmt-subcard-title i { margin-right: 8px; color: var(--c-mgmt); }
.mgmt-subcard-badge { font-size: 0.75rem; color: var(--c-mgmt); background: rgba(239, 68, 68, 0.1); padding: 3px 8px; border-radius: 4px; border: 1px solid rgba(239, 68, 68, 0.3); font-family: monospace; white-space: nowrap; margin-left: 10px; }
.mgmt-subcard-desc { font-size: 0.85rem; color: #ddd; line-height: 1.6; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }

/* ==============================
   6. 榮譽板塊 (Honors)
   ============================== */
.honors-section { 
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto 40px auto; 
    background: rgba(15, 20, 25, 0.3); 
    backdrop-filter: blur(30px); 
    -webkit-backdrop-filter: blur(30px); 
    border: 1px solid var(--glass-border); 
    border-top: 1px solid var(--glass-highlight); 
    border-left: 1px solid var(--glass-highlight); 
    box-shadow: 0 15px 50px 0 rgba(0, 0, 0, 0.4); 
    border-radius: 16px; 
    padding: 40px; 
}

.honors-title { color: var(--c-honor); font-size: 1.5rem; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 2px; text-shadow: 0 0 15px rgba(0, 0, 0, 0.8); }
.honors-subtitle { color: var(--text-muted); font-size: 0.9rem; }
.honors-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }

.honor-card { 
    background: rgba(0, 0, 0, 0.2); 
    border: 1px solid rgba(255, 255, 255, 0.05); 
    border-top: 1px solid rgba(255, 255, 255, 0.1); 
    border-left: 2px solid var(--c-honor); 
    padding: 15px; 
    border-radius: 0 8px 8px 0; 
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); /* 清理 !important */
    overflow: hidden; 
}

.honor-card.is-ready:hover { 
    transform: translateX(5px); 
    background: rgba(0, 0, 0, 0.3); 
}

.honor-name { color: var(--c-honor); font-weight: bold; font-size: 1.1rem; margin-bottom: 5px; display: flex; align-items: center; }
.honor-name i { margin-right: 8px; }
.honor-desc { font-size: 0.85rem; color: #ddd; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }
.honor-owner { color: #fff; font-size: 0.8rem; background: rgba(0, 0, 0, 0.5); padding: 2px 6px; border-radius: 4px; margin-top: 8px; display: inline-block; border: 1px solid rgba(255, 255, 255, 0.1); }

/* ==============================
   7. 頁尾 (Footer)
   ============================== */
.footer { 
    position: relative;
    z-index: 10;
    text-align: center; 
    margin-top: 60px; 
    color: #aaa; 
    font-size: 0.8rem; 
    font-family: monospace; 
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); 
}

/* ==============================
   8. 手機端自適應 (Mobile Responsive)
   ============================== */
@media screen and (max-width: 768px) {
    body { padding: 30px 15px; }
    
    .header h1 { font-size: 2rem; letter-spacing: 2px; }
    .header p { font-size: 0.85rem; }
    
    /* 按鈕調整 */
    .glass-back-btn { top: 15px; left: 15px; padding: 8px 16px; font-size: 0.85rem; }
    
    /* 卡片調整 */
    .roles-container { gap: 25px; padding: 10px 0; }
    .role-card { max-width: 100%; padding: 20px 15px; }
    .role-name { font-size: 1.3rem; }
    
    /* 管理板塊調整 */
    .mgmt-card-wrapper { margin-bottom: 30px; }
    .mgmt-standalone-card { padding: 20px; }
    .mgmt-card-title { font-size: 1.2rem; flex-direction: column; align-items: flex-start; gap: 5px; }
    .private-tag { margin-left: 0; }
    
    /* 榮譽板塊調整 */
    .honors-section { padding: 25px 15px; margin: 20px auto; }
}