/* MetaOps — 出海投放 / 客服私域 / 多账号运营中台 */
:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e5eaf1;
  --line-soft: #eef2f7;
  --bg: #f5f7fb;
  --card: #ffffff;
  --brand: #1877f2;
  --brand-dark: #0b5ed7;
  --brand-soft: #e8f1ff;
  --green: #15803d;
  --green-soft: #e9f7ef;
  --amber: #b45309;
  --amber-soft: #fff5e6;
  --red: #b91c1c;
  --red-soft: #fdecec;
  --wa: #25d366;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -18px rgba(15, 23, 42, .25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scrollbar-gutter: stable; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }
svg { display: block; }

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

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 232px;
  background: radial-gradient(1200px 400px at -10% -10%, #17325e 0%, transparent 60%), linear-gradient(180deg, #0b1220 0%, #101c33 100%);
  color: #cbd5e1; display: flex; flex-direction: column; padding: 18px 14px 16px; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 16px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #1877f2 0%, #12b3c8 100%);
  color: #fff; font-weight: 800; font-size: 15px; letter-spacing: -.5px;
  box-shadow: 0 6px 16px -6px rgba(24, 119, 242, .9);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { color: #fff; font-size: 15px; letter-spacing: .2px; }
.brand-text span { color: #7f93b3; font-size: 11px; margin-top: 3px; }

.nav-label { color: #5f7392; font-size: 11px; letter-spacing: .12em; padding: 14px 10px 7px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 9px;
  color: #9fb0c8; font-size: 13.5px; transition: background .15s, color .15s; position: relative;
}
.nav a svg { width: 17px; height: 17px; opacity: .85; flex: none; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: #e2e8f0; }
.nav a.active { background: linear-gradient(90deg, rgba(24, 119, 242, .26), rgba(24, 119, 242, .10)); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #3b8bff; }
.nav .count {
  margin-left: auto; background: #1877f2; color: #fff; font-size: 11px; font-weight: 700;
  min-width: 19px; height: 19px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px;
}
.nav .count.plain { background: rgba(255, 255, 255, .12); color: #cbd5e1; font-weight: 600; }

.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.who { display: flex; align-items: center; gap: 10px; padding: 6px 7px; border-radius: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: #1e3a5f; color: #bcd3f5; font-weight: 700; font-size: 13px;
}
.who-meta { min-width: 0; line-height: 1.25; }
.who-meta b { display: block; color: #e2e8f0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-meta span { color: #7f93b3; font-size: 11px; }
.logout {
  margin-left: auto; background: transparent; border: 0; color: #7f93b3; cursor: pointer;
  padding: 6px; border-radius: 8px; display: grid; place-items: center;
}
.logout:hover { background: rgba(255, 255, 255, .07); color: #fff; }

.main { margin-left: 232px; flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  padding: 13px 26px; background: rgba(245, 247, 251, .88); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.page-head h1 { margin: 0; font-size: 18px; letter-spacing: -.2px; }
.page-head p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.view { padding: 20px 26px 44px; width: 100%; max-width: 1560px; transition: opacity .12s ease; }
.view.is-refreshing { opacity: .55; pointer-events: none; }

/* ------------------------------ 通用组件 ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 13px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: #cdd6e3; background: #fbfcfe; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-dark { background: #0f172a; border-color: #0f172a; color: #fff; }
.btn-dark:hover { background: #1e293b; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: #eef2f7; color: var(--ink); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

.icon-btn { width: 34px; height: 34px; padding: 0; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { color: var(--ink); border-color: #cdd6e3; }
.icon-btn svg { width: 16px; height: 16px; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; border: 1px solid transparent; white-space: nowrap;
}
.pill.demo { background: var(--amber-soft); color: var(--amber); border-color: #f7e0bd; }
.pill.live { background: var(--green-soft); color: var(--green); border-color: #cdebd8; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.gray { background: #f1f5f9; color: var(--muted); border-color: #e2e8f0; }
.pill.blue { background: var(--brand-soft); color: var(--brand-dark); border-color: #d6e6ff; }
.pill.green { background: var(--green-soft); color: var(--green); border-color: #cdebd8; }
.pill.red { background: var(--red-soft); color: var(--red); border-color: #f6d5d5; }
.pill.amber { background: var(--amber-soft); color: var(--amber); border-color: #f7e0bd; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 650; letter-spacing: -.1px; }
.card-head .sub { color: var(--muted); font-size: 12px; margin-left: 2px; }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px 18px; }
.card-body.tight { padding: 10px 12px; }

.grid-2 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; }
.grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }

/* ------------------------------ KPI ------------------------------ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi { padding: 15px 17px 13px; position: relative; overflow: hidden; }
.kpi-label { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 25px; font-weight: 700; letter-spacing: -.6px; margin: 7px 0 2px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-size: 13px; font-weight: 600; color: var(--muted-2); letter-spacing: 0; margin-left: 2px; }
.kpi-foot { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted-2); min-height: 20px; }
.kpi-foot .delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 650; }
.kpi-foot .delta.up { color: var(--green); }
.kpi-foot .delta.down { color: var(--red); }
.kpi-foot .delta.flat { color: var(--muted); }
.spark { position: absolute; right: 12px; bottom: 10px; width: 92px; height: 34px; opacity: .8; }
.kpi.accent .kpi-value { color: var(--ink); }

/* ------------------------------ 表格 ------------------------------ */
.table-wrap { overflow: auto; max-width: 100%; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: right; font-weight: 600; font-size: 11.5px; color: var(--muted); letter-spacing: .01em;
  padding: 9px 14px; background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.table th:first-child, .table td:first-child { text-align: left; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th .arrow { margin-left: 4px; font-size: 11px; color: var(--brand); font-weight: 700; }
.table th .arrow.idle { color: #9aa8ba; font-weight: 500; }
.table th.sortable:hover { color: var(--ink); }
.table th.sortable:hover .arrow.idle { color: #64748b; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table tbody tr:hover { background: #fafcff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .name { text-align: left; font-weight: 550; color: var(--ink); max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.table th.left, .table td.left { text-align: left; }
.table .sub { color: var(--muted-2); font-size: 11.5px; font-weight: 400; }
.table .strong { font-weight: 650; }
.table.compact td { padding: 8px 14px; }
.table.tight th, .table.tight td { padding-left: 10px; padding-right: 10px; }
.table.tight td, .table.tight th { white-space: normal; }
.table.tight td.mono { word-break: break-all; }

/* 预算进度 */
.pace { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.pace-track { width: 62px; height: 6px; border-radius: 4px; background: #eef2f7; overflow: hidden; flex: none; }
.pace-fill { height: 100%; border-radius: 4px; background: #1877f2; transition: width .2s; }
.pace-fill.warn { background: #f59e0b; }
.pace-fill.over { background: #dc2626; }
.pace-text { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ------------------------------ 控件 ------------------------------ */
.seg { display: inline-flex; padding: 3px; background: #fff; border: 1px solid var(--line); border-radius: 10px; gap: 2px; }
.seg button {
  border: 0; background: transparent; height: 27px; padding: 0 11px; border-radius: 7px;
  font-size: 12.5px; color: var(--muted); cursor: pointer; font-weight: 500; white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button.active { background: #0f172a; color: #fff; }
.seg.blue button.active { background: var(--brand); }

/* 日期区间日历 */
.date-pop {
  position: fixed; z-index: 120; width: 322px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 24px 60px -22px rgba(15, 23, 42, .5); padding: 12px 14px 10px;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 8px; }
.dp-head b { font-size: 13.5px; font-weight: 650; }
.dp-nav {
  width: 26px; height: 26px; border: 1px solid var(--line); background: #fff; border-radius: 7px;
  color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer;
}
.dp-nav:hover { color: var(--ink); border-color: #cdd6e3; }
.dp-week { display: grid; grid-template-columns: repeat(7, 1fr); padding: 4px 0 6px; color: var(--muted-2); font-size: 11px; text-align: center; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-day {
  height: 34px; border: 0; background: transparent; border-radius: 9px; font-size: 12.5px;
  color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums;
}
.dp-day:hover { background: #eef4ff; }
.dp-day.empty { cursor: default; }
.dp-day.disabled { color: #d3dae4; cursor: not-allowed; }
.dp-day.other { color: #c3ccd9; }
.dp-day.in-range { background: #e8f1ff; }
.dp-day.start, .dp-day.end { background: var(--brand); color: #fff; font-weight: 650; }
.dp-day.today:not(.start):not(.end) { box-shadow: inset 0 0 0 1px #9dc3ff; }
.dp-nav:disabled { opacity: .35; cursor: not-allowed; }
.dp-foot { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.dp-sel { font-size: 11.5px; color: var(--muted); }

.input, .select, textarea.input {
  width: 100%; height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; color: var(--ink); font-size: 13px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; padding: 9px 11px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, textarea.input:focus { border-color: #9dc3ff; box-shadow: 0 0 0 3px rgba(24, 119, 242, .12); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
.field label { font-size: 12.5px; color: var(--ink-2); font-weight: 550; }
.field .hint { font-size: 11.5px; color: var(--muted-2); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; }

.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted-2); }
.search input { padding-left: 32px; }

/* ------------------------------ 图表 ------------------------------ */
.chart-wrap { padding: 8px 10px 2px; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: #eef2f7; stroke-width: 1; }
.chart .axis { fill: #94a3b8; font-size: 10.5px; }
.chart .line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { opacity: .16; }
.chart .dot { stroke: #fff; stroke-width: 1.6; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }

.bars { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 150px 1fr 74px; align-items: center; gap: 10px; font-size: 12.5px; }
.bar-row .label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; border-radius: 6px; background: #eef2f7; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #1877f2, #4aa3ff); }
.bar-row .val { text-align: right; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ------------------------------ 收件箱 ------------------------------ */
.inbox { display: grid; grid-template-columns: 336px minmax(0, 1fr); gap: 14px; height: calc(100vh - 176px); min-height: 540px; }
.conv-panel { display: flex; flex-direction: column; overflow: hidden; }
.conv-tools { padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 9px; border-bottom: 1px solid var(--line-soft); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted); border-radius: 999px;
  height: 26px; padding: 0 10px; font-size: 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
}
.chip:hover { border-color: #cdd6e3; color: var(--ink); }
.chip.active { background: #0f172a; border-color: #0f172a; color: #fff; }
.chip .n { opacity: .7; font-size: 11px; }
.conv-list { overflow: auto; flex: 1; }
.conv {
  display: flex; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--line-soft);
  cursor: pointer; transition: background .12s; position: relative; color: inherit;
}
.conv:hover { background: #f8fbff; }
.conv.active { background: #eef6ff; }
.conv.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.conv-avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; }
.conv-main { min-width: 0; flex: 1; }
.conv-top { display: flex; align-items: center; gap: 6px; }
.conv-top b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-top time { margin-left: auto; font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.conv-snippet { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.conv-meta { display: flex; align-items: center; gap: 5px; margin-top: 5px; }
.mini-tag { font-size: 10.5px; padding: 1px 6px; border-radius: 5px; background: #f1f5f9; color: #475569; }
.unread-dot { background: #e11d48; color: #fff; font-size: 10.5px; font-weight: 700; min-width: 17px; height: 17px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }

.chat-panel { display: flex; flex-direction: column; overflow: hidden; }
.chat-head { padding: 13px 18px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chat-head h3 { margin: 0; font-size: 15px; }
.chat-head .sub { color: var(--muted); font-size: 12px; }
.chat-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.chat-body { flex: 1; overflow: auto; padding: 18px; background: linear-gradient(180deg, #fbfcfe, #f7f9fc); }
.msg { display: flex; width: 100%; margin-bottom: 12px; gap: 8px; }
.msg-wrap { max-width: min(560px, 72%); min-width: 0; }
.msg .bubble { width: fit-content; max-width: 100%; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.msg.in .bubble { background: #fff; border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg.out { justify-content: flex-end; }
.msg.out .msg-wrap { margin-left: auto; text-align: right; }
.msg.out .bubble { background: #d8ecff; border: 1px solid #bfe0ff; border-top-right-radius: 4px; margin-left: auto; text-align: left; }
.msg .meta { font-size: 10.5px; color: var(--muted-2); margin-top: 4px; }
.msg.out .meta { text-align: right; }
.msg .failed { color: var(--red); }
.chat-day { text-align: center; font-size: 11px; color: var(--muted-2); margin: 14px 0 12px; }
.chat-day span { background: #eef2f7; padding: 2px 9px; border-radius: 999px; }

.composer { border-top: 1px solid var(--line-soft); padding: 12px 14px 14px; background: #fff; }
.composer textarea {
  width: 100%; resize: none; height: 74px; border: 1px solid var(--line); border-radius: 11px;
  padding: 10px 12px; font-size: 13px; font-family: inherit; outline: none; line-height: 1.5;
}
.composer textarea:focus { border-color: #9dc3ff; box-shadow: 0 0 0 3px rgba(24, 119, 242, .1); }
.composer-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.quick { display: flex; gap: 6px; overflow: auto; flex: 1; }
.quick button { border: 1px solid var(--line); background: #fff; border-radius: 7px; height: 26px; padding: 0 9px; font-size: 11.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.quick button:hover { border-color: #9dc3ff; color: var(--brand-dark); background: #f6faff; }

.empty { padding: 44px 20px; text-align: center; color: var(--muted-2); font-size: 13px; }
.empty .big { font-size: 15px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.empty svg { width: 40px; height: 40px; margin: 0 auto 10px; opacity: .5; }

/* 渠道色 */
.ch-whatsapp { background: #25d366; }
.ch-messenger { background: #0084ff; }
.ch-instagram { background: linear-gradient(135deg, #f58529, #dd2a7b 55%, #8134af); }
.channel-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ------------------------------ 资产 ------------------------------ */
.asset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.asset-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.asset-foot { border-top: 1px solid var(--line-soft); padding: 10px 16px 12px; color: var(--muted-2); font-size: 11.5px; line-height: 1.6; }
.asset-item:last-child { border-bottom: 0; }
.asset-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-dark); flex: none; }
.asset-icon.wa { background: #e7fbef; color: #128c4b; }
.asset-icon.ig { background: #fdeef7; color: #c0267e; }
.asset-icon svg { width: 17px; height: 17px; }
.asset-main { min-width: 0; flex: 1; }
.asset-main b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-main span { color: var(--muted); font-size: 11.5px; }
.asset-side { display: flex; align-items: center; gap: 6px; }

/* 渠道卡片 */
.asset-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.channel-card {
  text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; cursor: pointer; box-shadow: var(--shadow); transition: border-color .16s, transform .16s, box-shadow .16s;
  font-family: inherit; color: inherit;
}
.channel-card:hover { border-color: #bcd7ff; transform: translateY(-1px); box-shadow: 0 14px 34px -22px rgba(24, 119, 242, .6); }
.channel-card-head { display: flex; align-items: flex-start; gap: 11px; }
.channel-card-title { flex: 1; min-width: 0; }
.channel-card-title h3 { margin: 0; font-size: 14.5px; }
.channel-card-title span { color: var(--muted-2); font-size: 11.5px; }
.channel-count { margin: 18px 0 2px; font-size: 12.5px; color: var(--muted); }
.channel-count b { font-size: 30px; color: var(--ink); font-weight: 700; letter-spacing: -1px; margin-right: 3px; }
.channel-desc { color: var(--muted-2); font-size: 11.5px; line-height: 1.6; }
.channel-go { margin-top: 16px; color: var(--brand); font-weight: 600; font-size: 12.5px; display: flex; align-items: center; gap: 4px; }

/* 弹窗里的资产列表 */
.ch-list { border: 1px solid var(--line-soft); border-radius: 10px; overflow: hidden; }
.ch-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.ch-item:last-child { border-bottom: 0; }
.ch-item b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-item .sub { color: var(--muted-2); font-size: 11px; }
.ch-item .pill { margin-left: auto; }
.modal.wide { max-width: 620px; }
.modal.wide .modal-body { max-height: 68vh; overflow: auto; }

@media (max-width: 1100px) {
  .asset-grid-3 { grid-template-columns: 1fr; }
}

/* 开关 */
.switch { position: relative; display: inline-block; vertical-align: middle; width: 34px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 999px; cursor: pointer; transition: .18s; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 2px; left: 2px; transition: .18s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(14px); }
.switch.sm { width: 30px; height: 18px; }
.switch.sm span::after { width: 14px; height: 14px; }
.switch.sm input:checked + span::after { transform: translateX(12px); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { filter: brightness(.95); }

.pwd-wrap { position: relative; }
.pwd-wrap .input { padding-right: 38px; }
.eye-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: 0; background: transparent; color: var(--muted-2);
  display: grid; place-items: center; cursor: pointer; border-radius: 6px;
}
.eye-btn:hover { background: #eef2f7; color: var(--ink-2); }
.eye-btn.on { color: var(--brand); }
.eye-btn svg { width: 17px; height: 17px; }

/* ------------------------------ 设置 / 表单 ------------------------------ */
.settings-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 14px; align-items: start; }
.section { padding: 18px; }
.section + .section { border-top: 1px solid var(--line-soft); }
.section h4 { margin: 0 0 3px; font-size: 13.5px; }
.section p.desc { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.fx-table { width: 100%; font-size: 12.5px; border-collapse: collapse; }
.fx-table td { padding: 7px 0; border-bottom: 1px dashed var(--line-soft); color: var(--ink-2); }
.fx-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

/* ------------------------------ Toast / Modal ------------------------------ */
#toast { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast {
  background: #0f172a; color: #fff; padding: 10px 14px; border-radius: 10px; font-size: 13px;
  box-shadow: 0 12px 30px -12px rgba(15, 23, 42, .6); max-width: 420px; animation: slideIn .18s ease;
  display: flex; gap: 8px; align-items: flex-start;
}
.toast.error { background: #7f1d1d; }
.toast.success { background: #14532d; }
@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal { background: #fff; border-radius: 16px; width: 100%; max-width: 460px; box-shadow: 0 30px 70px -20px rgba(15, 23, 42, .5); overflow: hidden; }
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 8px; }

.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px; color: var(--muted); }
.spinner { width: 18px; height: 18px; border: 2px solid #dbeafe; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 11px; font-size: 12.5px; line-height: 1.55; }
.banner.demo { background: #fffaef; border: 1px solid #f5e3bd; color: #8a5a09; }
.banner.info { background: #f2f8ff; border: 1px solid #d5e6ff; color: #1e4f8f; }
.banner svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.banner b { font-weight: 650; }

@media (max-width: 1240px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-2-even, .settings-grid { grid-template-columns: 1fr; }
  .asset-grid { grid-template-columns: 1fr; }
  .grid-2 > *, .grid-2-even > *, .settings-grid > *, .asset-grid > * { min-width: 0; }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .view { padding: 16px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .topbar-actions { width: 100%; justify-content: flex-start; }
  .inbox { grid-template-columns: 1fr; height: auto; }
  .conv-panel { max-height: 320px; }
  .page-head h1 { font-size: 16px; }
  .kpi-value { font-size: 22px; }
  .table-wrap { max-width: 100%; }
  .card-head { flex-wrap: wrap; row-gap: 8px; }
  .card-head .right { margin-left: 0; }
}
