:root {
  --primary: #448bff;
  --primary-dark: #2f6fd3;
  --success: #67c23a;
  --warning: #e6a23c;
  --danger: #f56c6c;
  --ink: #1a1a2e;
  --muted: #7b8190;
  --line: #e6e9ef;
  --surface: #fff;
  --sidebar: #1e1e2e;
}

html, body { max-width: 100%; overflow-x: hidden; }
button, input, select, textarea { font: inherit; }
button, .btn, input, select { min-height: 42px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
input, select, textarea {
  width: 100%; border: 1px solid #d9dde6; border-radius: 8px; padding: 9px 11px;
  color: #303442; background: #fff; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(68,139,255,.12); }
textarea { resize: vertical; }
label { display: grid; gap: 6px; color: #555c6c; font-size: 13px; }
fieldset { border: 0; margin-top: 16px; }
legend { margin-bottom: 8px; font-size: 13px; color: #555c6c; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-success { color: var(--success) !important; }
.text-danger, .danger-text { color: var(--danger) !important; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: 8px; border: 1px solid transparent; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn-outline { background: #fff; color: var(--primary); border-color: #bfd5ff; }
.btn-outline:hover { background: #f2f7ff; }
.text-button { color: var(--primary); border: 0; background: transparent; min-height: 32px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-heading .page-title { margin: 0; font-size: 24px; line-height: 1.3; }
.page-subtitle { margin-top: 5px; color: var(--muted); font-size: 14px; }
.panel { min-width: 0; background: var(--surface); border-radius: 12px; padding: 20px; box-shadow: 0 2px 9px rgba(22,31,52,.06); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.panel-heading h2 { color: var(--ink); font-size: 16px; }
.panel-heading p, .panel-heading span { color: var(--muted); font-size: 13px; }

/* 仪表盘 */
.monitor-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)) !important; }
.monitor-grid, .monitor-card, .card-header, .card-heading, .chart-container { min-width: 0; max-width: 100%; }
.monitor-card { overflow: hidden; }
.card-heading { overflow: hidden; }
.display-name, .card-ip { overflow-wrap: anywhere; }
.chart-container { width: 100%; overflow: hidden; }
.chart-container canvas { display: block; width: 100% !important; max-width: 100% !important; }
.card-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-top: 1px solid #eef0f4; margin-top: 14px; padding-top: 12px; color: var(--muted); font-size: 12px; }
.metric-period { margin: 3px 0 5px; font-size: 10px; color: var(--muted); }
.availability { margin-top: 4px; font-size: 10px; line-height: 1.35; color: var(--muted); }
.ann-modal-close { border: 0; background: transparent; min-width: 44px; min-height: 44px; }
.ann-modal[tabindex]:focus { outline: none; }
.ann-modal-title { font-size: 20px; }

/* 详情和状态页 */
.breadcrumbs { display: flex; gap: 8px; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.segmented { display: inline-flex; max-width: 100%; overflow-x: auto; padding: 4px; margin-bottom: 12px; border-radius: 10px; background: #e8ebf1; }
.segmented button { min-width: max-content; min-height: 36px; padding: 6px 14px; border: 0; border-radius: 7px; background: transparent; color: #606779; }
.segmented button.active { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.metric-selector { margin-left: 10px; }
.metric-help { margin: -4px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.detail-summary { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin: 8px 0 18px; }
.summary-card { min-width: 0; padding: 18px; background: #fff; border-radius: 12px; border-top: 3px solid var(--primary); box-shadow: 0 2px 9px rgba(22,31,52,.06); }
.summary-card.carrier-mobile { border-color: var(--success); }.summary-card.carrier-unicom { border-color: var(--primary); }.summary-card.carrier-telecom { border-color: var(--warning); }
.summary-card h2 { font-size: 14px; }.summary-value { margin-top: 12px; font-size: 28px; font-weight: 700; color: var(--ink); }.summary-card > p { color: var(--muted); font-size: 12px; }
.summary-card dl { margin-top: 14px; display: grid; gap: 7px; }.summary-card dl div { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }.summary-card dt { color: var(--muted); }.summary-card dd { font-weight: 600; }
.chart-panel { margin-bottom: 18px; }.chart-wrap { min-width: 0; position: relative; }.chart-wrap-large { height: 420px; }.chart-wrap canvas { width: 100% !important; max-width: 100% !important; }
.anomaly-list { display: grid; gap: 8px; }.anomaly-row { display: grid; grid-template-columns: auto minmax(120px,.8fr) minmax(180px,1fr) minmax(180px,1fr); align-items: center; gap: 10px; padding: 11px; border-radius: 8px; background: #f8f9fb; font-size: 13px; }.anomaly-row small { color: var(--muted); }
.status-main { max-width: 1100px; }.overall-status { margin-bottom: 18px; }.overall-status-content { display: flex; align-items: center; gap: 18px; }.overall-status-content h2 { color: var(--ink); }.overall-status-content p { color: var(--muted); }
.status-orb { width: 42px; height: 42px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 10px rgba(103,194,58,.13); }.status-orb.degraded { background: var(--warning); box-shadow: 0 0 0 10px rgba(230,162,60,.13); }.status-orb.offline { background: var(--danger); box-shadow: 0 0 0 10px rgba(245,108,108,.13); }.status-orb.unknown { background: #a8aeba; box-shadow: 0 0 0 10px rgba(168,174,186,.15); }
.status-list { display: grid; gap: 18px; }.status-node-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }.status-node-header h2 { color: var(--ink); font-size: 18px; }.status-node-header p { color: var(--muted); font-size: 12px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 5px 9px; border-radius: 99px; background: #eef1f5; color: #687083; font-size: 12px; }.status-pill.operational { background: #edf8e9; color: #4b9b2e; }.status-pill.degraded { background: #fff6e6; color: #aa741b; }.status-pill.offline { background: #fff0f0; color: #c84e4e; }
.status-dot { display: inline-block; flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; background: #a8aeba; }.status-dot.operational { background: var(--success); }.status-dot.degraded { background: var(--warning); }.status-dot.offline { background: var(--danger); }.status-dot.unknown { background: #a8aeba; }
.status-help { margin-bottom: 18px; }.status-help .panel-heading { margin-bottom: 12px; }.status-help-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }.status-help-grid > div { padding: 12px; border-radius: 8px; background: #f7f9fc; }.status-help-grid dt { color: var(--ink); font-weight: 700; }.status-help-grid dd { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.status-current, .status-window { align-content: start; }.status-current > span { display: flex; align-items: center; gap: 5px; }.status-window strong { color: var(--ink); font-size: 14px; }.status-window small, .status-current small { line-height: 1.45; }
.status-table { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }.status-table-row { display: grid; grid-template-columns: 1fr repeat(4,minmax(90px,.8fr)); align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); font-size: 13px; }.status-table-row:first-child { border-top: 0; }.status-table-row.header { background: #f6f7f9; color: var(--muted); font-size: 11px; text-transform: uppercase; }.status-table-row > span { display: grid; gap: 2px; }.status-table-row small { color: var(--muted); font-size: 10px; }.status-node-link { margin-top: 12px; text-align: right; font-size: 13px; }
.maintenance-item { padding: 14px 0; border-top: 1px solid var(--line); }.maintenance-item:first-child { border-top: 0; }.maintenance-item h3 { display: inline; margin-left: 8px; }.maintenance-time { color: var(--muted); font-size: 12px; margin: 8px 0; }.announcement-rendered { font-size: 14px; }.tag { display: inline-flex; padding: 2px 7px; border-radius: 99px; background: #eaf2ff; color: var(--primary); font-size: 10px; }.tag.maintenance { background: #fff2df; color: #b57618; }
.policy { max-width: 760px; margin: 30px auto; }.policy h1 { margin-bottom: 16px; }.policy p { margin-top: 10px; }

/* 后台布局 */
.admin-body { background: #f3f5f8; min-height: 100vh; }
.admin-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 300; width: 240px; display: flex; flex-direction: column; background: var(--sidebar); color: #fff; transition: transform .25s; }
.admin-brand { padding: 24px 22px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }.admin-brand a { display: block; color: #fff; font-weight: 800; letter-spacing: .06em; }.admin-brand span { color: #7fb0ff; }.admin-brand small { display: block; color: #8c93a7; margin-top: 5px; }
.admin-nav { padding: 14px 10px; display: grid; gap: 4px; overflow-y: auto; }.admin-nav a { color: #aeb4c5; padding: 10px 12px; border-radius: 8px; text-decoration: none; }.admin-nav a:hover, .admin-nav a.active { color: #fff; background: rgba(68,139,255,.22); }
.admin-sidebar-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 15px 18px; border-top: 1px solid rgba(255,255,255,.08); color: #aeb4c5; font-size: 12px; }.admin-sidebar-footer button { border: 0; background: transparent; color: #ff9c9c; min-height: 32px; }
.admin-main { min-width: 0; margin-left: 240px; padding: 24px 28px 50px; }.admin-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }.admin-topbar h1 { color: var(--ink); font-size: 24px; }.admin-topbar p { color: var(--muted); font-size: 13px; }
.admin-view { display: grid; gap: 18px; }.admin-view[hidden] { display: none; }
.admin-menu-button { display: none; position: fixed; left: 12px; top: 10px; z-index: 350; width: 44px; border: 0; border-radius: 8px; background: var(--sidebar); color: #fff; }.admin-drawer-overlay { display: none; position: fixed; inset: 0; z-index: 280; background: rgba(10,12,20,.5); }
.toolbar { display: flex; align-items: center; gap: 10px; }.toolbar.wrap { flex-wrap: wrap; }.toolbar input { max-width: 280px; }.toolbar select { width: auto; min-width: 130px; }.toolbar > span { color: var(--muted); font-size: 13px; }
.bulk-toolbar { padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }.bulk-toolbar button { border: 0; background: transparent; color: var(--primary); min-height: 32px; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 15px; }.admin-stat { padding: 18px; border-radius: 12px; background: #fff; border-left: 4px solid var(--primary); box-shadow: 0 2px 9px rgba(22,31,52,.05); }.admin-stat.green { border-color: var(--success); }.admin-stat.orange { border-color: var(--warning); }.admin-stat.purple { border-color: #8b6fdd; }.admin-stat span { color: var(--muted); font-size: 12px; }.admin-stat strong { display: block; margin-top: 6px; color: var(--ink); font-size: 27px; }
.admin-two-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.simple-list-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-top: 1px solid var(--line); }.simple-list-row:first-child { border-top: 0; }.simple-list-row strong, .simple-list-row small { display: block; }.simple-list-row small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.table-panel { padding: 0; overflow: hidden; }.responsive-table { max-width: 100%; overflow-x: auto; }.admin-table { width: 100%; border-collapse: collapse; font-size: 12px; }.admin-table th { padding: 12px; background: #f7f8fa; color: #737a89; text-align: left; white-space: nowrap; }.admin-table td { max-width: 260px; padding: 12px; border-top: 1px solid var(--line); vertical-align: middle; overflow-wrap: anywhere; }.admin-table td strong, .admin-table td small { display: block; }.admin-table td small { margin-top: 3px; color: var(--muted); }.admin-table tr.dragging { opacity: .45; }.drag-handle { cursor: grab; color: #a5abb7; font-size: 18px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 7px; }.row-actions button { min-height: 30px; padding: 2px; border: 0; background: transparent; color: var(--primary); font-size: 12px; }.tag-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }.tag-list span, .check-chip span { border: 1px solid var(--tag-color,#b9d2ff); border-radius: 99px; padding: 1px 6px; color: #596274; font-size: 10px; }
.sync-badge { display: inline-flex; padding: 2px 7px; border-radius: 99px; background: #eef1f5; color: #687083; font-size: 10px; }.sync-badge.synced, .sync-badge.success, .sync-badge.published { background: #edf8e9; color: #4b9b2e; }.sync-badge.conflict, .sync-badge.partial, .sync-badge.scheduled { background: #fff6e6; color: #a86f16; }.sync-badge.error, .sync-badge.failed, .sync-badge.invalid { background: #fff0f0; color: #c84e4e; }.sync-badge.remote_missing, .sync-badge.archived, .sync-badge.draft { background: #eef1f5; color: #687083; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }.pagination button { min-height: 32px; padding: 3px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.chip-manager { display: flex; flex-wrap: wrap; gap: 8px; }.manager-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; }.manager-chip i { width: 9px; height: 9px; border-radius: 50%; }.manager-chip button { min-height: 28px; border: 0; background: transparent; color: var(--primary); font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; margin-top: 16px; }.form-hint { color: var(--muted); font-size: 12px; }.inline-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }.inline-summary span { padding: 5px 9px; border-radius: 7px; background: #f1f4f8; color: var(--muted); font-size: 11px; }
.check-chip-list { display: flex; flex-wrap: wrap; gap: 7px; }.check-chip { display: inline-flex; align-items: center; width: auto; }.check-chip input { width: 16px; min-height: 16px; margin-right: 4px; }.confirm-check { display: flex; grid-template-columns: auto 1fr; align-items: center; margin-top: 14px; }.confirm-check input { width: 18px; min-height: 18px; }
.warning-box { padding: 10px 12px; margin-bottom: 14px; border-radius: 8px; background: #fff7e8; color: #8a651f; font-size: 12px; }.warning-box.danger { background: #fff0f0; color: #a83e3e; }
.announcement-layout { grid-template-columns: 1.3fr .7fr; }.announcement-admin-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 14px 0; border-top: 1px solid var(--line); }.announcement-admin-item:first-child { border-top: 0; }.announcement-admin-item h3 { margin-top: 7px; font-size: 14px; }.announcement-admin-item p, .announcement-admin-item small { color: var(--muted); font-size: 11px; }.template-item { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }.template-item:first-child { border-top: 0; }.template-item small { display: block; color: var(--muted); font-size: 10px; }.announcement-preview { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.health-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }.health-card { min-width: 0; padding: 17px; border-radius: 12px; background: #fff; box-shadow: 0 2px 9px rgba(22,31,52,.05); }.health-card-title { display: flex; justify-content: space-between; align-items: center; }.health-card h2 { color: var(--ink); font-size: 14px; }.health-card dl { margin-top: 13px; display: grid; gap: 7px; }.health-card dl div { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; }.health-card dt { color: var(--muted); }.health-card dd { max-width: 65%; overflow-wrap: anywhere; text-align: right; }

/* 后台弹窗 */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 500; padding: 20px; align-items: center; justify-content: center; background: rgba(10,12,20,.58); }.modal-overlay.show { display: flex; }.modal-card { width: min(720px,100%); max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 13px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.25); }.modal-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fff; }.modal-header h2 { font-size: 17px; }.modal-header button { width: 44px; border: 0; background: transparent; font-size: 22px; }.modal-card form { padding: 18px 20px 20px; }.modal-card form > label + label { margin-top: 12px; }.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
#toastRegion { position: fixed; top: 18px; right: 18px; z-index: 800; display: grid; gap: 8px; }.toast { position: static; transform: none; min-width: 240px; border-radius: 8px; padding: 11px 14px; background: #303442; color: #fff; box-shadow: 0 7px 25px rgba(0,0,0,.2); }.toast.success { background: #4d9d31; }.toast.error { background: #c84e4e; }
.fade-word { opacity: 0; transform: translateY(-7px); }.welcome-text span { display: inline-block; transition: opacity .2s, transform .2s; }
.empty-state.compact { padding: 25px 10px; }

@media (max-width: 1024px) {
  .health-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .admin-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 768px) {
  .header-inner { height: auto; min-height: 60px; padding: 10px 16px; align-items: flex-start; gap: 10px; }
  .nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; }.nav a { margin-left: 0; min-height: 36px; display: inline-flex; align-items: center; }
  .main { width: 100%; padding: 18px 14px; }.page-heading { align-items: flex-start; }.page-heading .btn { flex: 0 0 auto; }
  .stats-bar { padding: 13px; gap: 8px 12px; }.stat-divider { display: none; }
  .metrics { grid-template-columns: repeat(3,minmax(0,1fr)); }.metric { min-width: 0; padding: 10px 4px; }.metric .operator { font-size: 11px; }.metric .latency { font-size: 19px; }
  .status-help-grid { grid-template-columns: 1fr; }
  .detail-summary { grid-template-columns: 1fr; }.chart-wrap-large { height: 330px; }.anomaly-row { grid-template-columns: auto 1fr; }.anomaly-row span:not(.status-dot), .anomaly-row small { grid-column: 2; }
  .status-table { overflow-x: auto; }.status-table-row { min-width: 620px; }.status-node-header { align-items: flex-start; }
  .admin-menu-button { display: block; }.admin-sidebar { transform: translateX(-100%); }.admin-sidebar.open { transform: translateX(0); }.admin-drawer-overlay.show { display: block; }.admin-main { margin-left: 0; padding: 72px 14px 40px; }.admin-topbar { align-items: flex-start; }.admin-topbar h1 { font-size: 21px; }
  .admin-two-columns, .announcement-layout, .health-grid { grid-template-columns: 1fr; }
  .toolbar { flex-wrap: wrap; }.toolbar input, .toolbar select { max-width: none; width: 100%; }.bulk-toolbar button { flex: 1; }
  .responsive-table { overflow: visible; }.admin-table thead { display: none; }.admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; max-width: none; }.admin-table tr { margin: 10px; width: calc(100% - 20px); border: 1px solid var(--line); border-radius: 9px; background: #fff; overflow: hidden; }.admin-table td { display: grid; grid-template-columns: 95px minmax(0,1fr); gap: 10px; padding: 9px 12px; border-top: 1px solid #f0f1f4; }.admin-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; }.admin-table td:first-child { border-top: 0; }.admin-table td .row-actions { justify-content: flex-start; }
  .modal-overlay { padding: 8px; align-items: flex-end; }.modal-card { max-height: calc(100vh - 16px); border-radius: 13px 13px 0 0; }.form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .header-inner { display: grid; grid-template-columns: 1fr; }.nav { justify-content: flex-start; }.nav a { font-size: 12px; }
  .page-heading { display: grid; }.page-heading .btn { width: 100%; }.page-heading .page-title { font-size: 21px; }
  .monitor-card { padding: 15px; }.card-header { align-items: flex-start; }.metrics { gap: 4px; }.chart-container { height: 220px; }.card-actions { align-items: flex-start; flex-direction: column; }
  .segmented { display: flex; width: 100%; }.segmented button { flex: 1; }.metric-selector { margin-left: 0; }
  .status-node { padding: 15px; }.status-node-header { display: grid; }.overall-status-content { align-items: flex-start; }.status-orb { flex: 0 0 34px; width: 34px; height: 34px; }
  .admin-stat-grid { grid-template-columns: 1fr; }.admin-topbar { display: grid; }.admin-topbar > a { display: none; }
  .pagination { flex-wrap: wrap; }.announcement-admin-item { display: grid; }
}
