* { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; }

/* ===== 侧边栏 ===== */
.sidebar-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-radius: 8px; transition: all 0.2s; font-size: 14px; font-weight: 500; color: #374151; margin-bottom: 2px; }
.sidebar-item.active { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: white; }
.sidebar-sub > div.active { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: white; font-weight: 600; }
.sidebar-item:hover:not(.active) { background: #f1f5f9; }
.sidebar-sub { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.sidebar-sub.open { max-height: 500px; }
.sidebar-sub-item { padding: 8px 14px 8px 34px; cursor: pointer; font-size: 13px; color: #6b7280; border-radius: 6px; margin: 2px 0; }
.sidebar-sub-item:hover { background: #f1f5f9; color: #374151; }
.sidebar-sub-item.active { background: #eff6ff; color: #3b82f6; font-weight: 600; }
.sidebar-icon { width: 20px; height: 20px; opacity: 0.85; transition: opacity 0.2s; }
.sidebar-item:hover .sidebar-icon { opacity: 1; }
.sidebar-item.active .sidebar-icon { opacity: 1; filter: brightness(0) invert(1); }
.sidebar-arrow { transition: transform 0.2s; }
.sidebar-badge { background: #ef4444; color: white; font-size: 11px; padding: 2px 6px; border-radius: 10px; margin-left: auto; font-weight: 600; min-width: 18px; text-align: center; }

/* ===== 按钮 ===== */
.btn { padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; border: none; }
.btn-primary { background: #3b82f6; color: white; }
.btn-primary:hover { background: #2563eb; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-sort-arrow { border: none; background: transparent; cursor: pointer; padding: 2px 4px; font-size: 10px; line-height: 1; color: #6b7280; border-radius: 3px; transition: all 0.15s; }
.btn-sort-arrow:hover:not(:disabled) { background: #e5e7eb; color: #1890ff; }
.btn-sort-arrow:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: 10px; }
.btn-outline { border: 1.5px solid #d1d5db; color: #374151; background: white; padding: 8px 18px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: all 0.2s; }
.btn-outline:hover { border-color: #3b82f6; color: #3b82f6; background: #eff6ff; }
.btn-danger { background: #ef4444; color: white; border: none; padding: 8px 18px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: #22c55e; color: white; border: none; padding: 8px 18px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.btn-success:hover { background: #16a34a; }
.btn-warning { background: #f59e0b; color: white; border: none; padding: 8px 18px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.btn-link { background: none; border: none; padding: 4px 8px; cursor: pointer; font-size: 13px; font-weight: 500; line-height: 1.4; transition: opacity 0.2s; white-space: nowrap; }
.btn-link:hover { opacity: 0.75; }
.btn-link.disabled, .btn-link:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn-link-primary { color: #3b82f6; }
.btn-link-success { color: #22c55e; }
.btn-link-danger { color: #ef4444; }
.btn-link-warning { color: #f59e0b; }
.btn-link-info { color: #0ea5e9; }
.btn-link-divider { display: inline-block; width: 1px; height: 14px; background: #e5e7eb; margin: 0 2px; }
.btn-secondary { background: #f3f4f6; color: #374151; border: 1px solid #d1d5db; padding: 8px 16px; border-radius: 8px; font-size: 14px; cursor: pointer; transition: all 0.2s; }
.btn-secondary:hover { background: #e5e7eb; }
.btn-cancel { background: white; color: #6b7280; border: 1px solid #d1d5db; padding: 8px 16px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.btn-cancel:hover { background: #f9fafb; }
.btn-primary-outline { border: 2px solid #3b82f6; color: #3b82f6; background: transparent; padding: 8px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn-primary-outline:hover { background: #eff6ff; }
.btn-block { width: 100%; display: block; text-align: center; }
.ctrl-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border: 1px solid #e5e7eb; border-radius: 8px; background: white; cursor: pointer; transition: all 0.2s; font-size: 13px; font-weight: 500; color: #374151; flex: 1; min-width: 130px; justify-content: center; }
.ctrl-btn:hover { border-color: #3b82f6; color: #3b82f6; background: #eff6ff; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(59,130,246,0.15); }
.ctrl-btn-icon { font-size: 16px; }
.ctrl-btn-text { white-space: nowrap; }

/* ===== 卡片 ===== */
.card { background: white; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); padding: 20px; }
.info-card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid #f1f5f9; }
.panel { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 20px; border: 1px solid #f1f5f9; }
.panel h3 { font-size: 16px; font-weight: 700; color: #1f2937; margin-bottom: 16px; }
.detail-card { background: white; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 20px; }
.list-card { background: white; border-radius: 10px; padding: 16px 20px; margin-bottom: 10px; border: 1px solid #f1f5f9; transition: all 0.2s; cursor: default; }
.list-card:hover { border-color: #d1d5db; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.device-card { background: white; border-radius: 12px; padding: 16px; border: 1px solid #e5e7eb; transition: all 0.2s; cursor: pointer; }
.device-card:hover { border-color: #3b82f6; box-shadow: 0 2px 12px rgba(59,130,246,0.1); }
.alarm-card { background: white; border-radius: 10px; padding: 16px; border-left: 4px solid #ef4444; margin-bottom: 10px; }
.alarm-card.warning { border-left-color: #f59e0b; }
.alarm-card.info { border-left-color: #3b82f6; }
.chart-card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.table-card { background: white; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid #f1f5f9; margin-bottom: 24px; }
.table-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.table-header h3 { font-size: 17px; font-weight: 700; color: #1f2937; }
.table-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rule-card { background: white; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid #f1f5f9; margin-bottom: 24px; }
.rule-card h3 { font-size: 17px; font-weight: 700; color: #1f2937; margin-bottom: 16px; }
.config-card { background: white; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 20px; border: 1px solid #f1f5f9; }
.config-card h3 { font-size: 16px; font-weight: 700; color: #1f2937; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }
.asset-card { background: white; border-radius: 12px; padding: 20px; border: 1px solid #e5e7eb; transition: all 0.2s; cursor: pointer; margin-bottom: 12px; }
.asset-card:hover { border-color: #3b82f6; box-shadow: 0 4px 16px rgba(59,130,246,0.1); }
.control-panel { background: white; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 20px; border: 1px solid #f1f5f9; }
.control-panel-compact { display: flex; gap: 10px; flex-wrap: wrap; background: white; border-radius: 12px; padding: 16px 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 16px; border: 1px solid #f1f5f9; align-items: stretch; }
.upgrade-progress-card { background: white; border-radius: 12px; padding: 20px; border: 1px solid #e5e7eb; margin-bottom: 16px; }
.device-selector-card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 16px; border: 1px solid #f1f5f9; }
.device-selector-card h3 { margin: 0 0 12px; font-size: 15px; color: #1f2937; }

/* ===== 表格 ===== */
table { width: 100%; border-collapse: collapse; }
th { background: #f8fafc; padding: 12px 16px; text-align: left; font-weight: 600; font-size: 13px; color: #64748b; border-bottom: 2px solid #e2e8f0; }
td { padding: 12px 16px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
tr:hover { background: #f8fafc; }
.data-table { min-width: 100%; border-collapse: collapse; }
.data-table thead th { background: #f8fafc; padding: 12px 14px; text-align: left; font-weight: 600; font-size: 13px; color: #64748b; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.data-table tbody td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; font-size: 14px; vertical-align: middle; white-space: nowrap; }
.data-table th.col-actions,
.data-table td.col-actions {
    min-width: 170px;
    position: sticky;
    right: 0;
    z-index: 1;
    box-shadow: -4px 0 8px rgba(15, 23, 42, 0.06);
}
.data-table thead th.col-actions { background: #f8fafc; z-index: 2; }
.data-table tbody td.col-actions { background: #fff; }
.data-table tbody tr:hover td.col-actions { background: #f8fafc; }
.data-table .table-actions { display: inline-flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.data-table .table-actions .btn-link { padding: 2px 6px; font-size: 13px; }
.data-table tbody tr:hover { background: #f8fafc; }
.table-wrapper { overflow-x: auto; border-radius: 10px; border: 1px solid #e5e7eb; }
.table-wrapper table { margin: 0; }
.rule-table { min-width: 100%; border-collapse: collapse; }
.rule-table thead th { background: #f8fafc; padding: 11px 14px; text-align: left; font-weight: 600; font-size: 13px; color: #64748b; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
.rule-table tbody td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; font-size: 14px; white-space: nowrap; }
.rule-table tbody tr:hover { background: #f8fafc; }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid #f1f5f9; flex-wrap: wrap; gap: 8px; }
.pagination-inner { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-btn { min-width: 32px; height: 32px; padding: 0 10px; border: 1px solid #d1d5db; background: #fff; color: #374151; font-size: 13px; border-radius: 6px; cursor: pointer; transition: all 0.15s; }
.page-btn:hover:not(:disabled):not(.active) { border-color: #3b82f6; color: #3b82f6; }
.page-btn.active { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.page-info { font-size: 13px; color: #6b7280; }
.page-ellipsis { padding: 0 4px; color: #9ca3af; font-size: 13px; }
.table-pagination { display: flex; justify-content: space-between; align-items: center; padding: 12px 4px 0; flex-wrap: wrap; gap: 8px; }
.pagination-info { font-size: 13px; color: #6b7280; }
.pagination-btns { display: flex; gap: 6px; align-items: center; }

/* ===== 表单 ===== */
.input { padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; outline: none; transition: border-color 0.2s; }
.input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
select.input { appearance: none; background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%236b7280'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 32px; }
.form-control { width: 100%; padding: 10px 14px; border: 2px solid #e5e7eb; border-radius: 8px; font-size: 14px; outline: none; transition: all 0.2s; background: #f9fafb; box-sizing: border-box; }
.form-control:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); background: white; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.form-grid .form-group.full-width { grid-column: 1 / -1; }
.input-group { display: flex; gap: 8px; align-items: center; }
.input-group .form-control { flex: 1; }
.search-bar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.search-bar .form-control { max-width: 260px; flex-shrink: 0; }
.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; padding: 16px; background: #f9fafb; border-radius: 10px; }
.filter-bar .search-input { width: 180px; flex-shrink: 0; }
.filter-bar .filter-select { width: 160px; flex-shrink: 0; }
.filter-bar .searchable-select-wrapper { width: 160px; flex-shrink: 0; }
.filter-bar input[type="date"] { width: 150px; flex-shrink: 0; }
.filter-bar .btn { flex-shrink: 0; }
.filter-bar .btn-primary.btn-sm,
.filter-bar .btn-secondary.btn-sm {
    width: 80px;
    height: 36px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 13px;
    border-radius: 8px;
}
.search-input { padding: 8px 12px; border: 1.5px solid #e5e7eb; border-radius: 8px; font-size: 13px; outline: none; transition: all 0.2s; }
.search-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.filter-select { padding: 8px 30px 8px 12px; border: 1.5px solid #e5e7eb; border-radius: 8px; font-size: 13px; outline: none; background: white; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.filter-select:focus { border-color: #3b82f6; }
.searchable-select-wrapper { position: relative; }
.searchable-select-wrapper .searchable-select-trigger:hover { border-color: #93c5fd; }
.searchable-select-wrapper .searchable-select-trigger:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); outline: none; }
.search-select-input { width: 100%; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; outline: none; transition: border-color 0.2s, box-shadow 0.2s; box-sizing: border-box; }
.search-select-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.search-select-dropdown { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid #d1d5db; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 100; max-height: 260px; overflow-y: auto; margin-top: 4px; }
.search-select-item { display: flex; align-items: center; padding: 10px 14px; cursor: pointer; transition: background 0.15s; border-bottom: 1px solid #f3f4f6; }
.search-select-item:last-child { border-bottom: none; }
.search-select-item:hover { background: #eff6ff; }
.search-select-item .item-code { font-weight: 600; color: #1f2937; min-width: 50px; font-size: 13px; }
.search-select-item .item-detail { color: #6b7280; font-size: 12px; margin-left: 10px; }
.search-select-hint { padding: 8px 14px; font-size: 12px; color: #9ca3af; text-align: center; background: #fafafa; border-top: 1px solid #f3f4f6; }
.config-form { display: grid; gap: 16px; }
.config-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f3f4f6; }
.config-row:last-child { border-bottom: none; }
.config-row label { width: 140px; font-size: 14px; font-weight: 500; color: #374151; flex-shrink: 0; }
.config-row .value { flex: 1; font-size: 14px; color: #1f2937; }

/* ===== Modal ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-dialog { background: white; border-radius: 12px; padding: 24px; max-width: 560px; width: 90%; max-height: 80vh; overflow-y: auto; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-content { background: #fff; border-radius: 16px; padding: 24px; width: 60vw; max-width: 860px; min-width: 480px; max-height: 75vh; display: flex; flex-direction: column; position: relative; box-shadow: 0 25px 60px rgba(0,0,0,0.25); animation: modalIn 0.25s ease-out; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #e5e7eb; flex-shrink: 0; }
.modal-header h3 { font-size: 18px; font-weight: 700; color: #1e293b; margin: 0; }
.modal-close { background: none; border: none; font-size: 24px; color: #94a3b8; cursor: pointer; line-height: 1; padding: 4px; transition: color 0.2s; }
.modal-close:hover { color: #ef4444; }
.modal-body { flex: 1; overflow-y: auto; min-height: 0; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 16px; border-top: 1px solid #e5e7eb; flex-shrink: 0; }
.modal-close-btn { background: none; border: none; font-size: 20px; color: #9ca3af; cursor: pointer; padding: 4px; }
.modal-confirm-content { width: 480px; max-width: 92vw; max-height: 75vh; }
.modal-lg { width: 70vw; max-width: 960px; }

/* ===== Tab ===== */
.tab-btn { padding: 8px 16px; font-size: 14px; color: #64748b; border-bottom: 2px solid transparent; cursor: pointer; }
.tab-btn.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: 600; }
.nav-tabs { display: flex; gap: 0; border-bottom: 2px solid #e5e7eb; margin-bottom: 20px; overflow-x: auto; }
.nav-tabs button { padding: 10px 20px; font-size: 14px; color: #6b7280; border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; white-space: nowrap; }
.nav-tabs button.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: 600; }
.nav-tabs button:hover:not(.active) { color: #374151; }
.tab-content > div { display: none; }
.tab-content > div.active { display: block; }
.tabs-container { margin-bottom: 20px; }
.tab-btn { padding: 10px 20px; font-size: 14px; color: #6b7280; border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-right: 4px; transition: all 0.2s; }
.tab-btn.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: 600; }
.view-tabs { display: flex; gap: 0; border-bottom: 2px solid #e5e7eb; margin-bottom: 20px; overflow-x: auto; }
.view-tabs button { padding: 10px 20px; font-size: 14px; color: #6b7280; border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.view-tabs button.active { color: #3b82f6; border-bottom-color: #3b82f6; font-weight: 600; }
.view-container { background: white; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid #f1f5f9; }

/* ===== Badge ===== */
.badge { display: inline-block; padding: 3px 10px; border-radius: 9999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-primary { background: #dbeafe; color: #1d4ed8; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-blue { background: #dbeafe; color: #2563eb; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-gray { background: #f3f4f6; color: #4b5563; }
.badge-purple { background: #f3e8ff; color: #7c3aed; }

/* ===== Toast ===== */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; }
.toast { padding: 12px 20px; border-radius: 8px; color: white; margin-bottom: 8px; animation: slideIn 0.3s ease; }
.toast-success { background: #10b981; }
.toast-error { background: #ef4444; }
.toast-info { background: #3b82f6; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== 登录页 ===== */
.login-page { min-height: 100vh; display: flex; position: relative; overflow: hidden; }
.login-left { flex: 1; background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #1d4ed8 100%); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 60px; position: relative; }
.login-left::before { content: ''; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.login-right { flex: 1; display: flex; justify-content: center; align-items: center; padding: 40px; background: white; }
.login-form-box { width: 100%; max-width: 420px; }
.login-input { width: 100%; padding: 12px 16px; border: 2px solid #e5e7eb; border-radius: 10px; font-size: 15px; outline: none; transition: all 0.2s; background: #f9fafb; }
.login-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); background: white; }
.login-btn { width: 100%; padding: 14px; background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; border: none; border-radius: 10px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s; }
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,0.4); }
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.sms-btn { white-space: nowrap; padding: 12px 16px; background: #3b82f6; color: white; border: none; border-radius: 10px; font-size: 14px; cursor: pointer; transition: all 0.2s; }
.sms-btn:hover { background: #2563eb; }
.sms-btn:disabled { background: #94a3b8; cursor: not-allowed; }
.third-btn { flex: 1; padding: 10px; border: 2px solid #e5e7eb; border-radius: 10px; background: white; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px; color: #374151; }
.third-btn:hover { border-color: #3b82f6; background: #f0f7ff; }
.login-tab { padding: 12px 0; font-size: 16px; font-weight: 600; color: #94a3b8; cursor: pointer; border-bottom: 3px solid transparent; transition: all 0.2s; }
.login-tab.active { color: #1d4ed8; border-bottom-color: #1d4ed8; }
.login-loading { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.6s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-container { max-width: 480px; margin: 40px auto; padding: 32px; background: white; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.login-title { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 24px; color: #1f2937; }
.login-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid #e5e7eb; }
.login-tabs .tab-btn { flex: 1; padding: 12px; text-align: center; font-size: 15px; font-weight: 600; color: #9ca3af; border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.login-tabs .tab-btn.active { color: #3b82f6; border-bottom-color: #3b82f6; }
.third-party-login { margin-top: 24px; text-align: center; }
.third-party-login p { font-size: 13px; color: #9ca3af; margin-bottom: 12px; }
.third-party-btns { display: flex; gap: 12px; justify-content: center; }
.btn-wechat { flex: 1; padding: 10px; border: 2px solid #e5e7eb; border-radius: 10px; background: white; cursor: pointer; font-size: 14px; color: #374151; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.2s; }
.btn-wechat:hover { border-color: #10b981; background: #f0fdf4; }
.icon-wechat { width: 20px; height: 20px; display: inline-block; background: #10b981; border-radius: 4px; }

/* ===== 统计卡片 ===== */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid #f1f5f9; text-align: center; transition: all 0.2s; position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.stat-card.blue::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-card.green::before { background: linear-gradient(90deg, #10b981, #34d399); }
.stat-card.orange::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.stat-card.purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.stat-card.red::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.stat-value { font-size: 28px; font-weight: 800; color: #1e40af; line-height: 1.2; margin-bottom: 6px; }
.stat-label { font-size: 13px; color: #6b7280; font-weight: 500; }
.dashboard-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.dashboard-stat { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid #f1f5f9; }
.dashboard-charts { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 24px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }

/* ===== 通知列表 ===== */
.notification-list { display: flex; flex-direction: column; gap: 8px; }
.notification-item { display: flex; gap: 14px; padding: 14px 18px; background: white; border-radius: 10px; border: 1px solid #f1f5f9; transition: all 0.2s; cursor: pointer; }
.notification-item:hover { border-color: #d1d5db; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.notification-item.unread { border-left: 3px solid #3b82f6; background: #f8fafc; }
.notification-type { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.notification-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.notification-title { font-size: 14px; font-weight: 600; color: #1f2937; }
.notification-time { font-size: 12px; color: #9ca3af; }
.notification-text { font-size: 13px; color: #6b7280; line-height: 1.5; }
.notification-priority { font-size: 11px; padding: 2px 8px; border-radius: 99px; font-weight: 600; }
.notification-actions { display: flex; gap: 8px; margin-top: 8px; }
.mark-read { font-size: 12px; color: #3b82f6; cursor: pointer; background: none; border: none; padding: 4px 8px; }
.mark-read:hover { text-decoration: underline; }

/* ===== 个人中心 ===== */
.profile-header { display: flex; gap: 24px; align-items: center; padding: 24px; background: white; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 20px; border: 1px solid #f1f5f9; }
.avatar-section { text-align: center; }
.avatar { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #8b5cf6); display: flex; align-items: center; justify-content: center; color: white; font-size: 28px; font-weight: 700; margin: 0 auto 8px; }
.profile-info { flex: 1; }
.profile-info h3 { font-size: 20px; font-weight: 700; color: #1f2937; margin-bottom: 4px; }
.profile-item { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #f3f4f6; font-size: 14px; }
.profile-item:last-child { border-bottom: none; }

/* ===== 详情 ===== */
.detail-item { display: flex; padding: 12px 0; border-bottom: 1px solid #f3f4f6; font-size: 14px; }
.detail-item .detail-label { width: 120px; color: #6b7280; flex-shrink: 0; font-weight: 500; }
.detail-item .detail-value { flex: 1; color: #1f2937; font-weight: 600; }
.detail-row { display: grid; grid-template-columns: 180px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid #f3f4f6; font-size: 14px; }
.info-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-row .label { color: #6b7280; }
.info-row .value { font-weight: 600; color: #1f2937; }
.view-detail { padding: 16px 0; border-bottom: 1px solid #f3f4f6; }
.view-detail:last-child { border-bottom: none; }
.content-section { margin-bottom: 28px; }
.summary-row { display: flex; gap: 24px; flex-wrap: wrap; padding: 16px 20px; background: #f0f9ff; border-radius: 10px; border: 1px solid #bae6fd; margin-bottom: 20px; }
.summary-row .summary-item { min-width: 140px; }
.summary-row .summary-label { font-size: 12px; color: #0369a1; font-weight: 500; }
.summary-row .summary-value { font-size: 18px; font-weight: 700; color: #0c4a6e; margin-top: 2px; }

/* ===== 进度条 ===== */
.progress-bar { height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.progress-bar { width: 100%; height: 10px; background: #e5e7eb; border-radius: 5px; overflow: hidden; margin: 4px 0; }
.progress-bar-fill { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #3b82f6, #60a5fa); transition: width 0.5s ease; }
.progress-text { font-size: 12px; color: #6b7280; margin-top: 4px; }

/* ===== 操作日志 ===== */
.operation-logs { display: flex; flex-direction: column; gap: 8px; }
.log-card { display: flex; gap: 12px; padding: 12px 16px; background: white; border-radius: 8px; border-left: 3px solid #e5e7eb; font-size: 13px; }
.log-card:nth-child(even) { background: #fafafa; }
.log-card.log-table-card { display: block; padding: 0; background: white; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 0; border: 1px solid #f1f5f9; overflow: hidden; }
.remote-control-page .log-card { display: block; padding: 20px; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border: 1px solid #f1f5f9; border-left: none; }
.remote-control-page .log-card:nth-child(even) { background: white; }
.log-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 12px; }
.log-header-row h3 { margin: 0; font-size: 15px; color: #1f2937; }
.log-search-input { width: 240px !important; padding: 7px 14px !important; font-size: 13px !important; }

/* ===== 布局 ===== */
.page { display: none; }
.page.active { display: block; }
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h2 { font-size: 22px; font-weight: 700; color: #1f2937; }
.page-header p { color: #6b7280; font-size: 14px; margin-top: 4px; }
.section-title { font-size: 16px; font-weight: 700; color: #1f2937; margin-bottom: 16px; padding-left: 10px; border-left: 3px solid #3b82f6; }
.action-bar { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; flex-wrap: wrap; gap: 12px; }
.empty-state { text-align: center; padding: 60px 20px; color: #9ca3af; }
.empty-state svg { width: 64px; height: 64px; margin: 0 auto 16px; opacity: 0.4; }
.empty-state p { font-size: 15px; }
.info-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.big-number { font-size: 32px; font-weight: 800; color: #1e40af; }
.subtitle { font-size: 14px; color: #6b7280; margin-top: 4px; }
.warning-message { padding: 12px 16px; background: #fef3c7; border-radius: 8px; border-left: 4px solid #f59e0b; font-size: 13px; color: #92400e; margin-bottom: 16px; }
[class$="-page"] { animation: fadeIn 0.25s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.device-selector { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 20px; }
.device-selector-card { background: white; border-radius: 10px; padding: 16px; border: 2px solid #e5e7eb; cursor: pointer; transition: all 0.2s; }
.device-selector-card.selected { border-color: #3b82f6; background: #eff6ff; }
.device-selector-card:hover:not(.selected) { border-color: #93c5fd; }
.control-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
.control-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 8px; }
.bind-item { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: white; border-radius: 10px; border: 1px solid #f1f5f9; margin-bottom: 10px; }
.bind-name { font-size: 14px; font-weight: 600; color: #1f2937; }
.bind-status { font-size: 12px; padding: 3px 10px; border-radius: 99px; font-weight: 600; }
.bind-status.bound { background: #dcfce7; color: #166534; }
.bind-status.unbind { background: #fee2e2; color: #991b1b; }
.account-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.benefits-list { list-style: none; padding: 0; margin: 8px 0 0; }
.benefits-list li { padding: 6px 0; font-size: 13px; color: #4b5563; }
.benefits-list li::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -3px;
  background-color: #22c55e;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 6L9 17l-5-5' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ===== 图表 ===== */
.chart-container { position: relative; height: 280px; width: 100%; }
.chart-container canvas { max-height: 100% !important; }
.map-placeholder { width: 100%; height: 400px; background: linear-gradient(135deg, #e0f2fe, #bae6fd, #7dd3fc); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #0369a1; font-size: 16px; font-weight: 600; position: relative; overflow: hidden; }
.map-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; margin-bottom: 24px; }
.map-legend { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: white; border-radius: 10px; border: 1px solid #e5e7eb; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.legend-item { display: flex; align-items: center; font-size: 13px; }
.map-marker { position: absolute; width: 32px; height: 32px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: flex; align-items: center; justify-content: center; color: white; font-size: 12px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.marker-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.marker-label { font-size: 12px; color: #374151; }
.point-icon { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: white; margin-right: 6px; }
.point-label { font-size: 13px; }
.layer-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 900; display: flex; align-items: center; justify-content: center; }
.layer-btn { padding: 6px 14px; border-radius: 6px; font-size: 13px; cursor: pointer; border: 1px solid #d1d5db; background: white; transition: all 0.2s; }
.layer-btn:hover { background: #f9fafb; }

/* ===== 辅助类 ===== */
.highlight-text { color: #3b82f6; font-weight: 700; }
.current { font-weight: 700; color: #3b82f6; }
.color { width: 12px; height: 12px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.text-primary { color: #3b82f6 !important; }
.text-success { color: #22c55e !important; }
.text-danger { color: #ef4444 !important; }
.text-warning { color: #f59e0b !important; }
.text-info { color: #06b6d4 !important; }
.input-suffix { font-size: 13px; color: #6b7280; margin-left: 8px; }
.icon-alipay { display: inline-block; width: 20px; height: 20px; background: #1677ff; border-radius: 4px; vertical-align: middle; margin-right: 4px; }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .login-left { display: none; }
    .login-right { flex: 1; }
    .sidebar { transform: translateX(-100%); position: fixed; z-index: 100; height: 100vh; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0 !important; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .control-card { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1024px) {
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .dashboard-charts { grid-template-columns: 1fr; }
    .map-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .log-header-row { flex-direction: column; align-items: stretch; }
    .log-search-input { width: 100% !important; }
    .control-panel-compact { flex-direction: column; }
    .ctrl-btn { min-width: unset; }
}

/* ===== SearchableSelect 可搜索下拉框 ===== */
.searchable-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}
.searchable-select-wrapper .searchable-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 30px 8px 12px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
    min-height: 40px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.searchable-select-wrapper .searchable-select-trigger:hover {
    border-color: #93c5fd;
}
.searchable-select-wrapper.open .searchable-select-trigger {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.searchable-select-wrapper .searchable-select-trigger .trigger-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #374151;
}
.searchable-select-wrapper .searchable-select-trigger .trigger-text.placeholder {
    color: #9ca3af;
}
.searchable-select-wrapper .searchable-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 9999;
    overflow: hidden;
}
.searchable-select-dropdown.ss-fixed {
    position: fixed !important;
    z-index: 10001 !important;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}
.searchable-select-dropdown.ss-dropdown-up {
    transform: translateY(-100%);
    margin-top: 0 !important;
}
.searchable-select-wrapper.open .searchable-select-dropdown {
    display: block;
}
.searchable-select-dropdown .searchable-select-search {
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    box-sizing: border-box;
    background: #fff;
}
.searchable-select-dropdown .searchable-select-search:focus {
    border-bottom-color: #3b82f6;
}
.searchable-select-dropdown .searchable-select-options {
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
    background: #fff;
}
.searchable-select-dropdown .searchable-select-option {
    padding: 9px 14px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.searchable-select-dropdown .searchable-select-option:hover {
    background: #f3f4f6;
}
.searchable-select-dropdown .searchable-select-option.highlighted {
    background: #eff6ff;
    color: #2563eb;
}
.searchable-select-dropdown .searchable-select-option.selected {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 600;
}
.searchable-select-dropdown .searchable-select-empty {
    padding: 20px 14px;
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
    background: #fff;
}
.searchable-select-wrapper select[data-searchable] {
    display: none;
}
.searchable-select-wrapper.ss-disabled .searchable-select-trigger {
    background: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===== RichEditor 富文本编辑器 ===== */
.rich-editor {
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.rich-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}
.rich-editor-toolbar button {
    padding: 4px 10px;
    border: none;
    background: #fff;
    border-radius: 4px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s;
    min-width: 32px;
}
.rich-editor-toolbar button:hover {
    background: #dbeafe;
    color: #2563eb;
}
.rich-editor-content {
    padding: 10px 12px;
    min-height: 80px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
    color: #1e293b;
    outline: none;
}
.rich-editor-content:empty::before,
.rich-editor-content.is-empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
}
.rich-editor-content ul,
.rich-editor-content ol {
    padding-left: 20px;
    margin: 4px 0;
}
.rich-editor-view {
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
}
.rich-editor-view ul,
.rich-editor-view ol {
    padding-left: 20px;
    margin: 4px 0;
}

/* 菜单配置页 Tab */
.menu-tab {
    padding: 8px 20px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
    transition: all 0.15s;
}
.menu-tab:hover {
    color: #3b82f6;
}
.menu-tab.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}
.menu-tab:first-child {
    border-radius: 6px 0 0 6px;
}
.menu-tab:last-child {
    border-radius: 0 6px 6px 0;
    border-left: none;
}

/* ===== 站内信富文本编辑器 ===== */
.rich-editor { border: 1.5px solid #e5e7eb; border-radius: 8px; overflow: hidden; background: #fff; }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 8px; border-bottom: 1px solid #e5e7eb; background: #f8fafc; align-items: center; }
.rich-toolbar .rt-btn { padding: 4px 10px; border: 1px solid transparent; background: #fff; border-radius: 4px; font-size: 13px; color: #374151; cursor: pointer; transition: all 0.15s; min-width: 32px; line-height: 1.4; }
.rich-toolbar .rt-btn:hover { background: #dbeafe; color: #2563eb; border-color: #bfdbfe; }
.rich-toolbar .rt-select { padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 13px; color: #374151; background: #fff; cursor: pointer; outline: none; }
.rich-toolbar .rt-link-input { padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 4px; font-size: 12px; color: #374151; outline: none; }
.rich-toolbar .rt-link-input:focus { border-color: #3b82f6; }
.rich-toolbar .rt-sep { display: inline-block; width: 1px; height: 20px; background: #d1d5db; margin: 0 4px; }
.rich-content { padding: 12px 14px; min-height: 240px; max-height: 400px; overflow-y: auto; font-size: 14px; line-height: 1.7; color: #1e293b; outline: none; }
.rich-content:empty::before { content: '请输入内容...'; color: #9ca3af; }
.rich-content:focus { background: #fcfcfd; }
.rich-content ul, .rich-content ol { padding-left: 24px; margin: 6px 0; }
.rich-content h1 { font-size: 22px; font-weight: 700; margin: 12px 0 8px; }
.rich-content h2 { font-size: 19px; font-weight: 700; margin: 10px 0 6px; }
.rich-content h3 { font-size: 16px; font-weight: 600; margin: 8px 0 4px; }
.rich-content p { margin: 6px 0; }
.rich-content a { color: #2563eb; text-decoration: underline; }

.rich-content-view { font-size: 14px; line-height: 1.7; color: #374151; word-break: break-word; }
.rich-content-view ul, .rich-content-view ol { padding-left: 24px; margin: 6px 0; }
.rich-content-view h1 { font-size: 22px; font-weight: 700; margin: 12px 0 8px; }
.rich-content-view h2 { font-size: 19px; font-weight: 700; margin: 10px 0 6px; }
.rich-content-view h3 { font-size: 16px; font-weight: 600; margin: 8px 0 4px; }
.rich-content-view p { margin: 6px 0; }
.rich-content-view a { color: #2563eb; text-decoration: underline; }
.rich-content-view img { max-width: 100%; border-radius: 6px; }

/* ===== 图片预览 ===== */
.image-preview {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
}
.image-preview--visible {
    display: flex;
}
.image-preview__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.88);
}
.image-preview__stage {
    position: relative;
    z-index: 1;
    max-width: min(92vw, 1200px);
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-preview__img {
    max-width: min(92vw, 1200px);
    max-height: 88vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    background: #fff;
}
.image-preview__close {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}
.image-preview__close:hover {
    background: rgba(255, 255, 255, 0.22);
}
.image-preview__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    transform: translateY(-50%);
    width: 44px;
    height: 64px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}
.image-preview__nav:hover {
    background: rgba(255, 255, 255, 0.22);
}
.image-preview__nav--prev { left: 20px; }
.image-preview__nav--next { right: 20px; }
.image-preview__counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 13px;
}
.js-image-preview {
    cursor: zoom-in;
}
