/* =========================================
   CORE VARIABLES & RESET (Cyberpunk Palette)
   ========================================= */
:root {
    --bg-dark: #020408;
    --bg-panel: rgba(10, 15, 30, 0.85);
    --neon-cyan: #00f3ff;
    --neon-blue: #0066ff;
    --neon-purple: #bc13fe;
    --neon-green: #0aff00;
    --neon-red: #ff2a2a;
    --text-main: #e0f7ff;
    --text-dim: #7da0b0;
    --border-color: rgba(0, 243, 255, 0.3);
    --glass-blur: blur(16px);
    --font-tech: 'Orbitron', 'Noto Sans TC', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 80px;
    --header-height: 70px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Noto Sans TC', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
}

/* =========================================
   BACKGROUND FX
   ========================================= */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.grid-bg {
    background-image:
        linear-gradient(rgba(0, 243, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 243, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: perspective(500px) rotateX(20deg) scale(1.5);
    opacity: 0.5;
}

.scanlines {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.2));
    background-size: 100% 4px;
    z-index: 9000;
    opacity: 0.15;
    pointer-events: none;
}

.vignette {
    background: radial-gradient(circle at center, transparent 0%, #000 90%);
}

.particles .particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--neon-cyan);
    box-shadow: 0 0 5px var(--neon-cyan);
    opacity: 0;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh);
        opacity: 0;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-10vh);
        opacity: 0;
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 10px var(--neon-cyan);
    }

    50% {
        box-shadow: 0 0 25px var(--neon-cyan), 0 0 10px var(--neon-purple);
    }
}

@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(100%);
    }
}

/* =========================================
   LAYOUT STRUCTURE
   ========================================= */
.layout-container {
    display: flex;
    min-height: 100vh;
    padding-top: var(--header-height);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
}

.navbar {
    height: 100%;
    display: flex;
    justify-content: space-between;
    /* 左邊 Logo，右邊選單分開 */
    align-items: center;
    padding: 0 2rem;
    background: rgba(5, 11, 20, 0.9);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.15);
}

.nav-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    /* 防止 Logo 被壓縮 */
}

.nav-right {
    display: flex;
    /* 讓內容橫向排列 */
    align-items: center;
    /* 垂直置中 */
    gap: 1.5rem;
    /* 設定每個元素之間的距離 */
    flex-shrink: 0;
    /* 防止內容被擠壓 */
}

.logo-link {
    text-decoration: none;
    /* 移除底線 */
    color: inherit;
    /* 保持原有文字顏色 */
}

.logo-glitch {
    font-family: var(--font-tech);
    font-size: 1.8rem;
    /* Slightly larger */
    font-weight: 900;
    letter-spacing: 2px;
    white-space: nowrap;

    /* New gradient text */
    background: linear-gradient(45deg, var(--neon-cyan), #d46cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;

    /* New soft glow effect */
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5), 0 0 20px rgba(212, 108, 255, 0.3);

    transition: all 0.3s ease;
    /* Smooth transition for hover */
}

.logo-glitch:hover {
    transform: scale(1.05);
    /* Slight zoom on hover */
    text-shadow: 0 0 15px rgba(0, 243, 255, 0.8), 0 0 25px rgba(212, 108, 255, 0.5);
    /* Brighter glow on hover */
}

.sys-status {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.9rem;
    white-space: nowrap;
    /* 防止文字換行 */
}

.status-online {
    color: var(--neon-green);
    text-shadow: 0 0 8px var(--neon-green);
    animation: blink 2s infinite;
    font-weight: bold;
    margin-left: 5px;
}

/* User Profile & Button */
.user-profile {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    /* 文字靠右對齊 */
    line-height: 1.2;
    margin-right: 0.5rem;
    /* 與按鈕保持一點距離 */
}

.user-rank {
    font-size: 0.65rem;
    color: var(--neon-purple);
    font-weight: bold;
    letter-spacing: 1px;
}

.welcome-text {
    font-size: 0.95rem;
    color: var(--neon-cyan);
    font-weight: 500;
}

/* 按鈕樣式優化 */
.cyber-btn {
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 0.5rem 1.2rem;
    font-family: var(--font-tech);
    text-decoration: none;
    text-transform: uppercase;
    transition: 0.3s;
    white-space: nowrap;
    /* 關鍵：防止按鈕文字換行 */
    font-size: 0.85rem;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    /* 固定高度 */
}

.cyber-btn:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 15px var(--neon-cyan);
}


/* =========================================
   SIDEBAR NAVIGATION (Collapsible)
   ========================================= */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--header-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg-panel);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color);
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 900;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--neon-cyan);
}

/* Collapsed State */
.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.menu-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    transition: opacity 0.3s;
}

.sidebar.collapsed .menu-label {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--neon-cyan);
    cursor: pointer;
    transition: 0.3s;
}

.sidebar-toggle:hover {
    text-shadow: 0 0 10px var(--neon-cyan);
}

/* Menu Items */
.sidebar-menu {
    flex: 1;
    padding-top: 1rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
    white-space: nowrap;
    /* 防止文字換行 */
}

.sidebar-item .material-icons {
    font-size: 1.5rem;
    margin-right: 1rem;
    min-width: 24px;
    text-align: center;
    transition: 0.3s;
}

.sidebar-text {
    font-family: 'Noto Sans TC';
    opacity: 1;
    transition: opacity 0.3s, transform 0.3s;
}

.sidebar.collapsed .sidebar-text {
    opacity: 0;
    transform: translateX(20px);
}

.sidebar-item:hover,
.sidebar-item.active {
    color: var(--neon-cyan);
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.1), transparent);
    border-left-color: var(--neon-cyan);
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.6);
}

.sidebar-item:hover .material-icons {
    transform: scale(1.1);
    filter: drop-shadow(0 0 5px var(--neon-cyan));
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    text-align: center;
}

.sidebar.collapsed .sidebar-footer {
    display: none;
}

/* =========================================
   MAIN CONTENT
   ========================================= */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem;
    transition: margin-left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-width: 100%;
}

.sidebar.collapsed+.main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Hero Section */
.hero-section {
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
    padding-bottom: 1rem;
}

.glitch-title {
    font-family: var(--font-tech);
    font-size: 2.5rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 3px;
    background: linear-gradient(90deg, #fff, var(--text-dim));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-family: var(--font-mono);
    color: var(--neon-cyan);
}

/* =========================================
   CARDS & DASHBOARD GRID
   ========================================= */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.cyber-card {
    background: linear-gradient(135deg, rgba(10, 15, 30, 0.9), rgba(5, 8, 16, 0.95));
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    overflow: hidden;
    clip-path: polygon(20px 0, 100% 0,
            100% calc(100% - 20px), calc(100% - 20px) 100%,
            0 100%, 0 20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.cyber-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(90deg, transparent 95%, rgba(0, 243, 255, 0.03) 95%),
        linear-gradient(transparent 95%, rgba(0, 243, 255, 0.03) 95%);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: 0;
}

.cyber-card:hover {
    border-color: var(--neon-cyan);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 243, 255, 0.15), inset 0 0 30px rgba(0, 243, 255, 0.05);
}

.cyber-card:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--neon-cyan);
    box-shadow: 0 0 15px var(--neon-cyan);
    animation: scanline 2s linear infinite;
    opacity: 0.5;
}

/* Card Corners (HUD Effect) */
.card-corner {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid var(--neon-cyan);
    opacity: 0.5;
    transition: 0.3s;
}

.corner-tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.corner-tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
}

.corner-bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
}

.corner-br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

.cyber-card:hover .card-corner {
    width: 15px;
    height: 15px;
    opacity: 1;
    box-shadow: 0 0 5px var(--neon-cyan);
}

/* Data Card Specifics */
.data-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.card-icon {
    width: 60px;
    height: 60px;
    background: rgba(0, 243, 255, 0.1);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--neon-cyan);
    font-size: 1.5rem;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

.card-info h3 {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-bottom: 0.2rem;
}

.big-number {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.trend {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend.positive {
    color: var(--neon-green);
}

/* Progress Bar */
.progress-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 10px;
    width: 100%;
}

.cyber-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-blue));
    box-shadow: 0 0 10px var(--neon-cyan);
    transition: width 3s ease-out;
}

/* =========================================
   CHARTS SECTION
   ========================================= */
.charts-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.chart-panel {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
}

.flex-grow {
    flex: 2;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    color: var(--neon-cyan);
    border-bottom: 1px dashed rgba(0, 243, 255, 0.3);
    padding-bottom: 0.5rem;
}

.chart-body {
    flex: 1;
    min-height: 250px;
    position: relative;
}

/* Custom CSS Bar Chart */
.bar-chart-container {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 100%;
    padding-top: 20px;
}

.simple-bar-chart {
    display: flex;
    width: 100%;
    height: 200px;
    align-items: flex-end;
    justify-content: space-around;
    gap: 10px;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    justify-content: flex-end;
    cursor: pointer;
    transition: transform 0.2s;
}

.bar-group:hover {
    transform: scaleY(1.05);
}

.bar-fill {
    width: 30%;
    background: linear-gradient(180deg, var(--neon-cyan), transparent);
    border-top: 2px solid var(--neon-cyan);
    position: relative;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
    animation: growUp 3s cubic-bezier(0.19, 1, 0.22, 1) forwards;
    transform-origin: bottom;
}

.bar-group.active .bar-fill {
    background: linear-gradient(180deg, var(--neon-purple), transparent);
    border-top-color: var(--neon-purple);
    box-shadow: 0 0 20px rgba(188, 19, 254, 0.4);
}

.bar-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    color: #fff;
    font-size: 0.8rem;
    opacity: 0;
    transition: 0.3s;
}

.bar-group:hover .bar-value {
    opacity: 1;
    top: -30px;
}

.bar-label {
    margin-top: 10px;
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* SVG Circular Chart */
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.svg-progress-container {
    position: relative;
    width: 180px;
    height: 180px;
}

.progress-ring__circle {
    stroke-dasharray: 502;
    /* Circumference of the circle */
    stroke-dashoffset: 502;
    /* Start with the circle empty */
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    filter: drop-shadow(0 0 8px var(--neon-purple));
}

.progress-ring__circle.is-animating {
    stroke-dashoffset: calc(502 - (502 * 87) / 100);
    /* 87% */
    transition: stroke-dashoffset 3s ease-out;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-text .number {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: bold;
    color: #fff;
    display: block;
}

/* =========================================
   WEATHER WIDGET (Hologram Style)
   ========================================= */
.weather-panel {
    min-width: 320px;
    background: radial-gradient(circle at top right, rgba(0, 100, 255, 0.1), transparent 70%),
        rgba(10, 15, 30, 0.6);
    overflow: hidden;
}

.weather-hologram-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg,
            transparent,
            transparent 2px,
            rgba(0, 243, 255, 0.05) 3px);
    pointer-events: none;
}

.weather-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.weather-main {
    text-align: center;
}

.weather-icon-large {
    font-size: 4rem;
    filter: drop-shadow(0 0 15px rgba(255, 200, 0, 0.6));
    animation: pulse 3s infinite;
}

.weather-temp {
    font-family: var(--font-mono);
    font-size: 3.5rem;
    color: var(--neon-cyan);
    line-height: 1;
    text-shadow: 0 0 20px var(--neon-cyan);
}

.weather-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.w-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.8rem;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.w-item .label {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.w-item .value {
    font-family: var(--font-mono);
    color: #fff;
    font-size: 1.1rem;
}

.weather-footer {
    text-align: right;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

/* =========================================
   FEATURE SHORTCUTS
   ========================================= */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.feature-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 1.2rem;
    background: linear-gradient(135deg, rgba(16, 26, 48, 0.8), rgba(0, 0, 0, 0.8));
    border: 1px solid var(--border-color);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.feature-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: var(--neon-cyan);
    transform: scaleY(0);
    transition: transform 0.3s;
}

.feature-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 243, 255, 0.15);
}

.feature-btn:hover::before {
    transform: scaleY(1);
}

/* 對話泡泡 */
.speech-bubble {
    position: fixed;
    background: rgba(10, 14, 39, 0.95);
    color: #00ffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.2rem;
    font-weight: 600;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    border: 2px solid #00ffff;
    z-index: 9999;
    pointer-events: none;
    animation: bubble-pop 0.3s ease;
    white-space: nowrap;
}

.speech-bubble.right::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -15px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 15px solid rgba(10, 14, 39, 0.95);
    filter: drop-shadow(-2px 0 0 #00ffff);
}

.speech-bubble.left::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -15px;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 15px solid rgba(10, 14, 39, 0.95);
    filter: drop-shadow(2px 0 0 #00ffff);
}

.speech-bubble.fade-out {
    animation: bubble-fade 0.5s ease forwards;
}

/* ============================================================
   💾 儲存中遮罩 (Loading Overlay)
   ============================================================ */

#saving-overlay {
    position: fixed;
    top: 0;
    left: 0;
    /* 從最左邊開始，覆蓋整個頁面包括側邊欄 */
    width: 100%;
    /* 全螢幕寬度 */
    height: 100%;
    background: rgba(10, 14, 39, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10000;
    /* 提高 z-index 確保在所有元素之上 */
    display: none;
    /* 預設隱藏 */
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 16px;

    transition: padding-left 0.3s ease;
}

/* =========================================
   NEW WIDGETS
   ========================================= */

/* System Monitor */
.sys-monitor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.monitor-item {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
}

.monitor-label {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.monitor-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.monitor-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-cyan));
    width: 0%;
    transition: width 1s ease-out;
    box-shadow: 0 0 10px var(--neon-blue);
}

.monitor-value {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    color: #fff;
    margin-top: 5px;
    display: block;
}

/* Activity Log */
.activity-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-time {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.75rem;
    min-width: 60px;
}

.activity-icon {
    color: var(--neon-cyan);
}

/* Quick Actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 10px;
}

.quick-action-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    text-decoration: none;
    transition: 0.3s;
    border-radius: 4px;
}

.quick-action-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    color: #fff;
    border-color: var(--neon-cyan);
    transform: translateY(-2px);
}

.quick-action-btn .material-icons {
    font-size: 1.5rem;
    color: var(--neon-cyan);
}

.quick-action-label {
    font-size: 0.7rem;
    font-family: var(--font-tech);
}

/* 當側邊欄收起時調整內容偏移 */
body:has(.sidebar.collapsed) #saving-overlay {
    padding-left: 60px;
}

/* 當 overlay 顯示時 */
#saving-overlay.active {
    display: flex;
}

/* 小螢幕時不偏移 */
@media (max-width: 768px) {
    #saving-overlay {
        padding-left: 0 !important;
    }
}

/* =========================================
   ANIMATIONS
   ========================================= */
@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes growUp {
    from {
        transform: scaleY(0);
        opacity: 0;
    }

    to {
        transform: scaleY(1);
        opacity: 1;
    }
}

@keyframes circleFill {
    from {
        stroke-dashoffset: 502;
    }

    to {
        stroke-dashoffset: calc(502 - (502 * 87) / 100);
        /* 87% */
    }
}

/* =========================================
   CAT ANIMATION (保留原始設定但優化 Z-index)
   ========================================= */
.character {
    position: fixed;
    z-index: 9999;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.character video,
.character img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    display: none;
}

.character video.active,
.character img.active {
    display: block;
}

.cat-custom.walking {
    animation: cat-walk-horizontal 30s linear infinite;
}

@keyframes cat-walk-horizontal {
    0% {
        left: -5%;
        transform: scaleX(-1);
    }

    48% {
        left: 95%;
        transform: scaleX(-1);
    }

    50% {
        left: 95%;
        transform: scaleX(1);
    }

    98% {
        left: -5%;
        transform: scaleX(1);
    }

    100% {
        left: -5%;
        transform: scaleX(-1);
    }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        border: none;
    }

    .sidebar.collapsed {
        width: 200px;
        transform: translateX(0);
        background: #050b14;
    }

    /* Mobile Toggle Logic Reverse: Hidden by default, show on toggle */

    .main-content {
        margin-left: 0 !important;
    }

    .navbar {
        padding: 0 1rem;
    }

    .sys-status,
    .user-rank {
        display: none;
    }

    .dashboard-grid,
    .charts-row {
        grid-template-columns: 1fr;
    }

    /* 調整貓咪在手機上的大小 */
    .character video,
    .character img {
        width: 80px;
        height: 80px;
    }
}

/* Footer */
.cyber-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.8rem;
    position: relative;
    z-index: 10;
}

/* --- 響應式調整 (手機/平板) --- */
@media (max-width: 768px) {
    .navbar {
        padding: 0 1rem;
        /* 縮小兩側留白 */
    }

    /* 手機版隱藏 "SYSTEM: ONLINE" 這種裝飾性文字，節省空間 */
    .sys-status {
        display: none;
    }

    .nav-right {
        gap: 0.8rem;
        /* 手機版縮小間距 */
    }

    .logo-glitch {
        font-size: 1.2rem;
        /* Logo 稍微縮小 */
    }

    .welcome-text {
        font-size: 0.85rem;
        /* 使用者名稱縮小 */
    }
}

.total-chip {
    position: static !important;
    transform: none !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    margin: 0 !important;
    margin-right: auto !important;

    padding: 8px 16px;
    font-size: 0.95rem;
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(255, 152, 0, 0.4);
    /* 增加陰影強度，使其更顯眼 */
    background-color: rgba(255, 120, 0, 0.2);
    /* 調整為更柔和、半透明的暖色背景 */
    border: 1px solid #ff9800;
    /* 保持邊框為明亮的橙色 */
}

/* 手機版調整 */
@media (max-width: 768px) {
    .control-bar {
        flex-direction: column;
        /* 手機版改為垂直排列 */
        align-items: stretch;
    }

    .total-chip {
        margin-right: 0 !important;
        margin-bottom: 10px !important;
        text-align: center;
        justify-content: center;
    }
}

/* =========================================
   INTERACTIVE FX (互動特效升級版)
   ========================================= */

/* --- 1. 數據卡片互動：光束掃描與點擊故障 --- */
.cyber-card {
    position: relative;
    overflow: hidden;
    /* 確保光束不出界 */
    cursor: pointer;
}

/* 掃描光束 (預設隱藏，滑鼠滑入觸發) */
.cyber-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.4), transparent);
    transform: skewX(-25deg);
    transition: 0s;
    pointer-events: none;
}

.cyber-card:hover::after {
    left: 150%;
    transition: 0.6s ease-in-out;
}

/* 點擊時的縮放回饋 */
.cyber-card:active {
    transform: scale(0.98);
    border-color: var(--neon-purple);
    box-shadow: 0 0 30px var(--neon-purple);
}

/* 數據數字的故障特效 (JS 觸發 class) */
.glitch-active {
    animation: glitch-anim 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
    color: var(--neon-purple) !important;
    text-shadow: 2px 0 var(--neon-cyan), -2px 0 var(--neon-green);
}

@keyframes glitch-anim {
    0% {
        transform: translate(0)
    }

    20% {
        transform: translate(-2px, 2px)
    }

    40% {
        transform: translate(-2px, -2px)
    }

    60% {
        transform: translate(2px, 2px)
    }

    80% {
        transform: translate(2px, -2px)
    }

    100% {
        transform: translate(0)
    }
}

/* --- 2. 長條圖互動：高亮與 HUD 提示 --- */
.bar-group {
    transition: all 0.3s ease;
    opacity: 0.6;
    /* 未選中時稍微變暗 */
}

.bar-group:hover {
    opacity: 1;
    transform: scaleY(1.1);
    z-index: 10;
}

.bar-group:hover .bar-fill {
    background: linear-gradient(180deg, #fff, var(--neon-cyan));
    box-shadow: 0 0 25px var(--neon-cyan);
}

/* 點擊選中狀態 */
.bar-group.selected {
    opacity: 1;
}

.bar-group.selected .bar-fill {
    background: linear-gradient(180deg, var(--neon-purple), var(--neon-blue));
    border-top-color: var(--neon-purple);
    box-shadow: 0 0 30px var(--neon-purple);
}

.bar-group.selected .bar-label {
    color: var(--neon-purple);
    font-weight: bold;
    text-shadow: 0 0 10px var(--neon-purple);
}

/* 隱藏原本的 bar-value，改用 JS 的浮動 HUD */
.bar-value {
    display: none;
}

/* 浮動 HUD 資訊框 */
#chart-tooltip {
    position: fixed;
    background: rgba(5, 11, 20, 0.95);
    border: 1px solid var(--neon-cyan);
    padding: 10px 15px;
    border-radius: 4px;
    pointer-events: none;
    /* 讓滑鼠穿透 */
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    backdrop-filter: blur(5px);
    transform: translate(-50%, -120%);
    /* 顯示在滑鼠上方 */
}

#chart-tooltip::before {
    content: 'DATA_POINT';
    /* 裝飾文字 */
    display: block;
    font-size: 0.6rem;
    color: var(--text-dim);
    margin-bottom: 4px;
    font-family: var(--font-mono);
}

#chart-tooltip .tooltip-val {
    color: var(--neon-cyan);
    font-size: 1.2rem;
    font-weight: bold;
    font-family: var(--font-mono);
}

/* --- 3. 圓形圖互動：脈衝 --- */
.svg-progress-container {
    cursor: pointer;
    transition: transform 0.3s;
}

.svg-progress-container:hover {
    transform: scale(1.1);
}

.svg-progress-container:hover .progress-ring__circle {
    filter: drop-shadow(0 0 15px var(--neon-purple));
    stroke: var(--neon-purple);
}

.svg-progress-container:active {
    transform: scale(0.95);
}

/* --- 4. 天氣面板互動：雷達掃描 --- */
.weather-panel {
    cursor: url("data:image/svg+xml;utf8,&lt;svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' style='fill:cyan'&gt;&lt;circle cx='10' cy='10' r='5'/&gt;&lt;/svg&gt;") 10 10, crosshair;
}

.weather-panel.scanning .weather-main {
    animation: scan-text 1.5s steps(10) infinite;
    opacity: 0.5;
}

.weather-panel.scanning::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    border: 2px solid var(--neon-cyan);
    animation: radar-wave 1s ease-out infinite;
}

@keyframes radar-wave {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

@keyframes scan-text {
    0% {
        opacity: 0.2;
    }

    50% {
        opacity: 1;
        text-shadow: 2px 0 red;
    }

    100% {
        opacity: 0.2;
    }
}

/* =========================================
   3D CAROUSEL COMPONENT
   ========================================= */
.carousel-section {
    margin: 2rem 0;
    padding: 1rem 0;
}

.carousel-section-title {
    text-align: center;
    margin-bottom: 2rem;
}

.carousel-section-title h2 {
    font-family: var(--font-tech);
    font-size: 1.5rem;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 10px var(--neon-cyan);
}

.carousel-section-title p {
    font-family: var(--font-mono);
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.carousel-3d-container {
    position: relative;
    width: 100%;
    height: 420px;
    perspective: 1200px;
    perspective-origin: center center;
}

.carousel-3d {
    position: absolute;
    width: 320px;
    height: 380px;
    left: 35%;
    /* Shifted further left */
    top: 50%;
    transform-style: preserve-3d;
    transform: translateX(-50%) translateY(-50%) rotateY(0deg);
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-item {
    position: absolute;
    width: 320px;
    height: 380px;
    backface-visibility: hidden;
    transition: opacity 0.5s ease;
}

.carousel-item:nth-child(1) {
    transform: rotateY(0deg) translateZ(350px);
}

.carousel-item:nth-child(2) {
    transform: rotateY(120deg) translateZ(350px);
}

.carousel-item:nth-child(3) {
    transform: rotateY(240deg) translateZ(350px);
}

/* Carousel Controls */
.carousel-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.carousel-btn {
    width: 50px;
    height: 50px;
    background: rgba(0, 243, 255, 0.1);
    border: 2px solid var(--neon-cyan);
    border-radius: 50%;
    color: var(--neon-cyan);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: var(--neon-cyan);
    color: #000;
    box-shadow: 0 0 20px var(--neon-cyan);
    transform: scale(1.1);
}

.carousel-btn:active {
    transform: scale(0.95);
}

/* Carousel Indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    background: rgba(0, 243, 255, 0.2);
    border: 1px solid var(--neon-cyan);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    transform: scale(1.2);
}

/* =========================================
   ELECTRO BORDER EFFECT
   ========================================= */
.electro-border {
    position: relative;
    background: linear-gradient(135deg, rgba(10, 15, 30, 0.95), rgba(5, 8, 16, 0.98));
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
}

.electro-border::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 3px;
    background: linear-gradient(90deg,
            var(--neon-cyan) 0%,
            var(--neon-purple) 25%,
            var(--neon-cyan) 50%,
            var(--neon-purple) 75%,
            var(--neon-cyan) 100%);
    background-size: 300% 100%;
    animation: electro-flow 3s linear infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    border-radius: 12px;
    pointer-events: none;
}

.electro-border::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.3), transparent);
    animation: electro-scan 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes electro-flow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

@keyframes electro-scan {
    0% {
        left: -100%;
    }

    50% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

/* Electro Card Content */
.electro-card-content {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.electro-card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(0, 243, 255, 0.2);
}

.electro-card-header .material-icons {
    font-size: 1.8rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

.electro-card-header h3 {
    font-family: var(--font-tech);
    font-size: 1rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.electro-card-header .badge {
    margin-left: auto;
    background: rgba(0, 243, 255, 0.2);
    border: 1px solid var(--neon-cyan);
    padding: 0.3rem 0.6rem;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--neon-cyan);
    border-radius: 4px;
}

/* Electro Data Table */
.electro-table {
    flex: 1;
    overflow: hidden;
}

.electro-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.electro-table thead th {
    background: rgba(0, 243, 255, 0.1);
    color: var(--neon-cyan);
    padding: 0.7rem 0.5rem;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--neon-cyan);
}

.electro-table tbody td {
    padding: 0.6rem 0.5rem;
    color: var(--text-main);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
}

.electro-table tbody tr {
    transition: all 0.2s ease;
}

.electro-table tbody tr:hover {
    background: rgba(0, 243, 255, 0.05);
}

.electro-table .qty-low {
    color: #ff6b6b;
    font-weight: bold;
}

.electro-table .qty-normal {
    color: var(--neon-green);
}

.electro-card-footer {
    margin-top: auto;
    padding-top: 0.8rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.electro-card-footer a {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-decoration: none;
    font-family: var(--font-mono);
    transition: color 0.3s;
}

.electro-card-footer a:hover {
    color: var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan);
}

/* Empty State */
.electro-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.electro-empty-state .material-icons {
    font-size: 3rem;
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* =========================================
   3D CAROUSEL RESPONSIVE
   ========================================= */
@media (max-width: 1200px) {
    .carousel-3d-container {
        height: 380px;
    }

    .carousel-3d {
        width: 280px;
        height: 340px;
    }

    .carousel-item {
        width: 280px;
        height: 340px;
    }

    .carousel-item:nth-child(1) {
        transform: rotateY(0deg) translateZ(300px);
    }

    .carousel-item:nth-child(2) {
        transform: rotateY(120deg) translateZ(300px);
    }

    .carousel-item:nth-child(3) {
        transform: rotateY(240deg) translateZ(300px);
    }
}

@media (max-width: 768px) {
    .carousel-3d-container {
        height: auto;
        perspective: none;
    }

    .carousel-3d {
        position: static;
        width: 100%;
        height: auto;
        transform: none !important;
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .carousel-item {
        position: static;
        width: 100%;
        height: 300px;
        transform: none !important;
    }

    .carousel-controls {
        display: none;
    }

    .carousel-indicators {
        display: none;
    }
}

/* =========================================
   🎨 COVERFLOW 3D CAROUSEL + HOLOGRAPHIC HUD
   ========================================= */

/* Main Command Center Layout */
.command-center {
    display: grid;
    grid-template-columns: 1fr 380px;
    /* 左側自動擴展，右側HUD固定寬度 */
    gap: 2rem;
    min-height: 70vh;
    padding: 2rem 0;
    align-items: start;
    position: relative;
}

/* Left Side: Coverflow Showcase */
.orbit-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 580px;
    perspective: 1200px;
    overflow: visible;
    /* 允許卡片在區域內完整顯示 */
    z-index: 1;
    padding: 20px 40px;
    /* 增加左右padding給卡片空間 */
    padding-left: 250px
}

.core-nucleus {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ambient glow behind carousel */
.nucleus-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 400px;
    background: radial-gradient(ellipse at center,
            rgba(0, 243, 255, 0.08) 0%,
            rgba(188, 19, 254, 0.05) 40%,
            transparent 70%);
    pointer-events: none;
    z-index: -1;
    filter: blur(40px);
}

/* 3D Coverflow Container */
.carousel-3d-container {
    position: relative;
    width: 100%;
    height: 540px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1200px;
    transform-style: preserve-3d;
}

.carousel-3d {
    position: relative;
    width: 340px;
    height: 440px;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* margin-left: -80px; Removed old centering hack */
    /* 🔴 新增以下兩行來修正位置 */
    left: 0 !important;
    /* 強制覆蓋舊設定的 35% */
    margin: 10 auto;
    /* 確保在容器內水平置中 */
}

/* Coverflow Cards - All start hidden/back */
.carousel-item {
    position: absolute;
    width: 340px;
    height: 440px;
    top: 0;
    left: 0;
    background: linear-gradient(145deg, rgba(15, 20, 35, 0.95), rgba(8, 12, 24, 0.98));
    border: 1px solid rgba(0, 243, 255, 0.2);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 0 30px rgba(0, 243, 255, 0.05);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    color: #fff;
    overflow: hidden;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

.carousel-item .electro-border {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* Coverflow positioning - JS will handle active state */
/* 縮小translateX的值，避免卡片超出orbit-zone邊界 */
.carousel-item:nth-child(1) {
    transform: translateX(0) translateZ(0) rotateY(0deg);
    z-index: 5;
}

.carousel-item:nth-child(2) {
    transform: translateX(200px) translateZ(-60px) rotateY(-35deg);
    z-index: 3;
    opacity: 0.75;
}

.carousel-item:nth-child(3) {
    transform: translateX(350px) translateZ(-140px) rotateY(-50deg);
    z-index: 1;
    opacity: 0.35;
}

.carousel-item:nth-child(4) {
    transform: translateX(-200px) translateZ(-60px) rotateY(35deg);
    z-index: 3;
    opacity: 0.75;
}

.carousel-item:nth-child(5) {
    transform: translateX(-350px) translateZ(-140px) rotateY(50deg);
    z-index: 1;
    opacity: 0.35;
}

/* Active card highlight */
.carousel-item.active {
    transform: translateX(0) translateZ(50px) rotateY(0deg) !important;
    z-index: 10 !important;
    opacity: 1 !important;
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(0, 243, 255, 0.2),
        inset 0 0 30px rgba(0, 243, 255, 0.05);
    border-color: rgba(0, 243, 255, 0.4);
}

/* Card Content */
.electro-card-content {
    padding: 1.2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.center-content {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.electro-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.electro-card-header .material-icons {
    font-size: 2rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 15px rgba(0, 243, 255, 0.6);
}

.electro-card-header h3 {
    font-size: 1rem;
    font-family: var(--font-tech);
    letter-spacing: 1px;
    margin: 0;
}

.electro-card-header .badge {
    background: rgba(0, 243, 255, 0.15);
    color: var(--neon-cyan);
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Tables */
.electro-table {
    flex: 1;
    overflow-y: auto;
    font-size: 0.75rem;
}

.electro-table table {
    width: 100%;
    border-collapse: collapse;
}

.electro-table th,
.electro-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.electro-table th {
    color: var(--text-dim);
    font-weight: 500;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.electro-card-footer {
    margin-top: auto;
    padding-top: 0.8rem;
    text-align: center;
}

.electro-card-footer a {
    color: var(--neon-cyan);
    text-decoration: none;
    font-size: 0.8rem;
    opacity: 0.8;
    transition: all 0.3s;
}

.electro-card-footer a:hover {
    opacity: 1;
    text-shadow: 0 0 10px var(--neon-cyan);
}

/* Metric Circle */
.metric-circle-container {
    width: 100px;
    height: 100px;
    margin: 0.5rem 0;
}

.metric-circle {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.metric-circle::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--neon-cyan);
    border-right-color: rgba(0, 243, 255, 0.4);
    animation: spin 4s linear infinite;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: bold;
    z-index: 1;
}

.metric-label {
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.metric-stats {
    width: 100%;
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.3rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.text-neon {
    color: var(--neon-cyan);
}

/* System Grid */
.system-grid {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sys-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
}

.sys-label {
    width: 35px;
    color: var(--text-dim);
}

.sys-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.sys-fill {
    height: 100%;
    background: var(--neon-cyan);
    box-shadow: 0 0 6px var(--neon-cyan);
}

.sys-val {
    width: 35px;
    text-align: right;
}

.system-status-indicator {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.7rem;
    color: #4caf50;
    padding: 0.4rem 0.8rem;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 15px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #4caf50;
    border-radius: 50%;
    box-shadow: 0 0 8px #4caf50;
    animation: blink 2s infinite;
}

/* Carousel Controls - 定位在carousel正下方 */
.carousel-controls {
    position: absolute;
    bottom: -90px;
    left: 30%;
    /* Match carousel position */
    transform: translateX(-50%);
    display: flex;
    gap: 4rem;
    z-index: 20;
}

.carousel-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.3);
    color: var(--neon-cyan);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: rgba(0, 243, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
    transform: scale(1.1);
}

.carousel-indicators {
    position: absolute;
    bottom: -35px;
    left: 30%;
    /* Match carousel position */
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 20;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-indicator.active {
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
    transform: scale(1.3);
}

/* Animations */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}


/* =========================================
   🏗️ HOLOGRAPHIC PANEL TOWER (Right Side)
   ========================================= */
.hud-zone {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    perspective: 800px;
    padding-top: 1rem;
    position: relative;
    z-index: 10;
    /* HUD面板在carousel之上 */
}

/* Floating 3D Panel Effect */
.hud-panel {
    position: relative;
    background: linear-gradient(160deg, rgba(15, 20, 35, 0.9), rgba(8, 12, 24, 0.95));
    border-radius: 16px;
    padding: 1.2rem;
    border: 1px solid rgba(0, 243, 255, 0.1);
    backdrop-filter: blur(15px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-style: preserve-3d;
}

/* 3D Depth Stacking */
.hud-panel:nth-child(1) {
    transform: translateZ(20px);
    z-index: 3;
}

.hud-panel:nth-child(2) {
    transform: translateZ(10px) scale(0.98);
    z-index: 2;
    margin-top: -0.5rem;
}

.hud-panel:nth-child(3) {
    transform: translateZ(0) scale(0.96);
    z-index: 1;
    margin-top: -0.5rem;
    animation: hud-pulse 4s ease-in-out infinite 0.6s;
}

/* Panel Animations */
@keyframes hud-pulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        border-color: rgba(0, 243, 255, 0.1);
    }

    50% {
        box-shadow: 0 4px 30px rgba(0, 243, 255, 0.15), 0 0 20px rgba(0, 243, 255, 0.08);
        border-color: rgba(0, 243, 255, 0.25);
    }
}

/* Scanning Line Animation */
.hud-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.05), transparent);
    animation: hud-scan 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes hud-scan {
    0% {
        left: -100%;
    }

    50%,
    100% {
        left: 200%;
    }
}

.hud-panel:nth-child(1) {
    animation: hud-pulse 4s ease-in-out infinite;
}

.hud-panel:nth-child(2) {
    animation: hud-pulse 4s ease-in-out infinite 0.3s;
}

.hud-panel:hover {
    transform: translateY(-8px) translateZ(30px) !important;
    border-color: rgba(0, 243, 255, 0.5) !important;
    animation: none;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(0, 243, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Panel Header */
.hud-label {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 0.55rem;
    font-family: var(--font-mono);
    color: var(--neon-cyan);
    letter-spacing: 1.5px;
    opacity: 0.6;
}

.hud-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(0, 243, 255, 0.1);
}

.hud-header .material-icons {
    color: var(--neon-cyan);
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.hud-header h3 {
    font-family: var(--font-tech);
    font-size: 0.95rem;
    color: #fff;
    font-weight: 500;
    margin: 0;
}

/* 📊 FIXED Bar Chart */
.chart-body {
    padding: 0.5rem 0;
}

.simple-bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 120px;
    padding: 0.5rem 0;
    gap: 4px;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 40px;
    height: 100%;
}

.bar-fill {
    width: 100%;
    background: linear-gradient(to top, rgba(0, 243, 255, 0.3), var(--neon-cyan));
    border-radius: 4px 4px 0 0;
    min-height: 5px;
    transition: height 0.8s ease;
    box-shadow: 0 0 8px rgba(0, 243, 255, 0.3);
}

/* X-Axis Labels - FIXED */
.bar-label {
    margin-top: 8px;
    color: var(--text-dim);
    font-size: 0.65rem;
    font-family: var(--font-mono);
    text-align: center;
    white-space: nowrap;
}

/* Data value on top of bar */
.bar-group::before {
    content: attr(data-value);
    font-size: 0.6rem;
    color: var(--neon-cyan);
    margin-bottom: 4px;
    opacity: 0.8;
}

/* Weather Panel */
.weather-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.weather-icon-large {
    font-size: 2.5rem;
    filter: drop-shadow(0 0 8px rgba(255, 200, 0, 0.4));
}

.weather-temp {
    font-size: 1.8rem;
    font-weight: bold;
    font-family: var(--font-mono);
}

.weather-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.weather-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.w-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.w-item .label {
    font-size: 0.65rem;
    color: var(--text-dim);
}

.w-item .value {
    font-size: 0.9rem;
    font-family: var(--font-mono);
    color: var(--neon-cyan);
}

/* Quick Actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 243, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.quick-action-btn:hover {
    background: rgba(0, 243, 255, 0.1);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
    transform: translateY(-2px);
}

.quick-action-btn .material-icons {
    font-size: 1rem;
    color: var(--neon-cyan);
}

/* Live indicator */
.live-dot {
    width: 6px;
    height: 6px;
    background: #4caf50;
    border-radius: 50%;
    animation: blink 1.5s infinite;
    box-shadow: 0 0 6px #4caf50;
}

/* =========================================
   📱 Responsive Design
   ========================================= */
@media (max-width: 1400px) {
    .command-center {
        grid-template-columns: 55% 45%;
    }

    .carousel-item {
        width: 260px;
        height: 340px;
    }

    .carousel-3d {
        width: 260px;
        height: 340px;
    }
}

@media (max-width: 1200px) {
    .command-center {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .orbit-zone {
        min-height: 400px;
    }

    .hud-zone {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }

    .hud-panel:nth-child(n) {
        transform: none;
        margin-top: 0;
    }
}

@media (max-width: 768px) {

    /* 🔴 新增這段：在手機上完全隱藏左側軌道區 (旋轉木馬) */
    .orbit-zone {
        display: none !important;
    }

    /* 調整主畫面配置，讓右側 HUD 填滿畫面 */
    .command-center {
        grid-template-columns: 1fr;
        /* 改為單欄 */
        padding: 10px;
        min-height: auto;
        /* 移除最小高度限制 */
        gap: 1rem;
    }

    .carousel-item {
        width: 240px;
        height: 320px;
    }

    .hud-zone {
        grid-template-columns: 1fr;
    }

    .carousel-item:nth-child(n+3) {
        display: none;
    }
}