:root {
  --ink: #17211d;
  --ink-2: #35423c;
  --muted: #7a8881;
  --line: #e4e8e5;
  --line-strong: #d8ded9;
  --canvas: #f4f5f1;
  --card: #ffffff;
  --sidebar: #15241f;
  --sidebar-soft: #21342d;
  --green: #166447;
  --green-2: #21805c;
  --green-soft: #e8f4ee;
  --mint: #b8e7d2;
  --amber: #e5a04d;
  --coral: #d96c55;
  --blue: #4e7895;
  --shadow: 0 12px 40px rgba(27, 45, 37, .055);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 100vh;
  padding: 24px 16px 18px;
  color: #fff;
  background:
    radial-gradient(circle at 20% 95%, rgba(69, 130, 103, .22), transparent 32%),
    var(--sidebar);
  display: flex;
  flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 1px 8px 27px; }
.brand-mark {
  width: 39px; height: 39px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #c9f078, #91d7aa);
  color: #16392b; font-size: 19px; font-weight: 800;
  box-shadow: 0 7px 20px rgba(129, 218, 164, .18);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 13px; letter-spacing: .12em; }
.brand small { margin-top: 4px; color: #8fa49b; font-size: 10px; letter-spacing: .08em; }
.nav-label { margin: 0 10px 9px; color: #6f887d; font-size: 9px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.primary-nav { display: flex; flex-direction: column; gap: 4px; }
.nav {
  position: relative;
  width: 100%; border: 0; border-radius: 10px; padding: 9px 11px;
  color: #9bb0a7; background: transparent; cursor: pointer;
  display: flex; align-items: center; gap: 10px; text-align: left;
  transition: color .18s, background .18s, transform .18s;
}
.nav:hover { color: #fff; background: rgba(255, 255, 255, .055); }
.nav.active { color: #fff; background: #263d34; box-shadow: inset 2px 0 #9dd6b2; }
.nav > span {
  width: 29px; height: 29px; flex: 0 0 29px; border-radius: 8px;
  display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .08);
  color: #9eb5ab; background: rgba(255, 255, 255, .035); font-size: 11px;
}
.nav.active > span { color: #173d2e; background: #a9dcbc; border-color: #a9dcbc; font-weight: 700; }
.nav b { font-size: 12px; font-weight: 560; }
.nav-live { width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: #7ed69d; box-shadow: 0 0 0 4px rgba(126, 214, 157, .1); }
.sidebar-bottom { margin-top: auto; }
.nav.utility { margin-bottom: 10px; }
.system-card { border: 1px solid #30473e; background: rgba(255, 255, 255, .035); border-radius: 12px; padding: 12px; display: flex; gap: 10px; align-items: center; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #87d6a3; box-shadow: 0 0 0 5px rgba(135, 214, 163, .09); }
.system-card b, .system-card small { display: block; }
.system-card b { font-size: 11px; font-weight: 620; }
.system-card small { margin-top: 3px; color: #81988e; font-size: 9px; }
.version { margin: 13px 2px 0; text-align: center; color: #587067; font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }

.main-content { min-width: 0; width: 100%; max-width: 1640px; margin: 0 auto; padding: 25px 32px 55px; }
.topbar { min-height: 54px; margin-bottom: 23px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar p, .section-kicker, .panel-title small, .sync-panel small, .route-head small {
  margin: 0 0 5px; color: #7e9187; font-size: 9px; font-weight: 750; letter-spacing: .17em;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 24px; line-height: 1.25; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 17px; line-height: 1.45; letter-spacing: -.018em; }
h3 { margin-bottom: 0; font-size: 14px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.api-state { display: flex; align-items: center; gap: 7px; color: #66746e; font-size: 10px; }
.api-state i { width: 7px; height: 7px; border-radius: 50%; background: #45a574; box-shadow: 0 0 0 4px #e4f3ea; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #e4faec; background: var(--green); font-size: 10px; font-weight: 750; letter-spacing: .06em; }

.page { display: none; animation: page-in .2s ease both; }
.page.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.hidden { display: none !important; }
.grid { display: grid; gap: 15px; margin-bottom: 15px; }
.grid.two { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); }
.grid.split { grid-template-columns: minmax(0, 1.65fr) minmax(270px, .7fr); }
.panel, .metrics article, .messenger { background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.panel { border-radius: 15px; padding: 22px; }
.panel-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.muted { color: #8c9a93; font-size: 10px; }
.block-gap { display: inline-block; margin-top: 5px; }
.error-text { color: #a54a39; font-size: 10px; }

.welcome-card {
  min-height: 138px; margin-bottom: 15px; padding: 25px 28px; border-radius: 16px; overflow: hidden;
  color: #fff; background:
    linear-gradient(100deg, rgba(17, 70, 50, .98), rgba(28, 100, 72, .88)),
    radial-gradient(circle at 80% 10%, #6bb993, transparent 38%);
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  box-shadow: 0 14px 35px rgba(21, 82, 58, .13);
}
.welcome-card > div { max-width: 800px; }
.overline { display: block; margin-bottom: 9px; color: #a8d8bd; font-size: 9px; font-weight: 750; letter-spacing: .18em; }
.welcome-card h2 { font-size: 22px; }
.welcome-card p { margin: 7px 0 0; color: #b7d0c4; font-size: 11px; line-height: 1.7; }
.jump-button { flex: 0 0 auto; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; padding: 11px 14px; color: #effaf3; background: rgba(255,255,255,.08); cursor: pointer; font-size: 11px; font-weight: 650; }
.jump-button:hover { background: rgba(255,255,255,.15); }
.jump-button span { margin-left: 8px; }

.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 15px; }
.metrics article { min-width: 0; border-radius: 14px; padding: 16px; display: flex; align-items: center; gap: 12px; }
.metrics article > div:last-child { min-width: 0; }
.metric-icon { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; display: grid; place-items: center; font-size: 9px; font-weight: 760; }
.metric-icon.green { color: #277153; background: #e1f1e9; }
.metric-icon.blue { color: #4c738e; background: #e8f0f4; }
.metric-icon.amber { color: #946020; background: #f7eddc; }
.metric-icon.coral { color: #9b4c3e; background: #f8e8e4; }
.metric-icon.slate { color: #596965; background: #ebefed; }
.metrics span, .metrics em { display: block; overflow: hidden; color: var(--muted); font-size: 9px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.metrics strong { display: block; margin: 3px 0 1px; font-size: 23px; line-height: 1.1; letter-spacing: -.04em; }
.metrics em { color: #a3ada8; font-size: 8px; }

label { display: block; margin-bottom: 13px; color: #617069; font-size: 10px; font-weight: 650; }
input, textarea, select { width: 100%; margin-top: 6px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 10px 11px; outline: 0; color: var(--ink); background: #fbfcfb; font-size: 11px; transition: border .16s, box-shadow .16s; }
textarea { min-height: 106px; resize: vertical; line-height: 1.65; }
input:focus, textarea:focus, select:focus { border-color: #7ba58f; box-shadow: 0 0 0 3px rgba(51, 132, 93, .09); }
.primary, .soft, .danger, .examples button { border: 0; border-radius: 9px; padding: 10px 13px; cursor: pointer; font-size: 10px; font-weight: 650; transition: transform .16s, background .16s, opacity .16s; }
.primary { width: 100%; color: #fff; background: var(--green); }
.primary:hover { background: #10573d; transform: translateY(-1px); }
.primary:disabled { opacity: .5; transform: none; }
.primary.compact { width: auto; white-space: nowrap; }
.soft { color: #365548; background: #edf3f0; }
.soft:hover { background: #e2ece7; }
.danger { padding: 6px 9px; color: #a04233; background: #fff0ec; }
.status-pill { padding: 6px 9px; border-radius: 99px; color: #287153; background: var(--green-soft); font-size: 9px; font-weight: 650; }
.status-pill i { display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: #51a979; }
.examples { min-height: 28px; margin: -2px 0 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.examples > span { color: #98a49e; font-size: 9px; }
.examples button { padding: 6px 8px; color: #50645b; background: #f1f4f2; }
.result-panel { min-height: 340px; }
.empty { min-height: 245px; display: grid; place-content: center; justify-items: center; text-align: center; color: #91a098; }
.empty-symbol { width: 46px; height: 46px; margin-bottom: 9px; border-radius: 15px; display: grid; place-items: center; color: #42755f; background: #eaf3ee; font-size: 11px; font-weight: 760; }
.empty p { margin: 0; font-size: 11px; line-height: 1.7; }
.result { border: 1px solid #dfe9e4; border-radius: 12px; padding: 17px; background: #f8fbf9; }
.result h3 { margin: 13px 0; }
.result p { margin: 0; padding: 8px 0; border-top: 1px solid #e6ece8; display: grid; grid-template-columns: 76px 1fr; gap: 10px; font-size: 11px; line-height: 1.55; }
.result p b { color: #75847c; font-weight: 600; }
.flow-panel { padding-bottom: 19px; }
.flow-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.flow-row > span { min-width: 0; flex: 1; border: 1px solid #e1e7e3; border-radius: 10px; padding: 10px; color: #3f5349; background: #f7f9f7; text-align: center; font-size: 10px; }
.flow-row > span i { display: inline-grid; width: 18px; height: 18px; margin-right: 6px; place-items: center; border-radius: 6px; color: #377458; background: #e2f0e8; font-size: 8px; font-style: normal; }
.flow-row > b { color: #9caaa3; font-weight: 500; }

.page-intro, .wechat-summary { margin-bottom: 17px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.page-intro h2, .wechat-summary h2 { font-size: 21px; }
.page-intro p:last-child, .wechat-summary > div:first-child > p:last-child { max-width: 680px; margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.wechat-stats { display: flex; align-items: center; gap: 6px; }
.wechat-stats > span { min-width: 70px; border-left: 1px solid var(--line-strong); padding-left: 13px; color: #86948d; font-size: 8px; }
.wechat-stats > span b { display: block; margin-bottom: 2px; color: var(--ink); font-size: 16px; }
.wechat-stats .source-state { min-width: 105px; border: 0; border-radius: 9px; padding: 9px 11px; color: #557165; background: #edf5f1; display: flex; align-items: center; gap: 7px; }
.source-state i { width: 7px; height: 7px; border-radius: 50%; background: #aab5b0; }
.source-state i.ok { background: #42a272; box-shadow: 0 0 0 4px rgba(66,162,114,.1); }
.source-state i.error { background: #ce5a45; box-shadow: 0 0 0 4px rgba(206,90,69,.1); }
.wechat-stats .source-state b { margin: 0; font-size: 9px; white-space: nowrap; }

.messenger { overflow: hidden; border-radius: 16px; }
.messenger-toolbar { min-height: 66px; padding: 11px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.source-identity { display: flex; align-items: center; gap: 9px; }
.source-logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #26a56f, #16764f); font-size: 11px; font-weight: 700; }
.source-identity b, .source-identity small { display: block; }
.source-identity b { font-size: 11px; }
.source-identity small { margin-top: 3px; color: #92a099; font-size: 8px; }
.toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.search-box { position: relative; width: 230px; margin: 0; }
.search-box span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #89978f; font-size: 14px; }
.search-box input { height: 35px; margin: 0; padding-left: 31px; }
.toolbar-actions select { width: 105px; height: 35px; margin: 0; padding: 7px 9px; }
.icon-button { height: 35px; white-space: nowrap; }
.icon-button span { display: inline-block; margin-right: 5px; font-size: 13px; transition: transform .3s; }
.icon-button.loading span { transform: rotate(180deg); }
.auth-notice { margin: 10px 12px 0; border: 1px solid #ead7b5; border-radius: 11px; padding: 10px 12px; color: #6e552c; background: #fff8e8; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.auth-notice b { font-size: 10px; }
.auth-notice p { margin: 2px 0 0; font-size: 9px; }

.messenger-grid { min-height: 600px; display: grid; grid-template-columns: minmax(245px, 285px) minmax(390px, 1fr) minmax(235px, 270px); }
.conversation-column, .message-column, .route-column { min-width: 0; }
.conversation-column { border-right: 1px solid var(--line); background: #fbfcfb; }
.column-head { height: 54px; padding: 12px 14px 8px; display: flex; align-items: center; justify-content: space-between; }
.column-head > div { display: flex; align-items: center; gap: 7px; }
.column-head b { font-size: 11px; }
.column-head span { min-width: 20px; border-radius: 99px; padding: 3px 6px; color: #5d7167; background: #e9efec; text-align: center; font-size: 8px; }
.column-head small { color: #99a59f; font-size: 8px; }
.filter-tabs { margin: 0 12px 9px; padding: 3px; border-radius: 9px; background: #eef2f0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.chat-filter { border: 0; border-radius: 7px; padding: 6px 5px; color: #819087; background: transparent; cursor: pointer; font-size: 8px; }
.chat-filter.active { color: #2f5948; background: #fff; box-shadow: 0 2px 8px rgba(31,52,42,.07); font-weight: 650; }
.conversation-list { height: 527px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #d7dfda transparent; }
.conversation-item { width: 100%; border: 0; border-top: 1px solid #edf0ee; padding: 12px; color: inherit; background: transparent; cursor: pointer; display: flex; align-items: flex-start; gap: 10px; text-align: left; transition: background .15s; }
.conversation-item:hover { background: #f3f7f5; }
.conversation-item.active { position: relative; background: #eaf3ee; }
.conversation-item.active::before { content: ""; position: absolute; inset: 8px auto 8px 0; width: 2px; border-radius: 2px; background: var(--green-2); }
.conversation-avatar, .chat-avatar { border-radius: 11px; display: grid; place-items: center; color: #41705a; background: #dcece4; font-size: 9px; font-weight: 700; }
.conversation-avatar { width: 38px; height: 38px; flex: 0 0 38px; }
.conversation-avatar.factory, .chat-avatar.factory { color: #8b5a1f; background: #f3e5ce; }
.conversation-avatar.internal, .chat-avatar.internal { color: #3e6680; background: #deebf1; }
.conversation-avatar.direct, .chat-avatar.direct { color: #675582; background: #eae3f2; }
.conversation-avatar.unclassified, .chat-avatar.unclassified { color: #66736d; background: #e8ecea; }
.conversation-copy { min-width: 0; flex: 1; }
.conversation-title { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.conversation-title b { overflow: hidden; font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.conversation-title time { flex: 0 0 auto; color: #a1aba6; font-size: 7px; }
.conversation-preview { display: block; overflow: hidden; margin-top: 4px; color: #7e8b85; font-size: 9px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.conversation-meta { display: flex; align-items: center; gap: 5px; margin-top: 6px; color: #93a099; font-size: 7px; }
.conversation-meta em { margin-left: auto; border-radius: 99px; padding: 2px 5px; color: #387055; background: #dceee4; font-style: normal; }
.kind-dot { width: 5px; height: 5px; border-radius: 50%; background: #a6b1ac; }
.kind-dot.internal { background: var(--blue); }
.kind-dot.factory { background: var(--amber); }
.kind-dot.direct { background: #826da2; }
.list-loading { padding: 15px 12px; display: grid; gap: 10px; }
.list-loading i { height: 55px; border-radius: 10px; background: linear-gradient(90deg, #edf1ef, #f7f9f8, #edf1ef); background-size: 200% 100%; animation: shimmer 1.15s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.list-empty { min-height: 300px; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.list-empty > span { width: 35px; height: 35px; margin-bottom: 8px; border-radius: 11px; display: grid; place-items: center; color: #73857c; background: #ebf0ed; }
.list-empty b { font-size: 10px; }
.list-empty p { margin: 5px 0 0; color: #99a49f; font-size: 8px; line-height: 1.55; }
.list-empty.error > span { color: #a74a38; background: #fae9e5; }

.message-column { display: grid; grid-template-rows: 64px 1fr 35px; background: #f5f7f5; }
.chat-header { padding: 11px 15px; border-bottom: 1px solid var(--line); background: #fff; display: flex; align-items: center; gap: 10px; }
.chat-avatar { width: 38px; height: 38px; flex: 0 0 38px; }
.chat-header > div:nth-child(2) { min-width: 0; flex: 1; }
.chat-header b, .chat-header span { display: block; }
.chat-header b { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.chat-header > div:nth-child(2) span { margin-top: 4px; color: #909d96; font-size: 8px; }
.readonly-badge { flex: 0 0 auto; border-radius: 99px; padding: 5px 7px; color: #5f746a; background: #eef3f0; font-size: 8px !important; }
.message-stream { height: 501px; overflow-y: auto; padding: 18px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #d7dfda transparent; }
.day-divider { margin: 8px 0 14px; display: flex; align-items: center; gap: 8px; }
.day-divider::before, .day-divider::after { content: ""; height: 1px; flex: 1; background: #e5e9e6; }
.day-divider span { color: #a0aaa5; font-size: 7px; }
.message-row { margin-bottom: 15px; display: flex; align-items: flex-start; gap: 8px; }
.message-row.outgoing { flex-direction: row-reverse; }
.message-sender-avatar { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 9px; display: grid; place-items: center; color: #4c675b; background: #e1e9e5; font-size: 7px; font-weight: 650; }
.message-row.outgoing .message-sender-avatar { color: #fff; background: var(--green); }
.message-body { max-width: min(78%, 540px); }
.message-row.outgoing .message-body { display: flex; flex-direction: column; align-items: flex-end; }
.message-sender { display: block; margin: 0 3px 4px; color: #89958f; font-size: 7px; }
.bubble { border: 1px solid #e1e6e3; border-radius: 4px 12px 12px 12px; padding: 9px 11px; color: #39483f; background: #fff; box-shadow: 0 3px 10px rgba(27,42,35,.035); font-size: 10px; line-height: 1.65; overflow-wrap: anywhere; }
.outgoing .bubble { border-color: #1c6e50; border-radius: 12px 4px 12px 12px; color: #fff; background: #1c6e50; }
.message-body time { display: block; margin: 4px 3px 0; color: #a3aca8; font-size: 7px; }
.message-empty { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #829189; text-align: center; }
.message-empty > span { width: 44px; height: 44px; margin-bottom: 9px; border-radius: 15px; display: grid; place-items: center; color: #55806c; background: #e4eee9; font-size: 9px; font-weight: 700; }
.message-empty b { color: #5d6e65; font-size: 10px; }
.message-empty p { margin: 5px 0 0; color: #9aa59f; font-size: 8px; }
.message-empty.error > span { color: #a74a38; background: #fae9e5; }
.message-loading { min-height: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; color: #839188; font-size: 9px; }
.message-loading i { width: 14px; height: 14px; border: 2px solid #d7e1dc; border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.message-foot { border-top: 1px solid var(--line); padding: 0 14px; color: #9aa49f; background: #fff; display: flex; align-items: center; justify-content: space-between; font-size: 7px; }
.message-foot span { display: flex; align-items: center; gap: 5px; }
.message-foot i { width: 5px; height: 5px; border-radius: 50%; background: #44a472; }

.route-column { border-left: 1px solid var(--line); padding: 17px 15px 14px; background: #fff; display: flex; flex-direction: column; }
.route-head { padding-bottom: 13px; border-bottom: 1px solid #edf0ee; }
.route-inspector { flex: 1; }
.route-placeholder { min-height: 300px; display: grid; place-content: center; justify-items: center; text-align: center; }
.route-placeholder span { width: 39px; height: 39px; margin-bottom: 8px; border-radius: 12px; display: grid; place-items: center; color: #557364; background: #eaf0ed; font-size: 10px; }
.route-placeholder p { max-width: 180px; margin: 0; color: #96a19b; font-size: 8px; line-height: 1.6; }
.route-status { margin: 14px 0; border-radius: 10px; padding: 11px; display: flex; align-items: center; gap: 9px; }
.route-status.ok { color: #2f6d50; background: #e9f4ee; }
.route-status.pending { color: #8a642e; background: #faf1df; }
.route-status > i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(255,255,255,.45); }
.route-status b, .route-status small { display: block; }
.route-status b { font-size: 9px; }
.route-status small { margin-top: 3px; opacity: .7; font-size: 7px; }
.route-details { margin: 0; }
.route-details > div { padding: 8px 0; border-bottom: 1px solid #eef1ef; display: grid; grid-template-columns: 60px 1fr; gap: 9px; }
.route-details dt { color: #8b9891; font-size: 7px; }
.route-details dd { margin: 0; overflow: hidden; color: #3d4b44; font-size: 8px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.route-skus { margin-top: 14px; }
.classify-group { margin-top: 13px; }
.classify-group > b { display: block; margin-bottom: 7px; font-size: 9px; }
.classify-group > div { padding: 3px; border-radius: 8px; background: #eef2f0; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; }
.classify-group button { border: 0; border-radius: 6px; padding: 6px; color: #75857d; background: transparent; cursor: pointer; font-size: 8px; }
.classify-group button.active { color: #285f46; background: #fff; box-shadow: 0 2px 8px rgba(31,52,42,.07); font-weight: 650; }
.route-skus > div:first-child { display: flex; align-items: center; justify-content: space-between; }
.route-skus b { font-size: 9px; }
.route-skus > div:first-child span { color: #8e9a94; font-size: 7px; }
.sku-pills { max-height: 100px; margin-top: 8px; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 5px; }
.sku-pills span { border-radius: 6px; padding: 4px 6px; color: #35624e; background: #eaf2ee; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 7px; }
.route-skus p { margin: 7px 0 0; color: #93a099; font-size: 8px; line-height: 1.6; }
.route-id { margin-top: 15px; border-radius: 9px; padding: 9px; background: #f5f7f6; }
.route-id span, .route-id code { display: block; }
.route-id span { margin-bottom: 5px; color: #8e9a94; font-size: 7px; }
.route-id code { overflow: hidden; color: #617068; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.route-action { width: 100%; margin-top: 13px; display: flex; justify-content: space-between; align-items: center; }

.compact-panel { align-self: start; }
.note { align-self: start; border-color: #e9dfc8; background: #fffbf2; display: flex; gap: 12px; }
.note-icon { width: 27px; height: 27px; flex: 0 0 27px; border-radius: 9px; display: grid; place-items: center; color: #8a682e; background: #f4e8cc; font-size: 10px; font-weight: 750; }
.note b { font-size: 11px; }
.note p { margin: 5px 0 0; color: #7d715c; font-size: 9px; line-height: 1.7; }
.table-panel { padding: 0; overflow: hidden; }
.table-panel .panel-title { margin: 0; padding: 19px 20px 15px; }
.table-wrap { overflow: auto; }
.data-table { max-height: 560px; }
table { width: 100%; border-collapse: collapse; font-size: 9px; }
th { position: sticky; top: 0; z-index: 1; color: #829088; background: #f7f9f7; text-align: left; font-size: 7px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
th, td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
td { color: #46564e; line-height: 1.5; }
td strong { color: var(--ink); }
.table-empty { padding: 32px; color: #98a39d; text-align: center; }
.tag { display: inline-block; border-radius: 99px; padding: 4px 7px; color: #426455; background: #edf3ef; font-size: 7px; font-weight: 650; white-space: nowrap; }
.tag.pending { color: #7d5a22; background: #fbefcf; }
.tag.done { color: #256844; background: #e3f3e9; }
.tag.warn { color: #8a3c2e; background: #fae8e4; }
.reply-box { min-width: 185px; display: flex; gap: 5px; }
.reply-box input { margin: 0; padding: 7px; font-size: 8px; }
.reply-box button { width: auto; padding: 6px 8px; font-size: 8px; }
.sync-panel { margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }
.sync-panel > div { flex: 1; }
.sync-panel p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }

#toast { position: fixed; right: 22px; bottom: 22px; z-index: 100; max-width: min(360px, calc(100vw - 44px)); border-radius: 10px; padding: 11px 14px; color: #fff; background: #173e30; box-shadow: 0 12px 30px rgba(16, 49, 37, .22); opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s; font-size: 10px; }
#toast.show { opacity: 1; transform: none; }

.modal-backdrop { position: fixed; inset: 0; z-index: 200; padding: 20px; display: grid; place-items: center; background: rgba(12, 25, 20, .52); backdrop-filter: blur(5px); }
.modal-card { width: min(420px, 100%); border: 1px solid rgba(255,255,255,.45); border-radius: 16px; padding: 24px; background: #fff; box-shadow: 0 24px 70px rgba(8, 25, 18, .28); }
.modal-kicker { color: #658477; font-size: 8px; font-weight: 750; letter-spacing: .18em; }
.modal-card h2 { margin-top: 6px; font-size: 19px; }
.modal-card > p { margin: 7px 0 18px; color: #7d8b84; font-size: 10px; line-height: 1.65; }
.modal-card label { margin-bottom: 19px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

@media (max-width: 1220px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .messenger-grid { grid-template-columns: 265px minmax(390px, 1fr); }
  .route-column { grid-column: 1 / -1; border-top: 1px solid var(--line); border-left: 0; display: grid; grid-template-columns: 190px 1fr auto; gap: 15px; align-items: start; }
  .route-head { border: 0; }
  .route-inspector { display: contents; }
  .route-placeholder { min-height: 100px; }
  .route-action { width: auto; align-self: center; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 13px 14px; }
  .brand { padding: 0 2px 12px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .nav-label, .system-card, .version { display: none; }
  .primary-nav { flex-direction: row; overflow-x: auto; }
  .nav { min-width: max-content; padding: 7px 9px; }
  .nav > span { width: 25px; height: 25px; flex-basis: 25px; }
  .nav-live { display: none; }
  .sidebar-bottom { position: absolute; right: 12px; top: 15px; }
  .nav.utility { width: auto; margin: 0; }
  .nav.utility b { display: none; }
  .main-content { padding: 20px 16px 45px; }
  .grid.two, .grid.split { grid-template-columns: 1fr; }
  .wechat-summary { align-items: flex-start; flex-direction: column; gap: 12px; }
  .messenger-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .search-box { flex: 1; width: auto; }
}

@media (max-width: 720px) {
  .topbar { margin-bottom: 17px; }
  .api-state { display: none; }
  .welcome-card { align-items: flex-start; flex-direction: column; }
  .welcome-card h2 { font-size: 18px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .messenger-grid { display: block; }
  .conversation-column { border-right: 0; border-bottom: 1px solid var(--line); }
  .conversation-list { height: 310px; }
  .message-stream { height: 430px; }
  .route-column { display: flex; border-top: 1px solid var(--line); }
  .route-inspector { display: block; }
  .route-action { width: 100%; }
  .wechat-stats { width: 100%; overflow-x: auto; }
  .toolbar-actions { flex-wrap: wrap; }
  .search-box { flex-basis: 100%; }
  .flow-row { flex-wrap: wrap; }
  .flow-row > b { display: none; }
  .flow-row > span { flex-basis: 30%; }
  .sync-panel { align-items: stretch; flex-direction: column; }
  .primary.compact { width: 100%; }
}

@media (max-width: 470px) {
  .metrics { grid-template-columns: 1fr; }
  .topbar-right { gap: 7px; }
  .sidebar-bottom { display: none; }
  .wechat-stats > span { min-width: 77px; }
  .toolbar-actions select, .icon-button { flex: 1; }
  .flow-row > span { flex-basis: 45%; }
}
