:root {
  --navy: #17345f;
  --navy-2: #25508f;
  --navy-3: #2f62ac;
  --accent: #1890ff;
  --green: #12a150;
  --green-soft: #e8f8ef;
  --orange: #f97316;
  --orange-soft: #fff3e8;
  --red: #e63c3c;
  --red-soft: #fdecec;
  --gray: #77879c;
  --gray-soft: #f1f4f8;
  --purple: #8b5cf6;
  --purple-soft: #f3edff;
  --blue-soft: #eef6ff;
  --bg: #eef2f7;
  --panel: #ffffff;
  --line: #dfe5ee;
  --text: #26313d;
  --text-2: #64748b;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(20, 40, 80, 0.05), 0 8px 24px rgba(20, 40, 80, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: #dce5f0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select { font-family: inherit; color: inherit; }
::selection { background: rgba(24, 144, 255, 0.2); }
svg { display: block; }

/* ---------- stage shell ---------- */
.stage {
  position: relative;
  width: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.stage.demo-running .demo-controls { opacity: 1; transform: none; }
.stage.demo-running .platform-progress { opacity: 1; }
.stage.demo-running .demo-cursor { pointer-events: none; }

.platform-bar {
  height: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  color: #fff;
  background: linear-gradient(90deg, #16345f 0%, #204a87 56%, #2c5da3 100%);
  box-shadow: 0 2px 10px rgba(16, 36, 72, 0.18);
  position: relative;
  z-index: 30;
}
.platform-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #fff;
  color: #1e4a8f;
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}
.platform-brand > b { font-size: 18px; font-weight: 700; white-space: nowrap; }
.brand-divider { width: 1px; height: 20px; background: rgba(255, 255, 255, 0.28); }
.product-name { font-size: 13px; color: #d6e7ff; white-space: nowrap; }
.platform-progress {
  margin: 0 auto;
  min-width: 260px;
  width: min(360px, 32vw);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #d6e5fb;
  opacity: 0.55;
  transition: opacity 0.4s;
}
.progress-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.progress-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #4ade80, #a3e635);
  transition: width 0.18s linear;
}
.platform-user { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.platform-bell {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #d8e6fb;
  position: relative;
}
.platform-bell:hover { background: rgba(255, 255, 255, 0.12); }
.platform-bell svg { width: 18px; height: 18px; }
.notify-dot {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff6b6b;
  border: 1px solid #fff;
  font-style: normal;
  font-size: 8px;
  display: grid;
  place-items: center;
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f2b84b;
  color: #4b2e0a;
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}
.user-name { font-size: 13px; color: #e8f2ff; white-space: nowrap; }

/* ---------- workspace split ---------- */
.workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 12px;
  padding: 12px;
}

.chat-panel,
.preview-panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid #d8e0eb;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-panel { flex: 0 0 40%; }
.preview-panel { flex: 1 1 60%; }

/* ---------- chat ---------- */
.chat-header {
  height: 64px;
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafd;
}
.assistant { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lobster-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #17b45e, #0f8d4b);
  color: #fff;
  box-shadow: 0 4px 10px rgba(18, 161, 80, 0.22);
}
.lobster-avatar svg { width: 25px; height: 25px; }
.assistant b { display: block; font-size: 14px; white-space: nowrap; }
.online {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--green);
  margin-top: 2px;
}
.online i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
}
.chat-status {
  font-size: 12px;
  color: var(--text-2);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}
.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 14px;
  background: #f3f6fb;
}
.chat-system {
  align-self: center;
  font-size: 12px;
  color: #8090a5;
  background: #edf1f7;
  border-radius: 999px;
  padding: 5px 12px;
  margin: 2px 0;
}
.chat-row { display: flex; align-items: flex-start; gap: 9px; max-width: 92%; }
.user-row { align-self: flex-end; justify-content: flex-end; }
.robot-row { align-self: flex-start; }
.chat-avatar { width: 30px; height: 30px; flex-basis: 30px; }
.chat-avatar svg { width: 18px; height: 18px; }
.bubble {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-line;
  max-width: calc(100% - 10px);
  min-width: 34px;
  word-break: break-word;
  animation: bubbleIn 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.user-bubble {
  background: linear-gradient(145deg, #1d7bdc, #1b62be);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(20, 90, 180, 0.18);
}
.robot-bubble {
  background: #fff;
  border: 1px solid #dee5ef;
  color: #202a37;
  border-bottom-left-radius: 4px;
  box-shadow: 0 3px 10px rgba(20, 40, 70, 0.07);
}
.user-row.sent .user-bubble { animation: bubbleSent 0.24s ease-out; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(6px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes bubbleSent { from { transform: scale(1.02); } to { transform: none; } }
.typing-bubble { display: flex; align-items: center; gap: 10px; min-height: 42px; }
.typing-bubble b { font-size: 12px; color: var(--text-2); font-weight: 500; }
.typing-dots { display: flex; gap: 4px; }
.typing-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: dotBounce 0.9s infinite ease-in-out;
}
.typing-dots i:nth-child(2) { animation-delay: 0.14s; }
.typing-dots i:nth-child(3) { animation-delay: 0.28s; }
@keyframes dotBounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.6; } 30% { transform: translateY(-4px); opacity: 1; } }

.composer {
  flex: 0 0 auto;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: #f8fafd;
}
.composer-inner {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid #d7dfea;
  border-radius: 10px;
  padding: 6px 6px 6px 14px;
  box-shadow: 0 2px 6px rgba(20, 40, 70, 0.05);
}
.composer-inner input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  height: 34px;
  font-size: 14px;
  background: transparent;
}
.send-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #2084f0, #1766c9);
  color: #fff;
  transition: transform 0.15s, box-shadow 0.15s;
}
.send-btn svg { width: 18px; height: 18px; }
.send-btn:hover, .send-btn.is-pressed { transform: scale(0.96); box-shadow: 0 0 0 4px rgba(24, 144, 255, 0.18); }

/* ---------- preview ---------- */
.preview-header {
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: #e9eef6;
  border-bottom: 1px solid #d3dce8;
}
.browser-dots { display: flex; gap: 6px; }
.browser-dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.browser-dots i:nth-child(2) { background: #febc2e; }
.browser-dots i:nth-child(3) { background: #28c840; }
.address-box {
  flex: 1;
  max-width: 760px;
  margin: 0 auto;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid #d2dae6;
  border-radius: 7px;
  color: #7a8aa0;
  box-shadow: inset 0 1px 2px rgba(20, 32, 64, 0.05);
}
.address-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  font-size: 12px;
  color: #46566d;
  background: transparent;
}
.module-pill {
  height: 27px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 12px;
  color: #1d5b3c;
  background: var(--green-soft);
  border: 1px solid #cdeeda;
  border-radius: 999px;
  padding: 0 11px;
}
.preview-window {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #edf1f6;
}
.preview-frame {
  position: absolute;
  inset: 0;
  display: none;
  animation: frameIn 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.preview-frame.is-active { display: block; }
@keyframes frameIn { from { opacity: 0; transform: translateX(16px) scale(0.995); } to { opacity: 1; transform: none; } }

/* ---------- boot frame ---------- */
.app-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f5f7fb;
  overflow: hidden;
}
.app-topbar {
  height: 52px;
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  color: #fff;
  background: linear-gradient(90deg, #16345f, #2a5aa0);
}
.app-brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.warehouse-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.14);
}
.warehouse-mark svg { width: 17px; height: 17px; }
.app-brand b { font-size: 15px; font-weight: 700; white-space: nowrap; }
.soft-tag {
  font-size: 11px;
  color: #cfe0ff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}
.app-top-right { display: flex; align-items: center; gap: 10px; }
.ghost-line { display: inline-block; width: 92px; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.24); }
.app-top-right .avatar { width: 26px; height: 26px; font-size: 11px; }
.datetime { font-size: 12px; color: #cde0ff; white-space: nowrap; }
.top-icon-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #d5e5ff;
  position: relative;
}
.top-icon-btn svg { width: 17px; height: 17px; }
.profile-pill { display: flex; align-items: center; gap: 7px; }
.profile-pill b { font-size: 12px; font-weight: 600; }

.app-body { flex: 1; min-height: 0; display: flex; }
.app-sidebar {
  width: 180px;
  flex: 0 0 180px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #e2e7ef;
}
.side-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 40px;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  color: #51617a;
  text-align: left;
  transition: background 0.14s, color 0.14s;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 17px; }
.nav-item:hover { background: #f3f6fb; color: #1b3f75; }
.nav-item.is-active { background: var(--blue-soft); color: #1765c7; font-weight: 600; }
.side-foot {
  padding: 13px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
}
.nav-skeleton {
  height: 38px;
  margin-bottom: 5px;
  border-radius: 8px;
  background: linear-gradient(90deg, #edf1f7 25%, #f7f9fc 45%, #edf1f7 65%);
  background-size: 220% 100%;
  animation: shimmer 1.4s infinite;
}
.side-foot-skeleton { height: 12px; margin: 20px 16px 0; border-radius: 6px; background: #edf1f7; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

.app-content {
  flex: 1;
  min-width: 0;
  overflow: auto;
  padding: 16px;
  background: #f4f6f9;
}
.build-placeholder {
  height: 100%;
  min-height: 320px;
  display: grid;
  place-items: center;
}
.build-box {
  width: min(360px, 90%);
  text-align: center;
  color: var(--text-2);
  border: 1px dashed #c7d2e2;
  border-radius: 12px;
  background: #fff;
  padding: 34px 24px;
}
.build-box svg { width: 46px; height: 46px; margin: 0 auto 14px; color: #7d9bc4; }
.build-box b { display: block; font-size: 16px; color: var(--text); margin-bottom: 6px; }
.build-box span { font-size: 13px; }

/* ---------- login frame ---------- */
.login-shell {
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e8f2ff 0%, #f2f8ff 45%, #e9f5ff 100%);
}
.login-card {
  width: min(380px, 88%);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(33, 82, 148, 0.16);
  padding: 34px 30px;
  text-align: center;
}
.login-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(145deg, #2888ef, #1765c7);
  box-shadow: 0 10px 24px rgba(24, 120, 220, 0.24);
}
.login-icon svg { width: 34px; height: 34px; }
.login-card h1 { font-size: 23px; color: #1b3a65; margin-bottom: 6px; }
.login-card > p { font-size: 13px; color: var(--text-2); margin-bottom: 24px; }
.oauth-btn {
  width: 100%;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 9px;
  background: linear-gradient(145deg, #2084f0, #1766c9);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 7px 18px rgba(23, 110, 205, 0.24);
}
.oauth-btn svg { width: 16px; height: 16px; }
.oauth-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #fff;
  color: #1e5fb5;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}
.login-foot { display: block; margin-top: 15px; font-size: 12px; color: #8193aa; }

/* ---------- app pages ---------- */
.app-page { display: none; animation: pageIn 0.46s cubic-bezier(0.22, 1, 0.36, 1); }
.app-page.is-active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.flash-target.module-glow { animation: moduleFlash 1.8s ease-out; }
@keyframes moduleFlash {
  0% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.4); opacity: 1; }
  70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0.12); opacity: 1; }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.page-head h2 { font-size: 19px; color: #1c314d; }
.page-head p { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.segmented {
  display: inline-flex;
  background: #e8edf4;
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}
.segmented button {
  height: 30px;
  padding: 0 13px;
  border-radius: 6px;
  font-size: 12px;
  color: #5f7088;
}
.segmented button.is-active { background: #fff; color: #1765c7; font-weight: 600; box-shadow: 0 1px 3px rgba(20, 44, 80, 0.12); }
.wh-select { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.wh-select select {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 8px;
  font-size: 12px;
  background: #fff;
}
.search-box { display: flex; align-items: center; gap: 8px; }
.search-box input {
  width: min(290px, 24vw);
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  font-size: 12px;
  background: #fff;
}
.primary-btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(145deg, #2084f0, #1766c9);
  color: #fff;
  box-shadow: 0 5px 14px rgba(23, 110, 205, 0.2);
}
.primary-btn:disabled { opacity: 0.55; box-shadow: none; cursor: default; }
.primary-btn.small { height: 34px; padding: 0 13px; font-size: 12px; }
.soft-meta { font-size: 12px; color: var(--text-2); }

.scan-wrap {
  background: #fff;
  border: 1px solid #d5deea;
  border-radius: 10px;
  padding: 7px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(20, 60, 120, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.scan-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 13px;
  border: 1px dashed #cbd6e5;
  border-radius: 8px;
}
.scan-icon { color: #7590b5; display: grid; place-items: center; }
.scan-icon svg { width: 20px; height: 20px; }
.scan-inner input { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 14px; background: transparent; }
.scan-wrap.scan-ok { animation: scanFlashOk 0.7s ease-out; }
.scan-wrap.scan-bad { animation: scanFlashBad 0.7s ease-out; }
@keyframes scanFlashOk { 0%, 45% { border-color: #16a34a; box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.22); } 100% { border-color: #d5deea; } }
@keyframes scanFlashBad { 0%, 45% { border-color: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2); } 100% { border-color: #d5deea; } }

.panel {
  background: #fff;
  border: 1px solid #e0e6ef;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(20, 40, 70, 0.04);
}
.panel-title {
  height: 42px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  color: #29394f;
  border-bottom: 1px solid #edf1f6;
  background: #fbfcfe;
}
.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 12px;
  align-items: stretch;
}
.stock-grid { grid-template-columns: minmax(0, 1fr) 280px; }
.table-scroll { height: 310px; overflow: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 36px;
  padding: 0 10px;
  background: #f7f9fc;
  border-bottom: 1px solid #e5eaf1;
  font-size: 11px;
  font-weight: 600;
  color: #6f8096;
  text-align: left;
  white-space: nowrap;
}
.table td {
  height: 40px;
  padding: 0 10px;
  border-bottom: 1px solid #eff2f7;
  font-size: 12px;
  color: #344258;
  white-space: nowrap;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f8fbff; }
.nomw { white-space: normal; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: Consolas, "SF Mono", monospace; font-size: 11px; color: #53657d; }
.money { color: #e0763a; }
.stock-num { font-size: 13px; color: #165d9f; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.tag-ok { color: #13753a; background: var(--green-soft); }
.tag-warning { color: #b45309; background: var(--orange-soft); }
.tag-danger { color: #c62828; background: var(--red-soft); }
.tag-gray { color: #5b6b7d; background: var(--gray-soft); }
.tag-blue { color: #1765c7; background: var(--blue-soft); }
.tag-purple { color: #6d28d9; background: var(--purple-soft); }
.empty-state {
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-2);
  font-size: 13px;
}
.empty-state svg { width: 44px; height: 44px; color: #a9bad1; }
.empty-state[hidden] { display: none; }
.action-row {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  border-top: 1px solid #edf1f6;
}

.summary-panel { display: flex; flex-direction: column; }
.summari-meta { font-size: 12px; }
.summary-main { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 22px 20px; }
.summary-item span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.summary-item b { font-size: 26px; color: #1c314d; font-weight: 800; }
.summary-item.main strong { display: block; font-size: 38px; color: #1765c7; font-weight: 800; }
.summary-item .money { color: #e0763a; font-size: 24px; }
.summary-foot { padding: 13px 16px; border-top: 1px solid #edf1f6; color: #7f8fa4; font-size: 11px; }

.stock-distrib { display: flex; flex-direction: column; }
.distrib-content { flex: 1; overflow: auto; padding: 8px 12px 14px; text-align: left; }
.distrib-empty { padding: 36px 12px; text-align: center; color: var(--text-2); font-size: 12px; }
.distrib-head { padding: 10px 2px 8px; border-bottom: 1px solid #edf1f6; margin-bottom: 8px; }
.distrib-head b { display: block; font-size: 13px; color: #26313d; }
.distrib-head span { font-size: 11px; color: var(--text-2); }
.distrib-row { padding: 9px 2px; border-bottom: 1px solid #f0f3f8; }
.distrib-row > div { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.distrib-row b { font-size: 13px; }
.distrib-row .stock-num { display: block; font-size: 15px; margin: 3px 0; }
.distrib-row small { color: #8493a8; font-size: 11px; }

.rule-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: #fff8e8;
  border: 1px solid #f2e3bd;
  color: #8a6524;
  font-size: 12px;
}
.rule-line svg { width: 16px; height: 16px; flex: 0 0 16px; }
.warn-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.warn-card {
  height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
.warn-card span { font-size: 12px; color: var(--text-2); }
.warn-card b { font-size: 28px; line-height: 1.15; margin: 2px 0; }
.warn-card em { font-size: 11px; font-style: normal; color: var(--text-2); }
.warn-card.danger { border-color: #f6c5c5; background: linear-gradient(145deg, #fff, #fff3f3); }
.warn-card.danger b { color: var(--red); }
.warn-card.warning { border-color: #ffd2a1; background: linear-gradient(145deg, #fff, #fff7ef); }
.warn-card.warning b { color: var(--orange); }
.warn-card.stale { border-color: #d9dfe8; background: linear-gradient(145deg, #fff, #f7f9fc); }
.warn-card.stale b { color: #64748b; }
.warn-panel { min-height: 260px; }
.warn-tools {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid #edf1f6;
}
.pending-note { font-size: 12px; color: var(--text-2); }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.kpi-card {
  height: 96px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 15px 16px;
}
.kpi-card span { display: block; font-size: 12px; color: var(--text-2); }
.kpi-card b { display: block; font-size: 25px; color: #1765c7; margin: 5px 0 2px; }
.kpi-card i { font-style: normal; font-size: 11px; color: #8b9aae; }
.kpi-card.danger { border-color: #f6c5c5; background: linear-gradient(145deg, #fff, #fff3f3); }
.kpi-card.danger b { color: var(--red); }
.stats-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 0.8fr) minmax(240px, 0.9fr);
  gap: 12px;
}
.chart-panel { min-height: 235px; display: flex; flex-direction: column; }
.chart-panel:first-child { grid-row: span 2; min-height: 334px; }
.chart-legend { display: flex; gap: 14px; padding: 9px 14px 0; font-size: 11px; color: var(--text-2); }
.legend-in::before, .legend-out::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 3px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: middle;
  background: #1890ff;
}
.legend-out::before { background: #f97316; }
.chart-panel svg { width: 100%; height: 190px; display: block; }
.chart-panel:first-child svg { flex: 1; min-height: 190px; }
.donut-wrap { position: relative; width: 170px; margin: 4px auto 0; }
.donut-wrap svg { height: 170px; width: 170px; }
.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
}
.donut-center b { display: block; font-size: 22px; color: #1c314d; }
.donut-center span { font-size: 11px; color: var(--text-2); }
.donut-legend { display: flex; justify-content: center; gap: 20px; padding: 5px 0 12px; font-size: 12px; color: #50617a; }
.dot-in, .dot-out { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: #1890ff; }
.dot-out { background: #f97316; }
.rank-list { padding: 10px 14px 12px; }
.rank-row { display: grid; grid-template-columns: 24px 1fr 1.2fr 48px; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #f0f3f8; }
.rank-row:last-child { border-bottom: 0; }
.rank-no { font-size: 11px; color: #7e8fa5; text-align: center; }
.rank-name { font-size: 12px; color: #344258; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar { height: 8px; border-radius: 999px; background: #edf1f6; overflow: hidden; }
.rank-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #1890ff, #4db8ff); }
.rank-qty { font-size: 12px; color: #53657d; text-align: right; }

/* ---------- subtitle, cursor, controls ---------- */
.subtitle-box {
  position: fixed;
  left: 50%;
  bottom: 80px;
  z-index: 210;
  max-width: min(920px, 86vw);
  padding: 12px 24px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-size: 24px;
  line-height: 1.4;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  pointer-events: none;
  transition: opacity 0.32s ease, transform 0.32s ease;
}
.subtitle-box.show { opacity: 1; transform: translate(-50%, 0); }

.demo-cursor {
  position: fixed;
  left: 0;
  top: 0;
  width: 24px;
  height: 32px;
  z-index: 320;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(12, 24, 40, 0.28));
  transition: left 0.32s cubic-bezier(0.22, 1, 0.36, 1), top 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.demo-cursor svg { width: 24px; height: 32px; }
.demo-cursor[hidden] { display: none; }

.demo-controls {
  position: fixed;
  top: 68px;
  right: 22px;
  z-index: 230;
  display: flex;
  gap: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #dce4ef;
  border-radius: 11px;
  box-shadow: 0 8px 24px rgba(20, 40, 80, 0.14);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s, transform 0.3s;
}
.demo-controls[hidden] { display: none; }
.demo-controls button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #53657d;
  cursor: pointer !important;
  transition: background 0.14s, color 0.14s;
}
.demo-controls button svg { width: 16px; height: 16px; }
.demo-controls button:hover { background: #edf3fb; color: #1765c7; }
.demo-controls button.is-paused,
.demo-controls button.is-muted { background: var(--blue-soft); color: #1765c7; }

/* ---------- report ---------- */
.report-overlay {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: grid;
  place-items: center;
  background: rgba(13, 28, 50, 0.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s, visibility 0.4s;
}
.report-overlay.is-open { opacity: 1; visibility: visible; pointer-events: none; }
.report-card {
  width: min(560px, 90vw);
  background: #fff;
  border-radius: 12px;
  padding: 28px 30px;
  box-shadow: 0 24px 70px rgba(8, 20, 40, 0.28);
  transform: translateY(14px) scale(0.98);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: auto;
}
.report-overlay.is-open .report-card { transform: none; }
.report-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.report-mark {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #17b45e, #0f8d4b);
}
.report-mark svg { width: 28px; height: 28px; }
.report-head h3 { font-size: 22px; color: #1c314d; }
.report-head p { font-size: 12px; color: var(--text-2); }
.report-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.report-item {
  height: 92px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafcff;
  padding: 15px 14px;
}
.report-item.wide { grid-column: span 2; }
.report-item span { display: block; font-size: 12px; color: var(--text-2); }
.report-item b { display: block; font-size: 23px; color: #1765c7; margin-top: 10px; }
.report-item .report-url { font-size: 14px; word-break: break-all; }
.report-closing {
  margin-top: 18px;
  padding: 13px 16px;
  border-radius: 9px;
  background: var(--green-soft);
  color: #176b3c;
  font-size: 14px;
  text-align: center;
}

/* ---------- start overlay ---------- */
.start-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  color: #fff;
  background:
    linear-gradient(145deg, #10294c 0%, #183e73 52%, #15335e 100%);
  transition: opacity 0.4s, visibility 0.4s;
}
.start-overlay.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.start-logo {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: linear-gradient(145deg, #22c878, #0c9350);
  box-shadow: 0 16px 40px rgba(16, 170, 92, 0.3);
}
.start-logo svg { width: 52px; height: 52px; }
.start-overlay h1 { font-size: 38px; font-weight: 800; }
.start-sub { font-size: 16px; color: #cfe0ff; }
.start-btn {
  margin-top: 8px;
  height: 50px;
  padding: 0 30px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: 10px;
  background: linear-gradient(145deg, #23aef0, #1572da);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 14px 30px rgba(16, 90, 190, 0.34);
}
.start-btn svg { width: 17px; height: 17px; }
.start-hint { font-size: 12px; color: #91b8e8; }

/* ---------- responsive guards ---------- */
@media (max-width: 1280px) {
  .workspace { padding: 10px; gap: 10px; }
  .chat-panel { flex-basis: 42%; }
  .preview-panel { flex-basis: 58%; }
  .work-grid { grid-template-columns: minmax(0, 1fr) 205px; }
  .stock-grid { grid-template-columns: minmax(0, 1fr) 250px; }
  .stats-grid { grid-template-columns: minmax(0, 1fr) minmax(210px, 0.8fr) minmax(210px, 0.9fr); }
  .kpi-row { grid-template-columns: repeat(5, minmax(120px, 1fr)); }
}
@media (max-width: 1050px) {
  .datetime, .soft-tag { display: none; }
  .subtitle-box { font-size: 20px; max-width: 90vw; }
}
@media (max-height: 800px) {
  .table-scroll { height: 250px; }
  .stats-grid { grid-template-columns: minmax(0, 1fr) minmax(200px, 0.8fr) minmax(200px, 0.9fr); }
  .kpi-card { height: 86px; padding: 12px 14px; }
  .kpi-card b { font-size: 22px; }
}
@media (max-width: 900px) {
  .workspace { flex-direction: column; }
  .chat-panel, .preview-panel { flex: 1 1 auto; }
  .chat-panel { min-height: 36%; }
  .preview-panel { min-height: 58%; }
  .work-grid, .stock-grid, .stats-grid { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}