/**
 * ACube Linear / Vercel 风格主题覆盖层
 * 在所有 CSS 之后加载，覆盖为更"犀利"的视觉风格
 * @version 1.0.0
 * @date 2025-12-26
 * 
 * 特点：
 * - 细边框分层（减少阴影堆叠）
 * - 收紧圆角（8px → 6px）
 * - 灰阶对比拉开（标题更深，次要更淡）
 * - 表格密度更紧凑
 * - 选中态带左侧竖条
 * - Tag 颜色减饱和
 */

/* ============================================================
   1. Linear 风格设计令牌（覆盖 Bootstrap 变量）
   ============================================================ */
:root {
    /* ---- 背景色系 ---- */
    --linear-bg: #F8FAFC;
    --linear-surface: #FFFFFF;
    --linear-surface-2: #F9FAFB;

    /* ---- 文字色系（对比度拉开） ---- */
    --linear-text: #0B0F19;           /* 主标题 - 更深 */
    --linear-text-secondary: #374151;  /* 正文 */
    --linear-muted: #667085;           /* 次要说明 */
    --linear-muted-2: #98A2B3;         /* ID、提示 */

    /* ---- 边框色系 ---- */
    --linear-border: #E5E7EB;
    --linear-border-light: #EEF2F7;

    /* ---- 主题色（Vercel/Linear 蓝） ---- */
    --linear-primary: #2563EB;
    --linear-primary-weak: rgba(37, 99, 235, 0.08);
    --linear-primary-focus: rgba(37, 99, 235, 0.18);

    /* ---- 语义色（减饱和） ---- */
    --linear-success: #16A34A;
    --linear-success-bg: rgba(22, 163, 74, 0.08);
    --linear-success-border: rgba(22, 163, 74, 0.20);

    --linear-warning: #D97706;
    --linear-warning-bg: rgba(217, 119, 6, 0.08);
    --linear-warning-border: rgba(217, 119, 6, 0.20);

    --linear-danger: #DC2626;
    --linear-danger-bg: rgba(220, 38, 38, 0.06);
    --linear-danger-border: rgba(220, 38, 38, 0.18);

    --linear-info: #0891B2;
    --linear-info-bg: rgba(8, 145, 178, 0.08);
    --linear-info-border: rgba(8, 145, 178, 0.20);

    /* ---- 圆角（收紧） ---- */
    --linear-radius: 6px;
    --linear-radius-sm: 4px;
    --linear-radius-lg: 8px;

    /* ---- 克制阴影 ---- */
    --linear-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.04);
    --linear-shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.06);
    --linear-shadow: 0 2px 6px rgba(16, 24, 40, 0.06);

    /* ---- Focus ring ---- */
    --linear-focus-ring: 0 0 0 3px var(--linear-primary-focus);

    /* ---- 控件尺寸 ---- */
    --linear-ctrl-h: 34px;
    --linear-ctrl-h-sm: 28px;
    --linear-ctrl-px: 12px;
}

/* ============================================================
   2. 全局基础样式
   ============================================================ */
body {
    background: var(--linear-bg);
    color: var(--linear-text-secondary);
}

/* 标题更深 */
h1, h2, h3, h4, h5, h6,
.ant-card-head-title,
.ant-modal-title,
.ant-drawer-title {
    color: var(--linear-text) !important;
}

/* 次要文字更淡 */
.ant-form-item-label > label,
.ant-descriptions-item-label,
.ant-statistic-title {
    color: var(--linear-muted) !important;
}

/* ============================================================
   3. 卡片组件 - 细边框 + 极轻阴影
   ============================================================ */
.ant-card {
    border: 1px solid var(--linear-border);
    border-radius: var(--linear-radius-lg);
    box-shadow: var(--linear-shadow-xs);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.ant-card:hover {
    box-shadow: var(--linear-shadow-sm);
    border-color: var(--linear-border);
}

.ant-card-head {
    border-bottom: 1px solid var(--linear-border-light);
    background: transparent;
    min-height: 48px;
    padding: 12px 16px;
}

.ant-card-body {
    padding: 16px;
}

/* ============================================================
   4. 按钮 - 统一高度 + 收紧圆角
   ============================================================ */
.ant-btn {
    height: var(--linear-ctrl-h);
    padding: 0 var(--linear-ctrl-px);
    border-radius: var(--linear-radius);
    border: 1px solid var(--linear-border);
    box-shadow: none;
    font-weight: 500;
    transition: all 0.15s ease;
}

.ant-btn:focus {
    box-shadow: var(--linear-focus-ring);
}

/* 默认按钮 */
.ant-btn-default {
    background: var(--linear-surface);
    border-color: var(--linear-border);
    color: var(--linear-text-secondary);
}

.ant-btn-default:hover {
    background: var(--linear-surface-2);
    border-color: #D1D5DB;
    color: var(--linear-text);
}

/* 主按钮 */
.ant-btn-primary {
    background: var(--linear-primary);
    border-color: var(--linear-primary);
    color: #fff;
}

.ant-btn-primary:hover {
    background: #1D4ED8;
    border-color: #1D4ED8;
    color: #fff;
}

/* 危险按钮 - 降噪为深红文字+浅底 */
.ant-btn-dangerous,
.ant-btn-dangerous.ant-btn-default,
.ant-btn-danger,
button.ant-btn-dangerous {
    background: rgba(220, 38, 38, 0.08) !important;
    border-color: rgba(220, 38, 38, 0.25) !important;
    color: #DC2626 !important;
}

.ant-btn-dangerous:hover,
.ant-btn-dangerous.ant-btn-default:hover,
.ant-btn-danger:hover,
button.ant-btn-dangerous:hover {
    background: rgba(220, 38, 38, 0.15) !important;
    border-color: rgba(220, 38, 38, 0.35) !important;
    color: #B91C1C !important;
}

/* 主要危险按钮（实心红底白字） */
.ant-btn-dangerous.ant-btn-primary {
    background: #DC2626 !important;
    border-color: #DC2626 !important;
    color: #fff !important;
}

.ant-btn-dangerous.ant-btn-primary:hover {
    background: #B91C1C !important;
    border-color: #B91C1C !important;
}

/* 小按钮 */
.ant-btn-sm {
    height: var(--linear-ctrl-h-sm);
    padding: 0 10px;
    font-size: 13px;
}

/* ============================================================
   5. 输入控件 - 统一高度 + 清晰 focus ring
   ============================================================ */
.ant-input,
.ant-input-affix-wrapper,
.ant-select-selector,
.ant-picker,
.ant-input-number {
    height: var(--linear-ctrl-h) !important;
    border-radius: var(--linear-radius) !important;
    border-color: var(--linear-border) !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* 修复带前缀/后缀的输入框（ant-input-affix-wrapper）背景与边框不贴合问题 */
.ant-input-affix-wrapper {
    background: #fff !important;
    padding: 0 11px !important;
}

/* 带前缀/后缀输入框内部 input - 透明背景，撑满高度 */
.ant-input-affix-wrapper > input.ant-input {
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* 前缀和后缀区域 */
.ant-input-prefix,
.ant-input-suffix {
    background: transparent !important;
}

/* Select 选择器内容垂直居中 */
.ant-select-selector {
    display: flex !important;
    align-items: center !important;
}

.ant-select-selection-search {
    display: flex !important;
    align-items: center !important;
}

.ant-select-selection-item,
.ant-select-selection-placeholder {
    line-height: calc(var(--linear-ctrl-h) - 2px) !important;
    display: flex !important;
    align-items: center !important;
}

/* 小尺寸 Select 垂直居中 */
.ant-select-sm .ant-select-selector {
    height: var(--linear-ctrl-h-sm) !important;
}

.ant-select-sm .ant-select-selection-item,
.ant-select-sm .ant-select-selection-placeholder {
    line-height: calc(var(--linear-ctrl-h-sm) - 2px) !important;
}

.ant-input:focus,
.ant-input-focused,
.ant-input-affix-wrapper:focus,
.ant-input-affix-wrapper-focused,
.ant-select-focused .ant-select-selector,
.ant-picker-focused,
.ant-input-number-focused {
    border-color: var(--linear-primary) !important;
    box-shadow: var(--linear-focus-ring) !important;
}

.ant-input::placeholder,
.ant-select-selection-placeholder {
    color: var(--linear-muted-2);
}

/* textarea 高度自适应 */
textarea.ant-input {
    height: auto !important;
    min-height: 80px;
}

/* ============================================================
   6. 表格 - 更紧凑 + 透明表头
   ============================================================ */
.ant-table {
    border-radius: var(--linear-radius-lg);
    overflow: hidden;
}

/* 表头 - Linear 风格透明 */
.ant-table-thead > tr > th {
    background: var(--linear-surface) !important;
    color: var(--linear-muted) !important;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--linear-border) !important;
    padding: 10px 12px !important;
}

/* 表格行 - 紧凑 */
.ant-table-tbody > tr > td {
    padding: 10px 12px !important;
    border-bottom: 1px solid var(--linear-border-light) !important;
    color: var(--linear-text-secondary);
    background: var(--linear-surface);
}

/* hover 行 - 淡灰底 */
.ant-table-tbody > tr:hover > td {
    background: rgba(15, 23, 42, 0.02) !important;
}

/* 选中行 */
.ant-table-tbody > tr.ant-table-row-selected > td {
    background: var(--linear-primary-weak) !important;
}

/* 固定列背景色（解决滚动重叠问题） */
.ant-table-cell-fix-left,
.ant-table-cell-fix-right {
    background: var(--linear-surface) !important;
}

.ant-table-tbody > tr:hover > .ant-table-cell-fix-left,
.ant-table-tbody > tr:hover > .ant-table-cell-fix-right {
    background: #F9FAFB !important;
}

.ant-table-tbody > tr:nth-child(even) > .ant-table-cell-fix-left,
.ant-table-tbody > tr:nth-child(even) > .ant-table-cell-fix-right {
    background: #FAFBFC !important;
}

.ant-table-tbody > tr:nth-child(even):hover > .ant-table-cell-fix-left,
.ant-table-tbody > tr:nth-child(even):hover > .ant-table-cell-fix-right {
    background: #F5F6F7 !important;
}

/* 固定列阴影分隔线 */
.ant-table-cell-fix-left-last::after,
.ant-table-cell-fix-right-first::after {
    box-shadow: inset 10px 0 8px -8px rgba(0, 0, 0, 0.08) !important;
}

.ant-table-cell-fix-right-first::after {
    box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.08) !important;
}

/* 表格边框 */
.ant-table-bordered {
    border: 1px solid var(--linear-border);
}

/* ============================================================
   7. 标签/Tag - 减饱和 + 胶囊形
   ============================================================ */
.ant-tag {
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--linear-border);
    background: rgba(15, 23, 42, 0.03);
    color: var(--linear-muted);
}

/* 成功标签 */
.ant-tag-green,
.ant-tag-success {
    background: var(--linear-success-bg) !important;
    border-color: var(--linear-success-border) !important;
    color: var(--linear-success) !important;
}

/* 警告标签 */
.ant-tag-orange,
.ant-tag-warning {
    background: var(--linear-warning-bg) !important;
    border-color: var(--linear-warning-border) !important;
    color: var(--linear-warning) !important;
}

/* 错误/危险标签 */
.ant-tag-red,
.ant-tag-error {
    background: var(--linear-danger-bg) !important;
    border-color: var(--linear-danger-border) !important;
    color: var(--linear-danger) !important;
}

/* 信息标签 */
.ant-tag-blue,
.ant-tag-processing,
.ant-tag-cyan {
    background: var(--linear-info-bg) !important;
    border-color: var(--linear-info-border) !important;
    color: var(--linear-info) !important;
}

/* 默认/中性标签 */
.ant-tag-default {
    background: rgba(15, 23, 42, 0.04);
    border-color: var(--linear-border);
    color: var(--linear-muted);
}

/* ============================================================
   8. 选中态 - 左侧竖条（Linear 特征）
   ============================================================ */
/* 菜单选中 */
.ant-menu-item-selected {
    background: var(--linear-primary-weak) !important;
    position: relative;
}

.ant-menu-item-selected::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--linear-primary);
}

/* 列表选中项 */
.list-item-selected,
.row-selected,
.is-active {
    background: var(--linear-primary-weak) !important;
    position: relative;
}

.list-item-selected::before,
.row-selected::before,
.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--linear-primary);
}

/* ============================================================
   9. 侧栏/顶栏 - 边框代替阴影
   ============================================================ */
.sider,
.ant-layout-sider {
    background: var(--linear-surface) !important;
    border-right: 1px solid var(--linear-border) !important;
    box-shadow: none !important;
}

.header,
.ant-layout-header {
    border-bottom: 1px solid var(--linear-border) !important;
    box-shadow: none !important;
}

/* ============================================================
   10. 下拉菜单/弹出层
   ============================================================ */
.ant-select-dropdown,
.ant-dropdown-menu,
.ant-popover-inner {
    border-radius: var(--linear-radius-lg);
    border: 1px solid var(--linear-border);
    box-shadow: var(--linear-shadow);
}

.ant-select-item-option-selected {
    background: var(--linear-primary-weak) !important;
    font-weight: 500;
}

.ant-select-item-option-active:not(.ant-select-item-option-selected) {
    background: var(--linear-surface-2) !important;
}

.ant-dropdown-menu-item:hover {
    background: var(--linear-surface-2);
}

/* ============================================================
   11. 模态框/抽屉
   ============================================================ */
.ant-modal-content {
    border-radius: var(--linear-radius-lg);
    box-shadow: 0 4px 24px rgba(16, 24, 40, 0.12);
    border: 1px solid var(--linear-border-light);
}

.ant-modal-header {
    border-bottom: 1px solid var(--linear-border-light);
    padding: 16px 20px;
}

.ant-modal-footer {
    border-top: 1px solid var(--linear-border-light);
    padding: 12px 20px;
    background: var(--linear-surface-2);
}

.ant-drawer-header {
    border-bottom: 1px solid var(--linear-border);
}

/* ============================================================
   12. 分页
   ============================================================ */
.ant-pagination-item {
    border-radius: var(--linear-radius);
    border-color: var(--linear-border);
}

.ant-pagination-item:hover {
    border-color: var(--linear-primary);
}

.ant-pagination-item-active {
    background: var(--linear-primary);
    border-color: var(--linear-primary);
}

/* ============================================================
   13. 告警/提示框
   ============================================================ */
.ant-alert {
    border-radius: var(--linear-radius);
}

.ant-alert-info {
    background: var(--linear-info-bg);
    border-color: var(--linear-info-border);
}

.ant-alert-success {
    background: var(--linear-success-bg);
    border-color: var(--linear-success-border);
}

.ant-alert-warning {
    background: var(--linear-warning-bg);
    border-color: var(--linear-warning-border);
}

.ant-alert-error {
    background: var(--linear-danger-bg);
    border-color: var(--linear-danger-border);
}

/* ============================================================
   14. 表单布局微调
   ============================================================ */
.ant-form-item-label {
    padding-bottom: 4px !important;
}

.ant-form-item-label > label {
    font-size: 13px;
    font-weight: 500;
}

/* ============================================================
   15. 统计卡片
   ============================================================ */
.statistic-card {
    border: 1px solid var(--linear-border);
    box-shadow: var(--linear-shadow-xs);
    border-radius: var(--linear-radius-lg);
}

.statistic-card:hover {
    box-shadow: var(--linear-shadow-sm);
    transform: translateY(-1px);
}

/* ============================================================
   16. 工具提示
   ============================================================ */
.ant-tooltip-inner {
    border-radius: var(--linear-radius);
    background: #1F2937;
    font-size: 12px;
    padding: 6px 10px;
}

/* ============================================================
   17. 消息提示
   ============================================================ */
.ant-message-notice-content {
    border-radius: var(--linear-radius);
    box-shadow: var(--linear-shadow);
    border: 1px solid var(--linear-border-light);
}

/* ============================================================
   18. 徽标数字
   ============================================================ */
.ant-badge-count {
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 0 0 2px var(--linear-surface);
}

/* ============================================================
   19. 空状态
   ============================================================ */
.ant-empty-description {
    color: var(--linear-muted-2);
}

/* ============================================================
   20. 滚动条（更细）
   ============================================================ */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d9d9d9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #bfbfbf;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #d9d9d9 transparent;
}

/* ============================================================
   21. 表格斑马纹（提高可读性）
   ============================================================ */
.ant-table-tbody > tr:nth-child(even) > td {
    background: rgba(15, 23, 42, 0.015);
}

.ant-table-tbody > tr:nth-child(even):hover > td {
    background: rgba(15, 23, 42, 0.035) !important;
}

/* ============================================================
   22. 操作按钮间距
   ============================================================ */
.ant-space-compact .ant-btn + .ant-btn,
.ant-btn + .ant-btn,
.action-buttons .ant-btn + .ant-btn,
td .ant-btn + .ant-btn {
    margin-left: 8px;
}

/* ============================================================
   23. 数字列右对齐
   ============================================================ */
.ant-table td.column-number,
.ant-table td.column-id,
.ant-table td.column-sort,
.ant-table td.column-order {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   24. 传感器管理/知识库管理等独立页面样式覆盖
   ============================================================ */

/* 独立页面容器 */
#sensor-management-app,
#sensor-monitor-app,
#sensor-alert-app,
#sensor-simulator-app,
#knowledge-management-app,
#pdf-upload-container {
    background: var(--linear-bg) !important;
}

/* 独立页面卡片/头部 */
.management-header,
.filter-toolbar,
.sensor-table-container,
.pagination-container {
    background: var(--linear-surface) !important;
    border: 1px solid var(--linear-border) !important;
    border-radius: var(--linear-radius-lg) !important;
    box-shadow: var(--linear-shadow-xs) !important;
}

.management-header h1 {
    color: var(--linear-text) !important;
    font-size: 20px !important;
    font-weight: 600 !important;
}

/* 原生表格样式覆盖 */
.sensor-table,
.knowledge-table,
table.data-table {
    border-collapse: collapse;
    width: 100%;
}

.sensor-table thead,
.knowledge-table thead,
table.data-table thead {
    background: transparent !important;
}

.sensor-table th,
.knowledge-table th,
table.data-table th {
    background: transparent !important;
    color: var(--linear-muted) !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 1px solid var(--linear-border) !important;
    padding: 10px 12px !important;
}

.sensor-table td,
.knowledge-table td,
table.data-table td {
    padding: 10px 12px !important;
    border-bottom: 1px solid var(--linear-border-light) !important;
    color: var(--linear-text-secondary);
}

/* 原生表格斑马纹 */
.sensor-table tbody tr:nth-child(even),
.knowledge-table tbody tr:nth-child(even),
table.data-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.015);
}

/* 原生表格 hover */
.sensor-table tbody tr:hover,
.knowledge-table tbody tr:hover,
table.data-table tbody tr:hover {
    background: rgba(15, 23, 42, 0.03) !important;
}

/* 状态徽章统一 */
.status-badge {
    border-radius: 999px !important;
    padding: 2px 10px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
}

.status-badge.normal {
    background: var(--linear-success-bg) !important;
    border-color: var(--linear-success-border) !important;
    color: var(--linear-success) !important;
}

.status-badge.warning {
    background: var(--linear-warning-bg) !important;
    border-color: var(--linear-warning-border) !important;
    color: var(--linear-warning) !important;
}

.status-badge.alert,
.status-badge.error {
    background: var(--linear-danger-bg) !important;
    border-color: var(--linear-danger-border) !important;
    color: var(--linear-danger) !important;
}

.status-badge.offline,
.status-badge.inactive {
    background: rgba(15, 23, 42, 0.04) !important;
    border-color: var(--linear-border) !important;
    color: var(--linear-muted) !important;
}

/* 独立页面按钮 */
.btn-small,
.btn-edit,
.btn-delete,
.btn-view {
    border-radius: var(--linear-radius) !important;
    font-weight: 500 !important;
    transition: all 0.15s ease !important;
}

.btn-edit {
    background: var(--linear-primary) !important;
}

.btn-edit:hover {
    background: #1D4ED8 !important;
}

.btn-delete {
    background: var(--linear-danger-bg) !important;
    color: var(--linear-danger) !important;
    border: 1px solid var(--linear-danger-border) !important;
}

.btn-delete:hover {
    background: rgba(220, 38, 38, 0.15) !important;
}

.btn-view {
    background: var(--linear-success-bg) !important;
    color: var(--linear-success) !important;
    border: 1px solid var(--linear-success-border) !important;
}

.btn-view:hover {
    background: rgba(22, 163, 74, 0.15) !important;
}

/* 独立页面输入框 */
.filter-group input,
.filter-group select {
    height: var(--linear-ctrl-h) !important;
    border-radius: var(--linear-radius) !important;
    border: 1px solid var(--linear-border) !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    border-color: var(--linear-primary) !important;
    box-shadow: var(--linear-focus-ring) !important;
    outline: none;
}

/* ============================================================
   Chrome DevTools 设备仿真兼容修复
   问题：同源窗口开启设备仿真会导致其他窗口滚动条消失
   原因：Chrome 设备仿真会将滚动条切换到 overlay 模式，
         影响同源所有窗口，导致 Table sticky 计算错误
   ============================================================ */

/* 强制 Table 始终使用标准滚动条 */
.ant-table-body,
.ant-table-content {
    scrollbar-gutter: stable;
}

/* Webkit 浏览器强制显示滚动条轨道 */
.ant-table-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
    display: block !important;
    -webkit-appearance: none;
}

.ant-table-body::-webkit-scrollbar-track {
    background: var(--linear-border, #E5E7EB);
    border-radius: 4px;
}

.ant-table-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
    min-height: 40px;
}

.ant-table-body::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* 确保 sticky header 正确对齐 */
.ant-table-sticky-holder {
    scrollbar-gutter: stable;
}

/* ============================================================
   定时任务管理页优化
   ============================================================ */

.scheduler-page {
    padding: 16px;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.scheduler-page__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.scheduler-page__title {
    margin: 0;
}

.scheduler-page__subtitle {
    margin: 6px 0 0;
    color: var(--linear-muted);
    font-size: 13px;
    line-height: 1.6;
}

.scheduler-stats-grid {
    margin: 0 !important;
}

.scheduler-stat-card {
    height: 100%;
}

.scheduler-stat-card .ant-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 112px;
}

.scheduler-stat-card--status .ant-card-body {
    align-items: flex-start;
    gap: 12px;
}

.scheduler-stat-card__label {
    color: var(--linear-muted);
    font-size: 12px;
}

.scheduler-stat-card__status-tag {
    margin: 0;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.scheduler-toolbar-card .ant-card-body,
.scheduler-table-card .ant-card-body,
.scheduler-detail-card .ant-card-body {
    padding: 16px;
}

.scheduler-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.scheduler-toolbar__filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.scheduler-toolbar__select {
    width: 220px;
}

.scheduler-toolbar__summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: var(--linear-text);
}

.scheduler-toolbar__summary-label {
    color: var(--linear-muted);
    font-size: 12px;
}

.scheduler-table__row--active td {
    background: rgba(37, 99, 235, 0.05) !important;
}

.scheduler-table__trigger {
    color: var(--linear-text);
    font-weight: 500;
}

.scheduler-table__last-run {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.scheduler-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.scheduler-detail-card__loading {
    text-align: center;
    padding: 32px 0;
}

.scheduler-detail-shell {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.scheduler-overview-card {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 20px;
    border: 1px solid var(--linear-border);
    border-radius: 12px;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.scheduler-overview-card__main {
    flex: 1;
    min-width: 260px;
}

.scheduler-overview-card__eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--linear-primary);
    font-size: 12px;
    font-weight: 600;
}

.scheduler-overview-card__title-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-top: 10px;
}

.scheduler-overview-card__title {
    margin: 0;
    font-size: 20px;
}

.scheduler-overview-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.scheduler-overview-card__desc {
    margin: 10px 0 0;
    max-width: 680px;
    color: var(--linear-muted);
    line-height: 1.7;
}

.scheduler-overview-card__metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 12px;
    min-width: 360px;
}

.scheduler-overview-card__metric {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--linear-border-light);
    background: rgba(255, 255, 255, 0.85);
}

.scheduler-overview-card__metric span {
    font-size: 12px;
    color: var(--linear-muted);
}

.scheduler-overview-card__metric strong {
    color: var(--linear-text);
    font-size: 15px;
    line-height: 1.4;
}

.scheduler-filter-panel,
.scheduler-section-card {
    border: 1px solid var(--linear-border);
    border-radius: 12px;
    background: #fff;
    padding: 16px;
}

.scheduler-filter-panel {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    background: linear-gradient(180deg, #fbfdff 0%, #ffffff 100%);
}

.scheduler-filter-panel__controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.scheduler-filter-panel__title {
    font-weight: 600;
    color: var(--linear-text);
    margin-right: 4px;
}

.scheduler-filter-panel__select {
    width: 180px;
}

/* ============================================================
 * G-22 v2 工单作业资质要求 · 多选下拉自适应高度
 * ============================================================ */
.qualification-multi-select .ant-select-selector {
    min-height: 34px !important;
    height: auto !important;
    padding: 4px 8px !important;
    align-items: flex-start !important;
}

.qualification-multi-select .ant-select-selection-overflow {
    flex-wrap: wrap !important;
    row-gap: 2px;
}

.qualification-multi-select .ant-select-selection-overflow-item {
    max-width: 100%;
}

.qualification-multi-select .ant-tag {
    white-space: normal !important;
    line-height: 20px;
}

/* ============================================================
 * 点检计划 · 根装备多选自适应高度（参照 _UI多选显示不溢出方案.md）
 * ============================================================ */
.root-equipment-multi-select .ant-select-selector {
    min-height: 40px !important;      /* size="large" 控件标准高度 */
    height: auto !important;          /* 关键：允许增长 */
    padding: 4px 8px !important;
    align-items: flex-start !important;
}

.root-equipment-multi-select .ant-select-selection-overflow {
    flex-wrap: wrap !important;       /* 关键：允许换行 */
    row-gap: 2px;
}

.root-equipment-multi-select .ant-select-selection-overflow-item {
    max-width: 100%;
}

.root-equipment-multi-select .ant-tag {
    white-space: normal !important;
    line-height: 20px;
}

/* ============================================================
 * 点检计划 · 设备范围多选自适应高度（参照 _UI多选显示不溢出方案.md）
 * ============================================================ */
.equipment-scope-multi-select .ant-select-selector {
    min-height: 40px !important;      /* size="large" 控件标准高度 */
    height: auto !important;          /* 关键：允许增长 */
    padding: 4px 8px !important;
    align-items: flex-start !important;
}

.equipment-scope-multi-select .ant-select-selection-overflow {
    flex-wrap: wrap !important;       /* 关键：允许换行 */
    row-gap: 2px;
}

.equipment-scope-multi-select .ant-select-selection-overflow-item {
    max-width: 100%;
}

.equipment-scope-multi-select .ant-tag {
    white-space: normal !important;
    line-height: 20px;
}

/* ============================================================
 * 点检计划 · 选择工具多选自适应高度（参照 _UI多选显示不溢出方案.md）
 * ============================================================ */
.tool-scope-multi-select .ant-select-selector {
    min-height: 40px !important;      /* size="large" 控件标准高度 */
    height: auto !important;          /* 关键：允许增长 */
    padding: 4px 8px !important;
    align-items: flex-start !important;
}

.tool-scope-multi-select .ant-select-selection-overflow {
    flex-wrap: wrap !important;       /* 关键：允许换行 */
    row-gap: 2px;
}

.tool-scope-multi-select .ant-select-selection-overflow-item {
    max-width: 100%;
}

.tool-scope-multi-select .ant-tag {
    white-space: normal !important;
    line-height: 20px;
}

/* ============================================================
 * 点检项目 · 相关备件多选自适应高度
 * ============================================================ */
.inspection-item-related-parts-select .ant-select-selector {
    min-height: var(--linear-ctrl-h) !important;
    height: auto !important;
    padding: 4px 8px !important;
    align-items: flex-start !important;
}

.inspection-item-related-parts-select .ant-select-selection-overflow {
    flex-wrap: wrap !important;
    row-gap: 2px;
}

.inspection-item-related-parts-select .ant-select-selection-overflow-item,
.inspection-item-related-parts-select .ant-select-selection-search {
    max-width: 100%;
}

.inspection-item-related-parts-select .ant-select-selection-item {
    height: auto !important;
    line-height: normal !important;
    align-items: flex-start !important;
}

.inspection-item-related-parts-select .ant-select-selection-item-content,
.inspection-item-related-parts-select .ant-tag {
    white-space: normal !important;
    word-break: break-all;
    line-height: 20px !important;
    max-width: 100%;
}

.scheduler-filter-panel__select--tenant {
    width: 220px;
}

.scheduler-filter-panel__hint {
    color: var(--linear-muted);
    font-size: 12px;
}

.scheduler-section-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.scheduler-section-card__title {
    margin: 0;
    font-size: 16px;
}

.scheduler-section-card__meta {
    display: inline-block;
    margin-top: 4px;
    color: var(--linear-muted);
    font-size: 12px;
    line-height: 1.6;
}

.scheduler-frequency-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.9fr);
    gap: 16px;
    align-items: stretch;
}

.scheduler-frequency-layout__editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scheduler-frequency-layout__row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.scheduler-frequency-layout__field--unit,
.scheduler-frequency-layout__field--weekday {
    width: 132px;
}

.scheduler-frequency-layout__field--number {
    width: 128px;
}

.scheduler-frequency-layout__time-group,
.scheduler-override-cell__time-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.scheduler-frequency-layout__field--time,
.scheduler-override-cell__field--time {
    width: 84px;
}

.scheduler-frequency-layout__hint {
    color: var(--linear-muted);
    font-size: 12px;
}

.scheduler-frequency-layout__actions {
    display: flex;
    justify-content: flex-start;
}

.scheduler-frequency-layout__preview {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.07) 0%, rgba(37, 99, 235, 0.03) 100%);
}

.scheduler-frequency-preview__label,
.scheduler-override-cell__preview {
    color: var(--linear-muted);
    font-size: 12px;
}

.scheduler-frequency-preview__value {
    font-size: 22px;
    line-height: 1.3;
    color: var(--linear-text);
}

.scheduler-frequency-preview__text {
    margin: 0;
    color: var(--linear-text-secondary);
    line-height: 1.7;
}

.scheduler-override-cell {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scheduler-override-cell__summary,
.scheduler-override-cell__editor,
.scheduler-override-cell__actions,
.scheduler-override-cell__buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.scheduler-override-cell__label {
    color: var(--linear-muted);
    font-size: 12px;
}

.scheduler-override-cell__field--unit,
.scheduler-override-cell__field--weekday {
    width: 112px;
}

.scheduler-override-cell__field--number {
    width: 96px;
}

.scheduler-override-cell__actions {
    justify-content: space-between;
}

.scheduler-override-cell__buttons {
    gap: 4px;
}

@media (max-width: 1200px) {
    .scheduler-overview-card {
        flex-direction: column;
    }

    .scheduler-overview-card__metrics {
        min-width: 0;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .scheduler-frequency-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .scheduler-page__header,
    .scheduler-overview-card__title-row,
    .scheduler-filter-panel,
    .scheduler-section-card__header,
    .scheduler-override-cell__actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .scheduler-toolbar,
    .scheduler-toolbar__summary,
    .scheduler-overview-card__badges {
        width: 100%;
    }

    .scheduler-toolbar__select,
    .scheduler-filter-panel__select,
    .scheduler-filter-panel__select--tenant,
    .scheduler-frequency-layout__field--unit,
    .scheduler-frequency-layout__field--weekday,
    .scheduler-frequency-layout__field--number,
    .scheduler-override-cell__field--unit,
    .scheduler-override-cell__field--weekday,
    .scheduler-override-cell__field--number {
        width: 100%;
    }

    .scheduler-overview-card__metrics {
        grid-template-columns: 1fr;
    }

    .scheduler-frequency-layout__row,
    .scheduler-override-cell__editor,
    .scheduler-override-cell__summary {
        width: 100%;
    }
}
