/* ============================================================
   LiSAC 小车上位机 - 全局样式表 v4.0
   风格：对齐主站（lisac-blog 研报）设计语言
         -- 白底、墨色正文、单一蓝色强调、细边框分层、
         -- 无渐变氛围、无 emoji、信息层级靠边框与色块
   主色：#2563EB (accent)   正文：#101418 (ink)
   ============================================================ */

/* ---------- 基础重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* ---- 主站 token（与 lisac-blog 研报站一致） ---- */
    --bg: #fbfbfc;
    --bg-soft: #f3f4f6;
    --ink: #101418;
    --muted: #5d6673;
    --faint: #8b94a3;
    --rule: rgba(16, 20, 24, 0.09);
    --rule-strong: rgba(16, 20, 24, 0.18);
    --accent: #2563eb;
    --accent-strong: #1d4ed8;
    --accent-soft: rgba(37, 99, 235, 0.07);
    --accent-soft-2: rgba(37, 99, 235, 0.12);
    --warm: #d97706;
    --warm-soft: rgba(217, 119, 6, 0.09);
    --red: #c0392b;
    --green: #1e7a4f;
    --violet: #7c3aed;
    --shadow-sm: 0 1px 2px rgba(16, 20, 24, 0.04), 0 1px 3px rgba(16, 20, 24, 0.06);
    --shadow-md: 0 2px 6px rgba(16, 20, 24, 0.05), 0 8px 24px rgba(16, 20, 24, 0.07);
    --radius: 14px;

    /* ---- 兼容映射（旧选择器引用，值对齐主站） ---- */
    --primary: var(--accent);
    --primary-strong: var(--accent-strong);
    --primary-light: var(--accent-soft);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: var(--ink);
    --text-sub: var(--muted);
    --text-light: var(--faint);
    --border: var(--rule);
    --bg-page: var(--bg);
    --bg-card: #ffffff;
    --bg-soft: #f8fafc;
    --shadow-card: var(--shadow-sm);
    --shadow-hover: var(--shadow-md);
    --radius-sm: 9px;
    --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro SC",
                 "Segoe UI", Roboto, "PingFang SC", "HarmonyOS Sans SC",
                 "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --font-mono: "SF Mono", "JetBrains Mono", "Cascadia Code",
                 Consolas, Menlo, monospace;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-main);
    background: var(--bg-page);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

::selection {
    background: rgba(37, 99, 235, 0.18);
}

:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.6);
    outline-offset: 2px;
}

/* ---------- 顶部导航栏（白底 + 细边框，对齐主站） ---------- */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: saturate(1.2) blur(8px);
    -webkit-backdrop-filter: saturate(1.2) blur(8px);
    border-bottom: 1px solid var(--rule);
    padding: 0 28px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 220px;
}

.brand-logo {
    width: 36px;
    height: 36px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-soft-2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-strong);
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 800;
}

.brand-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--text-main);
    line-height: 1.25;
}

.brand-sub {
    font-size: 11px;
    color: var(--text-light);
    letter-spacing: 0.3px;
}

.nav-links {
    display: flex;
    gap: 2px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: var(--text-sub);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 9px;
    font-size: 13.5px;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: color 0.15s, background-color 0.15s;
    position: relative;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--bg-soft);
    color: var(--text-main);
}

.nav-link.active {
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-weight: 600;
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: -17px;
    height: 2px;
    border-radius: 1px;
    background: var(--primary);
}

.nav-link svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-sub);
    min-width: 220px;
    justify-content: flex-end;
}

.nav-status .status-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warning);
    display: inline-block;
    transition: all 0.3s;
}

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.status-dot.offline {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* ---------- 页面主体 ---------- */
.container {
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 28px 48px;
}

/* ---------- 页面标题区 ---------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-header .subtitle {
    font-size: 13px;
    color: var(--text-sub);
    margin-top: 5px;
}

/* ---------- 卡片 ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-1px);
}

.card-title {
    font-size: 14.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}

.card-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--rule);
}

/* ---------- 网格布局 ---------- */
.grid {
    display: grid;
    gap: 20px;
}

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

@media (max-width: 900px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---------- 指标统计卡片 ---------- */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.stat-card::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    opacity: 0.9;
}

.stat-card.blue  { --accent: #2563EB; }
.stat-card.cyan  { --accent: #0891B2; }
.stat-card.green { --accent: #059669; }
.stat-card.purple{ --accent: #7C3AED; }
.stat-card.orange{ --accent: #D97706; }
.stat-card.red   { --accent: #DC2626; }

.stat-card.blue::before   { background: var(--accent); }
.stat-card.cyan::before   { background: var(--accent); }
.stat-card.green::before  { background: var(--accent); }
.stat-card.purple::before { background: var(--accent); }
.stat-card.orange::before { background: var(--accent); }
.stat-card.red::before    { background: var(--accent); }

.stat-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--accent-soft-2);
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    color: var(--accent-strong);
}

.stat-card.blue  .stat-icon { background: var(--accent-soft); border-color: var(--accent-soft-2); }
.stat-card.cyan  .stat-icon { background: rgba(8, 145, 178, 0.08); border-color: rgba(8, 145, 178, 0.18); }
.stat-card.green .stat-icon { background: rgba(5, 150, 105, 0.08); border-color: rgba(5, 150, 105, 0.18); }
.stat-card.purple .stat-icon { background: rgba(124, 58, 237, 0.08); border-color: rgba(124, 58, 237, 0.18); }
.stat-card.orange .stat-icon { background: var(--warm-soft); border-color: rgba(217, 119, 6, 0.18); }
.stat-card.red   .stat-icon { background: rgba(192, 57, 43, 0.08); border-color: rgba(192, 57, 43, 0.18); }

.stat-label {
    font-size: 12.5px;
    color: var(--text-sub);
    margin-bottom: 3px;
    letter-spacing: 0.2px;
}

.stat-value {
    font-size: 27px;
    font-weight: 700;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    letter-spacing: -0.5px;
}

.stat-value span {
    color: var(--accent);
}

.stat-unit {
    font-size: 12px;
    font-weight: 500;
    color: var(--accent);
    margin-left: 3px;
}

/* ---------- 传感器探头指示灯 ---------- */
.sensor-array {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 14px 0;
}

.sensor-array .probe {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-light);
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.sensor-array .probe.active {
    background: var(--success);
    color: #fff;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

/* ---------- 姿态数值 ---------- */
.attitude-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    text-align: center;
}

.attitude-item {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 10px;
}

.attitude-item .att-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.attitude-item .att-label {
    font-size: 12px;
    color: var(--text-sub);
    margin-top: 4px;
}

/* ---------- 表格 ---------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    background: #F9FAFB;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-sub);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #EEF1F6;
    font-variant-numeric: tabular-nums;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover td {
    background: var(--bg-soft);
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease,
                color 0.15s ease, transform 0.1s ease;
    font-family: inherit;
    line-height: 1.4;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-strong);
}

.btn-success {
    background: #059669;
    color: #fff;
}

.btn-success:hover {
    background: #047857;
}

.btn-danger {
    background: var(--red);
    color: #fff;
}

.btn-danger:hover {
    background: #a93226;
}

.btn-warning {
    background: var(--warm);
    color: #fff;
}

.btn-warning:hover {
    background: #b45309;
}

.btn-outline {
    background: #fff;
    color: var(--primary);
    border-color: #BFDBFE;
}

.btn-outline:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.btn-gray {
    background: #F1F5F9;
    color: var(--text-main);
    border-color: var(--border);
}

.btn-gray:hover {
    background: #E2E8F0;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 15px;
    border-radius: 10px;
}

/* ---------- 上传区 ---------- */
.upload-zone {
    border: 2px dashed #CBD5E1;
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    background: var(--bg-soft);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.upload-zone .upload-icon {
    font-size: 34px;
    margin-bottom: 8px;
}

.upload-zone .upload-text {
    color: var(--text-sub);
    font-size: 14px;
}

.upload-zone .upload-text strong {
    color: var(--primary);
}

.upload-file-info {
    margin-top: 12px;
    padding: 8px 14px;
    background: var(--primary-light);
    border-radius: 8px;
    font-size: 13px;
    color: var(--primary);
    display: none;
}

/* ---------- 进度条 ---------- */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #F1F5F9;
    border-radius: 3px;
    overflow: hidden;
    margin: 14px 0;
}

.progress-bar .progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    color: var(--text-sub);
    text-align: center;
}

/* ---------- 滑块（PID 调参） ---------- */
.param-row {
    display: grid;
    grid-template-columns: 150px 1fr 100px;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #EEF1F6;
}

.param-row:last-child {
    border-bottom: none;
}

.param-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.param-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #E2E8F0;
    outline: none;
    transition: background 0.2s ease;
}

.param-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s;
}

.param-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.param-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary);
    cursor: pointer;
}

.param-value {
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-strong);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    background: var(--primary-light);
    border-radius: 6px;
    padding: 5px 10px;
}

.param-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    padding: 14px 0 8px;
    border-bottom: 2px solid #DBEAFE;
    margin-bottom: 4px;
}

/* ---------- 消息提示条 ---------- */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin: 12px 0;
    font-size: 14px;
    display: none;
}

.alert.show {
    display: block;
    animation: fadeIn 0.25s;
}

.alert-success {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-info {
    background: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

.alert-warning {
    background: #FFFBEB;
    color: #92400E;
    border: 1px solid #FDE68A;
}

/* ---------- 徽章 ---------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.2px;
    line-height: 1.5;
}

.badge-green  { background: #D1FAE5; color: #065F46; }
.badge-yellow { background: #FEF3C7; color: #92400E; }
.badge-red    { background: #FEE2E2; color: #991B1B; }
.badge-blue   { background: #DBEAFE; color: #1E40AF; }
.badge-gray   { background: #F1F5F9; color: #475569; }

/* ---------- 系统信息列表 ---------- */
.info-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

@media (max-width: 900px) {
    .info-list { grid-template-columns: 1fr; }
}

.info-item {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.info-item .info-label {
    color: var(--text-sub);
    white-space: nowrap;
}

.info-item .info-value {
    font-weight: 600;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    text-align: right;
    word-break: break-all;
}

/* ---------- 图表容器 ---------- */
.chart-box {
    width: 100%;
    height: 220px;
}

/* ---------- 底部 ---------- */
.footer {
    text-align: center;
    padding: 18px;
    font-size: 12px;
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.6);
    border-top: 1px solid var(--border);
    letter-spacing: 0.3px;
}

/* ---------- 模式徽章 ---------- */
.mode-badge {
    font-size: 13px;
    padding: 6px 14px;
}

/* ---------- 手动控制：方向按键（D-Pad） ---------- */
.dpad {
    display: grid;
    grid-template-columns: repeat(3, 76px);
    grid-template-rows: repeat(3, 76px);
    gap: 8px;
    justify-content: center;
}

.dpad-btn {
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    transition: border-color 0.12s ease, color 0.12s ease,
                background-color 0.12s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    user-select: none;
    box-shadow: var(--shadow-card);
}

.dpad-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.dpad-btn:active, .dpad-btn.pressed {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: scale(0.96);
}

.dpad-stop {
    background: #F1F5F9;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
}

.dpad-stop:hover {
    border-color: var(--warning);
    color: #B45309;
    background: #FFFBEB;
}

.dpad-stop:active, .dpad-stop.pressed {
    background: var(--warning);
    color: #fff;
}

.dpad-empty {
    visibility: hidden;
}

/* 急停大按钮 */
.estop-btn {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 4px;
    border: none;
    border-radius: var(--radius);
    background: var(--danger);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.estop-btn:hover {
    background: #DC2626;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.45);
}

.estop-btn:active {
    transform: scale(0.98);
}

/* ---------- 手动控制：键盘提示 ---------- */
.kbd-hint {
    display: flex;
    gap: 16px;
    justify-content: center;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 14px;
    flex-wrap: wrap;
}

.kbd {
    display: inline-block;
    min-width: 22px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: #fff;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-main);
    text-align: center;
}

/* ---------- 日志页面 ---------- */
.log-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filter-group {
    display: flex;
    gap: 4px;
    background: #F1F5F9;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.filter-btn {
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-sub);
    transition: color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
    font-family: inherit;
}

.filter-btn:hover {
    color: var(--text-main);
}

.filter-btn.active {
    background: #fff;
    color: var(--primary-strong);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.log-list {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    height: 560px;
    overflow-y: auto;
    font-size: 13px;
    font-family: var(--font-mono);
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

.log-list::-webkit-scrollbar { width: 8px; }
.log-list::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}
.log-list::-webkit-scrollbar-track { background: transparent; }

.log-item {
    display: grid;
    grid-template-columns: 150px 64px 90px 1fr;
    gap: 10px;
    padding: 8px 16px;
    border-bottom: 1px solid #EEF1F6;
    align-items: baseline;
}

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

.log-item:hover {
    background: #fff;
}

.log-time {
    color: var(--text-light);
    white-space: nowrap;
}

.log-source {
    color: var(--text-sub);
    white-space: nowrap;
}

.log-message {
    color: var(--text-main);
    word-break: break-all;
}

.log-item.level-error .log-message { color: #DC2626; }
.log-item.level-warning .log-message { color: #B45309; }
.log-item.level-success .log-message { color: #047857; }

.log-empty {
    text-align: center;
    color: var(--text-light);
    padding: 60px 0;
}

.log-auto {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-sub);
    cursor: pointer;
    user-select: none;
}

/* ---------- 通用工具 ---------- */
.flex-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.text-muted { color: var(--text-sub); }
.text-light { color: var(--text-light); }

.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* ---------- 动画 ---------- */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 页面主区滚动条（细、低调，贴近大厂质感） */
html {
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

html::-webkit-scrollbar { width: 10px; height: 10px; }
html::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 5px;
    border: 2px solid var(--bg-page);
}
html::-webkit-scrollbar-track { background: transparent; }

/* 移动端适配 */
@media (max-width: 768px) {
    .navbar {
        padding: 0 12px;
        height: auto;
        flex-wrap: wrap;
        gap: 6px;
        padding-top: 8px;
    }

    .nav-brand { min-width: 0; }
    .nav-links { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto; }
    .nav-status { min-width: 0; }
    .container { padding: 16px 12px 32px; }
    .log-item { grid-template-columns: 130px 56px 1fr; }
    .log-source { display: none; }
}

/* 移动端降级：避免 blur 在低端手机上造成卡顿 */
@media (max-width: 768px) {
    .navbar {
        background: #fff;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* ============================================================
   波形调试页（wave.html）
   ============================================================ */
.wave-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wave-channels {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.wave-group-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--faint);
    letter-spacing: 0.08em;
}

.wave-group-gap { margin-left: 8px; }

.wave-chk {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.wave-chk input {
    accent-color: var(--accent);
    width: 14px;
    height: 14px;
}

.wave-actions {
    display: flex;
    gap: 8px;
}

.wave-notes p {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 6px;
    line-height: 1.6;
}

.wave-notes b { color: var(--ink); }
