:root {
    --win-bg: #1a1a2e;
    --taskbar-bg: rgba(30, 30, 42, 0.92);
    --text-light: #ffffff;
    --window-shadow: 0 8px 40px rgba(0, 0, 0, 0.55);
    --titlebar-height: 38px;
    --accent: #4a6cf7;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    width: 100vw; height: 100vh; overflow: hidden;
    user-select: none; background: #000; position: relative;
}

/* 锁屏 */
.lockscreen {
    position: fixed; inset: 0; z-index: 1000;
    background: linear-gradient(160deg, #0c1445, #1a237e, #0d1b3e, #0a1628);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; transition: opacity 0.6s;
}
.lockscreen.fading-out { opacity: 0; pointer-events: none; }
.lockscreen .time-display { font-size: 110px; font-weight: 300; color: #fff; text-shadow: 0 0 80px rgba(180,200,255,0.5); }
.lockscreen .date-display { font-size: 22px; color: #d0d8f0; margin-top: 12px; }
.lockscreen .hint-text { position: absolute; bottom: 80px; font-size: 14px; color: rgba(255,255,255,0.55); }

/* 登录 */
.login-overlay {
    position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,0.7);
    backdrop-filter: blur(20px); display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.5s;
}
.login-overlay.active { opacity: 1; pointer-events: all; }
.login-box {
    background: rgba(30,30,45,0.9); border-radius: 18px; padding: 40px;
    width: 380px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.login-avatar {
    width: 80px; height: 80px; border-radius: 50%; background: #4a6cf7;
    display: flex; align-items: center; justify-content: center; font-size: 36px;
    color: #fff; margin: 0 auto 20px;
}
.login-name { font-size: 24px; color: #fff; margin-bottom: 20px; }
.login-input-group input {
    width: 100%; padding: 12px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.1);
    color: #fff; font-size: 15px; outline: none; margin-bottom: 15px;
}
.login-btn {
    width: 100%; padding: 12px; border: none; border-radius: 8px;
    background: #4a6cf7; color: #fff; font-size: 16px; cursor: pointer;
}
#loginError { color: #ff6b6b; margin-top: 10px; font-size: 13px; }

/* 桌面 */
.desktop {
    position: fixed; inset: 0; z-index: 1;
    background: url('https://i.redd.it/4q6x5y1k1hp41.jpg') center/cover no-repeat, linear-gradient(135deg, #0d3b66, #1a659e);
    display: none; flex-direction: column;
}
.desktop.active { display: flex; }
.desktop-icons-area {
    flex: 1; padding: 20px; display: flex; flex-direction: column;
    gap: 15px; align-items: flex-start; padding-top: 30px; padding-left: 30px;
}
.desktop-icon {
    display: flex; flex-direction: column; align-items: center; width: 90px;
    padding: 8px; border-radius: 6px; cursor: pointer;
}
.desktop-icon:hover { background: rgba(255,255,255,0.15); }
.desktop-icon .icon-img {
    width: 52px; height: 52px; border-radius: 8px; display: flex;
    align-items: center; justify-content: center; font-size: 18px; font-weight: bold;
    color: #fff; margin-bottom: 5px;
}
.desktop-icon .icon-label { font-size: 12px; color: #fff; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,0.7); }

/* 任务栏 */
.taskbar {
    height: 48px; background: var(--taskbar-bg); backdrop-filter: blur(20px);
    display: flex; align-items: center; padding: 0 15px; gap: 10px;
    border-top: 1px solid rgba(255,255,255,0.1);
    position: relative;
}
.taskbar .start-btn {
    width: 40px; height: 40px; border-radius: 6px; display: flex; align-items: center;
    justify-content: center; cursor: pointer; font-size: 16px; font-weight: bold; color: #fff;
    transition: background 0.2s;
}
.taskbar .start-btn:hover { background: rgba(255,255,255,0.15); }
.taskbar .taskbar-icon-item {
    width: auto; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 6px; display: flex;
    align-items: center; justify-content: center; cursor: pointer;
    font-size: 13px; color: #fff; font-weight: 500;
}
.taskbar .taskbar-icon-item.active { background: rgba(255,255,255,0.2); }

/* 开始菜单 */
.start-menu {
    position: absolute; bottom: 52px; left: 0; width: 220px;
    background: rgba(30,30,45,0.95); backdrop-filter: blur(20px);
    border-radius: 8px; padding: 10px 0; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    z-index: 101;
}
.start-menu-item {
    padding: 10px 20px; color: #ccc; cursor: pointer; font-size: 14px;
    transition: background 0.2s;
}
.start-menu-item:hover { background: rgba(255,255,255,0.1); }

/* 通用窗口 */
.window-container { position: fixed; z-index: 200; display: none; pointer-events: none; }
.window-container.open { display: block; pointer-events: all; }
.window-frame {
    position: absolute; width: 900px; height: 600px; min-width: 600px; min-height: 400px;
    background: #1a1a2e; border-radius: 10px; box-shadow: var(--window-shadow);
    display: flex; flex-direction: column; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.15);
}
.window-frame.maximized {
    width: 100vw !important; height: calc(100vh - 48px) !important;
    top: 0 !important; left: 0 !important; border-radius: 0 !important;
    min-width: auto; min-height: auto;
}
.window-titlebar {
    height: var(--titlebar-height); background: #1e1e32; display: flex;
    align-items: center; padding: 0 10px; cursor: move;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.window-titlebar .title-text { flex: 1; text-align: center; color: #ccc; font-size: 13px; }
.win-btn {
    width: 30px; height: 28px; border-radius: 4px; display: flex;
    align-items: center; justify-content: center; cursor: pointer; color: #aaa; font-size: 14px;
}
.win-btn:hover { background: rgba(255,255,255,0.1); }
.close-btn:hover { background: #d93025 !important; color: #fff !important; }

/* DLC 管理器 */
.dlc-body { display: flex; flex: 1; overflow: hidden; }
.dlc-sidebar {
    width: 160px; background: #252535; padding: 10px;
    border-right: 1px solid #333;
}
.dlc-sidebar .nav-section { color: #777; font-size: 10px; letter-spacing: 1px; margin-bottom: 5px; }
.dlc-sidebar .nav-item {
    padding: 8px; color: #ccc; cursor: pointer; border-radius: 4px;
}
.dlc-sidebar .nav-item.active { background: var(--accent); color: #fff; }
.dlc-sidebar .nav-item.disabled { color: #555; cursor: default; pointer-events: none; }
.dlc-sidebar .nav-item.enabled { color: #ccc; cursor: pointer; pointer-events: auto; }
.dlc-main { flex: 1; display: flex; flex-direction: column; background: #1a1a2e; overflow-y: auto; }
.dlc-header { padding: 10px 20px; font-size: 16px; border-bottom: 1px solid #333; }
.dlc-info-bar {
    padding: 6px 20px; font-size: 11px; color: #9aa0b0;
    background: #1e1e32; border-bottom: 1px solid #333;
}
.dlc-panel { display: none; flex: 1; flex-direction: column; }
.dlc-panel.active { display: flex; }
.dlc-content { flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; }

/* 检测区域 */
.detection-center {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex: 1; min-height: 200px;
}
.step-text { font-size: 14px; color: #ccc; }
.step-success { color: #4caf84; }
.step-fail { color: #e07060; }
.spinner {
    width: 36px; height: 36px; border: 3px solid rgba(255,255,255,0.15);
    border-top-color: var(--accent); border-radius: 50%;
    animation: spin 0.8s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 游戏卡片 */
.game-cards-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; padding: 6px 0; }
.game-card {
    background: #222238; border-radius: 10px; overflow: hidden;
    transition: all 0.3s; border: 1px solid rgba(255,255,255,0.05);
    display: flex; flex-direction: column; aspect-ratio: 0.62;
}
.game-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,0.5); }
.game-card .card-cover {
    flex: 1; display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: bold; background: linear-gradient(135deg, #2a2a3a, #3a3a4a); color: #fff;
}
.game-card .card-info { padding: 10px; background: #1e1e32; }
.game-card .card-info .game-name { font-size: 13px; color: #e0e0e0; }
.game-card .card-info .game-status { font-size: 10px; color: #4caf84; margin-top: 4px; }

/* DLC 管理表格 */
.dlc-table-wrapper { flex: 1; overflow-y: auto; }
.dlc-table { width: 100%; border-collapse: collapse; color: #ccc; font-size: 13px; }
.dlc-table th, .dlc-table td { padding: 8px 10px; border-bottom: 1px solid #2a2a3a; text-align: left; }
.dlc-table th { background: #252535; position: sticky; top: 0; z-index: 1; }
.dlc-table tr:hover { background: rgba(255,255,255,0.05); }
.dlc-table .game-cell { display: flex; align-items: center; gap: 8px; }
.search-bar { display: flex; gap: 8px; padding: 10px 20px; border-bottom: 1px solid #333; }
.search-bar input {
    flex: 1; padding: 6px 10px; border-radius: 4px; border: 1px solid #444466;
    background: #1c1c2c; color: #e0e0e0; font-size: 12px; outline: none;
}
.search-bar button {
    padding: 6px 14px; border: none; background: var(--accent); color: #fff;
    border-radius: 4px; cursor: pointer; font-size: 12px;
}

/* 数据演示模拟窗口 */
.demo-content { padding: 20px; color: #ccc; }
.demo-switch-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.demo-switch-group label { font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.btn {
    padding: 8px 18px; border: none; background: var(--accent);
    color: #fff; border-radius: 4px; cursor: pointer; font-size: 13px;
}
.btn:hover { opacity: 0.9; }

/* 资源管理器 */
.explorer-body { display: flex; flex: 1; overflow: hidden; }
.explorer-sidebar {
    width: 200px; background: #252535; border-right: 1px solid rgba(255,255,255,0.08);
    padding: 10px 0; overflow-y: auto;
}
.explorer-sidebar ul { list-style: none; padding-left: 10px; }
.explorer-sidebar li {
    padding: 6px 12px; cursor: pointer; color: #ccc;
    border-radius: 4px; display: flex; align-items: center; gap: 6px; font-size: 13px;
}
.explorer-sidebar li:hover { background: #3a3a50; }
.explorer-main { flex: 1; display: flex; flex-direction: column; background: #1a1a2e; }
.explorer-toolbar {
    padding: 8px 15px; display: flex; align-items: center; gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.address-bar {
    display: flex; align-items: center; flex: 1; background: #2a2a3a;
    border-radius: 4px; padding: 0 10px; height: 30px; color: #ccc; font-size: 13px;
}
.file-list {
    flex: 1; display: grid; grid-template-columns: repeat(auto-fill, 90px);
    gap: 10px; padding: 15px; align-content: flex-start; overflow-y: auto;
}
.file-item {
    display: flex; flex-direction: column; align-items: center;
    padding: 8px; border-radius: 6px; cursor: pointer; width: 85px; text-align: center;
}
.file-item:hover { background: rgba(255,255,255,0.1); }
.file-item .file-icon { font-size: 28px; margin-bottom: 4px; color: #fff; }
.file-item .file-name { font-size: 11px; color: #ddd; word-break: break-all; }
.disk-capacity { padding: 10px 15px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.disk-capacity .bar { height: 6px; background: #4a6cf7; border-radius: 3px; margin-top: 5px; }

/* 右键菜单 */
.context-menu {
    position: fixed; z-index: 9999; background: #2a2a3a; border-radius: 6px;
    padding: 5px 0; box-shadow: 0 6px 20px rgba(0,0,0,0.6); min-width: 180px;
    border: 1px solid #444;
}
.context-item {
    padding: 8px 16px; color: #ccc; font-size: 13px; cursor: pointer;
}
.context-item:hover { background: #3a3a50; }

/* DLC 详情弹窗 */
.dlc-modal {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 500px; max-height: 70vh; background: #1e1e32; border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.7); z-index: 10000;
    display: flex; flex-direction: column; overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}
.dlc-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 15px; background: #252535; border-bottom: 1px solid #333;
}
.dlc-modal-title { color: #ccc; font-size: 14px; font-weight: 500; }
.dlc-modal .close-btn {
    width: 28px; height: 28px; border-radius: 4px; display: flex;
    align-items: center; justify-content: center; cursor: pointer; color: #aaa; font-size: 16px;
}
.dlc-modal .close-btn:hover { background: #d93025; color: #fff; }
.dlc-modal-body {
    padding: 15px; overflow-y: auto; flex: 1;
}
.dlc-item {
    display: flex; align-items: center; gap: 12px; padding: 6px 0;
    border-bottom: 1px solid #2a2a3a;
}
.dlc-item:last-child { border-bottom: none; }
.dlc-checkbox { width: 18px; height: 18px; accent-color: #4a6cf7; }
.dlc-thumb {
    width: 50px; height: 50px; background: #2a2a3a; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    color: #ccc; font-size: 20px; font-weight: bold;
}
.dlc-name { color: #ddd; font-size: 13px; }