/* ============================================================
   OfficeMind · Layout & Components
   ============================================================ */

/* ---------------- 应用骨架 ---------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--glass);
  backdrop-filter: blur(var(--glass-blur));
  border-right: 1px solid var(--border);
  transition: width var(--dur) var(--ease), flex-basis var(--dur) var(--ease);
  z-index: 60;
}
.app.collapsed .sidebar { width: var(--sidebar-w-collapsed); flex-basis: var(--sidebar-w-collapsed); }

.sb-head {
  height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 var(--sp-4); border-bottom: 1px solid var(--border); flex: 0 0 auto;
}
.logo {
  width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px;
  background: linear-gradient(140deg, var(--accent), var(--purple));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 4px 14px var(--accent-soft);
}
.logo svg { width: 19px; height: 19px; }
.logo-txt { overflow: hidden; white-space: nowrap; }
.logo-txt b { display: block; font-size: var(--fs-14); letter-spacing: .2px; line-height: 1.2; }
.logo-txt span { display: block; font-size: 10px; color: var(--text-mute); letter-spacing: .5px; }
.app.collapsed .logo-txt { display: none; }

.sb-body { flex: 1 1 auto; overflow-y: auto; padding: var(--sp-3) var(--sp-2); }
.sb-group { margin-bottom: var(--sp-4); }
.sb-group-title {
  font-size: 10px; letter-spacing: 1.1px; text-transform: uppercase;
  color: var(--text-mute); padding: 6px 12px 8px; font-weight: 650; white-space: nowrap;
}
.app.collapsed .sb-group-title { text-align: center; padding: 6px 0; font-size: 0; }
.app.collapsed .sb-group-title::first-letter { font-size: 11px; }

.nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--text-dim); font-size: var(--fs-13); font-weight: 500;
  position: relative; transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  text-align: left; margin-bottom: 2px;
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: .9; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item .nav-label { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nav-badge {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 99px;
  background: var(--surface-3); color: var(--text-dim);
}
.nav-item.active .nav-badge { background: var(--accent); color: var(--accent-text); }
.app.collapsed .nav-item { justify-content: center; padding: 10px 0; }
.app.collapsed .nav-label, .app.collapsed .nav-badge { display: none; }

.sb-foot { flex: 0 0 auto; padding: var(--sp-3); border-top: 1px solid var(--border); }
.tenant-chip {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px; border-radius: var(--r-md); background: var(--surface-2);
  border: 1px solid var(--border); transition: border-color var(--dur) var(--ease);
}
.tenant-chip:hover { border-color: var(--border-strong); }
.tc-avatar {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; color: #fff; background: linear-gradient(140deg, var(--accent-2), var(--info));
}
.tc-meta { flex: 1 1 auto; text-align: left; overflow: hidden; }
.tc-meta b { display: block; font-size: var(--fs-12); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-meta span { display: block; font-size: 10px; color: var(--text-mute); }
.app.collapsed .tc-meta, .app.collapsed .tc-arrow { display: none; }
.app.collapsed .tenant-chip { justify-content: center; }

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

.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 0 var(--sp-6); position: sticky; top: 0; z-index: 50;
  background: var(--glass); backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--border);
}
.tb-title { font-size: var(--fs-16); font-weight: 700; letter-spacing: .2px; }
.tb-sub { font-size: var(--fs-12); color: var(--text-mute); margin-top: -2px; }
.tb-spacer { flex: 1 1 auto; }

.search {
  display: flex; align-items: center; gap: 8px; width: 260px;
  padding: 0 12px; height: 36px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  transition: border-color var(--dur) var(--ease), width var(--dur) var(--ease);
}
.search:focus-within { border-color: var(--accent); width: 300px; }
.search svg { width: 15px; height: 15px; color: var(--text-mute); flex: 0 0 15px; }
.search input { flex: 1 1 auto; border: 0; background: none; outline: none; font-size: var(--fs-13); min-width: 0; }
.search input::placeholder { color: var(--text-mute); }
.search .kbd { flex: 0 0 auto; }

.kbd {
  font-family: var(--font-mono); font-size: 10px; padding: 2px 5px; border-radius: 5px;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text-mute);
}

.credits-pill {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  border-radius: var(--r-full); background: var(--accent-soft); color: var(--accent);
  font-size: var(--fs-12); font-weight: 700; border: 1px solid transparent;
}
.credits-pill.low { background: rgba(255, 107, 129, .12); color: var(--danger); }
.credits-pill svg { width: 14px; height: 14px; }

.icon-btn {
  width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center;
  color: var(--text-dim); border: 1px solid transparent; transition: all var(--dur) var(--ease);
  position: relative;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 99px;
  background: var(--danger); box-shadow: 0 0 0 2px var(--bg);
}

.view { flex: 1 1 auto; padding: var(--sp-6); min-width: 0; }
.view-inner { max-width: 1440px; margin: 0 auto; }

/* ---------------- 通用块 ---------------- */
.page-head { display: flex; align-items: flex-start; gap: var(--sp-4); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.page-head h1 { font-size: var(--fs-24); font-weight: 750; letter-spacing: -.2px; }
.page-head p { font-size: var(--fs-13); color: var(--text-mute); margin-top: 3px; max-width: 720px; }
.page-head .ph-actions { margin-left: auto; display: flex; gap: var(--sp-2); flex-wrap: wrap; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card.hoverable:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.card-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 14px var(--sp-4); border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: var(--fs-14); font-weight: 700; }
.card-head .sub { font-size: var(--fs-12); color: var(--text-mute); }
.card-head .ch-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.card-body { padding: var(--sp-4); }
.card-body.tight { padding: var(--sp-2); }
.card-foot { padding: 12px var(--sp-4); border-top: 1px solid var(--border); display: flex; gap: var(--sp-2); align-items: center; }

.grid { display: grid; gap: var(--sp-4); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.row { display: flex; gap: var(--sp-3); align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1 1 auto; }
.mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); } .mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.muted { color: var(--text-mute); }
.dim { color: var(--text-dim); }
.mono { font-family: var(--font-mono); }
.t-xs { font-size: var(--fs-11); } .t-sm { font-size: var(--fs-12); }
.t-md { font-size: var(--fs-13); } .t-lg { font-size: var(--fs-15); }
.b { font-weight: 700; } .fw6 { font-weight: 600; }
.right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  font-size: var(--fs-13); font-weight: 600; white-space: nowrap;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  transition: all var(--dur) var(--ease);
}
.btn svg { width: 15px; height: 15px; flex: 0 0 15px; }
.btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: var(--accent-text); border-color: transparent;
  box-shadow: 0 4px 14px var(--accent-soft);
}
.btn-primary:hover { box-shadow: 0 6px 20px var(--accent-soft); }
.btn-soft { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: rgba(255, 107, 129, .12); color: var(--danger); border-color: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: var(--fs-12); border-radius: var(--r-xs); }
.btn-sm svg { width: 13px; height: 13px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: var(--fs-14); border-radius: var(--r-md); }
.btn-icon { width: 34px; padding: 0; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; pointer-events: none; }

/* ---------------- 表单 ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: var(--fs-12); font-weight: 600; color: var(--text-dim); }
.field .hint { font-size: var(--fs-11); color: var(--text-mute); }
.input, .select, .textarea {
  width: 100%; min-height: 36px; padding: 7px 11px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  font-size: var(--fs-13); outline: none; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); background: var(--surface); }
.input::placeholder, .textarea::placeholder { color: var(--text-mute); }
.textarea { min-height: 92px; resize: vertical; line-height: 1.6; font-family: var(--font-sans); }
.textarea.mono { font-family: var(--font-mono); font-size: var(--fs-12); }
.select { appearance: none; cursor: pointer; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.input-group { display: flex; align-items: center; gap: 8px; }
.range { width: 100%; accent-color: var(--accent); }

.switch { position: relative; width: 38px; height: 22px; flex: 0 0 38px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch i {
  position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3);
  border: 1px solid var(--border); transition: all var(--dur) var(--ease);
}
.switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 99px;
  background: var(--text-mute); transition: all var(--dur) var(--ease);
}
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); background: #fff; }

.check { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); }
.seg button {
  padding: 5px 12px; border-radius: 6px; font-size: var(--fs-12); font-weight: 600;
  color: var(--text-dim); transition: all var(--dur) var(--ease); white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg button.active.accent { background: var(--accent); color: var(--accent-text); }

/* ---------------- 标签 / 徽章 ---------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 6px; font-size: var(--fs-11); font-weight: 650; letter-spacing: .2px;
  background: var(--surface-3); color: var(--text-dim); white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: rgba(56, 232, 176, .13); color: var(--ok); }
.badge.warn { background: rgba(255, 184, 77, .14); color: var(--warn); }
.badge.danger { background: rgba(255, 107, 129, .14); color: var(--danger); }
.badge.info { background: rgba(86, 199, 255, .14); color: var(--info); }
.badge.purple { background: rgba(179, 123, 255, .14); color: var(--purple); }
.badge.outline { background: transparent; border: 1px solid var(--border-strong); }
.badge-dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }

.status {
  display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-12);
  font-weight: 600; color: var(--text-dim); white-space: nowrap;
}
.status .s-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--text-mute); position: relative; }
.status.working .s-dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(56, 232, 176, .16); animation: pulse 1.8s infinite; }
.status.thinking .s-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: pulse 1.4s infinite; }
.status.meeting .s-dot { background: var(--info); box-shadow: 0 0 0 3px rgba(86, 199, 255, .16); }
.status.idle .s-dot { background: var(--text-mute); }
.status.offline .s-dot { background: var(--danger); }
.status.resting .s-dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(255, 184, 77, .16); }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .55; transform: scale(.82); } }

/* ---------------- 头像 ---------------- */
.avatar {
  position: relative; flex: 0 0 auto; border-radius: var(--r-md); overflow: hidden;
  background: var(--surface-3); display: grid; place-items: center;
}
.avatar svg { width: 100%; height: 100%; }
.avatar .av-ring { position: absolute; inset: 0; border-radius: inherit; border: 2px solid transparent; }
.avatar.sm { width: 32px; height: 32px; border-radius: 9px; }
.avatar.md { width: 42px; height: 42px; border-radius: 12px; }
.avatar.lg { width: 60px; height: 60px; border-radius: 16px; }
.avatar.xl { width: 84px; height: 84px; border-radius: 22px; }
.avatar.round { border-radius: 99px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -9px; border: 2px solid var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-13); }
table.tbl th {
  text-align: left; font-size: var(--fs-11); font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--text-mute); padding: 10px 12px;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.tbl td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tbody tr { transition: background var(--dur) var(--ease); }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl .num { font-family: var(--font-mono); font-size: var(--fs-12); }
.cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-main .cm-t { font-weight: 600; }
.cell-main .cm-s { font-size: var(--fs-11); color: var(--text-mute); }

/* ---------------- Tabs ---------------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button {
  padding: 10px 14px; font-size: var(--fs-13); font-weight: 600; color: var(--text-mute);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------------- 统计卡 ---------------- */
.stat {
  padding: var(--sp-4); border-radius: var(--r-lg); background: var(--surface);
  border: 1px solid var(--border); position: relative; overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.stat::after {
  content: ""; position: absolute; right: -28px; top: -28px; width: 96px; height: 96px;
  border-radius: 99px; background: var(--accent-soft); opacity: .5;
}
.stat .s-top { display: flex; align-items: center; gap: 8px; position: relative; z-index: 1; }
.stat .s-icon {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.stat .s-icon svg { width: 16px; height: 16px; }
.stat .s-label { font-size: var(--fs-12); color: var(--text-mute); font-weight: 600; }
.stat .s-value { font-size: var(--fs-28); font-weight: 780; letter-spacing: -.6px; margin-top: 8px; line-height: 1.1; position: relative; z-index: 1; }
.stat .s-value small { font-size: var(--fs-13); font-weight: 600; color: var(--text-mute); margin-left: 4px; }
.stat .s-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: var(--fs-11); color: var(--text-mute); position: relative; z-index: 1; }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; }
.trend.up { color: var(--danger); } .trend.down { color: var(--ok); }
.trend.good { color: var(--ok); } .trend.bad { color: var(--danger); }
.trend svg { width: 12px; height: 12px; }

/* ---------------- 进度条 ---------------- */
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .5s var(--ease-out); }
.progress.thin { height: 4px; }
.progress.warn > i { background: linear-gradient(90deg, var(--warn), var(--amber)); }
.progress.danger > i { background: linear-gradient(90deg, var(--danger), var(--warn)); }

/* ---------------- 弹出层 ---------------- */
.overlay {
  position: fixed; inset: 0; background: rgba(4, 6, 16, .58);
  backdrop-filter: blur(3px); z-index: var(--z-modal);
  opacity: 0; pointer-events: none; transition: opacity var(--dur) var(--ease);
}
.overlay.show { opacity: 1; pointer-events: auto; }
/* 抽屉的遮罩必须低于抽屉面板本身，否则会盖住抽屉导致无法交互 */
.overlay.overlay-under-drawer { z-index: calc(var(--z-drawer) - 1); }

.modal {
  position: fixed; z-index: var(--z-modal); left: 50%; top: 50%;
  transform: translate(-50%, -46%) scale(.97); opacity: 0; pointer-events: none;
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 64px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-3); display: flex; flex-direction: column;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease-out);
}
.modal.show { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
.modal.wide { width: min(920px, calc(100vw - 32px)); }
.modal-head { padding: 18px var(--sp-5) 12px; display: flex; align-items: flex-start; gap: 12px; }
.modal-head h3 { font-size: var(--fs-18); font-weight: 720; }
.modal-head p { font-size: var(--fs-12); color: var(--text-mute); margin-top: 3px; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 0 var(--sp-5); overflow-y: auto; flex: 1 1 auto; }
.modal-foot { padding: 14px var(--sp-5) 18px; display: flex; gap: var(--sp-2); justify-content: flex-end; }

.drawer {
  position: fixed; z-index: var(--z-drawer); right: 0; top: 0; height: 100vh;
  width: min(560px, 100vw); background: var(--surface); border-left: 1px solid var(--border);
  box-shadow: var(--shadow-3); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s var(--ease-out);
}
.drawer.show { transform: translateX(0); }
.drawer.wide { width: min(880px, 100vw); }
.drawer-head { padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: var(--sp-5); }
.drawer-foot { padding: 14px var(--sp-5); border-top: 1px solid var(--border); display: flex; gap: var(--sp-2); justify-content: flex-end; }

.popover {
  position: fixed; z-index: 1100; min-width: 200px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-3);
  opacity: 0; transform: translateY(-6px) scale(.98); pointer-events: none;
  transition: all var(--dur) var(--ease-out);
}
.popover.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.popover .pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  border-radius: var(--r-xs); font-size: var(--fs-13); color: var(--text-dim); text-align: left;
}
.popover .pop-item:hover { background: var(--surface-2); color: var(--text); }
.popover .pop-item svg { width: 15px; height: 15px; }
.popover .pop-item.active { color: var(--accent); background: var(--accent-soft); }
.popover .pop-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.popover .pop-title { font-size: 10px; letter-spacing: .8px; text-transform: uppercase; color: var(--text-mute); padding: 6px 10px 4px; font-weight: 700; }

.toast-wrap { position: fixed; bottom: 22px; right: 22px; z-index: var(--z-toast); display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 15px; min-width: 240px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md);
  box-shadow: var(--shadow-3); font-size: var(--fs-13); font-weight: 550;
  transform: translateX(120%); opacity: 0; transition: all .32s var(--ease-out);
}
.toast.show { transform: translateX(0); opacity: 1; }
.toast .t-ic { width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; flex: 0 0 22px; }
.toast .t-ic svg { width: 13px; height: 13px; }
.toast.ok .t-ic { background: rgba(56, 232, 176, .16); color: var(--ok); }
.toast.info .t-ic { background: var(--accent-soft); color: var(--accent); }
.toast.warn .t-ic { background: rgba(255, 184, 77, .16); color: var(--warn); }
.toast.err .t-ic { background: rgba(255, 107, 129, .16); color: var(--danger); }

/* ---------------- 空状态 / 时间线 ---------------- */
.empty { padding: 46px 20px; text-align: center; color: var(--text-mute); }
.empty .e-ic {
  width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-mute);
}
.empty .e-ic svg { width: 24px; height: 24px; }
.empty b { display: block; font-size: var(--fs-14); color: var(--text-dim); margin-bottom: 4px; }

.timeline { position: relative; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.tl-item { position: relative; padding-bottom: var(--sp-4); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 99px;
  background: var(--surface); border: 2px solid var(--border-strong);
}
.tl-item.ok::before { border-color: var(--ok); background: var(--ok); }
.tl-item.run::before { border-color: var(--accent); background: var(--accent); animation: pulse 1.4s infinite; }
.tl-item.err::before { border-color: var(--danger); background: var(--danger); }
.tl-head { display: flex; align-items: center; gap: 8px; font-size: var(--fs-13); font-weight: 600; }
.tl-time { font-family: var(--font-mono); font-size: var(--fs-11); color: var(--text-mute); margin-left: auto; }
.tl-body { font-size: var(--fs-12); color: var(--text-dim); margin-top: 3px; }

/* ---------------- 图表 ---------------- */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.legend { display: flex; gap: var(--sp-4); flex-wrap: wrap; font-size: var(--fs-12); color: var(--text-dim); }
.legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }

.mini-bars { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.mini-bars i { flex: 1 1 auto; border-radius: 3px 3px 1px 1px; background: var(--accent-soft); min-height: 3px; transition: all .3s var(--ease); }
.mini-bars i.hi { background: var(--accent); }

/* ---------------- 登录屏 ---------------- */
.login-screen {
  position: fixed; inset: 0; z-index: var(--z-login);
  display: grid; grid-template-columns: 1.05fr 1fr;
  background: var(--bg); background-image: var(--bg-grad);
}
.login-left { position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-left::before {
  content: ""; position: absolute; width: 520px; height: 520px; right: -180px; top: -140px;
  border-radius: 99px; background: var(--accent-soft); filter: blur(30px);
}
.login-right { display: grid; place-items: center; padding: 40px; position: relative; }
.login-card { width: min(400px, 100%); }
.ls-brand { display: flex; align-items: center; gap: 12px; position: relative; }
.ls-brand .logo { width: 40px; height: 40px; border-radius: 12px; flex: 0 0 40px; }
.ls-brand .logo svg { width: 24px; height: 24px; }
.ls-brand b { font-size: var(--fs-18); }
.ls-brand span { display: block; font-size: var(--fs-11); color: var(--text-mute); }
.ls-hero { position: relative; margin-top: 40px; }
.ls-hero h1 { font-size: var(--fs-40); line-height: 1.18; font-weight: 780; letter-spacing: -1px; }
.ls-hero h1 em { font-style: normal; background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ls-hero p { margin-top: 16px; font-size: var(--fs-14); color: var(--text-dim); max-width: 440px; line-height: 1.7; }
.ls-feats { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; position: relative; }
.ls-feat { display: flex; align-items: center; gap: 10px; font-size: var(--fs-13); color: var(--text-dim); }
.ls-feat .f-ic { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: 0 0 22px; }
.ls-feat .f-ic svg { width: 12px; height: 12px; }
.ls-mock { margin-top: 32px; position: relative; }
.ls-foot { position: relative; display: flex; align-items: center; gap: var(--sp-4); font-size: var(--fs-11); color: var(--text-mute); }

.tenant-pick {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--border); width: 100%;
}
.tenant-pick:hover { border-color: var(--accent); }
.tenant-pick svg,#lgTenant > svg { width: 20px; height: 20px; flex: 0 0 20px; }
.divider-or { display: flex; align-items: center; gap: 12px; color: var(--text-mute); font-size: var(--fs-11); margin: var(--sp-4) 0; }
.divider-or::before, .divider-or::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--border); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .search { display: none; }
}
@media (max-width: 760px) {
  .g3 { grid-template-columns: 1fr; }
  .g2 { grid-template-columns: 1fr; }
  .view { padding: var(--sp-4); }
  .topbar { padding: 0 var(--sp-4); }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); }
  .app.mobile-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-3); }
}
