:root {
    /* 品牌色 */
    --color-primary: #2563EB;
    --color-primary-light: #3B82F6;
    --color-primary-dark: #1D4ED8;
    
    /* 语义色 */
    --color-success: #10B981;       /* 连接成功 / 正常 */
    --color-warning: #F59E0B;       /* 警告 / 等待 */
    --color-error: #EF4444;         /* 错误 / 断连 / 超差 */
    --color-info: #06B6D4;          /* 提示信息 */
    
    /* 中性色 */
    --color-bg: #F8FAFC;            /* 页面背景 */
    --color-surface: #FFFFFF;       /* 卡片背景 */
    --color-border: #E2E8F0;        /* 边框 */
    --color-text: #0F172A;          /* 主文字 */
    --color-text-secondary: #64748B; /* 辅助文字 */
    --color-text-muted: #94A3B8;    /* 淡化文字 */
    
    /* 蓝牙操作按钮专用（醒目绿色渐变） */
    --color-ble-btn: linear-gradient(135deg, #34C759, #248A3D);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    /* 间距量子（所有间距为 8 的倍数） */
    --space: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background-color: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
}

/* 按钮通用逻辑 */
button {
    border: none;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.1s ease, filter 0.2s ease;
}
button:active { transform: scale(0.96); }

.btn-primary {
    background-color: var(--color-primary);
    color: white;
    height: 48px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-primary:active { background-color: var(--color-primary-dark); }
.btn-primary:disabled {
    background-color: var(--color-text-muted);
    transform: none;
    cursor: not-allowed;
}

/* 移动端核心容器约束 */
.mobile-container {
    max-width: 480px; 
    margin: 0 auto;
    background: var(--color-bg);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    transition: max-width 0.3s ease;
}
@media (min-width: 1024px) {
    .mobile-container {
        max-width: 1000px;
    }
}

/* Toast 提示 */
#toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.toast {
    background: rgba(15, 23, 42, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 14px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    animation: fadeInOut 2.5s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(20px); }
    15% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}
