        body {
            font-family: 'Segoe UI', '微軟正黑體', 'Poppins', system-ui, sans-serif;
            background: linear-gradient(135deg, #0A0F24 0%, #181D45 50%, #0C1230 100%);
            min-height: 100vh;
            padding: 20px;
            position: relative;
            overflow-x: hidden;
        }
        body::before {
            content: '';
            position: fixed;
            width: 100%; height: 100%; top: 0; left: 0;
            background-image: linear-gradient(rgba(0,255,255,0.03) 1px, transparent 1px),
                              linear-gradient(90deg, rgba(0,255,255,0.03) 1px, transparent 1px);
            background-size: 40px 40px;
            pointer-events: none;
        }
        body::after {
            content: '';
            position: fixed;
            width: 150%; height: 150%; top: -25%; left: -25%;
            background: radial-gradient(circle at 30% 40%, rgba(99,102,241,0.2), transparent 55%),
                        radial-gradient(circle at 72% 65%, rgba(34,211,238,0.14), transparent 50%);
            animation: pulse 8s ease-in-out infinite;
            pointer-events: none;
        }
        .lang-switch {
            display: flex; gap: 3px; padding: 3px;
            background: rgba(99, 102, 241, 0.08); border: 1px solid rgba(99, 102, 241, 0.15);
            border-radius: 40px; backdrop-filter: blur(8px);
        }
        .lang-switch button {
            width: auto; padding: 6px 14px; border: none; background: transparent;
            color: #64748b; font-size: 0.8rem; font-weight: 600; border-radius: 30px; cursor: pointer; transition: all 0.2s; white-space: nowrap;
        }
        .lang-switch button.active { background: linear-gradient(90deg, #22d3ee, #818cf8); color: #fff; }

        .glass-card {
            background: rgba(248, 250, 255, 0.96); backdrop-filter: blur(14px); border-radius: 40px;
            box-shadow: 0 25px 55px rgba(15,23,42,0.28), 0 0 40px rgba(99,102,241,0.18);
            width: 100%; max-width: 1520px; margin: 0 auto; padding: 2rem; position: relative; z-index: 2;
            isolation: isolate;
        }
        h1 {
            font-size: 2rem; font-weight: 700;
            background: linear-gradient(120deg, #22d3ee, #818cf8 45%, #ec4899);
            background-clip: text; -webkit-background-clip: text; color: transparent;
            text-align: center; margin-bottom: 0.3rem;
        }
        .subtitle {
            text-align: center; font-size: 0.85rem; margin-bottom: 1.5rem;
            border-bottom: 1px solid rgba(139,92,246,0.25); padding-bottom: 0.8rem;
            font-weight: 600;
            background: linear-gradient(90deg, #6366f1, #8b5cf6, #ec4899);
            -webkit-background-clip: text;
            background-clip: text;
            color: transparent;
            letter-spacing: 0.4px;
        }

        #loginPanel { max-width: 450px; margin: 0 auto; }
        .input-group { margin-bottom: 1.2rem; }
        label { display: block; font-weight: 600; color: #475569; margin-bottom: 0.5rem; font-size: 0.9rem; }
        .input-wrapper { position: relative; }
        .input-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: #6366f1; z-index: 1; }
        input, select, textarea, button {
            width: 100%; padding: 12px 20px 12px 50px; font-size: 0.95rem;
            border: 1px solid rgba(99,102,241,0.4); border-radius: 60px; background: #f8fafc;
            transition: all 0.2s; font-family: inherit; color: #1e293b;
        }
        textarea { border-radius: 20px; padding: 12px; resize: vertical; }
        input:focus, select:focus, textarea:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 4px rgba(99,102,241,0.2); }
        button {
            background: linear-gradient(90deg, #22d3ee, #6366f1); color: white; cursor: pointer; font-weight: 600; border: none; padding: 12px 20px;
        }
        button:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(99,102,241,0.4); }
        button:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
        .checkbox-group { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
        .checkbox-group input { width: auto; padding: 0; transform: scale(1.1); cursor: pointer; }
        .status { margin-top: 1rem; padding: 12px; border-radius: 60px; display: none; text-align: center; }
        .status.success { background: #10b981; color: white; display: block; }
        .status.error { background: #f43f5e; color: white; display: block; }
        .hidden { display: none !important; }
        /* 已登录用户首帧直接显示主面板，避免闪现登录页（配合 head 内同步脚本） */
        html.authed #loginPanel { display: none !important; }
        html.authed #mainPanel { display: block !important; }

        /* 工具栏（筛选 + 批量操作） */
        .toolbar-panel {
            background: rgba(248,250,255,0.6); border: 1px solid rgba(99,102,241,0.2);
            border-radius: 24px; padding: 12px 14px; margin-bottom: 14px;
        }
        .toolbar-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
        .toolbar-row + .toolbar-row { margin-top: 10px; border-top: 1px dashed rgba(99,102,241,0.2); padding-top: 10px; }
        .toolbar-panel .search-wrapper { flex: 1; position: relative; min-width: 200px; }
        .toolbar-panel .search-wrapper input { padding-left: 45px; }
        .toolbar-panel .search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: #6366f1; pointer-events: none; }
        .selected-count {
            font-size: 0.8rem; color: #6366f1; font-weight: 600;
            background: rgba(99,102,241,0.1); padding: 8px 14px; border-radius: 30px; white-space: nowrap;
        }
        .toolbar-actions .selected-count { margin-right: auto; }
        .btn-outline {
            width: auto; padding: 8px 14px; font-size: 0.8rem; border-radius: 30px;
            background: rgba(99,102,241,0.1); color: #6366f1; border: 1px solid rgba(99,102,241,0.3);
        }
        .btn-outline:hover { background: rgba(99,102,241,0.25); }
        .btn-danger-outline { background: rgba(244,63,94,0.08); color: #f43f5e; border-color: rgba(244,63,94,0.3); }
        .btn-danger-outline:hover { background: rgba(244,63,94,0.2); }
        .checkbox-inline { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: #475569; cursor: pointer; white-space: nowrap; }
        .checkbox-inline input { width: auto; padding: 0; accent-color: #6366f1; cursor: pointer; }
        .group-filter { width: auto; padding: 8px 14px; font-size: 0.8rem; border-radius: 30px; }

        .interval-widget { display: flex; gap: 6px; }
        .interval-widget input { flex: 1; min-width: 0; padding: 8px 14px; }
        .interval-widget select { width: auto; padding: 8px 12px; }
        .interval-days-hint { font-size: 0.72rem; color: #6366f1; margin-top: 4px; font-weight: 600; }

        .contact-add-row { display: flex; gap: 6px; align-items: center; }
        .contact-add-row select { width: auto; padding: 8px 12px; }
        .contact-add-row input { flex: 1; min-width: 0; padding: 8px 14px; }
        .contact-add-row .btn-sm { width: auto; }
        .contact-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
        .contact-chip {
            display: inline-flex; align-items: center; gap: 6px;
            background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.3);
            border-radius: 20px; padding: 4px 10px; font-size: 0.75rem; color: #6366f1;
        }
        .contact-chip button { width: auto; padding: 0 4px; background: none; border: none; color: #f43f5e; font-size: 0.9rem; cursor: pointer; }
        .plan-contact-chip {
            display: inline-block; background: rgba(99,102,241,0.1); border-radius: 12px;
            padding: 1px 8px; font-size: 0.7rem; color: #6366f1; margin-right: 4px;
        }

        .schedule-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
        .schedule-preview .schedule-chip {
            background: #fff; border: 1px solid rgba(99,102,241,0.3); border-radius: 30px;
            padding: 6px 12px; font-size: 0.8rem; color: #475569;
        }
        .schedule-preview .schedule-chip.overdue { border-color: #f43f5e; color: #f43f5e; }

        .tab-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
        .tab-count { margin-left: auto; font-size: 0.75rem; color: #6366f1; background: rgba(99,102,241,0.1); padding: 6px 12px; border-radius: 30px; white-space: nowrap; }
        .plan-filter-banner {
            display: flex; align-items: center; gap: 10px; justify-content: space-between;
            background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.3);
            border-radius: 30px; padding: 8px 16px; margin-bottom: 12px;
            font-size: 0.85rem; color: #6366f1; font-weight: 600;
        }
        .plan-filter-banner button {
            width: auto; padding: 4px 14px; font-size: 0.75rem; border-radius: 30px;
            background: rgba(244,63,94,0.12); color: #f43f5e; border: 1px solid rgba(244,63,94,0.3); cursor: pointer;
        }
        .plan-filter-banner button:hover { background: rgba(244,63,94,0.25); }

        .device-group {
            margin-bottom: 14px; border: 1px solid rgba(99,102,241,0.18); border-radius: 18px;
            overflow: hidden; background: #fff;
        }
        .device-group-header {
            display: flex; align-items: center; gap: 10px; padding: 10px 14px;
            background: rgba(99,102,241,0.08); border-bottom: 1px solid rgba(99,102,241,0.15); flex-wrap: wrap;
        }
        .device-group-header input.group-check { width: 16px; height: 16px; padding: 0; accent-color: #6366f1; cursor: pointer; flex-shrink: 0; }
        .dg-code-link {
            font-weight: 700; color: #6366f1; font-size: 0.9rem; cursor: pointer; text-decoration: underline;
            text-underline-offset: 3px; transition: color 0.15s; width: auto;
        }
        .dg-code-link:hover { color: #f43f5e; }
        .dg-model { font-size: 0.75rem; color: #999; flex: 1; min-width: 80px; }
        .dg-group { font-size: 0.7rem; color: #6366f1; background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.25); padding: 3px 10px; border-radius: 20px; cursor: default; }
        .dg-group.dg-group-empty { color: #999; border-style: dashed; background: transparent; }
        .dg-count { font-size: 0.7rem; color: #6366f1; background: rgba(99,102,241,0.15); padding: 3px 10px; border-radius: 20px; }
        .dg-status { font-size: 0.7rem; padding: 3px 10px; border-radius: 20px; font-weight: 700; }
        .dg-status.overdue { background: rgba(244,63,94,0.12); color: #f43f5e; }
        .dg-status.due7 { background: rgba(251,146,60,0.12); color: #fb923c; }
        .dg-status.due30 { background: rgba(251,191,36,0.14); color: #fbbf24; }
        .dg-status.later { background: rgba(16,185,129,0.12); color: #10b981; }
        .device-group-body { padding: 10px; }
        .device-group-body .record-item { margin-bottom: 8px; }
        .device-group-empty { text-align: center; color: #bbb; font-size: 0.8rem; padding: 14px; }
        .device-edit-btn {
            width: auto; padding: 5px 12px; font-size: 0.75rem; border-radius: 20px; font-weight: 600;
            background: rgba(99,102,241,0.1); color: #6366f1; border: 1px solid rgba(99,102,241,0.3); flex-shrink: 0;
        }
        .device-edit-btn:hover { background: rgba(99,102,241,0.25); }
        /* 保养/维修统计视图（卡片图形） */
        #planView, #recordChart { margin-bottom: 16px; }
        .view-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
        .view-card {
            border-radius: 18px; padding: 12px 14px; background: #fff;
            border: 1px solid rgba(99,102,241,0.15); box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        }
        .view-card .label { font-size: 0.75rem; color: #475569; margin-bottom: 4px; display: inline-flex; align-items: center; gap: 5px; }
        .view-card .num { font-size: 1.6rem; font-weight: 800; line-height: 1; }
        .view-card.danger .num { color: #f43f5e; }
        .view-card.warn .num { color: #fb923c; }
        .view-card.info .num { color: #fbbf24; }
        .view-card.ok .num { color: #10b981; }

        /* 设备详情视图 */
        #deviceDetailView {
            background: rgba(248,250,255,0.85); border: 1px solid rgba(99,102,241,0.25);
            border-radius: 28px; padding: 18px;
        }
        .detail-topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
        .detail-topbar h2 { color: #6366f1; font-size: 1.2rem; flex: 1; min-width: 150px; }
        .detail-info-grid {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px;
        }
        .detail-charts {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin-bottom: 16px;
        }
        .detail-charts .chart-box {
            background: #fff; border: 1px solid rgba(99,102,241,0.15); border-radius: 16px; padding: 10px;
        }
        .chart-box .chart-title { text-align: center; font-size: 0.8rem; font-weight: 700; color: #475569; padding: 4px 0 8px; }
        /* 详情页：保养状态卡片 */
        .mini-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
        .mini-card { border-radius: 12px; padding: 10px; background: #f8fafc; border: 1px solid rgba(99,102,241,0.15); }
        .mini-card .label { font-size: 0.7rem; color: #475569; display: inline-flex; align-items: center; gap: 4px; }
        .mini-card .num { font-size: 1.4rem; font-weight: 800; line-height: 1.2; }
        .mini-card.danger .num { color: #f43f5e; }
        .mini-card.warn .num { color: #fb923c; }
        .mini-card.info .num { color: #fbbf24; }
        .mini-card.ok .num { color: #10b981; }
        /* 详情页：维修记录月度简易柱状图 */
        .mini-bars { display: flex; align-items: stretch; gap: 8px; height: 160px; padding: 0 6px 2px; }
        .mini-bar-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
        .mini-bar-track { width: 100%; max-width: 34px; flex: 1; display: flex; align-items: flex-end; background: rgba(99,102,241,0.08); border-radius: 6px 6px 0 0; overflow: hidden; }
        .mini-bar-fill { width: 100%; background: linear-gradient(180deg, #6366f1, #8b5cf6); border-radius: 6px 6px 0 0; min-height: 2px; }
        .mini-bar-label { font-size: 0.65rem; color: #94a3b8; }
        .mini-bar-num { font-size: 0.7rem; font-weight: 700; color: #475569; }
        /* 维修记录统计看板 */
        .record-stats { margin-bottom: 16px; }
        .stats-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
        .stats-summary .stat-box { background: #fff; border: 1px solid rgba(99,102,241,0.15); border-radius: 16px; padding: 12px 14px; }
        .stats-summary .stat-box .k { font-size: 0.7rem; color: #94a3b8; }
        .stats-summary .stat-box .num { font-size: 1.35rem; font-weight: 800; color: #1e293b; margin-top: 2px; white-space: nowrap; }
        .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
        .stats-panel { background: #fff; border: 1px solid rgba(99,102,241,0.15); border-radius: 16px; padding: 12px 14px; }
        .stats-panel h4 { font-size: 0.8rem; color: #475569; margin: 0 0 10px; }
        .top-dev-list { display: flex; flex-direction: column; gap: 8px; }
        .top-dev-item .row { display: flex; justify-content: space-between; font-size: 0.75rem; color: #475569; margin-bottom: 3px; }
        .top-dev-item .row .cnt { font-weight: 700; color: #6366f1; }
        .top-dev-item .track { height: 8px; background: rgba(99,102,241,0.1); border-radius: 6px; overflow: hidden; }
        .top-dev-item .track .fill { height: 100%; background: linear-gradient(90deg, #22d3ee, #6366f1); border-radius: 6px; }
        .detail-stat {
            background: #fff; border: 1px solid rgba(99,102,241,0.15); border-radius: 16px; padding: 12px;
        }
        .detail-stat .k { font-size: 0.7rem; color: #999; }
        .detail-stat .v { font-size: 0.9rem; font-weight: 700; color: #1e293b; margin-top: 2px; }
        .detail-stat .v.danger { color: #f43f5e; }
        .detail-section { margin-bottom: 14px; }
        .detail-section h4 { color: #475569; margin-bottom: 8px; font-size: 0.9rem; }
        .detail-list { max-height: 260px; overflow-y: auto; }

        .modal-overlay {
            position: fixed; inset: 0; background: rgba(0,0,0,0.55);
            display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 20px;
        }
        .modal-overlay.hidden { display: none; }
        .modal {
            background: #f8fafc; border-radius: 24px; padding: 24px; width: 100%; max-width: 460px;
            box-shadow: 0 25px 60px rgba(0,0,0,0.4); max-height: 90vh; overflow-y: auto;
        }
        .modal h3 { text-align: center; color: #6366f1; margin-bottom: 18px; }
        .modal .input-group { margin-bottom: 14px; }
        .modal input { padding: 10px 16px; }
        .modal .hint { font-size: 0.75rem; color: #999; background: rgba(99,102,241,0.08); border-radius: 14px; padding: 8px 12px; margin-top: 4px; }
        .modal-actions { display: flex; gap: 8px; margin-top: 20px; }
        .modal-actions button { flex: 1; }
        /* 自定义分组下拉（替代原生 datalist，保持 UI 一致） */
        .combo { position: relative; }
        .combo input { padding-right: 42px; }
        .combo-toggle {
            position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
            width: 32px; height: 32px; min-width: 0; padding: 0; border: none;
            background: transparent; color: #6366f1; font-size: 0.8rem; cursor: pointer;
            display: flex; align-items: center; justify-content: center; border-radius: 10px;
        }
        .combo-toggle:hover { background: rgba(99, 102, 241, 0.12); }
        .combo-menu {
            position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 2100;
            background: #fff; border: 1px solid rgba(99, 102, 241, 0.2); border-radius: 14px;
            box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18); max-height: 200px; overflow-y: auto; padding: 4px;
        }
        .combo-menu.hidden { display: none; }
        .combo-item { padding: 8px 12px; border-radius: 10px; cursor: pointer; font-size: 0.85rem; color: #334155; }
        .combo-item:hover { background: rgba(99, 102, 241, 0.1); color: #4338ca; }
        .combo-empty { padding: 8px 12px; font-size: 0.8rem; color: #94a3b8; }

        /* 概览仪表盘：即将到期(1/3) + 概览统计 + 分组分布 */
        .dashboard { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
        .dash-card { background: #fff; border: 1px solid rgba(99,102,241,0.10); border-radius: 18px; padding: 14px 16px; box-shadow: 0 6px 18px rgba(15,23,42,0.06); min-width: 0; }
        .dash-card h4 { font-size: 0.82rem; color: #6366f1; margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
        .dash-upcoming { background: #fffbf0; border-left: 5px solid #f59e0b; }
        .dash-empty { font-size: 0.8rem; color: #94a3b8; text-align: center; padding: 12px 0; }
        .upcoming-item { padding: 5px 4px; border-radius: 10px; cursor: pointer; transition: background 0.15s; }
        .upcoming-item:hover { background: rgba(99,102,241,0.1); }
        .upcoming-item-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 3px; }
        .upcoming-name { font-size: 0.78rem; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .upcoming-days { font-size: 0.7rem; font-weight: 700; white-space: nowrap; }
        .upcoming-days.overdue { color: #f43f5e; }
        .upcoming-days.due7 { color: #fb923c; }
        .upcoming-days.due30 { color: #d97706; }
        .upcoming-progress { height: 4px; background: rgba(0,0,0,0.07); border-radius: 4px; overflow: hidden; }
        .upcoming-progress i { display: block; height: 100%; border-radius: 4px; }
        .upcoming-progress i.overdue { background: #f43f5e; }
        .upcoming-progress i.due7 { background: #fb923c; }
        .upcoming-progress i.due30 { background: #fbbf24; }
        .stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
        .stat-card { background: linear-gradient(135deg, rgba(99,102,241,0.10), rgba(99,102,241,0.03)); border-radius: 14px; padding: 10px 12px; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
        .stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(99,102,241,0.18); }
        .stat-num { font-size: 1.35rem; font-weight: 800; color: #4338ca; line-height: 1.1; }
        .stat-label { font-size: 0.72rem; color: #64748b; margin-top: 2px; }
        .group-pill { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border-radius: 12px; background: rgba(99,102,241,0.06); margin-bottom: 6px; font-size: 0.8rem; color: #334155; cursor: pointer; transition: background 0.15s; }
        .group-pill:hover { background: rgba(99,102,241,0.14); }
        .group-pill .g-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .group-pill .g-count { font-weight: 800; color: #6366f1; background: rgba(99,102,241,0.12); padding: 2px 8px; border-radius: 20px; font-size: 0.7rem; flex-shrink: 0; }
        /* 分组展开：展示该组下的设备列表 */
        .group-drill-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
        .drill-title { font-size: 0.8rem; font-weight: 700; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .drill-title em { font-style: normal; color: #6366f1; margin-left: 4px; }
        .drill-back { background: rgba(99,102,241,0.1); border: none; color: #6366f1; font-size: 0.7rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; cursor: pointer; flex-shrink: 0; }
        .drill-back:hover { background: rgba(99,102,241,0.2); }
        .drill-device { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; background: rgba(99,102,241,0.05); margin-bottom: 6px; cursor: pointer; font-size: 0.78rem; transition: background 0.15s; }
        .drill-device:hover { background: rgba(99,102,241,0.13); }
        .drill-device .dd-code { font-weight: 700; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .drill-device .dd-counts { font-size: 0.68rem; color: #64748b; white-space: nowrap; flex-shrink: 0; }

        @media (max-width: 768px) {
            .dashboard { grid-template-columns: 1fr; }
        }

        .tabs { display: flex; gap: 4px; margin-bottom: 14px; background: rgba(99,102,241,0.08); border-radius: 40px; padding: 4px; }
        .tab-btn {
            flex: 1; padding: 10px 16px; border-radius: 36px; border: none; background: transparent;
            color: #475569; font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: all 0.2s; text-align: center;
        }
        .tab-btn:hover { background: rgba(99,102,241,0.15); }
        .tab-btn.active { background: #6366f1; color: white; box-shadow: 0 4px 10px rgba(99,102,241,0.3); }
        .tab-content { display: none; }
        .tab-content.active { display: block; }

        .record-list {
            max-height: 400px; overflow-y: auto; border: 1px solid rgba(99,102,241,0.16);
            border-radius: 20px; padding: 10px; background: #fff;
            box-shadow: 0 2px 10px rgba(0,0,0,0.04);
            min-height: 200px; /* 预留空间，减少异步加载时的布局偏移（CLS） */
        }
        .record-item {
            background: white; border-radius: 16px; padding: 12px; margin-bottom: 8px;
            box-shadow: 0 1px 4px rgba(0,0,0,0.05); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
        }
        .record-item .info { flex: 1; }
        .record-item .info .date { font-size: 0.75rem; color: #6366f1; font-weight: 600; }
        .record-item .info .desc { font-size: 0.85rem; margin-top: 4px; }
        .record-item .info .meta { font-size: 0.7rem; color: #999; margin-top: 4px; }
        .record-item .actions { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
        .record-item .actions button { padding: 4px 10px; font-size: 0.7rem; border-radius: 20px; width: auto; }
        .btn-sm { padding: 4px 12px; font-size: 0.7rem; border-radius: 20px; width: auto; }
        .load-more-btn { padding: 8px 24px; font-size: 0.8rem; border-radius: 30px; cursor: pointer; background: rgba(99,102,241,0.1); color: #6366f1; border: 1px solid rgba(99,102,241,0.35); transition: all 0.2s; }
        .load-more-btn:hover { background: rgba(99,102,241,0.2); }
        .btn-danger { background: rgba(244,63,94,0.14); color: #f43f5e; border: 1px solid rgba(244,63,94,0.3); }
        .btn-edit { background: #6366f1; color: #fff; border-color: #6366f1; }
        /* 零件规格：整行可点击进入该零件的编辑 */
        #partsList .record-item { cursor: pointer; transition: background 0.15s; }
        #partsList .record-item:hover { background: rgba(99, 102, 241, 0.06); }
        .btn-success { background: #10b981; }
        .btn-done { background: #10b981; }

        .form-section {
            background: #fff; border: 1px solid rgba(99,102,241,0.16);
            border-radius: 20px; padding: 16px; margin-top: 16px; overflow: hidden;
            box-shadow: 0 2px 10px rgba(0,0,0,0.04);
        }
        .form-section h4 {
            color: #475569; margin: -16px -16px 12px; padding: 12px 16px;
            background: rgba(99,102,241,0.07); border-bottom: 1px solid rgba(99,102,241,0.12); font-size: 0.9rem;
        }
        .form-row { display: flex; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
        .form-row .field { flex: 1; min-width: 150px; }
        .form-row .field label { font-size: 0.75rem; margin-bottom: 3px; }
        .form-row .field input, .form-row .field select, .form-row .field textarea { padding: 8px 14px; font-size: 0.85rem; border-radius: 40px; }
        .event-date-row { display: flex; gap: 6px; }
        .event-date-row select { width: auto; }
        .event-date-row input { flex: 1; min-width: 0; }
        .form-row .field textarea { border-radius: 16px; }
        .form-actions { display: flex; gap: 8px; margin-top: 10px; }
        .form-actions button { flex: 1; padding: 10px; font-size: 0.85rem; }
        .form-hint { font-size: 0.75rem; color: #64748b; background: rgba(34,211,238,0.08); border: 1px dashed rgba(34,211,238,0.4); border-radius: 12px; padding: 8px 12px; margin-top: 10px; line-height: 1.5; }

        .empty-state { text-align: center; padding: 40px 20px; color: #6366f1; }
        .empty-state p { font-size: 0.9rem; margin-bottom: 10px; }

        footer { margin-top: 2rem; text-align: center; font-size: 0.7rem; color: #94a3b8; }

        @media (max-width: 768px) {
            .glass-card { padding: 1.2rem; }
            .toolbar-row { flex-direction: column; align-items: stretch; }
            .toolbar-panel .search-wrapper { width: 100%; }
            .form-row { flex-direction: column; }
            .form-row .field { min-width: auto; }
            .tabs { flex-wrap: wrap; }
            .tab-btn { min-width: 80px; }
            .contact-add-row { flex-wrap: wrap; }
        }
    