:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --line: #e7e9f1;
  --line-soft: #f0f2f8;
  --text: #1a2033;
  --muted: #7b839a;
  --primary: #3f5bf6;
  --primary-600: #3348d8;
  --primary-50: #eef1ff;
  --yellow: #ffd21e;
  --dark: #101625;
  --green: #12996a;
  --green-50: #e8f7f0;
  --amber: #c77700;
  --amber-50: #fff5e5;
  --red: #df3f46;
  --red-50: #fdecec;
  --violet: #6f52d9;
  --violet-50: #f1edff;
  --blue: #2f7cf6;
  --blue-50: #eaf2ff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font-family: inherit; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 208px;
  flex: 0 0 208px;
  background: radial-gradient(120% 60% at 0% 0%, #1b2437 0%, #101625 55%);
  color: #c8cede;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 18px 16px 16px;
}

.brand-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--yellow);
  color: #171b26;
  font-weight: 800;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 210, 30, .22);
}

.brand-name { font-size: 14px; font-weight: 600; color: #fff; letter-spacing: .3px; }
.brand-sub { font-size: 10.5px; color: #7f8aa3; letter-spacing: .5px; }

.nav { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.nav::-webkit-scrollbar { width: 0; }

.nav-section {
  font-size: 10.5px;
  color: #5d6880;
  letter-spacing: 1.2px;
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: #a9b2c6;
  font-size: 12.5px;
  position: relative;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 16px; height: 16px; flex: 0 0 16px; opacity: .9; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: rgba(255, 255, 255, .09); color: #fff; font-weight: 500; }
.nav-item.active::before {
  content: "";
  position: absolute; left: 0; top: 9px; bottom: 9px;
  width: 3px; border-radius: 3px; background: var(--yellow);
}
.nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  padding: 0 5px;
  border-radius: 8px;
  min-width: 16px;
  text-align: center;
}

.sidebar-foot {
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, .06);
  font-size: 10.5px;
  color: #6a7489;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: #28c07d; box-shadow: 0 0 0 3px rgba(40, 192, 125, .15); }

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

.topbar {
  height: 54px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title { font-size: 14px; font-weight: 600; }
.topbar-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.user-menu { position: relative; }
.user-menu > summary {
  list-style: none;
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 8px;
}
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu > summary:hover { background: #f4f6fb; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #3f5bf6, #7c5cfc);
  color: #fff; font-size: 11.5px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.user-meta { line-height: 1.25; }
.user-name { font-size: 12px; font-weight: 500; }
.user-role { font-size: 10.5px; color: var(--muted); }
.user-dropdown {
  position: absolute; right: 0; top: 42px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 30px rgba(16, 24, 40, .12);
  min-width: 180px; padding: 6px; z-index: 30;
}
.user-dropdown .meta { padding: 8px 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.user-dropdown .meta b { display: block; font-size: 12px; }
.user-dropdown .meta span { color: var(--muted); font-size: 11px; }
.user-dropdown button {
  width: 100%; text-align: left; background: none; border: 0;
  padding: 7px 10px; border-radius: 6px; color: var(--text); cursor: pointer; font-size: 12px;
}
.user-dropdown button:hover { background: #f6f7fb; color: var(--red); }

.content { padding: 20px 22px 40px; max-width: 1500px; width: 100%; }

/* ---------- 页头 ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-head h1 { font-size: 19px; font-weight: 600; letter-spacing: .2px; }
.page-head p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  gap: 10px;
}
.card-h h3 { font-size: 13px; font-weight: 600; }
.card-h .sub { color: var(--muted); font-size: 11.5px; }
.card-b { padding: 16px; }
.card-b.tight { padding: 10px 16px; }
.card-b.flush { padding: 0; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 32px; padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 7px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:hover { background: #fafbff; border-color: #cdd3e3; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.btn-danger { color: var(--red); border-color: #f2cccc; }
.btn-danger:hover { background: var(--red-50); border-color: #e9b4b4; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f3f5fa; color: var(--text); border-color: transparent; }
.btn-sm { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.btn-xs { height: 22px; padding: 0 7px; font-size: 11px; border-radius: 5px; }
.btn-icon { width: 30px; padding: 0; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
}
.badge-green { background: var(--green-50); color: var(--green); }
.badge-amber { background: var(--amber-50); color: var(--amber); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-blue { background: var(--blue-50); color: var(--blue); }
.badge-violet { background: var(--violet-50); color: var(--violet); }
.badge-gray { background: #f1f3f8; color: #6f7890; }

.tag {
  display: inline-flex; align-items: center;
  padding: 0 6px; height: 19px;
  border-radius: 4px;
  background: #f4f6fb;
  color: #646e85;
  font-size: 10.5px;
}

/* ---------- 表单 ---------- */
.input, .select, textarea.input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 8px 10px; line-height: 1.6; resize: vertical; }
.input:focus, .select:focus, textarea.input:focus {
  border-color: #9aa9f9;
  box-shadow: 0 0 0 3px rgba(63, 91, 246, .1);
}
.input::placeholder { color: #a9b0c3; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b839a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 26px; }
.filters .select, .filters .input { width: auto; min-width: 120px; }
.filters form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .input[type="text"] { min-width: 180px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.field .hint { font-size: 11px; color: #9aa2b5; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
fieldset { border: 0; margin: 0; padding: 0; }
.check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); }
.check-group { display: flex; flex-wrap: wrap; gap: 10px 16px; }

.mode-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mode-card {
  border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; cursor: pointer;
  transition: .15s; background: #fbfcff;
}
.mode-card input { display: none; }
.mode-card b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.mode-card span { font-size: 11px; color: var(--muted); }
.mode-card:has(input:checked) { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 2px rgba(63, 91, 246, .08); }

.scheme-item-row { display: grid; grid-template-columns: 1fr 110px 30px; gap: 8px; margin-bottom: 8px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th {
  text-align: left; font-weight: 500; color: var(--muted);
  background: #fafbfd;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr:hover { background: #fbfcff; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .right { text-align: right; }
.tbl .check-col { width: 34px; }
.cell-main { font-weight: 500; color: var(--text); }
.cell-sub { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.cell-title { display: flex; flex-direction: column; gap: 1px; }
.cell-title b { font-weight: 500; font-size: 12.5px; }
.cell-title span { color: var(--muted); font-size: 11px; }
.ellipsis { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 11.5px; letter-spacing: -.2px; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.amount { font-weight: 600; font-variant-numeric: tabular-nums; }

.actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.actions form { display: inline-flex; }

/* ---------- 筛选 / 标签页 ---------- */
.filters {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.filters .right { display: flex; gap: 8px; align-items: center; }

.tabs { display: flex; gap: 2px; padding: 0 16px; border-bottom: 1px solid var(--line-soft); overflow-x: auto; }
.tab {
  padding: 10px 12px 9px;
  color: var(--muted);
  font-size: 12.5px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-color: var(--primary); font-weight: 500; }
.tab .count {
  display: inline-block; margin-left: 4px;
  font-size: 10.5px; color: var(--muted);
  background: #f1f3f8; padding: 0 5px; border-radius: 7px;
}

.pager { display: flex; align-items: center; gap: 4px; padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.page-item {
  min-width: 27px; height: 27px; padding: 0 7px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 12px; color: var(--muted);
  border: 1px solid transparent;
}
.page-item:hover { background: #f4f6fb; color: var(--text); }
.page-item.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-item.disabled { opacity: .35; pointer-events: none; }
.page-gap { color: #b0b8ca; padding: 0 2px; }

/* ---------- 统计卡 ---------- */
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.stat-label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; }
.stat-value { font-size: 25px; font-weight: 600; letter-spacing: -.5px; margin-top: 5px; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat-foot { font-size: 11px; color: var(--muted); margin-top: 5px; display: flex; align-items: center; gap: 6px; }
.stat-accent { position: absolute; right: 12px; bottom: 12px; width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; opacity: .9; }
.stat-accent svg { width: 15px; height: 15px; }
.accent-blue { background: var(--blue-50); color: var(--blue); }
.accent-green { background: var(--green-50); color: var(--green); }
.accent-amber { background: var(--amber-50); color: var(--amber); }
.accent-red { background: var(--red-50); color: var(--red); }
.accent-violet { background: var(--violet-50); color: var(--violet); }

/* ---------- 图表 ---------- */
.chart { padding: 6px 4px 0; }
.chart-legend { display: flex; gap: 14px; align-items: center; margin-left: auto; font-size: 11px; color: var(--muted); }
.legend-dot { width: 7px; height: 7px; border-radius: 2px; display: inline-block; margin-right: 4px; }
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 10px 4px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.chart-bar-wrap { flex: 1; display: flex; align-items: flex-end; justify-content: center; width: 100%; position: relative; }
.chart-bar {
  width: 26px; max-width: 60%;
  background: linear-gradient(180deg, #6d83ff, #3f5bf6);
  border-radius: 5px 5px 3px 3px;
  min-height: 3px;
  position: relative;
  transition: filter .15s;
}
.chart-bar:hover { filter: brightness(1.08); }
.chart-tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #1a2033; color: #fff; font-size: 10.5px; padding: 3px 7px; border-radius: 5px;
  white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s;
}
.chart-bar:hover .chart-tip { opacity: 1; }
.chart-x { font-size: 10.5px; color: var(--muted); margin-top: 6px; white-space: nowrap; }

.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-item { display: grid; grid-template-columns: 92px 1fr 56px; gap: 10px; align-items: center; font-size: 12px; }
.bar-item .name { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 6px; background: #f0f2f8; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #6d83ff, #3f5bf6); }
.bar-item .val { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 库存条 ---------- */
.stock-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line-soft); }
.stock-row:last-child { border-bottom: 0; }
.stock-name { font-size: 12.5px; }
.stock-track { flex: 1; height: 6px; background: #f0f2f8; border-radius: 4px; overflow: hidden; max-width: 130px; }
.stock-fill { height: 100%; border-radius: 4px; background: #8fa3ff; }
.stock-fill.warn { background: #f0a13a; }
.stock-fill.danger { background: #e87474; }
.stock-num { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 32px; text-align: right; }

/* ---------- 列表/时间线 ---------- */
.timeline { position: relative; padding-left: 16px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding: 0 0 14px 10px; }
.timeline-item::before {
  content: ""; position: absolute; left: -16px; top: 5px; width: 7px; height: 7px;
  border-radius: 50%; background: #fff; border: 2px solid var(--primary);
}
.timeline-item.success::before { border-color: var(--green); }
.timeline-item.failed::before { border-color: var(--red); }
.timeline-item .t { font-size: 11px; color: var(--muted); }
.timeline-item .m { font-size: 12px; margin-top: 2px; word-break: break-word; }

/* ---------- 提示 / 空状态 ---------- */
.flash { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; border-radius: 8px; font-size: 12.5px; margin-bottom: 10px; border: 1px solid transparent; }
.flash-success { background: var(--green-50); border-color: #c9ebda; color: #0f7a52; }
.flash-error { background: var(--red-50); border-color: #f5cfcf; color: #b62a31; }
.flash-info { background: var(--blue-50); border-color: #d3e3ff; color: #245fbd; }

.empty { padding: 38px 16px; text-align: center; color: var(--muted); font-size: 12px; }
.empty b { display: block; color: var(--text); font-size: 13px; margin-bottom: 4px; }

.callout { padding: 12px 14px; border-radius: 8px; font-size: 12px; line-height: 1.7; }
.callout-amber { background: var(--amber-50); color: #8a5300; }
.callout-blue { background: var(--blue-50); color: #24539e; }
.callout-gray { background: #f6f7fb; color: #59617a; }
.callout code { background: rgba(0,0,0,.05); padding: 1px 5px; border-radius: 4px; font-size: 11px; }

/* ---------- 店铺卡 ---------- */
.shop-card { position: relative; }
.shop-head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 16px 12px; }
.shop-avatar {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #fff1b8, #ffd21e);
  color: #3d3200; font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.shop-meta b { display: block; font-size: 13px; }
.shop-meta span { font-size: 11px; color: var(--muted); }
.shop-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.shop-stat { padding: 9px 12px; text-align: center; border-right: 1px solid var(--line-soft); }
.shop-stat:last-child { border-right: 0; }
.shop-stat b { display: block; font-size: 14px; }
.shop-stat span { font-size: 10.5px; color: var(--muted); }
.shop-actions { padding: 10px 12px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- IM ---------- */
.im-wrap {
  display: grid; grid-template-columns: 292px minmax(0, 1fr);
  height: calc(100vh - 148px);
  min-height: 520px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
}
.im-side { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.im-side-h { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.im-side-h b { font-size: 13px; }
.im-list { overflow-y: auto; flex: 1; }
.im-conv { display: flex; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); color: var(--text); }
.im-conv:hover { background: #fbfcff; color: var(--text); }
.im-conv.active { background: var(--primary-50); }
.im-conv .avatar { width: 32px; height: 32px; flex: 0 0 32px; background: linear-gradient(135deg, #9aa9f9, #6d83ff); }
.im-conv-main { flex: 1; min-width: 0; }
.im-conv-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.im-conv-top b { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-conv-top span { font-size: 10px; color: var(--muted); white-space: nowrap; }
.im-conv-bottom { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 2px; }
.im-conv-bottom span { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.im-unread { background: var(--red); color: #fff; font-size: 9.5px; min-width: 15px; height: 15px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

.im-main { display: flex; flex-direction: column; min-height: 0; background: #f7f8fc; }
.im-head { padding: 11px 16px; background: #fff; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.im-head b { font-size: 13px; }
.im-head span { font-size: 11px; color: var(--muted); }
.im-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 8px; max-width: 76%; }
.msg .bubble { padding: 8px 11px; border-radius: 10px; font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.msg .bubble img { max-width: 220px; border-radius: 6px; display: block; }
.msg .meta { font-size: 10px; color: #98a0b3; margin-top: 3px; }
.msg-in { align-self: flex-start; }
.msg-in .bubble { background: #fff; border: 1px solid var(--line); border-top-left-radius: 3px; }
.msg-out { align-self: flex-end; flex-direction: row-reverse; }
.msg-out .bubble { background: var(--primary); color: #fff; border-top-right-radius: 3px; }
.msg-out .meta { text-align: right; }
.msg-system { align-self: center; max-width: 100%; }
.msg-system .bubble { background: #e9ecf5; color: #667089; font-size: 11px; padding: 4px 10px; border-radius: 999px; }
.im-composer { background: #fff; border-top: 1px solid var(--line-soft); padding: 10px 12px; }
.im-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.im-quick button { border: 1px solid var(--line); background: #fbfcff; border-radius: 6px; padding: 3px 8px; font-size: 11px; color: #59617a; cursor: pointer; }
.im-quick button:hover { border-color: #b9c4f8; color: var(--primary); }
.im-input-row { display: flex; gap: 8px; align-items: flex-end; }
.im-input-row textarea { flex: 1; min-height: 38px; max-height: 120px; }
.im-empty { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }

/* ---------- 登录 ---------- */
.guest { min-height: 100vh; display: flex; background: #0f1422; }
.guest-side {
  flex: 1.15;
  background: radial-gradient(80% 80% at 20% 10%, #24305a 0%, #101625 55%, #0b0f19 100%);
  color: #d5dbea;
  padding: 54px 56px;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.guest-side::after {
  content: ""; position: absolute; width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle, rgba(63, 91, 246, .25), transparent 65%);
  right: -160px; bottom: -160px;
}
.guest-brand { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.guest-brand .brand-mark { width: 36px; height: 36px; font-size: 18px; border-radius: 10px; }
.guest-brand b { font-size: 16px; color: #fff; }
.guest-brand span { display: block; font-size: 11px; color: #8892aa; letter-spacing: .5px; }
.guest-copy { margin-top: auto; position: relative; z-index: 1; max-width: 460px; }
.guest-copy h1 { font-size: 30px; line-height: 1.35; font-weight: 600; color: #fff; letter-spacing: .3px; }
.guest-copy h1 em { font-style: normal; color: var(--yellow); }
.guest-copy p { margin-top: 14px; color: #9aa4bd; font-size: 13px; line-height: 1.8; }
.guest-features { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.guest-features span { border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); border-radius: 999px; padding: 5px 11px; font-size: 11.5px; color: #b6bfd4; }
.guest-foot { margin-top: 40px; font-size: 11px; color: #5f6980; position: relative; z-index: 1; }

.guest-main { flex: 1; background: #fff; display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-box { width: 100%; max-width: 348px; }
.login-box h2 { font-size: 21px; font-weight: 600; }
.login-box .lead { color: var(--muted); font-size: 12.5px; margin-top: 4px; margin-bottom: 24px; }
.login-box .field { margin-bottom: 14px; }
.login-box .input { height: 38px; font-size: 13px; }
.login-box .btn { width: 100%; height: 38px; font-size: 13px; margin-top: 6px; }
.login-hint { margin-top: 18px; padding: 11px 12px; background: #f7f8fc; border: 1px dashed var(--line); border-radius: 8px; font-size: 11.5px; color: var(--muted); line-height: 1.8; }
.login-hint b { color: var(--text); }
.login-hint code { background: #eef1ff; color: var(--primary); padding: 1px 5px; border-radius: 4px; }

/* ---------- 其他 ---------- */
summary { list-style: none; }
summary::-webkit-details-marker { display: none; }
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 14px; }
.kv { display: grid; grid-template-columns: 92px 1fr; gap: 8px 12px; font-size: 12.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.mb-0 { margin-bottom: 0; }
.mb-10 { margin-bottom: 10px; }
.mb-14 { margin-bottom: 14px; }
.mt-10 { margin-top: 10px; }
.mt-14 { margin-top: 14px; }
.hint-line { font-size: 11.5px; color: var(--muted); }
.divider { height: 1px; background: var(--line-soft); margin: 14px 0; }
.url-box { display: flex; gap: 6px; align-items: center; }
.url-box .input { font-size: 11px; }
.progress { height: 5px; background: #eef0f6; border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }

.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 5px; background: var(--muted); }
.status-dot.green { background: var(--green); }
.status-dot.red { background: var(--red); }
.status-dot.amber { background: #e0a02a; }

.error-page { max-width: 460px; margin: 80px auto; text-align: center; }
.error-page .code { font-size: 56px; font-weight: 700; color: #dfe3ef; letter-spacing: 2px; }
.error-page h1 { font-size: 18px; margin: 8px 0; }
.error-page p { color: var(--muted); font-size: 12.5px; }

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2-1, .grid-1-2 { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
  .sidebar { width: 60px; flex-basis: 60px; }
  .brand-name, .brand-sub, .nav-item span, .nav-section, .sidebar-foot span { display: none; }
  .brand { justify-content: center; padding: 16px 0; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-badge { position: absolute; top: 3px; right: 6px; }
  .content { padding: 16px; }
  .im-wrap { grid-template-columns: 1fr; }
  .im-side { display: none; }
  .guest-side { display: none; }
}
