/* =====================================================================
   巡维云 EquipCare · 设计令牌与基础样式
   风格：现代企业级 SaaS（浅色 / #F5F7FA 底 / 白卡片，企业绿 #16845B 强调）
   参考 Linear / Stripe Dashboard 的信息层级与克制的视觉语言
   无任何外部字体 / 图标依赖
   ===================================================================== */

:root {
    /* 品牌与语义色（企业绿主强调；蓝=信息、橙=警告、红=危险） */
    --brand-900: #0d2b1e;
    --brand-800: #11412d;
    --brand-700: #16845b;
    --primary: #16845b;
    --primary-strong: #10653f;
    --primary-soft: #e8f5ee;
    --success: #16845b;
    --success-soft: #e8f5ee;
    --warning: #d97706;
    --warning-soft: #fdf3e3;
    --danger: #dc2626;
    --danger-soft: #fdecec;
    --info: #2563eb;
    --info-soft: #eaf1fe;

    /* 中性色：浅灰底 + 白色面板 + 深灰文字 */
    --bg: #f5f7fa;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --surface-raised: #ffffff;
    --border: #e8edf2;
    --border-strong: #d5dde6;
    --text: #263445;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --sidebar-text: #475569;

    /* 尺寸与阴影（浅色阴影：低扩散、低透明度，克制不夸张） */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow: 0 2px 8px rgba(15, 23, 42, .07);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12);
    --sidebar-width: 240px;
    --topbar-height: 64px;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* =====================================================================
   暗色模式（第八期创新升级）：html[data-theme="dark"] 覆盖语义令牌。
   组件层全部引用 var() 令牌，切换主题零组件改动；
   个别历史硬编码浅色（约 15 处）在暗色下仍可读，后续分批收敛。
   ===================================================================== */
[data-theme="dark"] {
    --primary: #34b98a;
    --primary-strong: #2a9a71;
    --primary-soft: #10301f;
    --success: #34b98a;
    --success-soft: #10301f;
    --warning: #f5a623;
    --warning-soft: #33230a;
    --danger: #f87171;
    --danger-soft: #3a1515;
    --info: #60a5fa;
    --info-soft: #10233f;

    --bg: #0f172a;
    --surface: #1b2436;
    --surface-alt: #16202f;
    --surface-raised: #212c40;
    --border: #2c3a4f;
    --border-strong: #3c4d66;
    --text: #e2e8f0;
    --text-secondary: #9fb0c3;
    --text-muted: #6c7f95;
    --sidebar-text: #b9c5d6;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 2px 10px rgba(0, 0, 0, .45);
    --shadow-lg: 0 12px 36px rgba(0, 0, 0, .55);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-strong);
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 600;
    letter-spacing: -.01em;
}

/* 可见焦点：键盘操作可达性 */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ============================ 登录页 ============================ */

.login-page {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    min-height: 100vh;
}

.login-brand {
    position: relative;
    padding: 64px 56px;
    color: #f0f7f3;
    background:
        radial-gradient(1200px 600px at -10% -20%, rgba(74, 222, 128, .12) 0%, transparent 60%),
        linear-gradient(150deg, #0a1f16 0%, #0d2b1e 55%, #11412d 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.login-brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
}

.login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 19px;
    font-weight: 600;
    letter-spacing: .04em;
    position: relative;
    z-index: 1;
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(140deg, #1d9c6b, #10653f);
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.login-headline {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.login-headline h1 {
    font-size: 30px;
    line-height: 1.35;
    margin-bottom: 16px;
}

.login-headline p {
    margin: 0 0 28px;
    color: #b3cfc0;
    font-size: 14px;
}

.login-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.login-points li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: #d3e6db;
    font-size: 13.5px;
}

.login-points .dot {
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    margin-top: 8px;
    border-radius: 50%;
    background: #4ade80;
}

.login-foot {
    position: relative;
    z-index: 1;
    color: #8fb2a2;
    font-size: 12px;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: var(--surface);
}

.login-card {
    width: 100%;
    max-width: 360px;
}

.login-card h2 {
    font-size: 22px;
    margin-bottom: 6px;
}

.login-card .sub {
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 13px;
}

.login-tip {
    margin-top: 20px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-alt);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.7;
}

/* ============================ 应用框架 ============================ */

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--surface);
    color: var(--sidebar-text);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--topbar-height);
    padding: 0 18px;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .03em;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand .logo-mark {
    width: 26px;
    height: 26px;
    border-radius: 7px;
    font-size: 12px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 10px 24px;
}

.nav-group-title {
    padding: 14px 10px 6px;
    font-size: 11px;
    letter-spacing: .12em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    text-align: left;
    font-family: inherit;
    color: var(--sidebar-text);
    font-size: 13.5px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.nav-item:hover {
    background: var(--surface-alt);
    color: var(--text);
}

.nav-item.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
    box-shadow: inset 2px 0 0 var(--primary);
}

.nav-item .nav-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: .55;
}

.sidebar-foot {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--text-muted);
}

.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    height: var(--topbar-height);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 20;
}

.crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.crumbs strong {
    color: var(--text);
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 5px 10px 5px 6px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface-alt);
    color: var(--text);
    cursor: pointer;
}

.user-chip:hover {
    border-color: var(--border-strong);
}

.avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary-strong);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 600;
}

.user-meta {
    line-height: 1.2;
    text-align: left;
}

.user-meta b {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
}

.user-meta span {
    font-size: 11px;
    color: var(--text-muted);
}

.content {
    flex: 1;
    padding: 24px 24px 40px;
    min-width: 0;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.page-head h1 {
    font-size: 20px;
    margin-bottom: 4px;
}

.page-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12.5px;
}

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

/* ============================ 卡片与布局 ============================ */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card + .card {
    margin-top: 16px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.card-head h2,
.card-head h3 {
    font-size: 14px;
}

.card-head .hint {
    color: var(--text-muted);
    font-size: 12px;
}

.card-body {
    padding: 18px;
}

.card-body.tight {
    padding: 0;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

/* 禁止卡片在 grid 行内被拉伸：用于「矮表单 + 高列表」并排场景，避免表单卡出现大片空白 */
.no-stretch {
    align-self: start;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, .9fr);
    gap: 16px;
    align-items: start;
}

/* ============================ 表单 ============================ */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.field > label {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.field .required::after {
    content: " *";
    color: var(--danger);
}

.field .help {
    font-size: 11.5px;
    color: var(--text-muted);
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 8px 11px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.input:hover,
.select:hover,
.textarea:hover {
    border-color: #b6c2d3;
}

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 111, 179, .14);
}

.textarea {
    min-height: 84px;
    resize: vertical;
}

.input[readonly],
.input:disabled,
.select:disabled {
    background: var(--surface-alt);
    color: var(--text-muted);
    cursor: not-allowed;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

.form-grid .span-2 {
    grid-column: span 2;
}

.form-section-title {
    grid-column: 1 / -1;
    margin: 10px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: .04em;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 16px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}

/* ============================ 按钮 ============================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    white-space: nowrap;
}

.btn:hover:not(:disabled) {
    background: var(--surface-alt);
    border-color: #b6c2d3;
}

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

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-strong);
    border-color: var(--primary-strong);
}

.btn-danger {
    color: var(--danger);
    border-color: #e8c4c1;
    background: var(--danger-soft);
}

.btn-danger:hover:not(:disabled) {
    background: #fbdcd9;
}

.btn-ghost {
    border-color: transparent;
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--surface-alt);
    border-color: var(--border);
}

.btn-sm {
    padding: 5px 9px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 13px;
    height: 13px;
    border: 2px solid rgba(255, 255, 255, .5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.btn-secondary.loading::after,
.btn-ghost.loading::after {
    border-color: rgba(47, 111, 179, .3);
    border-top-color: var(--primary);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================ 表格 ============================ */

.table-wrap {
    overflow-x: auto;
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

table.data thead th {
    text-align: left;
    padding: 10px 14px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
}

table.data tbody td {
    padding: 14px 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
}

table.data tbody tr:hover {
    background: #f6f9fb;
}

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

table.data td.actions {
    white-space: nowrap;
    text-align: right;
}

table.data td.actions .btn + .btn {
    margin-left: 2px;
}

table.data .mono {
    font-family: var(--font-mono);
    font-size: 12.5px;
}

.table-empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

/* ============================ 徽标 ============================ */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.7;
    white-space: nowrap;
    border: 1px solid transparent;
}

.tag::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.tag.plain::before {
    display: none;
}

.tag-blue { color: var(--primary-strong); background: var(--primary-soft); }
.tag-green { color: var(--success); background: var(--success-soft); }
.tag-amber { color: var(--warning); background: var(--warning-soft); }
.tag-red { color: var(--danger); background: var(--danger-soft); }
.tag-gray { color: var(--text-secondary); background: #f0f2f6; }
.tag-purple { color: var(--info); background: var(--info-soft); }

/* ============================ 统计块 ============================ */

.stat {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

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

.stat .value {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.02em;
    margin-top: 2px;
}

/* ============================ 工具栏 ============================ */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.toolbar .field {
    margin-bottom: 0;
    min-width: 150px;
}

.toolbar .field.grow {
    flex: 1;
    min-width: 220px;
}

.toolbar .spacer {
    flex: 1;
}

/* ============================ 分页 ============================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 18px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-muted);
}

.pager {
    display: flex;
    gap: 6px;
    align-items: center;
}

.pager button {
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    color: var(--text-secondary);
    cursor: pointer;
}

.pager button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.pager button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pager button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* ============================ 弹层 ============================ */

.modal-mask {
    position: fixed;
    inset: 0;
    background: rgba(20, 27, 40, .45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 64px 16px;
    z-index: 100;
    overflow-y: auto;
}

.modal {
    width: 100%;
    max-width: 560px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: modal-in .16s ease-out;
}

.modal.wide {
    max-width: 820px;
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.modal-head h3 {
    font-size: 15px;
}

.modal-body {
    padding: 18px 20px;
    max-height: 62vh;
    overflow-y: auto;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.icon-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
}

.icon-btn:hover {
    background: var(--surface-alt);
    color: var(--text);
}

/* ============================ 提示 ============================ */

.toast-stack {
    position: fixed;
    top: 66px;
    right: 18px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    min-width: 220px;
    max-width: 380px;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    box-shadow: var(--shadow);
    font-size: 13px;
    animation: toast-in .18s ease-out;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warning); }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: none; }
}

.alert {
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 12.5px;
    border: 1px solid transparent;
    margin-bottom: 14px;
}

.alert-info { background: var(--primary-soft); color: var(--primary-strong); border-color: #cfe1f5; }
.alert-warn { background: var(--warning-soft); color: var(--warning); border-color: #f0dcb8; }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: #f0cfcc; }

/* ============================ 键值列表 ============================ */

.kv {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 8px 12px;
    font-size: 13px;
}

.kv dt {
    color: var(--text-muted);
}

.kv dd {
    margin: 0;
    word-break: break-all;
}

/* ============================ 树 / 复选 ============================ */

.tree {
    font-size: 13px;
}

.tree-node {
    padding: 4px 0;
}

.tree-node .row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 6px;
    border-radius: var(--radius-sm);
}

.tree-node .row:hover {
    background: var(--surface-alt);
}

.tree-children {
    margin-left: 22px;
    border-left: 1px dashed var(--border);
    padding-left: 10px;
}

.check-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 2px;
    font-size: 12.5px;
    color: var(--text-secondary);
    cursor: pointer;
}

.check-line input {
    margin-top: 3px;
    accent-color: var(--primary);
}

.check-line code {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-muted);
}

/* ============================ 设备详情 ============================ */

.detail-hero {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 18px;
    border-bottom: 1px solid var(--border);
}

.hero-cover {
    width: 148px;
    height: 108px;
    flex: 0 0 auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-size: 12px;
    overflow: hidden;
}

.hero-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-main h2 {
    font-size: 17px;
    margin-bottom: 4px;
}

.hero-sub {
    color: var(--text-muted);
    font-size: 12.5px;
    margin-bottom: 10px;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.section-tabs {
    display: flex;
    gap: 2px;
    padding: 0 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.section-tabs button {
    padding: 11px 14px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
}

.section-tabs button.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}

.section-body {
    padding: 18px;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px;
}

.file-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}

.file-card .thumb {
    height: 96px;
    background: var(--surface-alt);
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-size: 12px;
    overflow: hidden;
}

.file-card .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.file-card .meta {
    padding: 8px 10px;
    font-size: 11.5px;
    color: var(--text-secondary);
}

.file-card .meta b {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.file-actions {
    display: flex;
    gap: 8px;
    padding: 0 10px 9px;
}

/* ============================ 二维码 ============================ */

.qr-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    align-items: start;
}

.qr-preview {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px;
    text-align: center;
    background: var(--surface);
}

.qr-preview img {
    width: 240px;
    height: 240px;
    display: block;
    margin: 0 auto 10px;
    image-rendering: pixelated;
}

.qr-preview .caption {
    font-size: 12px;
    color: var(--text-muted);
}

.qr-content {
    font-family: var(--font-mono);
    font-size: 11.5px;
    background: var(--surface-alt);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    word-break: break-all;
    color: var(--text-secondary);
}

/* ============================ 打印 ============================ */

.print-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.print-sheet {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 16mm 16mm 14mm;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    color: #1a1a1a;
    font-size: 12px;
}

.print-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #1f2733;
    padding-bottom: 10px;
    margin-bottom: 14px;
}

.print-head h1 {
    font-size: 20px;
    letter-spacing: .06em;
}

.print-head .sub {
    color: #5a6474;
    font-size: 11px;
    margin-top: 3px;
}

.print-qr {
    text-align: center;
    font-size: 10px;
    color: #5a6474;
}

.print-qr img {
    width: 96px;
    height: 96px;
    display: block;
    margin-bottom: 3px;
}

.print-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid #cfd7e3;
    border-left: 1px solid #cfd7e3;
    margin-bottom: 12px;
}

.print-grid .cell {
    border-right: 1px solid #cfd7e3;
    border-bottom: 1px solid #cfd7e3;
    padding: 6px 8px;
    min-height: 34px;
}

.print-grid .cell .k {
    font-size: 9.5px;
    color: #6b7280;
    letter-spacing: .04em;
}

.print-grid .cell .v {
    font-size: 12px;
    font-weight: 500;
    word-break: break-all;
}

.print-grid .cell.span-2 { grid-column: span 2; }
.print-grid .cell.span-4 { grid-column: span 4; }

.print-section-title {
    font-size: 12px;
    font-weight: 600;
    margin: 14px 0 6px;
    padding-left: 8px;
    border-left: 3px solid var(--primary);
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10.5px;
}

.print-table th,
.print-table td {
    border: 1px solid #cfd7e3;
    padding: 5px 7px;
    text-align: left;
}

.print-table th {
    background: #f2f5f9;
    font-weight: 600;
    color: #374151;
}

.print-sign {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 26px;
    font-size: 11px;
    color: #374151;
}

.print-sign div {
    border-top: 1px solid #9aa4b2;
    padding-top: 6px;
}

.print-foot {
    margin-top: 16px;
    padding-top: 8px;
    border-top: 1px dashed #cfd7e3;
    font-size: 9.5px;
    color: #8a93a3;
    display: flex;
    justify-content: space-between;
}

@media print {
    body {
        background: #fff;
    }

    .sidebar,
    .topbar,
    .print-toolbar,
    .toast-stack {
        display: none !important;
    }

    .app-shell {
        display: block;
    }

    .content {
        padding: 0;
    }

    .print-sheet {
        width: auto;
        min-height: auto;
        margin: 0;
        padding: 0;
        border: none;
        box-shadow: none;
    }

    @page {
        size: A4;
        margin: 14mm;
    }
}

/* ============================ 空态 / 加载 ============================ */

.empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.skeleton {
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, #eef1f6 25%, #f6f8fb 37%, #eef1f6 63%);
    background-size: 400% 100%;
    animation: shimmer 1.3s ease infinite;
}

@keyframes shimmer {
    from { background-position: 100% 50%; }
    to { background-position: 0 50%; }
}

/* ============================ 角色权限卡片 ============================ */

.role-list {
    display: flex;
    flex-direction: column;
}

.role-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid #eef1f6;
}

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

.role-row .grow {
    flex: 1;
    min-width: 0;
}

.role-row .name {
    font-weight: 600;
    font-size: 13.5px;
}

.role-row .code {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-muted);
}

.perm-groups {
    display: grid;
    gap: 14px;
}

.perm-group {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.perm-group > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    font-weight: 600;
}

.perm-group > div {
    padding: 8px 12px 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(246px, 1fr));
    gap: 2px 14px;
}

/* ============================ 扫码页 ============================ */

.scan-page {
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 16px 60px;
}

.scan-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.scan-top {
    padding: 18px;
    background: linear-gradient(150deg, var(--brand-800), var(--brand-700));
    color: #fff;
}

.scan-top .asset-no {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #7fd6a4;
}

.scan-top h2 {
    font-size: 18px;
    margin: 4px 0 10px;
}

.scan-body {
    padding: 16px 18px;
}

.scan-row {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px solid #eef1f6;
    font-size: 13px;
}

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

.scan-row span:first-child {
    color: var(--text-muted);
}

.scan-actions {
    display: flex;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface-alt);
}

.scan-actions .btn {
    flex: 1;
}

/* ============================ 响应式 ============================ */

@media (max-width: 1080px) {
    .split,
    .qr-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 860px) {
    .login-page {
        grid-template-columns: 1fr;
    }

    .login-brand {
        display: none;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
    }

    .sidebar-brand {
        border-bottom: none;
    }

    .sidebar-nav {
        display: flex;
        gap: 4px;
        padding: 8px;
        overflow-x: auto;
    }

    .nav-group-title,
    .sidebar-foot {
        display: none;
    }

    .content {
        padding: 14px;
    }

    .grid-2,
    .grid-3,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .span-2 {
        grid-column: span 1;
    }

    .print-sheet {
        width: 100%;
        padding: 16px;
    }

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

    .print-grid .cell.span-4 {
        grid-column: span 2;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ============================ 二维码标签打印 ============================ */

.qr-label-print {
    display: none;
}

.qr-label {
    width: 90mm;
    padding: 6mm;
    border: 1px solid #cfd7e3;
    text-align: center;
    color: #1a1a1a;
}

.qr-label img {
    width: 46mm;
    height: 46mm;
    display: block;
    margin: 0 auto 2mm;
}

.qr-label .no {
    font-family: var(--font-mono);
    font-size: 10pt;
    font-weight: 600;
}

.qr-label .name {
    font-size: 9pt;
    margin-top: 1mm;
}

.qr-label .tips {
    margin-top: 2mm;
    font-size: 7.5pt;
    color: #6b7280;
}

@media print {
    body.print-qr-only .content > *:not(.qr-label-print) {
        display: none !important;
    }

    body.print-qr-only .qr-label-print {
        display: block !important;
    }
}

/* =====================================================================
   巡检中心（第四阶段）
   模板编辑器 / 计划作用域 / 任务执行 / 日历 / 统计
   ===================================================================== */

/* 通用小件 ------------------------------------------------------------ */

.stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.cell-sub {
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.5;
    margin-top: 2px;
}

.tag-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
}

.kv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px 22px;
    padding: 4px 0 14px;
}

.kv-label {
    display: block;
    color: var(--text-muted);
    font-size: 11.5px;
    margin-bottom: 3px;
}

.kv-value {
    font-size: 13px;
    color: var(--text);
    word-break: break-all;
}

.check-line.compact {
    font-size: 12.5px;
    color: var(--text-secondary);
}

.icon-btn.danger:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* 筛选胶囊 ------------------------------------------------------------ */

.chip-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.chip {
    padding: 5px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 12.5px;
    cursor: pointer;
    transition: border-color .12s ease, color .12s ease, background-color .12s ease;
}

.chip:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.chip.active {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary-strong);
    font-weight: 600;
}

/* 多选列表 ------------------------------------------------------------ */

.picker {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    overflow: hidden;
    margin-bottom: 10px;
}

.picker > .input {
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
}

.picker-list {
    max-height: 190px;
    overflow-y: auto;
    padding: 6px 4px;
}

.picker-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.picker-item:hover {
    background: var(--surface-alt);
}

/* 模板编辑器 ---------------------------------------------------------- */

.tpl-items-head {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin: 18px 0 10px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.tpl-items-head h4 {
    margin: 0 0 3px;
    font-size: 14px;
}

.tpl-items-head > div:first-child {
    flex: 1;
}

.tpl-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tpl-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-alt);
    padding: 12px;
}

.tpl-item-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.tpl-item-seq {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
}

.tpl-item-name {
    flex: 1;
    font-weight: 600;
}

.tpl-item-tools {
    display: flex;
    gap: 2px;
    margin-left: auto;
}

.tpl-item-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
}

/* 任务详情 / 执行 ----------------------------------------------------- */

.qr-box {
    width: 168px;
    height: 168px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
}

.qr-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

tr.row-abnormal > td {
    background: var(--danger-soft);
}

.photo-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.photo-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    position: relative;
}

.photo-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-alt);
}

.photo-cell .icon-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    line-height: 1;
    font-size: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
}

.progress {
    flex: 1;
    height: 8px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: var(--primary);
    transition: width .18s ease;
}

.exec-list {
    display: flex;
    flex-direction: column;
}

.exec-item {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid transparent;
    transition: background .15s ease, border-color .15s ease;
}

/* 卡片完成态：绿序号；异常：红左条 */
.exec-item.done .exec-seq {
    background: var(--success-soft, #e7f6ef);
    border-color: var(--success);
    color: var(--success);
}

.exec-item.abnormal {
    border-left-color: var(--danger);
    background: var(--danger-soft, #fdf1f1);
}

.exec-item.flash {
    background: var(--primary-soft, #e8f5ef);
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.exec-item:last-child {
    border-bottom: 0;
}

.exec-head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.exec-seq {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-alt);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.exec-title {
    flex: 1;
}

.exec-title strong {
    font-size: 13.5px;
}

.exec-tags {
    display: flex;
    gap: 6px;
    margin-top: 5px;
}

.exec-actions {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}

.exec-btn {
    min-width: 56px;
}

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

.exec-btn.danger.active {
    background: var(--danger);
    border-color: var(--danger);
}

.exec-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 8px 0 0 34px;
    color: var(--text-muted);
    font-size: 11.5px;
}

.exec-rule {
    color: var(--warning);
}

.exec-value {
    margin: 10px 0 0 34px;
    max-width: 460px;
}

.exec-extra {
    margin: 10px 0 0 34px;
    max-width: 560px;
    padding: 12px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-alt);
}

.exec-submit {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    margin-top: 14px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

/* 异常清单 ------------------------------------------------------------ */

.anomaly-list {
    display: flex;
    flex-direction: column;
}

.anomaly-item {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.anomaly-item:last-child {
    border-bottom: 0;
}

.anomaly-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}

.anomaly-head .grow {
    flex: 1;
}

.anomaly-item-main {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 13.5px;
}

.anomaly-value {
    color: var(--danger);
    font-size: 12.5px;
    font-family: var(--font-mono);
}

.anomaly-body {
    padding-left: 2px;
}

.anomaly-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

/* 日历 ---------------------------------------------------------------- */

.calendar-legend {
    display: flex;
    gap: 12px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    display: inline-block;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.calendar-head {
    text-align: center;
    font-size: 11.5px;
    color: var(--text-muted);
    padding: 4px 0 6px;
}

.calendar-cell {
    min-height: 74px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 6px 7px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: border-color .12s ease, background-color .12s ease;
}

.calendar-cell.empty {
    border: 1px dashed var(--border);
    background: transparent;
    cursor: default;
}

.calendar-cell.has-task {
    background: var(--surface-alt);
}

.calendar-cell:hover:not(.empty) {
    border-color: var(--primary);
}

.calendar-cell.today {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.calendar-cell.selected {
    background: var(--primary-soft);
    border-color: var(--primary);
}

.calendar-day {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.calendar-total {
    font-size: 11.5px;
    color: var(--text);
    font-weight: 600;
}

.calendar-bars {
    display: flex;
    gap: 2px;
    height: 5px;
    border-radius: 999px;
    overflow: hidden;
}

.calendar-bars .bar {
    display: block;
    height: 100%;
}

.calendar-abnormal {
    font-size: 11px;
    color: var(--danger);
}

.bar-PENDING {
    background: var(--border-strong);
}

.bar-IN_PROGRESS {
    background: var(--primary);
}

.bar-SUBMITTED {
    background: var(--success);
}

.bar-EXPIRED {
    background: var(--danger);
}

.dot-PENDING {
    background: var(--border-strong);
}

.dot-IN_PROGRESS {
    background: var(--primary);
}

.dot-SUBMITTED {
    background: var(--success);
}

.dot-EXPIRED {
    background: var(--danger);
}

/* 统计 ---------------------------------------------------------------- */

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.metric {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}

.metric-label {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.metric-value {
    font-size: 22px;
    font-weight: 700;
    font-family: var(--font-mono);
    line-height: 1.1;
    color: var(--text);
}

.metric-value.ok {
    color: var(--success);
}

.metric-value.warn {
    color: var(--warning);
}

.metric-value.danger {
    color: var(--danger);
}

.metric-hint {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.bar-row {
    display: grid;
    grid-template-columns: minmax(90px, 168px) 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-size: 12.5px;
}

.bar-label {
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bar-track {
    height: 8px;
    border-radius: 999px;
    background: var(--surface-alt);
    border: 1px solid var(--border);
    overflow: hidden;
}

.bar-fill {
    display: block;
    height: 100%;
    background: var(--primary);
}

.bar-value {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11.5px;
    min-width: 58px;
    text-align: right;
}

.fill-PENDING {
    background: var(--border-strong);
}

.fill-IN_PROGRESS {
    background: var(--primary);
}

.fill-SUBMITTED {
    background: var(--success);
}

.fill-EXPIRED {
    background: var(--danger);
}

.fill-ABNORMAL {
    background: var(--danger);
}

.inline-bar {
    display: inline-block;
    width: 72px;
    height: 6px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
    vertical-align: middle;
    margin-right: 8px;
}

.inline-bar i {
    display: block;
    height: 100%;
    background: var(--primary);
}

.trend {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 160px;
    padding-top: 8px;
}

.trend-col {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 100%;
    min-width: 4px;
}

.trend-bars {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 1px;
}

.trend-bar {
    display: block;
    width: 33%;
    max-width: 8px;
    border-radius: 2px 2px 0 0;
    background: var(--border-strong);
}

.trend-bar.done {
    background: var(--success);
}

.trend-bar.abnormal {
    background: var(--danger);
}

.trend-axis {
    display: flex;
    gap: 3px;
    margin-top: 4px;
}

.trend-axis span {
    flex: 1;
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
}

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

    .detail-hero {
        flex-direction: column;
    }

    .calendar-cell {
        min-height: 58px;
        padding: 4px;
    }

    .exec-value,
    .exec-extra,
    .exec-meta {
        margin-left: 0;
        max-width: none;
    }

    .exec-head {
        flex-wrap: wrap;
    }

    .exec-actions {
        width: 100%;
        margin-top: 8px;
    }

    .exec-actions .exec-btn {
        flex: 1;
        min-width: 0;
    }

    .exec-submit {
        flex-direction: column;
        align-items: stretch;
    }

    /* 视图 Tab / 状态标签：窄屏可横向滑动 */
    .section-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .section-tabs button {
        white-space: nowrap;
    }

    .status-chips {
        flex-wrap: wrap;
    }

    /* 看板窄屏：固定列宽横向滑动 */
    .wo-board {
        grid-template-columns: repeat(5, 240px);
    }
}

/* 视图 Tab 条：独立卡片形态（巡检任务页 列表/日历 切换） */
.card.section-tabs {
    padding: 0 6px;
    border-bottom: 1px solid var(--border);
}

/* 日历头部导航按钮组 */
.calendar-nav {
    display: inline-flex;
    gap: 6px;
    margin-left: 12px;
}

/* 状态标签行的行首说明文字 */
.chip-label {
    align-self: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* 工单看板：五列状态泳道，仅展示不拖拽 */
.wo-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(230px, 1fr));
    gap: 12px;
    padding: 16px 18px;
    overflow-x: auto;
    align-items: start;
}

.board-col {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 10px);
    padding: 10px;
    min-width: 0;
}

.board-col-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 4px 10px;
}

.board-count {
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.board-col-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.board-card {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius, 8px);
    padding: 10px 12px;
    cursor: pointer;
    font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.board-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.board-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.board-card-main {
    margin-top: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.board-card-sub {
    margin-top: 4px;
    font-size: 11.5px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.board-card-foot {
    margin-top: 6px;
}

.board-empty {
    padding: 18px 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* 详情页顶部双栏：概况（宽）+ 故障现场（窄），窄屏叠放 */
.detail-two-col {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 16px;
    align-items: start;
}

@media (max-width: 1080px) {
    .detail-two-col {
        grid-template-columns: 1fr;
    }
}

/* 备件库存低于安全库存：浅橙提示（红留给更强信号） */
.stock-below {
    color: var(--warning);
    font-weight: 600;
}

tr.row-below-safety td {
    background: var(--warning-soft, #fdf6ec);
}

@media (prefers-reduced-motion: reduce) {
    .chip,
    .calendar-cell,
    .progress-fill {
        transition: none;
    }
}

/* 表单里的「grow」字段：栅格里占满整行，flex 容器里占满剩余宽度 */
.form-grid .field.grow {
    grid-column: 1 / -1;
}

.exec-submit .field.grow {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.exec-submit .field textarea,
.exec-submit .field input {
    width: 100%;
}

/* =====================================================================
   维修工单中心（第五阶段）
   列表 / 报修 / 详情 / 派单 / 工作台 / 维修记录 / 验收 / 时间线 / 评价
   ===================================================================== */

/* 基础小件补全 -------------------------------------------------------- */

.hint {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
}

.link {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed transparent;
}

.link:hover {
    color: var(--primary-strong);
    border-bottom-color: var(--primary-strong);
}

/* 长文本（故障描述 / 维修总结 / 验收意见）：保留换行，不撑破卡片 */
.fault-text {
    margin: 4px 0 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 堆叠行：维修记录 / 备件用料 / 验收记录都用它，一行一条、可带小标题 */
.stack-row {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 10px 12px;
}

.stack-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    row-gap: 4px;
    margin-bottom: 2px;
}

.stack-head strong {
    font-size: 13.5px;
}

/* 照片条：报修现场 / 维修前后 / 验收照片 */
.photo-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

/* 派单 / 工作台的指标卡沿用 .metric，这里给一个语义别名 */
.metric-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
}

.metric-card.is-link {
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.metric-card.is-link:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

/* 工单操作时间线 ------------------------------------------------------ */

.timeline {
    /* 六类事件各给一个色相，低饱和，与整体蓝灰不冲突 */
    --ev-create: var(--primary);
    --ev-status: var(--info);
    --ev-repair: var(--primary-strong);
    --ev-dispatch: var(--warning);
    --ev-verify: var(--success);
    --ev-part: #5b8def;
    --ev-eval: #9aa4b5;

    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    padding: 0 0 12px;
}

.timeline-dot {
    position: absolute;
    left: -24px;
    top: 12px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--border-strong);
}

.timeline-body {
    border: 1px solid var(--border);
    border-left: 3px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-alt);
    padding: 9px 12px;
}

.ev-create .timeline-dot { border-color: var(--ev-create); }
.ev-create .timeline-body { border-left-color: var(--ev-create); }

.ev-status .timeline-dot { border-color: var(--ev-status); }
.ev-status .timeline-body { border-left-color: var(--ev-status); }

.ev-repair .timeline-dot { border-color: var(--ev-repair); }
.ev-repair .timeline-body { border-left-color: var(--ev-repair); }

.ev-dispatch .timeline-dot { border-color: var(--ev-dispatch); }
.ev-dispatch .timeline-body { border-left-color: var(--ev-dispatch); }

.ev-verify .timeline-dot { border-color: var(--ev-verify); }
.ev-verify .timeline-body { border-left-color: var(--ev-verify); }

.ev-part .timeline-dot { border-color: var(--ev-part); }
.ev-part .timeline-body { border-left-color: var(--ev-part); }

.ev-eval .timeline-dot { border-color: var(--ev-eval); }
.ev-eval .timeline-body { border-left-color: var(--ev-eval); }

.timeline-body .cell-sub {
    margin-top: 0;
}

/* 星级评分 ------------------------------------------------------------ */

.rating-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
    gap: 14px;
}

.rating-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.rating-label {
    font-size: 12.5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.rating-tail {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.rating-star {
    padding: 0 2px;
    border: 0;
    background: none;
    font-size: 22px;
    line-height: 1;
    color: var(--border-strong);
    cursor: pointer;
    transition: color .12s, transform .12s;
}

.rating-star.on {
    color: #d99b16;
}

.rating-star:hover {
    transform: scale(1.1);
}

.rating-star:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* 已评价时的只读回显 */
.rating-readonly {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 2px 0;
}

.rating-readonly .rating-label {
    min-width: 62px;
}

.rating-stars {
    color: #d99b16;
    font-size: 15px;
    letter-spacing: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .rating-star,
    .metric-card.is-link {
        transition: none;
    }

    .rating-star:hover {
        transform: none;
    }
}

/* 时间线 / 记录行里的正文已经是卡片内的内容，再套一层边框会显得层层嵌套 */
.timeline-body .fault-text,
.stack-row .fault-text {
    margin: 6px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
}

/* ============================ 驾驶舱（第七阶段） ============================ */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.chart-dom {
    width: 100%;
    height: 280px;
}

.chart-host {
    position: relative;
    padding: 0 16px 12px;
}

.chart-host .card-head,
.chart-host h2 {
    margin: 0;
    padding: 12px 0 4px;
}

.chart-empty {
    position: absolute;
    inset: 48px 16px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 13px;
    background: var(--surface);
}

.export-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ============================ 通知中心（第七阶段） ============================ */

.msg-list {
    display: flex;
    flex-direction: column;
}

.msg-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.msg-item:last-child {
    border-bottom: 0;
}

.msg-unread {
    background: var(--danger-soft);
}

.msg-check {
    display: flex;
    align-items: center;
    padding-top: 2px;
}

.msg-main {
    flex: 1;
    min-width: 0;
}

.msg-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.msg-content {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    word-break: break-word;
}

.msg-time {
    margin-top: 4px;
}

/* =====================================================================
   阶段八 · 深空工业主题适配层
   覆盖历史上硬编码的浅色值；打印纸张样式保持白底不在此列
   （阶段十一修正：全站已切换浅色主题，color-scheme 必须为 light，
     否则浏览器 UA 会把 button 默认文字渲染为白色，顶栏用户名白字白底不可见）
   ===================================================================== */

body {
    color-scheme: light;
}

/* 表单控件 */
.input:hover,
.select:hover,
.textarea:hover {
    border-color: var(--border-strong);
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 132, 91, .14);
}

.input::placeholder,
.textarea::placeholder {
    color: var(--text-muted);
}

/* 按钮 */
.btn {
    background: var(--surface);
    border-color: var(--border-strong);
}

.btn:hover:not(:disabled) {
    background: var(--surface-alt);
    border-color: #c3ceda;
}

.btn-primary {
    color: #ffffff;
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-strong);
    border-color: var(--primary-strong);
}

.btn-primary.loading::after {
    border-color: rgba(255, 255, 255, .4);
    border-top-color: #ffffff;
}

.btn-danger {
    color: var(--danger);
    border-color: rgba(220, 38, 38, .4);
    background: var(--danger-soft);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(220, 38, 38, .1);
}

.btn-secondary.loading::after,
.btn-ghost.loading::after {
    border-color: rgba(22, 132, 91, .35);
    border-top-color: var(--primary);
}

/* 表格 */
table.data tbody td {
    border-bottom: 1px solid var(--border);
}

table.data tbody tr:hover {
    background: #f6f9fb;
}

/* 徽标：中性灰；紫徽标重映射为企业蓝灰（保持阶段八口径） */
.tag-gray {
    color: var(--text-secondary);
    background: #eef2f6;
}

.tag-purple {
    color: var(--info);
    background: var(--info-soft);
}

/* 统计块：企业绿顶部强调线，统一卡片规范 */
.stat,
.metric,
.metric-card {
    background: var(--surface);
    position: relative;
}

.stat .value,
.metric-value {
    font-variant-numeric: tabular-nums;
}

.stat::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
    opacity: .85;
}

/* 弹层与提示 */
.modal-mask {
    background: rgba(15, 23, 42, .45);
}

.alert-info {
    background: var(--info-soft);
    color: #1d4ed8;
    border-color: rgba(37, 99, 235, .3);
}

.alert-warn {
    background: var(--warning-soft);
    color: #b45309;
    border-color: rgba(217, 119, 6, .3);
}

.alert-error {
    background: var(--danger-soft);
    color: #b91c1c;
    border-color: rgba(220, 38, 38, .3);
}

/* 加载骨架 */
.skeleton {
    background: linear-gradient(90deg, #eef2f6 25%, #f7fafc 37%, #eef2f6 63%);
    background-size: 400% 100%;
}

/* 杂项分隔线 */
.role-row {
    border-bottom: 1px solid var(--border);
}

.scan-row {
    border-bottom: 1px solid var(--border);
}

/* 选中态 / 日历 */
.chip.active {
    background: var(--primary-soft);
    border-color: var(--primary);
    color: var(--primary-strong);
}

.calendar-cell.selected {
    background: var(--primary-soft);
}

/* 星级金色保留（通用惯例，非禁用色） */
.rating-star.on,
.rating-stars {
    color: #e2b23e;
}

/* ---------------- 顶栏：全局搜索 / 消息铃铛 / 头像菜单 ---------------- */

.topbar-search {
    position: relative;
    width: 300px;
    max-width: 34vw;
}

.topbar-search .input {
    height: 32px;
    padding: 0 12px 0 30px;
    font-size: 12.5px;
    background: var(--surface-alt);
    border-color: var(--border);
    border-radius: 999px;
}

.topbar-search .input:focus {
    background: var(--surface-raised);
}

.topbar-search::before {
    content: "";
    position: absolute;
    left: 11px;
    top: 50%;
    width: 12px;
    height: 12px;
    transform: translateY(-50%);
    border: 1.5px solid var(--text-muted);
    border-radius: 50%;
    pointer-events: none;
}

.topbar-search::after {
    content: "";
    position: absolute;
    left: 21.5px;
    top: calc(50% + 5px);
    width: 6px;
    height: 1.5px;
    background: var(--text-muted);
    transform: rotate(45deg);
    pointer-events: none;
}

.search-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 380px;
    overflow-y: auto;
    z-index: 60;
}

.search-group-title {
    padding: 8px 12px 4px;
    font-size: 11px;
    letter-spacing: .1em;
    color: var(--text-muted);
}

.search-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12.5px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.search-item:hover,
.search-item.active {
    background: var(--primary-soft);
    color: var(--text);
}

.search-item .mono {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-muted);
}

.search-empty {
    padding: 16px 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12.5px;
}

.bell-btn {
    position: relative;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--surface-alt);
    color: var(--text-secondary);
    font-size: 16px;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
}

.bell-btn:hover {
    border-color: var(--primary);
    color: var(--primary-strong);
}

.bell-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.avatar-wrap {
    position: relative;
}

.avatar-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 168px;
    background: var(--surface-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 60;
}

.avatar-menu .menu-head {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.avatar-menu .menu-head b {
    display: block;
    font-size: 13px;
}

.avatar-menu .menu-head span {
    font-size: 11.5px;
    color: var(--text-muted);
}

.avatar-menu button {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.avatar-menu button:hover {
    background: var(--primary-soft);
    color: var(--text);
}

/* 联动顶栏收紧：紧凑布局 */
.content {
    padding: 16px 22px 36px;
}

/* 移动端适配 */
@media (max-width: 860px) {
    .topbar {
        padding: 0 12px;
        gap: 8px;
    }

    .topbar-search {
        width: 150px;
    }

    .user-meta {
        display: none;
    }

    .crumbs span:first-child {
        display: none;
    }
}

/* ==========================================================================
   阶段九 · 滚动条统一美化（全站 + 弹窗细化）
   Windows Chrome/Edge 默认滚动条过宽且亮灰，与深空主题不符；统一为细长条。
   ========================================================================== */

/* Firefox：滑块浅灰半透明，轨道透明 */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .45) transparent;
}

/* WebKit（Chrome / Edge / Safari） */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .4);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, .55);
    background-clip: padding-box;
}
::-webkit-scrollbar-thumb:active {
    background: rgba(71, 85, 105, .65);
    background-clip: padding-box;
}
::-webkit-scrollbar-corner {
    background: transparent;
}

/* 弹窗与内嵌滚动区：更细（8px），贴近内容 */
.modal-mask,
.modal-body,
.table-wrap {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .4) transparent;
}
.modal ::-webkit-scrollbar,
.modal-mask::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

/* 键盘聚焦滚动区时滑块点亮为工业绿，保留可达性提示 */
.modal:focus-within::-webkit-scrollbar-thumb {
    background: rgba(74, 222, 128, .5);
    background-clip: padding-box;
}

/* 打印恢复白底浅灰滑块 */
@media print {
    * {
        scrollbar-width: auto;
        scrollbar-color: #b8bec9 #ffffff;
    }
}


/* ==========================================================================
   阶段十 · 侧栏折叠 + 导航标签 + 建设中占位页
   ========================================================================== */

/* 折叠按钮：品牌行右侧，小尺寸图标按钮 */
.sidebar-toggle {
    margin-left: auto;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}

.sidebar-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* 折叠态：收窄为图标宽度，隐藏文字 */
.sidebar {
    transition: width .18s ease;
}

.sidebar.collapsed {
    width: 64px;
}

/* 折叠态同步收窄壳层栅格列 */
.app-shell:has(.sidebar.collapsed) {
    grid-template-columns: 64px 1fr;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-group-title {
    display: none;
}

/* 折叠态：隐藏圆点，显示首字徽标（修复折叠后只剩一列小点的问题） */
.sidebar.collapsed .nav-dot {
    display: none;
}

.nav-abbr {
    display: none;
}

.sidebar.collapsed .nav-abbr {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface-alt);
}

.sidebar.collapsed .nav-item.active .nav-abbr {
    color: var(--primary);
    background: var(--surface);
}

.sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 0 8px;
}

.sidebar.collapsed .sidebar-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    margin-left: 0;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 9px 0;
}

.sidebar.collapsed .sidebar-foot {
    text-align: center;
    padding: 12px 4px;
}

/* 建设中占位页 */
.placeholder-card {
    padding: 56px 24px;
    text-align: center;
}

.placeholder-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.placeholder-card h2 {
    font-size: 17px;
    color: var(--text);
    margin-bottom: 8px;
}

.placeholder-card p {
    margin: 0 auto;
    max-width: 460px;
    color: var(--text-secondary);
    font-size: 13.5px;
}

.placeholder-note {
    margin-top: 14px !important;
    color: var(--text-muted) !important;
    font-size: 12.5px !important;
}

/* ==========================================================================
   阶段十 · 数据驾驶舱五层信息架构
   ========================================================================== */

/* 欢迎区 */
.dash-welcome {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.dash-greet {
    font-size: 22px;
    color: var(--text);
}

.dash-date {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

/* 第一层：核心指标卡（4 张大卡） */
.dash-core-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.dash-core-card {
    padding: 20px 22px;
}

.dash-core-card .value {
    font-size: 26px;
    font-weight: 700;
}

.dash-core-card .label {
    font-size: 12.5px;
    color: var(--text-secondary);
}

/* 双列图表网格 */
.dash-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* 驾驶舱筛选工具条：控件固定宽度横排 */
.card .toolbar .input {
    width: auto;
}

.card .toolbar select.input {
    min-width: 130px;
}

.card .toolbar input[type="date"].input {
    width: 150px;
}

.dash-grid-2 .card {
    min-width: 0;
}

/* 近期动态流 */
.dash-feed {
    padding: 8px 20px 16px;
}

.feed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

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

.feed-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.feed-main b {
    font-size: 13.5px;
    color: var(--text);
    font-weight: 600;
}

.feed-main .hint {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 响应式：窄屏单列 */
@media (max-width: 1080px) {
    .dash-core-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dash-grid-2 {
        grid-template-columns: 1fr;
    }

    .dash-welcome {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ==========================================================================
   阶段十 · 设备列表统计卡 + 详情生命周期时间线
   ========================================================================== */

.equip-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.equip-stat {
    text-align: left;
    padding: 16px 20px;
    cursor: pointer;
    transition: box-shadow .15s ease, transform .15s ease;
}

.equip-stat:hover {
    box-shadow: var(--shadow);
}

.equip-stat .value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
}

.equip-stat-total .value {
    color: var(--primary);
}

.equip-stat .label {
    font-size: 12.5px;
    color: var(--text-secondary);
}

/* 生命周期时间线 */
.life-wrap {
    padding: 4px 8px;
}

.life-timeline {
    position: relative;
    padding-left: 20px;
}

.life-timeline::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--border);
}

.life-dot {
    position: relative;
    width: 10px;
    height: 10px;
    margin-left: -15px;
    margin-bottom: 2px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--primary);
}

.life-item {
    margin: 0 0 18px 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.life-item b {
    font-size: 13.5px;
    color: var(--text);
}

.life-time {
    font-size: 12px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 1080px) {
    .equip-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   阶段十 · 交互统一与响应式增强
   目标：窄屏（≤860px）下页面头部、筛选条、卡片头、弹层不破版；
   表格横向滑动；触控目标不小于 36px；动效尊重系统减弱设置。
   ========================================================================== */

@media (max-width: 860px) {
    /* 页头：标题与操作按钮纵向堆叠，按钮可换行 */
    .page-head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .page-head .page-actions {
        flex-wrap: wrap;
        gap: 8px;
    }

    .page-head .page-actions .btn {
        flex: 1 1 auto;
        min-height: 38px;
    }

    /* 筛选工具条：允许换行，控件保持可点宽度 */
    .toolbar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .toolbar .field {
        min-width: 130px;
    }

    /* 卡片头：标题与工具区换行 */
    .card-head {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* 弹层：窄屏留出边距，高度受限时可滚 */
    .modal-mask {
        padding: 12px;
    }

    .modal {
        max-height: calc(100dvh - 24px);
    }

    /* 表格：容器内横向滑动，行高保持 52px 触控规格 */
    table.data tbody tr {
        min-height: 52px;
    }

    /* 分页窄屏换行 */
    .pagination {
        flex-wrap: wrap;
    }

    /* 移动端横向侧栏：导航项文字保持单行，避免逐字竖排 */
    .sidebar-nav .nav-item {
        white-space: nowrap;
        flex: 0 0 auto;
    }

    .sidebar-brand {
        flex: 0 0 auto;
    }
}

/* 系统减弱动效：全站过渡与动画停用（与既有规则叠加） */
@media (prefers-reduced-motion: reduce) {
    .exec-item,
    .board-card,
    .modal,
    .chip,
    .btn {
        transition: none;
        animation: none;
    }
}

/* =====================================================================
   AI 智能副驾（第八期创新升级）
   ===================================================================== */

.ai-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.ai-md { font-size: 14px; line-height: 1.75; color: var(--text); }
.ai-md .ai-h { margin: 14px 0 6px; font-size: 15px; color: var(--text); }
.ai-md .ai-h:first-child { margin-top: 0; }
.ai-md .ai-p { margin: 6px 0; }
.ai-md .ai-ul { margin: 6px 0; padding-left: 20px; }
.ai-md .ai-ul li { margin: 4px 0; }
.ai-md .ai-gap { height: 6px; }
.ai-md .ai-inline {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: var(--font-mono);
    font-size: 12.5px;
}
.ai-md .ai-code {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    overflow-x: auto;
    white-space: pre-wrap;
}

.ai-caret {
    display: inline-block;
    color: var(--primary);
    animation: ai-blink 1s step-end infinite;
}
@keyframes ai-blink {
    50% { opacity: 0; }
}

.ai-suggest-box {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ai-suggest-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.ai-suggest-item:hover { border-color: var(--primary); background: var(--primary-soft); }
