/* ========== 统一配色系统 ========== */
:root {
    /* 背景色 */
    --bg-primary: #050510;
    --bg-secondary: #0a141f;
    --bg-panel: rgba(10, 20, 35, 0.85);

    /* 主题色 */
    --color-primary: #00aaff;
    --color-success: #00ff88;
    --color-warning: #ffaa00;
    --color-error: #ff4466;

    /* 文字色 */
    --text-primary: #e0e0e0;
    --text-secondary: #8899aa;
    --text-muted: #556677;

    /* 边框色 */
    --border-subtle: rgba(0, 170, 255, 0.2);
    --border-accent: rgba(0, 170, 255, 0.5);
}

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

body {
    overflow: hidden;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    /* [H8 Fix] 添加回退值 */
    background-color: var(--bg-primary, #050510);
    color: var(--text-primary, #e0e0e0);
}

#gl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    z-index: 0;
}

/* Dashboard position is controlled by panels.css */
/* Original dashboard style removed to avoid conflicts */

.chart-container {
    flex: 1;
    max-width: 600px;
    background: rgba(0, 20, 40, 0.6);
    border: 1px solid rgba(0, 170, 255, 0.3);
    border-radius: 8px;
    padding: 10px;
    backdrop-filter: blur(4px);
    pointer-events: auto;
}

.chart-container h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #00aaff;
    text-align: center;
}

canvas {
    width: 100% !important;
    height: calc(100% - 20px) !important;
}

/* Detailed Data Panel (3D Label) */
.data-panel {
    background: rgba(0, 20, 40, 0.85);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 4px;
    padding: 8px;
    font-family: 'Inter', sans-serif;
    min-width: 120px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.data-panel-title {
    color: #00ffff;
    font-size: 12px;
    font-weight: bold;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
    margin-bottom: 4px;
    text-align: center;
}

.data-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #aaccff;
    margin-bottom: 2px;
}

.data-value {
    color: #ffffff;
    font-weight: bold;
}

.data-unit {
    color: #667788;
    margin-left: 2px;
}

#ui-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass through to canvas */
}

/* .panel 样式已移至 panels.css，这里只保留左侧面板特定样式 */
#ui-overlay .panel {
    width: auto;
}

h1 {
    font-size: 14px;
    font-weight: 600;
    /* [H8 Fix] 添加回退值 */
    color: var(--color-primary, #00aaff);
    margin-bottom: 16px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle, rgba(0, 170, 255, 0.2));
    padding-bottom: 10px;
}

/* 核心指标区 */
.core-metrics {
    margin-bottom: 16px;
}

/* 操作按钮区 */
.control-section {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.primary-btn {
    flex: 1;
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.primary-btn:hover {
    background: #0088cc;
    box-shadow: 0 4px 12px rgba(0, 170, 255, 0.3);
}

.secondary-btn {
    flex: 1;
    background: rgba(0, 170, 255, 0.15);
    color: var(--color-primary);
    border: 1px solid var(--border-accent);
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: rgba(0, 170, 255, 0.25);
    box-shadow: 0 4px 12px rgba(0, 170, 255, 0.2);
}

/* 折叠区域 */
.collapsible-section {
    margin-bottom: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 0;
}

.collapsible-section summary {
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px 12px;
    user-select: none;
    list-style: none;
    transition: all 0.2s;
}

.collapsible-section summary:hover {
    color: var(--color-primary);
    background: rgba(0, 170, 255, 0.05);
}

.collapsible-section[open] summary {
    border-bottom: 1px solid var(--border-subtle);
    color: var(--color-primary);
}

.section-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    background: rgba(0, 170, 255, 0.1);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(0, 170, 255, 0.2);
    color: var(--color-primary);
    border-color: var(--border-accent);
}

/* 回放控制 */
.replay-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.replay-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(0, 170, 255, 0.15);
    border: 1px solid var(--border-subtle);
    color: var(--color-primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.replay-btn:hover {
    background: rgba(0, 170, 255, 0.3);
}

.replay-controls input[type="range"] {
    flex: 1;
    accent-color: var(--color-primary);
}

.replay-time {
    text-align: right;
    font-size: 11px;
    color: var(--color-primary);
    margin-top: 4px;
}

.status-row {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-active {
    color: #00ff88;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.5);
}

.data-row {
    margin-bottom: 8px;
    font-size: 14px;
    color: #ccc;
    display: flex;
    justify-content: space-between;
}

.data-row span:last-child {
    color: #fff;
    font-family: 'Consolas', monospace;
    font-weight: bold;
}

/* Device Monitor Panel - Position controlled by panels.css */
.device-monitor {
    /* Position is set by #device-panel in panels.css */
    width: 280px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}

.device-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 5px;
}

.device-item {
    font-size: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.device-name {
    color: #8899aa;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.device-status {
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
}

.device-status.running {
    color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.device-status.stopped {
    color: #8899aa;
    background: rgba(136, 153, 170, 0.1);
    border: 1px solid rgba(136, 153, 170, 0.3);
}

.device-status.fault {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.device-status.unknown {
    color: #ffaa00;
    border: 1px solid rgba(255, 170, 0, 0.3);
}

/* Scrollbar for device list */
.device-list::-webkit-scrollbar {
    width: 4px;
}

.device-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.device-list::-webkit-scrollbar-thumb {
    background: rgba(0, 170, 255, 0.3);
    border-radius: 2px;
}

/* Alarm Log Panel - Position controlled by panels.css */
.alarm-log {
    /* Position is set by #alarm-log-panel in panels.css */
    width: 280px;
    max-height: 300px;
    display: flex;
    flex-direction: column;
}

.alarm-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 5px;
}

.alarm-item {
    font-size: 12px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 8px;
}

.alarm-item .time {
    color: #8899aa;
    font-family: monospace;
}

.alarm-item.error .msg {
    color: #ff4444;
}

.alarm-item.warning .msg {
    color: #ffaa00;
}

.alarm-item.info .msg {
    color: #00aaff;
}

.alarm-item.success .msg {
    color: #00ff88;
}

/* Scrollbar for alarm list */
.alarm-list::-webkit-scrollbar {
    width: 4px;
}

.alarm-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.alarm-list::-webkit-scrollbar-thumb {
    background: rgba(0, 170, 255, 0.3);
    border-radius: 2px;
}

/* Global HUD */
.hud-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through */
    z-index: 50;
    padding: 20px;
    box-sizing: border-box;
    background: radial-gradient(circle at center, transparent 60%, rgba(0, 10, 30, 0.6) 100%);
    transition: opacity 0.5s ease;
}

.hud-container.hidden {
    opacity: 0;
}

.hud-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to bottom, rgba(0, 170, 255, 0.1), transparent);
    border-bottom: 1px solid rgba(0, 170, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
}

.hud-title {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #00aaff;
    text-shadow: 0 0 10px #00aaff;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ff0000;
    /* Default Disconnected */
    box-shadow: 0 0 5px #ff0000;
    transition: all 0.3s ease;
}

.status-dot.connected {
    background-color: #00ff00;
    box-shadow: 0 0 8px #00ff00;
}

.status-dot.disconnected {
    background-color: #ff0000;
    box-shadow: 0 0 5px #ff0000;
}

.hud-time {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    color: #fff;
}

.hud-corner {
    position: absolute;
    width: 200px;
    height: 100px;
    border: 2px solid rgba(0, 170, 255, 0.5);
    background: rgba(0, 20, 40, 0.6);
    backdrop-filter: blur(4px);
}

.hud-corner::before {
    /* Corner accent */
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #00aaff;
    box-shadow: 0 0 10px #00aaff;
}

.top-left {
    top: 80px;
    left: 20px;
    border-right: none;
    border-bottom: none;
}

.top-left::before {
    top: 0;
    left: 0;
}

.top-right {
    top: 80px;
    right: 20px;
    border-left: none;
    border-bottom: none;
    text-align: right;
}

.top-right::before {
    top: 0;
    right: 0;
}

.bottom-left {
    bottom: 20px;
    left: 20px;
    border-right: none;
    border-top: none;
}

.bottom-left::before {
    bottom: 0;
    left: 0;
}

.bottom-right {
    bottom: 20px;
    right: 20px;
    border-left: none;
    border-top: none;
    text-align: right;
}

.bottom-right::before {
    bottom: 0;
    right: 0;
}

.hud-widget {
    padding: 15px;
}

.hud-label {
    font-size: 0.8rem;
    color: #8899aa;
    letter-spacing: 2px;
}

.hud-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* 3D Labels */
.label-3d {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0, 170, 255, 0.5);
    pointer-events: none;
    white-space: nowrap;
    backdrop-filter: blur(2px);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.label-3d span {
    font-weight: bold;
    color: #00aaff;
    margin-left: 5px;
}

/* 3D Callout Styles */
.callout-container {
    position: absolute;
    pointer-events: none;
    /* Center the container on the anchor point */
    transform: translate(-50%, -50%);
}

/* Property Panel */
.glass-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    background: rgba(10, 20, 40, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 170, 255, 0.3);
    border-radius: 12px;
    padding: 20px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 100;
}

.glass-panel.hidden {
    transform: translateX(120%);
    opacity: 0;
    pointer-events: none;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: #00aaff;
    text-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
}

#panel-close {
    background: none;
    border: none;
    color: #8899aa;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

#panel-close:hover {
    color: #fff;
}

.prop-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.prop-row .label {
    color: #8899aa;
}

.prop-row .value {
    font-weight: 500;
}

.status-ok {
    color: #00ff88;
}

.status-warning {
    color: #ffaa00;
}

.status-error {
    color: #ff4444;
}

.panel-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    background: rgba(0, 170, 255, 0.2);
    border: 1px solid rgba(0, 170, 255, 0.5);
    color: #00aaff;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(0, 170, 255, 0.4);
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.3);
}

.action-btn.warning {
    border-color: rgba(255, 68, 68, 0.5);
    color: #ff4444;
    background: rgba(255, 68, 68, 0.1);
}

.action-btn.warning:hover {
    background: rgba(255, 68, 68, 0.3);
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.3);
}

/* ========== 环境主题选择器 ========== */
.theme-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.theme-label {
    font-size: 11px;
    color: var(--text-secondary, #8899aa);
    min-width: 36px;
}

.theme-toggle {
    display: flex;
    gap: 4px;
    flex: 1;
}

.theme-btn {
    flex: 1;
    background: rgba(30, 40, 60, 0.6);
    border: 1px solid rgba(0, 170, 255, 0.2);
    color: var(--text-secondary, #8899aa);
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.theme-btn:hover {
    background: rgba(0, 170, 255, 0.15);
    border-color: rgba(0, 170, 255, 0.4);
}

.theme-btn.active {
    background: rgba(0, 170, 255, 0.25);
    border-color: var(--color-primary, #00aaff);
    color: var(--color-primary, #00aaff);
    box-shadow: 0 0 8px rgba(0, 170, 255, 0.3);
}

.callout-dot {
    width: 8px;
    height: 8px;
    background: #00aaff;
    border-radius: 50%;
    box-shadow: 0 0 10px #00aaff;
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
}

.callout-line {
    width: 40px;
    height: 2px;
    background: #00aaff;
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 50%;
    transform: rotate(-45deg);
    box-shadow: 0 0 5px #00aaff;
}

.callout-content {
    position: absolute;
    /* Position at the end of the line (approx 40px at -45deg) */
    top: -30px;
    left: 30px;

    color: #fff;
    font-family: 'Inter', sans-serif;
    padding: 8px 12px;
    background: rgba(0, 10, 20, 0.85);
    border: 1px solid rgba(0, 170, 255, 0.6);
    border-left: 3px solid #00aaff;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.callout-content:hover {
    background: rgba(0, 20, 40, 0.95);
    border-color: #00ffff;
    transform: scale(1.05);
    z-index: 100;
}

/* Notifications */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification-toast {
    background: rgba(10, 25, 40, 0.9);
    border-left: 4px solid #00aaff;
    color: #fff;
    padding: 16px 24px;
    border-radius: 4px;
    min-width: 300px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    font-size: 14px;
    display: flex;
    align-items: center;
    animation: slideIn 0.3s ease-out forwards;
    pointer-events: auto;
}

.notification-toast.success {
    border-left-color: #00ff88;
}

.notification-toast.info {
    border-left-color: #00aaff;
}

.notification-toast.warning {
    border-left-color: #ffaa00;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Button Styles */
button {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* Demo Mode Buttons */
#demo-btn,
#anomaly-btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    color: white;
}

#demo-btn {
    background: #3498db;
}

#demo-btn:hover {
    background: #2980b9;
}

#anomaly-btn {
    background: #f39c12;
}

#anomaly-btn:hover {
    background: #e67e22;
}

/* --- Mobile Adaptation (Phase 17) --- */
@media (max-width: 768px) {

    /* 1. Adjust Main Panel */
    .panel {
        width: 280px;
        padding: 15px;
        top: 10px;
        left: 10px;
    }

    h1 {
        font-size: 18px;
        margin-bottom: 15px;
    }

    .data-row {
        font-size: 12px;
    }

    /* 2. Adjust Dashboard (Bottom Charts) */
    #dashboard-panel {
        height: 160px;
        padding: 10px;
        gap: 10px;
    }

    .chart-container h3 {
        font-size: 12px;
        margin-bottom: 5px;
    }

    /* 3. Adjust HUD (Cinematic Mode) */
    .hud-top-bar {
        padding: 0 15px;
        height: 50px;
    }

    .hud-title {
        font-size: 16px;
    }

    .hud-time {
        font-size: 1rem;
    }

    .hud-corner {
        width: 140px;
        height: 70px;
    }

    .hud-widget {
        padding: 10px;
    }

    .hud-label {
        font-size: 0.7rem;
    }

    .hud-value {
        font-size: 1.2rem;
    }

    /* Reposition corners to avoid overlap */
    .top-left {
        top: 60px;
        left: 10px;
    }

    .top-right {
        top: 60px;
        right: 10px;
    }

    .bottom-left {
        bottom: 10px;
        left: 10px;
    }

    .bottom-right {
        bottom: 10px;
        right: 10px;
    }

    /* 4. Adjust Property Panel */
    .glass-panel {
        width: 260px;
        top: 10px;
        right: 10px;
        padding: 15px;
    }

    /* 5. Touch Targets */
    button {
        padding: 10px 16px;
        /* Larger touch area */
    }

    /* 6. Alarm Log & Device Monitor - Collapsible or Smaller */
    .alarm-log,
    .device-monitor {
        width: 240px;
        max-height: 180px;
    }

    .alarm-log {
        top: 60px;
        right: 10px;
    }

    .device-monitor {
        top: 230px;
        /* Stack below main panel */
        left: 10px;
    }
}

/* ========== Welcome Guide - Apple/Claude 风格 ========== */
.welcome-overlay {
    position: fixed;
    inset: 0;
    background: var(--surface-overlay, rgba(0, 0, 0, 0.6));
    backdrop-filter: blur(var(--blur-sm, 4px));
    -webkit-backdrop-filter: blur(var(--blur-sm, 4px));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-modal, 500);
    animation: overlay-fade-in var(--duration-normal, 250ms) var(--ease-out, ease-out);
}

.welcome-overlay.hidden {
    display: none;
}

@keyframes overlay-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modal-scale-in {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.welcome-card {
    width: 520px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
    /* 减小边距，留更多空间 */
    overflow-y: auto;
    /* 改为auto允许滚动 */
    background: linear-gradient(180deg,
            rgba(34, 34, 46, 0.95) 0%,
            rgba(26, 26, 36, 0.98) 100%);
    backdrop-filter: blur(var(--blur-xl, 24px));
    -webkit-backdrop-filter: blur(var(--blur-xl, 24px));
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
    border-radius: var(--radius-xl, 16px);
    box-shadow: var(--shadow-xl, 0 16px 48px rgba(0, 0, 0, 0.6));
    padding: var(--space-6, 24px);
    /* 减小padding */
    animation: modal-scale-in var(--duration-slow, 400ms) var(--ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1));
}

.welcome-header {
    text-align: center;
    margin-bottom: var(--space-6, 24px);
}

.welcome-icon {
    margin-bottom: var(--space-4, 16px);
}

.welcome-icon svg {
    filter: drop-shadow(0 4px 12px rgba(94, 181, 247, 0.3));
}

.welcome-title {
    font: var(--text-title-1, 600 24px/1.3 sans-serif);
    color: var(--text-primary, #f0f0f5);
    letter-spacing: var(--tracking-tight, -0.02em);
    margin: 0 0 var(--space-2, 8px) 0;
}

.welcome-subtitle {
    font: var(--text-body, 400 14px/1.5 sans-serif);
    color: var(--text-secondary, #9ca3af);
    margin: 0;
}

.guide-section {
    margin-bottom: var(--space-5, 20px);
}

.section-title {
    font: var(--text-caption, 400 12px/1.4 sans-serif);
    font-weight: 500;
    color: var(--text-tertiary, #6b7280);
    text-transform: uppercase;
    letter-spacing: var(--tracking-wider, 0.05em);
    margin: 0 0 var(--space-4, 16px) 0;
}

.keyboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3, 12px);
}

.keyboard-key {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2, 8px);
}

.key-cap {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg,
            var(--surface-elevated-3, #22222e) 0%,
            var(--surface-elevated-2, #1a1a24) 100%);
    border: 1px solid var(--border-default, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius-md, 8px);
    box-shadow:
        0 2px 0 var(--surface-base, #0a0a0f),
        0 4px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    font-family: var(--font-mono, monospace);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #f0f0f5);
    transition:
        transform var(--duration-fast, 150ms) var(--ease-default),
        box-shadow var(--duration-fast, 150ms) var(--ease-default);
}

.key-cap:hover {
    transform: translateY(-2px);
    box-shadow:
        0 4px 0 var(--surface-base, #0a0a0f),
        0 8px 16px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.key-cap.wide {
    width: auto;
    padding: 0 var(--space-4, 16px);
    min-width: 72px;
    font-size: 13px;
}

.key-cap svg {
    color: var(--text-secondary, #9ca3af);
}

.key-label {
    font: var(--text-caption, 400 12px/1.4 sans-serif);
    color: var(--text-tertiary, #6b7280);
}

.tips-section {
    padding-top: var(--space-4, 16px);
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3, 12px);
}

.tips-list li {
    display: flex;
    align-items: center;
    gap: var(--space-3, 12px);
    font: var(--text-body, 400 14px/1.5 sans-serif);
    color: var(--text-secondary, #9ca3af);
}

.tip-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

.welcome-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-6, 24px);
    padding-top: var(--space-5, 20px);
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-default, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius-sm, 4px);
    background: var(--surface-elevated-2, #1a1a24);
    transition:
        background var(--duration-fast, 150ms) var(--ease-default),
        border-color var(--duration-fast, 150ms) var(--ease-default);
    position: relative;
}

.checkbox-wrapper input:checked+.checkbox-custom {
    background: var(--color-accent, #5eb5f7);
    border-color: var(--color-accent, #5eb5f7);
}

.checkbox-wrapper input:checked+.checkbox-custom::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-wrapper input:focus-visible+.checkbox-custom {
    outline: 2px solid var(--color-accent, #5eb5f7);
    outline-offset: 2px;
}

.checkbox-text {
    font: var(--text-caption, 400 12px/1.4 sans-serif);
    color: var(--text-tertiary, #6b7280);
}

.btn-lg {
    height: 48px;
    padding: var(--space-3, 12px) var(--space-6, 24px);
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
}

.btn-lg svg {
    transition: transform var(--duration-fast, 150ms) var(--ease-default);
}

.btn-lg:hover svg {
    transform: translateX(4px);
}

@media (max-width: 600px) {
    .welcome-card {
        padding: var(--space-6, 24px);
        max-width: calc(100vw - 32px);
    }

    .welcome-title {
        font-size: 20px;
    }

    .keyboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2, 8px);
    }

    .key-cap {
        width: 48px;
        height: 48px;
    }

    .welcome-footer {
        flex-direction: column;
        gap: var(--space-4, 16px);
    }

    .btn-lg {
        width: 100%;
        justify-content: center;
    }
}

/* ========== Big Screen Mode ========== */
.bigscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #020510 0%, #0a1525 50%, #051020 100%);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}

.bigscreen-overlay.hidden {
    display: none;
}

/* 大屏头部 */
.bigscreen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    background: linear-gradient(90deg, transparent, rgba(0, 170, 255, 0.1), transparent);
    border-bottom: 1px solid rgba(0, 170, 255, 0.3);
}

.bigscreen-header h1 {
    font-size: 28px;
    color: var(--color-primary);
    text-shadow: 0 0 20px rgba(0, 170, 255, 0.5);
    letter-spacing: 4px;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 30px;
    color: var(--text-secondary);
    font-size: 16px;
}

.exit-btn {
    background: rgba(255, 68, 102, 0.2);
    border: 1px solid var(--color-error);
    color: var(--color-error);
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.exit-btn:hover {
    background: rgba(255, 68, 102, 0.4);
}

/* 大屏主内容区 */
.bigscreen-content {
    flex: 1;
    display: flex;
    padding: 20px;
    gap: 20px;
    min-height: 0;
}

/* 侧边数据面板 */
.bs-panel {
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 数据卡片 */
.bs-card {
    background: rgba(10, 25, 45, 0.8);
    border: 1px solid rgba(0, 170, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
}

.bs-card h3 {
    font-size: 14px;
    color: var(--color-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 170, 255, 0.2);
}

.bs-data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.bs-data-row .label {
    color: var(--text-secondary);
    font-size: 13px;
}

.bs-data-row .value {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-primary);
}

.bs-data-row .unit {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 5px;
}

.bs-data-row.success .value {
    color: var(--color-success);
}

/* 液位条 */
.bs-level-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.bs-level-bar .label {
    width: 60px;
    font-size: 12px;
    color: var(--text-secondary);
}

.level-track {
    flex: 1;
    height: 8px;
    background: rgba(0, 170, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.level-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-success));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.bs-level-bar .percent {
    width: 40px;
    text-align: right;
    font-size: 14px;
    color: var(--color-primary);
}

/* 设备状态网格 */
.bs-status-grid {
    display: flex;
    justify-content: space-around;
}

.status-item {
    text-align: center;
}

.status-item .count {
    display: block;
    font-size: 28px;
    font-weight: 700;
}

.status-item .label {
    font-size: 12px;
    color: var(--text-muted);
}

.status-item.online .count {
    color: var(--color-success);
}

.status-item.offline .count {
    color: var(--text-muted);
}

.status-item.warning .count {
    color: var(--color-warning);
}

/* 中间场景区域 */
.bs-scene-area {
    flex: 1;
    position: relative;
    background: transparent;
    border: 2px solid rgba(0, 170, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
}

.scene-label {
    background: rgba(0, 170, 255, 0.1);
    padding: 5px 20px;
    border-radius: 15px;
    font-size: 12px;
    color: var(--text-muted);
}

/* 底部趋势图 */
.bigscreen-footer {
    height: 180px;
    padding: 15px 40px;
    border-top: 1px solid rgba(0, 170, 255, 0.2);
}

.bs-chart-container {
    height: 100%;
    background: rgba(10, 25, 45, 0.6);
    border-radius: 12px;
    padding: 15px 20px;
}

.bs-chart-container h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.bs-chart-container canvas {
    width: 100% !important;
    height: calc(100% - 30px) !important;
}

/* ========== Mobile Touch Controls ========== */
.mobile-controls {
    display: none;
    /* 默认隐藏，通过 JS 检测移动设备后显示 */
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 8000;
    pointer-events: none;
}

/* 虚拟摇杆 */
.joystick-container {
    position: absolute;
    left: 30px;
    bottom: 30px;
    pointer-events: auto;
    touch-action: none;
    /* [M15 Fix] 防止触摸冲突 */
}

.joystick-base {
    width: 120px;
    height: 120px;
    background: rgba(10, 30, 50, 0.6);
    border: 2px solid rgba(0, 170, 255, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.joystick-stick {
    width: 50px;
    height: 50px;
    background: linear-gradient(145deg, rgba(0, 170, 255, 0.8), rgba(0, 136, 204, 0.6));
    border: 2px solid rgba(0, 170, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.5);
    transition: transform 0.1s ease-out;
    touch-action: none;
    /* [M15 Fix] 防止触摸冲突 */
}

/* 上下移动按钮 */
.mobile-buttons {
    position: absolute;
    right: 30px;
    bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
    touch-action: none;
    /* [M15 Fix] 防止触摸冲突 */
}

.mobile-btn {
    width: 60px;
    height: 60px;
    background: rgba(10, 30, 50, 0.6);
    border: 2px solid rgba(0, 170, 255, 0.4);
    border-radius: 12px;
    color: var(--color-primary);
    font-size: 24px;
    cursor: pointer;
    touch-action: none;
    /* [M15 Fix] 改为 none 防止滚动冲突 */
}

.mobile-btn:active {
    background: rgba(0, 170, 255, 0.3);
    transform: scale(0.95);
}

/* 移动端响应式布局 */
@media (max-width: 768px) {

    /* 显示触控控件 */
    .mobile-controls {
        display: block;
    }

    /* 左侧控制面板 */
    #ui-overlay .panel {
        width: 200px;
        padding: 15px;
        font-size: 12px;
    }

    #ui-overlay .panel h1 {
        font-size: 16px;
    }

    /* 底部仪表盘 */
    #dashboard-panel {
        height: auto;
        max-height: 30vh;
    }

    .chart-container {
        min-width: 150px;
    }

    /* 设备面板 */
    #device-panel {
        width: 180px;
        right: 10px;
    }

    /* 告警面板 */
    #alarm-log-panel {
        width: 180px;
        right: 10px;
        bottom: 160px;
    }

    /* 欢迎引导层 */
    .welcome-card {
        padding: 20px;
        width: 95%;
    }

    .key-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 大屏模式调整 */
    .bigscreen-content {
        flex-direction: column;
    }

    .bs-panel {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
    }

    .bs-scene-area {
        min-height: 200px;
    }
}

/* 平板适配 */
@media (max-width: 1024px) and (min-width: 769px) {
    .mobile-controls {
        display: block;
    }

    .joystick-base {
        width: 100px;
        height: 100px;
    }

    .joystick-stick {
        width: 40px;
        height: 40px;
    }
}

/* 横屏模式 */
@media (max-height: 500px) and (orientation: landscape) {
    #ui-overlay .panel {
        max-height: 80vh;
        overflow-y: auto;
    }

    #dashboard-panel {
        height: 35vh;
    }
}

/* ========== 超小屏幕适配 (320px - 414px) ========== */
@media (max-width: 414px) {

    /* 欢迎引导层适配 */
    .welcome-card {
        max-height: 90vh;
        max-height: 90dvh;
        /* 动态视口高度 */
        overflow-y: auto;
        padding: var(--space-4, 16px);
    }

    .welcome-header {
        margin-bottom: var(--space-3, 12px);
    }

    .welcome-icon svg {
        width: 36px;
        height: 36px;
    }

    .welcome-title {
        font-size: 18px;
    }

    .welcome-subtitle {
        font-size: 12px;
    }

    .keyboard-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-1, 4px);
    }

    .key-cap {
        width: 40px;
        height: 40px;
        font-size: 13px;
    }

    .key-cap.wide {
        min-width: 56px;
        padding: 0 var(--space-2, 8px);
        font-size: 11px;
    }

    .key-label {
        font-size: 10px;
    }

    .tips-section {
        display: none;
        /* 小屏隐藏功能提示，简化内容 */
    }

    .welcome-footer {
        flex-direction: column;
        gap: var(--space-3, 12px);
        margin-top: var(--space-4, 16px);
        padding-top: var(--space-3, 12px);
    }

    .btn-lg {
        width: 100%;
        justify-content: center;
    }

    /* 虚拟摇杆适配 */
    .joystick-container {
        left: 15px;
        bottom: 15px;
    }

    .joystick-base {
        width: 90px;
        height: 90px;
    }

    .joystick-stick {
        width: 36px;
        height: 36px;
    }

    .mobile-buttons {
        right: 15px;
        bottom: 15px;
    }

    .mobile-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    /* 面板适配 */
    #ui-overlay .panel {
        width: 180px;
        padding: 12px;
        top: 8px;
        left: 8px;
    }

    #ui-overlay .panel h1 {
        font-size: 14px;
        margin-bottom: 10px;
    }

    .data-row {
        font-size: 11px;
    }

    .primary-btn {
        padding: 8px 12px;
        font-size: 11px;
    }

    .control-section {
        flex-direction: column;
        gap: 8px;
    }

    #device-panel,
    #alarm-log-panel {
        width: 150px;
        right: 8px;
    }

    .device-name {
        max-width: 100px;
        font-size: 10px;
    }

    /* 属性面板适配 */
    .glass-panel {
        width: 260px;
        right: 10px;
        top: 10px;
        padding: 15px;
    }

    .panel-header h2 {
        font-size: 1rem;
    }
}

/* ========== 竖屏旋转提示 - 强制横屏 ========== */
.rotate-overlay {
    display: none;
    /* 默认隐藏 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0a141f 0%, #050510 100%);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

/* 移动端竖屏时显示旋转提示 */
@media (max-width: 896px) and (orientation: portrait) {
    .rotate-overlay {
        display: flex !important;
    }

    /* 竖屏时隐藏其他内容 */
    #welcome-guide,
    #ui-overlay,
    #mobile-controls,
    #dashboard-panel,
    #device-panel,
    #alarm-log-panel {
        display: none !important;
    }
}

.rotate-content {
    text-align: center;
    color: #fff;
}

.rotate-icon {
    font-size: 64px;
    animation: rotatePhone 2s ease-in-out infinite;
}

.rotate-arrow {
    font-size: 48px;
    color: var(--color-primary, #00aaff);
    margin: 20px 0;
    animation: pulse 1.5s ease-in-out infinite;
}

.rotate-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-primary, #00aaff);
    margin-bottom: 10px;
}

.rotate-hint {
    font-size: 14px;
    color: var(--text-secondary, #8899aa);
}

@keyframes rotatePhone {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-15deg);
    }

    75% {
        transform: rotate(90deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

/* ========== 竖屏模式适配 ========== */
@media (max-width: 896px) and (orientation: portrait) {

    /* 欢迎弹窗竖屏适配 */
    .welcome-card {
        width: calc(100vw - 32px);
        max-width: 400px;
        max-height: 85vh;
        padding: 16px;
        overflow-y: auto;
    }

    .keyboard-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }

    .key-cap {
        width: 44px;
        height: 44px;
    }

    .tips-section {
        display: none;
    }

    .welcome-footer {
        flex-direction: column;
        gap: 12px;
    }

    .btn-lg {
        width: 100%;
        justify-content: center;
    }

    /* 左侧面板竖屏 */
    #ui-overlay .panel {
        width: 150px;
        padding: 10px;
    }

    /* 虚拟摇杆 - 左下角，上下按钮在右侧 */
    .joystick-container {
        left: 15px;
        bottom: 15px;
    }

    .joystick-base {
        width: 80px;
        height: 80px;
    }

    .joystick-stick {
        width: 32px;
        height: 32px;
    }

    /* 上下按钮 - 右下角 */
    .mobile-buttons {
        right: 15px;
        bottom: 15px;
    }

    .mobile-btn {
        width: 50px;
        height: 50px;
    }

    /* 隐藏次要面板节省空间 */
    #device-panel,
    #alarm-log-panel,
    #dashboard-panel {
        display: none;
    }
}

/* ========== 横屏模式适配 ========== */
@media (max-height: 500px) and (orientation: landscape) {

    /* 欢迎弹窗横屏自适应 */
    .welcome-card {
        max-width: 70vw;
        max-height: 90vh;
        padding: 12px 20px;
        overflow-y: auto;
    }

    .keyboard-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 6px;
    }

    .key-cap {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .tips-section {
        display: none;
    }

    /* 左侧面板紧凑模式 */
    #ui-overlay .panel {
        width: 130px;
        padding: 8px;
        max-height: 90vh;
        overflow-y: auto;
    }

    #ui-overlay .panel h1 {
        font-size: 12px;
        margin-bottom: 8px;
        padding-bottom: 6px;
    }

    .data-row {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .control-section {
        flex-direction: column;
        gap: 6px;
    }

    .primary-btn {
        padding: 6px 10px;
        font-size: 10px;
    }

    .collapsible-section {
        margin-bottom: 6px;
    }

    .collapsible-section summary {
        padding: 6px 10px;
        font-size: 11px;
    }

    /* 虚拟摇杆 - 面板右侧 */
    .joystick-container {
        left: 150px;
        /* 在紧凑面板右边 */
        bottom: 15px;
    }

    .joystick-base {
        width: 80px;
        height: 80px;
    }

    .joystick-stick {
        width: 32px;
        height: 32px;
    }

    /* 上下按钮 - 右下角 */
    .mobile-buttons {
        right: 20px;
        bottom: 15px;
        flex-direction: row;
        /* 横向排列 */
        gap: 15px;
    }

    .mobile-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    /* 隐藏右侧面板 - 横屏空间有限 */
    #device-panel,
    #alarm-log-panel {
        display: none;
    }

    /* 底部仪表盘隐藏 */
    #dashboard-panel {
        display: none;
    }

    /* 欢迎引导层横屏优化 */
    .welcome-card {
        width: auto !important;
        min-width: 400px;
        max-width: 70vw;
        max-height: 90vh;
        padding: 12px 20px;
        overflow-y: auto;
    }

    .welcome-header {
        margin-bottom: 10px;
    }

    .welcome-icon svg {
        width: 32px;
        height: 32px;
    }

    .welcome-title {
        font-size: 16px;
    }

    .welcome-subtitle {
        font-size: 11px;
    }

    .keyboard-grid {
        grid-template-columns: repeat(8, 1fr);
        /* 横屏一行8个 */
        gap: 6px;
    }

    .key-cap {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .key-cap.wide {
        min-width: 48px;
        font-size: 10px;
    }

    .key-label {
        font-size: 9px;
    }

    .tips-section {
        display: none;
    }

    .welcome-footer {
        flex-direction: row;
        margin-top: 12px;
        padding-top: 10px;
    }

    .btn-lg {
        height: 40px;
        padding: 8px 20px;
        font-size: 13px;
    }

    /* 属性面板横屏优化 */
    .glass-panel {
        width: 240px;
        right: 80px;
        /* 避开右侧按钮 */
        top: 5px;
        padding: 12px;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ========== Device Control Buttons ========== */
.control-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 80px;
    justify-content: center;
}

.control-btn .btn-icon {
    font-size: 10px;
}

.control-btn[data-action="start"] {
    border-color: var(--color-success);
    color: var(--color-success);
}

.control-btn[data-action="start"]:hover {
    background: rgba(0, 255, 136, 0.2);
}

.control-btn[data-action="stop"] {
    border-color: var(--color-warning);
    color: var(--color-warning);
}

.control-btn[data-action="stop"]:hover {
    background: rgba(255, 170, 0, 0.2);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== Confirmation Dialog ========== */
.confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15000;
    animation: fadeIn 0.2s ease-out;
}

.confirm-dialog.hidden {
    display: none;
}

.confirm-card {
    background: linear-gradient(145deg, rgba(15, 30, 50, 0.98), rgba(10, 20, 35, 0.98));
    border: 1px solid rgba(0, 170, 255, 0.4);
    border-radius: 16px;
    padding: 30px 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.confirm-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.confirm-card h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.confirm-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.confirm-device {
    background: rgba(0, 170, 255, 0.1);
    border: 1px solid rgba(0, 170, 255, 0.2);
    border-radius: 8px;
    padding: 12px 20px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.confirm-device .label {
    color: var(--text-muted);
    font-size: 13px;
}

.confirm-device .value {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 15px;
}

.confirm-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-actions button {
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.cancel-btn {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-secondary);
}

.cancel-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.ok-btn {
    background: linear-gradient(135deg, var(--color-primary), #0088cc);
    border: none;
    color: white;
}

.ok-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 170, 255, 0.4);
}

.ok-btn.danger {
    background: linear-gradient(135deg, var(--color-error), #cc3344);
}

.ok-btn.danger:hover {
    box-shadow: 0 5px 20px rgba(255, 68, 102, 0.4);
}