/* ============================================================
   设备网IP与5G网卡管理系统 - 科技感浅色主题
   设计要点：浅色底 + 蓝青渐变 + 光效点缀 + 几何线条 + 轻量动效
   质感层（本次新增）：
   1) 全局极轻微颗粒纹理（body::after 固定叠加层，不拦截事件）
   2) 大扩散范围、低透明度多层柔和阴影（避免浓重黑色投影）
   3) 轻量毛玻璃：仅用于顶栏/侧栏/按钮/浮层/Toast，严禁大面积玻璃化
   ============================================================ */
:root {
  --bg: #f2f6fd;
  --bg-2: #eaf1ff;
  --surface: #ffffff;
  --primary: #1d4ed8;
  --primary-2: #06b6d4;
  --primary-soft: #e8efff;
  --grad: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  --grad-soft: linear-gradient(135deg, #eef4ff 0%, #e6fbff 100%);
  --text: #0f172a;
  --muted: #64748b;
  --border: #e3e9f4;
  --used: #2563eb;
  --free: #10b981;
  --reserved: #f59e0b;
  --disabled: #94a3b8;
  --danger: #dc2626;
  /* 多层柔和阴影：贴地微影 + 中距扩散 + 远距环境影，透明度逐层降低 */
  --shadow:
    0 1px 2px rgba(15, 39, 92, .03),
    0 8px 24px rgba(15, 39, 92, .05),
    0 22px 48px rgba(15, 39, 92, .045);
  --shadow-lg:
    0 2px 8px rgba(15, 39, 92, .04),
    0 18px 44px rgba(15, 39, 92, .09),
    0 40px 88px rgba(15, 39, 92, .07);
  --shadow-soft: 0 2px 6px rgba(15, 39, 92, .04), 0 10px 28px rgba(15, 39, 92, .06);
  /* 颗粒纹理：SVG 分形噪声，灰度化后以极低透明度平铺 */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 12% -8%, #e3edff 0%, transparent 60%),
    radial-gradient(900px 460px at 92% 4%, #e2fbff 0%, transparent 62%);
  color: var(--text);
  font-size: 14px;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* 全局颗粒纹理叠加层：固定全屏、极低透明度、不拦截指针事件 */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 2000; pointer-events: none;
  background-image: var(--noise); background-repeat: repeat; background-size: 200px 200px;
  opacity: .035;
}
::selection { background: rgba(6, 182, 212, .18); }
/* 细滚动条，弱化存在感 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, .26); border-radius: 10px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, .4); border: 2px solid transparent; background-clip: padding-box; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------------- 登录页 ---------------- */
.login-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eaf1ff 0%, #f7fbff 45%, #e6fbfb 100%);
  overflow: hidden;
}
.login-bg { position: absolute; inset: 0; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.orb-1 { width: 420px; height: 420px; background: #60a5fa; top: -120px; left: -80px; animation: float 14s ease-in-out infinite; }
.orb-2 { width: 360px; height: 360px; background: #22d3ee; bottom: -110px; right: -60px; animation: float 18s ease-in-out infinite reverse; }
.orb-3 { width: 260px; height: 260px; background: #a5b4fc; top: 40%; left: 55%; animation: float 22s ease-in-out infinite; }
.grid-lines {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, .07) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 45%, #000 30%, transparent 78%);
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(28px, -22px) scale(1.06); }
}
/* 登录卡：轻量毛玻璃（局部，非整页），顶部高光描边 */
.login-card {
  position: relative; width: 400px; max-width: 92vw;
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 20px; padding: 30px 30px 22px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .7);
  animation: rise .5s cubic-bezier(.2, .8, .3, 1);
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.login-card::before {
  content: ''; position: absolute; top: 0; left: 30px; right: 30px; height: 3px;
  background: var(--grad); border-radius: 0 0 4px 4px;
}
.login-brand { display: flex; justify-content: center; margin-bottom: 14px; }
.logo-login { height: 44px; width: auto; }
.login-head { text-align: center; margin-bottom: 20px; }
.brand-title { font-weight: 700; font-size: 18px; letter-spacing: .3px; }
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.login-foot {
  margin-top: 16px; text-align: center; font-size: 11px; letter-spacing: 2px;
  color: #94a3b8; text-transform: uppercase;
}
.login-hint { margin-top: 12px; font-size: 11px; color: var(--muted); text-align: center; }
.link-btn {
  display: block; width: 100%; margin-top: 10px; padding: 7px;
  background: none; border: none; border-radius: 9px; cursor: pointer;
  color: var(--primary); font-size: 12px; transition: background .18s, color .18s;
}
.link-btn:hover { background: rgba(232, 239, 255, .8); }
.pwd-box {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  background: rgba(232, 239, 255, .55); backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px dashed var(--primary-2); border-radius: 10px;
}
.pwd-box input {
  flex: 1; border: none; background: none; outline: none;
  font-size: 16px; font-weight: 700; letter-spacing: 2px; color: var(--text);
}

/* ---------------- 输入 / 按钮 ---------------- */
.input {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; font-size: 13px; color: var(--text); outline: none; width: 100%;
  box-shadow: 0 1px 2px rgba(15, 39, 92, .04);
  transition: border-color .18s, box-shadow .18s;
}
.input:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(6, 182, 212, .14); }
select.input { cursor: pointer; }
textarea.input { resize: vertical; }
.btn {
  border: 1px solid var(--border); background: #fff; color: var(--text);
  border-radius: 10px; padding: 8px 14px; font-size: 13px; cursor: pointer;
  transition: transform .15s, box-shadow .18s, background .18s, color .18s;
  white-space: nowrap;
}
.btn:hover { border-color: #c7d6f5; box-shadow: 0 2px 6px rgba(30, 64, 175, .06), 0 10px 24px rgba(30, 64, 175, .1); }
.btn:active { transform: translateY(1px); }
/* 主按钮：渐变底 + 顶部内高光 + 大扩散彩色环境光（非浓重黑影） */
.btn-primary {
  background: var(--grad); color: #fff; border-color: transparent; font-weight: 600;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .28),
    0 2px 6px rgba(37, 99, 235, .18),
    0 12px 32px rgba(37, 99, 235, .22);
}
.btn-primary:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .3),
    0 4px 10px rgba(37, 99, 235, .2),
    0 18px 44px rgba(37, 99, 235, .28);
}
/* 次按钮：轻量毛玻璃 + 内高光 */
.btn-ghost {
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-color: rgba(255, 255, 255, .75);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 2px 8px rgba(15, 39, 92, .05);
}
.btn-block { width: 100%; padding: 11px; margin-top: 4px; }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.form-err { color: var(--danger); font-size: 12px; min-height: 16px; margin-top: 6px; }
.icon-btn {
  background: none; border: none; font-size: 17px; cursor: pointer; color: var(--text);
  padding: 6px 9px; border-radius: 8px; transition: background .18s;
}
.icon-btn:hover { background: rgba(37, 99, 235, .09); }

/* ---------------- 顶栏（毛玻璃导航） ---------------- */
.topbar {
  height: 58px; flex: 0 0 58px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  background: rgba(255, 255, 255, .68);
  backdrop-filter: blur(20px) saturate(165%);
  -webkit-backdrop-filter: blur(20px) saturate(165%);
  border-bottom: 1px solid rgba(226, 233, 244, .8);
  position: relative; z-index: 30;
  box-shadow: 0 6px 24px rgba(15, 39, 92, .05);
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary-2), var(--primary), transparent);
  opacity: .5;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-name { font-size: 13px; color: var(--muted); }
.role-badge {
  font-size: 11px; padding: 3px 10px; border-radius: 20px;
  background: var(--grad); color: #fff; font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .22), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.role-badge.viewer { background: #94a3b8; box-shadow: 0 2px 8px rgba(100, 116, 139, .2), inset 0 1px 0 rgba(255, 255, 255, .25); }
.logo-header { height: 28px; width: auto; }

/* ---------------- 布局 / 侧边栏（毛玻璃） ---------------- */
/* 整屏固定高度：顶栏 + 下方弹性区，滚动只发生在右侧 .content 内，左菜单始终不动 */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.layout { display: flex; flex: 1 1 auto; min-height: 0; }
.sidebar {
  width: 208px; flex: 0 0 208px;
  background: rgba(255, 255, 255, .58);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-right: 1px solid rgba(226, 233, 244, .85); padding: 16px 12px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow-y: auto; /* 菜单项过多时独立滚动，不影响右侧 */
}
.nav-group { display: flex; flex-direction: column; gap: 5px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  text-align: left; border: 1px solid transparent; background: none;
  padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 13px; color: var(--text);
  transition: background .18s, color .18s, box-shadow .18s;
}
.nav-item i { font-style: normal; opacity: .7; }
.nav-item:hover { background: rgba(232, 239, 255, .75); }
.nav-item.active {
  background: var(--grad); color: #fff; font-weight: 600;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .26), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.nav-item.active i { opacity: 1; }
.nav-foot { font-size: 11px; color: #a3aec4; padding: 8px 12px; }

/* 右侧内容区为唯一滚动容器：表格表头 position:sticky 相对它吸附 */
.content { flex: 1; padding: 18px 20px 40px; min-width: 0; overflow: auto; }
.view { animation: fadeUp .34s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.view-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.view-title {
  margin: 0; font-size: 19px; font-weight: 700; position: relative; padding-left: 12px;
}
.view-title::before {
  content: ''; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px;
  border-radius: 3px; background: var(--grad);
  box-shadow: 0 0 8px rgba(6, 182, 212, .35);
}
.view-sub { font-size: 12px; color: var(--muted); }
.section-label {
  font-size: 12px; color: var(--muted); margin: 6px 0 10px; letter-spacing: 1px;
  display: flex; align-items: center; gap: 8px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border), transparent); }

/* ---------------- 卡片 / KPI ---------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px;
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.kpi::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--grad); }
.kpi .num {
  font-size: 26px; font-weight: 800; letter-spacing: -.5px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.kpi .lab { color: var(--muted); font-size: 12px; margin-top: 4px; }
.kpi.used::before { background: linear-gradient(90deg, var(--used), #60a5fa); }
.kpi.free::before { background: linear-gradient(90deg, var(--free), #6ee7b7); }
.kpi.reserved::before { background: linear-gradient(90deg, var(--reserved), #fcd34d); }
.kpi.off::before { background: linear-gradient(90deg, var(--disabled), #cbd5e1); }
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-card { display: flex; flex-direction: column; align-items: center; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 8px; font-size: 12px; color: var(--muted); }
.legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; box-shadow: 0 1px 3px rgba(15, 39, 92, .18); }
.bar-row { display: flex; align-items: center; gap: 10px; width: 100%; margin-bottom: 10px; }
.bar-label { width: 74px; font-size: 12px; color: var(--muted); text-align: right; }
.bar-track { flex: 1; background: var(--bg-2); border-radius: 8px; height: 16px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(15, 39, 92, .06); }
.bar-fill {
  height: 100%; background: var(--grad); border-radius: 8px;
  transition: width .6s cubic-bezier(.2, .8, .3, 1);
  box-shadow: 0 1px 4px rgba(37, 99, 235, .25);
}
.bar-val { width: 84px; font-size: 12px; color: var(--muted); }

/* ---------------- 表格 ---------------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 130px; flex: 0 1 auto; }
.toolbar #search, .toolbar #c-search, .toolbar #u-search, .toolbar #a-search { flex: 1 1 220px; min-width: 180px; }
/* 注意：.table-wrap 不能设 overflow（否则会成为新的滚动容器，表头就不会吸附到右侧内容区顶部）。
   横向溢出改由 .content 统一滚动，并用 min-width 保证表格不溢出卡片边框。 */
.table-wrap {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.table-wrap.tw-ip    { min-width: 880px; }
.table-wrap.tw-card  { min-width: 1240px; }
.table-wrap.tw-user  { min-width: 760px; }
.table-wrap.tw-audit { min-width: 720px; }
.table-wrap.tw-plan  { min-width: 660px; }
.data-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
/* .table-wrap 不再裁剪溢出，需由表格自身补圆角，保持卡片外观不变 */
.table-wrap .data-table thead th:first-child { border-top-left-radius: 13px; }
.table-wrap .data-table thead th:last-child { border-top-right-radius: 13px; }
.table-wrap .data-table tbody tr:last-child td:first-child { border-bottom-left-radius: 13px; }
.table-wrap .data-table tbody tr:last-child td:last-child { border-bottom-right-radius: 13px; }
/* 表头吸附：毛玻璃 + 底部柔和分隔影，保证滚动时列含义始终清晰 */
.data-table th {
  background: rgba(248, 250, 253, .88);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  color: var(--muted); font-weight: 600; text-align: left;
  padding: 10px 12px; white-space: nowrap; position: sticky; top: 0; z-index: 2;
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 -1px 0 var(--border), 0 2px 8px rgba(15, 39, 92, .05); /* 吸附时保留分隔线 */
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: #f6f9ff; }
.data-table tbody tr:last-child td { border-bottom: none; }
.col-act { text-align: right; white-space: nowrap; }
.row-act { display: flex; gap: 6px; justify-content: flex-end; }
.status-tag {
  display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 39, 92, .06);
}
.status-已用 { background: #dbeafe; color: #1d4ed8; }
.status-空闲 { background: #d1fae5; color: #047857; }
.status-预留 { background: #fef3c7; color: #b45309; }
.status-停用 { background: #e5e7eb; color: #64748b; }
.pager { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.import-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.import-box .input { width: auto; min-width: 160px; }
.import-result { font-size: 13px; margin-top: 6px; }
.import-result .ok { color: #047857; }
.import-result .fail { color: var(--danger); }
.fail-table { margin-top: 10px; max-height: 260px; overflow: auto; }

/* ---------------- 弹窗（浮层） ---------------- */
.modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .32); backdrop-filter: blur(6px) saturate(120%);
  -webkit-backdrop-filter: blur(6px) saturate(120%);
  display: flex; align-items: center; justify-content: center; z-index: 60;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  width: 560px; max-width: 94vw; max-height: 88vh; display: flex; flex-direction: column;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 16px;
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .8);
  animation: pop .22s cubic-bezier(.2, .8, .3, 1);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid rgba(227, 233, 244, .8);
  font-weight: 700;
  background: linear-gradient(135deg, rgba(238, 244, 255, .92), rgba(230, 251, 255, .92));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 16px 16px 0 0;
}
.modal-body { padding: 18px; overflow: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 18px; border-top: 1px solid var(--border);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.form-grid .span2 { grid-column: 1 / -1; }
.form-grid .input { font-size: 13px; }

/* 权限矩阵 */
.perm-matrix { margin-top: 4px; }
.perm-hint { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-table th, .perm-table td { border: 1px solid var(--border); padding: 7px 10px; text-align: center; }
.perm-table th { background: rgba(248, 250, 252, .9); color: var(--muted); font-weight: 600; }
.perm-table td:first-child { text-align: left; font-weight: 600; color: var(--text); }
.perm-table input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.perm-actions { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }

/* ---------------- Toast（深色玻璃） ---------------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: rgba(15, 23, 42, .78); color: #fff; padding: 10px 20px; border-radius: 10px; z-index: 90;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 8px 32px rgba(15, 23, 42, .28);
  animation: slideUp .24s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .topbar-title { display: none; }
  .sidebar {
    position: fixed; top: 58px; left: 0; bottom: 0; width: 200px; z-index: 40;
    transform: translateX(-100%); transition: transform .22s;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    box-shadow: 0 2px 6px rgba(15, 39, 92, .04), 0 16px 40px rgba(15, 39, 92, .1);
  }
  .sidebar.open { transform: translateX(0); }
  .chart-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-card { width: 94vw; }
}
@media (max-width: 560px) {
  .content { padding: 14px 12px 30px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .toolbar .input { width: 100%; flex: 1 1 100% !important; }
  .logo-header { height: 24px; }
  .data-table th, .data-table td { padding: 8px 9px; font-size: 12px; }
  /* 窄屏顶栏：收起用户名、压缩按钮，避免右侧换行挤压 */
  .topbar { padding: 0 10px; }
  .user-name { display: none; }
  .topbar-right { gap: 6px; }
  .topbar-right .btn { padding: 6px 9px; font-size: 12px; }
}
