/* ==========================================================================
   GBase Connect — 日本BSL Demo
   设计令牌与组件样式。取自 Claude Design 原型（design/ 下留存原件），
   把原型里的 inline style 归纳为可复用的类。
   ========================================================================== */

:root {
  /* 墨 / 纸 —— 文字与底色 */
  --ink:        #1A2333;
  --muted:      #5B6B80;
  --muted-2:    #9AA5B5;
  --paper:      #F5F7FA;
  --white:      #fff;

  /* 线 */
  --line:       #E3E8EF;
  --line-soft:  #F0F2F5;
  --line-mid:   #DCE3EC;
  --line-hard:  #D2DAE4;
  --line-dash:  #C5CDD8;

  /* 蓝 —— 主色 */
  --navy:       #1B3A8C;
  --blue:       #2F6CC0;
  --blue-bg:    #EEF4FC;
  --blue-bg-2:  #E3EDFA;
  --chip-bg:    #EEF1F5;

  /* 绿 —— 完成 / 正常 */
  --green:      #3F9A48;
  --green-ink:  #2C6E33;
  --green-bg:   #E4F3E6;

  /* 金 —— 推定 / 待办 */
  --gold:       #F4B942;
  --gold-mid:   #C98A12;
  --gold-ink:   #7A5200;
  --gold-bg:    #FBF3DF;
  --gold-bg-2:  #FFF9EB;

  /* 红 —— 停止 / 危险 */
  --red:        #C62828;
  --red-bg:     #FDECEA;

  /* 灰 */
  --grey-bg:    #F1F3F6;
  --slate:      #8A94A6;

  /* 尺寸 */
  --nav-w:      216px;
  --top-h:      56px;
  --status-h:   28px;
  --radius:     8px;
  --radius-sm:  6px;

  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans-ja: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  --sans-zh: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: #DDE2EA;
  color: var(--ink);
  font-family: var(--sans-zh);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[lang="ja"]     { font-family: var(--sans-ja); }
[lang="zh-CN"]  { font-family: var(--sans-zh); }
[lang] button, [lang] input, [lang] select, [lang] textarea { font-family: inherit; }

a { color: var(--blue); text-decoration: none; cursor: pointer; }
a:hover { color: var(--navy); text-decoration: underline; }

:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }

@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .35 } }
@keyframes spin  { to { transform: rotate(360deg) } }
@keyframes rise  { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
@keyframes ping  { 0% { transform: scale(1); opacity: .6 } 100% { transform: scale(2.4); opacity: 0 } }
@keyframes sweep { from { transform: rotate(0) } to { transform: rotate(360deg) } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   骨架
   ========================================================================== */

.app {
  width: 1440px;
  height: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  grid-template-rows: var(--top-h) 1fr var(--status-h);
  background: var(--paper);
  overflow: hidden;
  font-size: 13px;
  line-height: 1.5;
}

/* 投影用 1440×900 是基准；窗口更大时铺满，更小时整体等比缩放。 */
@media (min-width: 1441px) { .app { width: 100%; height: 100vh; } }

.sidebar {
  grid-row: 1 / 4;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 14px 0 12px;
}

.topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.main { overflow: auto; padding: 22px 24px 24px; position: relative; }

.statusbar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 24px;
  background: #fff;
  border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted);
}

/* ==========================================================================
   侧边导航
   ========================================================================== */

.tenant {
  padding: 6px 16px 16px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,.14);
}
.tenant__mark {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--green) 0 50%, var(--blue) 50% 100%);
  display: grid; place-items: center;
  font: 700 10px var(--mono); color: #fff;
}
.tenant__name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.tenant__sub  { font-size: 10px; opacity: .7; }

.nav { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; }
.nav__hdr {
  font: 500 10px var(--mono); letter-spacing: .08em;
  opacity: .55; padding: 12px 10px 4px;
  min-height: 8px;
}
.nav__item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: var(--radius-sm);
  cursor: pointer; color: #fff; font-size: 13px; font-weight: 400;
  background: transparent; border: 0; width: 100%; text-align: left;
  font-family: inherit; line-height: 1.5;
}
.nav__item:hover { background: rgba(255,255,255,.12); }
.nav__item.is-active { background: rgba(255,255,255,.16); font-weight: 700; }
.nav__item.is-soon { opacity: .7; }
.nav__item.is-sub { padding-left: 20px; }
.nav__icon { width: 16px; height: 16px; display: inline-flex; flex: none; opacity: .9; }
.nav__label { flex: 1; }
.nav__badge { background: var(--gold); color: var(--ink); font-size: 10px; font-weight: 700; padding: 0 6px; border-radius: 9px; }
.nav__soon { border: 1px dashed rgba(255,255,255,.5); font-size: 9px; padding: 0 5px; border-radius: 3px; opacity: .8; }

.sidebar__spacer { flex: 1; }

.whoami { padding: 0 16px; font-size: 11px; opacity: .85; display: flex; align-items: center; gap: 8px; }
.whoami__avatar {
  width: 24px; height: 24px; border-radius: 50%; background: #5A8FC0; flex: none;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff;
}
.whoami__dept { opacity: .7; }

/* ==========================================================================
   顶栏
   ========================================================================== */

.topbar__title { font-size: 15px; font-weight: 700; }
.topbar__sub   { font-size: 12px; color: var(--muted); }
.topbar__spacer{ flex: 1; }
.topbar__now   { font-size: 12px; color: var(--muted); }
.topbar__rule  { width: 1px; height: 20px; background: var(--line); }

.notes-flag {
  font-size: 11px; background: var(--gold-bg-2); color: var(--gold-ink);
  border: 1px solid var(--gold); border-radius: 4px; padding: 2px 8px;
}

.langswitch { display: flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; font-size: 12px; }
.langswitch button {
  padding: 4px 10px; cursor: pointer; font-weight: 500; font-size: 12px;
  background: #fff; color: var(--muted); border: 0; font-family: inherit;
}
.langswitch button + button { border-left: 1px solid var(--line); }
.langswitch button.is-on { background: var(--navy); color: #fff; }

.bell {
  width: 28px; height: 28px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--muted); position: relative;
  background: #fff; cursor: default;
}
.bell__dot {
  position: absolute; top: -4px; right: -4px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--red); color: #fff; font-size: 9px; display: grid; place-items: center; font-weight: 700;
}

.iconbtn {
  height: 28px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: #fff; color: var(--muted); cursor: pointer; font-size: 12px; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.iconbtn:hover { border-color: var(--navy); color: var(--navy); }
.iconbtn.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ==========================================================================
   通用组件
   ========================================================================== */

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.card--flush { overflow: hidden; }
.card--pad { padding: 16px 18px; }
.card--muted { background: var(--grey-bg); }

.card__head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
}
.card__title { font-weight: 700; }
.spacer { flex: 1; }

.btn {
  height: 36px; padding: 0 16px; min-width: 96px;
  font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); cursor: pointer; font-family: inherit;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.btn:hover { border-color: var(--muted-2); }
.btn--primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn--primary:hover { background: #16306f; border-color: #16306f; }
.btn--ghost   { color: var(--navy); border-color: var(--navy); }
.btn--ghost:hover { background: var(--blue-bg); }
.btn--quiet   { color: var(--muted); }
.btn--danger  { color: var(--red); border-color: var(--red); }
.btn--danger:hover { background: var(--red-bg); }
.btn[disabled] { background: var(--muted-2); border-color: var(--muted-2); color: #fff; cursor: default; }
.btn[disabled]:hover { background: var(--muted-2); }

.chip {
  font-size: 10px; padding: 1px 6px; border-radius: 3px;
  background: var(--chip-bg); color: var(--navy); white-space: nowrap;
}
.chip--new    { font-weight: 700; background: var(--blue); color: #fff; }
.chip--est    { font-weight: 700; background: var(--gold-bg); color: var(--gold-ink); border: 1px solid var(--gold); flex: none; }
.chip--ok     { background: var(--green-bg); color: var(--green-ink); }
.chip--outline{ border: 1px solid var(--line); background: #fff; color: var(--muted); }

.pill {
  padding: 4px 10px; border-radius: 12px; font-size: 12px; cursor: pointer;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  font-family: inherit; line-height: 1.5;
}
.pill.is-on { background: var(--navy); color: #fff; border-color: var(--navy); }
.pill--static { cursor: default; }

.badge-count { background: var(--gold); font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 9px; color: var(--ink); }

.mono { font-family: var(--mono); }
.u-muted { color: var(--muted); }
.u-small { font-size: 11px; }
.u-mini  { font-size: 10px; }
.u-bold  { font-weight: 700; }
.u-right { text-align: right; }
.u-nowrap{ white-space: nowrap; }
.u-trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.u-mt-auto { margin-top: auto; }

.field__label { color: var(--muted); font-size: 11px; }
.field__value { font-weight: 500; }

.input {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 13px; font-family: inherit; color: var(--ink); background: #fff;
}
.input:focus { outline: 0; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(27,58,140,.10); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.stack  { display: flex; flex-direction: column; gap: 14px; }
.row    { display: flex; align-items: center; gap: 10px; }

.note-strip {
  margin: -6px 0 14px; padding: 8px 12px;
  background: var(--gold-bg-2); border: 1px dashed var(--gold);
  border-radius: var(--radius-sm); font-size: 12px; color: #6B4E00;
}

/* 表格 —— 统一由 --cols 定义列宽 */
.tbl__head, .tbl__row { display: grid; grid-template-columns: var(--cols); gap: 12px; }
.tbl__head {
  padding: 10px 18px; background: var(--paper);
  font-size: 11px; color: var(--muted); font-weight: 700;
  border-bottom: 1px solid var(--line);
}
.tbl__row {
  padding: 11px 18px; border-bottom: 1px solid var(--line-soft);
  align-items: center; font-size: 12px;
  background: #fff; border-left: 0; border-right: 0; border-top: 0;
  width: 100%; text-align: left; font-family: inherit; color: inherit;
}
.tbl__row--link { cursor: pointer; }
.tbl__row--link:hover { background: var(--paper); }
.tbl__row:last-child { border-bottom: 0; }

.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot--live { animation: pulse 1.6s ease-in-out infinite; }

/* ==========================================================================
   S1 工作台
   ========================================================================== */

.kpi { padding: 16px 18px; }
.kpi__label { font-size: 12px; color: var(--muted); }
.kpi__value { font-size: 30px; font-weight: 700; margin-top: 4px; }
.kpi__value--accent { color: var(--navy); }
.kpi__sub { font-size: 11px; color: var(--muted); }
.kpi__row { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.kpi__row .kpi__value { margin-top: 0; }

.s1 { display: grid; grid-template-columns: 1fr 320px; gap: 14px; margin-top: 14px; }

.detect__row { --cols: 56px 1fr 130px 120px 90px; }
.detect__row--hit { background: var(--blue-bg); }
.detect__row--hit:hover { background: var(--blue-bg-2); }
.detect__go { text-align: right; color: var(--blue); font-weight: 700; }

.srcstat { display: grid; grid-template-columns: repeat(4,1fr); }
.srcstat > div { padding: 12px 18px; border-right: 1px solid var(--line); }
.srcstat > div:last-child { border-right: 0; }
.srcstat__layer { font: 500 10px var(--mono); color: var(--muted); }
.srcstat__n { font-size: 18px; font-weight: 700; }
.srcstat__n span { font-size: 11px; font-weight: 400; color: var(--muted); }

.mailq { padding: 6px 0; display: flex; flex-direction: column; }
.mailq__item {
  padding: 10px 18px; cursor: pointer; border-top: 1px solid var(--line-soft);
  background: #fff; border-left: 0; border-right: 0; border-bottom: 0;
  width: 100%; text-align: left; font-family: inherit; font-size: 13px; color: inherit;
}
.mailq__item:hover { background: var(--paper); }

/* ==========================================================================
   S3 地块详情 / S5 地理扩展 —— 地图
   ========================================================================== */

.map {
  position: relative; overflow: hidden; background: #E9EEF3;
  /* 离线时的等高线底纹，保证没有网络也不是一片空白 */
  background-image:
    repeating-linear-gradient(45deg,  rgba(151,168,186,.10) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(-45deg, rgba(151,168,186,.10) 0 1px, transparent 1px 22px);
}
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; filter: saturate(.85); }
.map__overlay { position: absolute; inset: 0; pointer-events: none; }
.map__ring {
  position: absolute; left: 50%; top: 50%; border-radius: 50%;
  border: 2px dashed var(--blue); background: rgba(47,108,192,.10);
}
.map__spoke { position: absolute; left: 50%; top: 50%; width: 2px; background: var(--blue); transform-origin: top center; margin-left: -1px; }
.map__sub {
  position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border-radius: 4px; background: var(--navy); display: grid; place-items: center;
  color: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.map__label {
  position: absolute; left: 50%; top: 50%; font-size: 11px; font-weight: 700;
  background: rgba(255,255,255,.9); padding: 1px 5px; border-radius: 3px; white-space: nowrap;
}
.map__pin {
  position: absolute; left: 50%; top: 50%; width: 16px; height: 16px;
  border-radius: 50% 50% 50% 0; background: var(--gold-mid);
  transform: translate(-50%,-100%) rotate(-45deg); border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.map__tag {
  position: absolute; left: 50%; top: 50%; font-size: 11px; font-weight: 700;
  background: #fff; padding: 2px 6px; border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,.15); white-space: nowrap;
}
.map__dist {
  position: absolute; left: 50%; top: 50%; font: 500 11px var(--mono);
  background: var(--navy); color: #fff; padding: 2px 6px; border-radius: 3px;
}
.map__note {
  position: absolute; right: 12px; bottom: 12px; font-size: 10px; color: var(--muted);
  background: rgba(255,255,255,.85); padding: 2px 6px; border-radius: 3px;
}

.estbox { padding: 14px 18px; }
.estbox__head { display: flex; align-items: center; gap: 8px; }
.estbox__label { font-weight: 700; color: var(--muted); }
.estbox__value { margin-top: 6px; font-size: 20px; color: var(--muted); }
.estbox__value span { font-size: 12px; }
.estbox__src { font-size: 11px; color: var(--muted); margin-top: 4px; }

.suit { display: flex; gap: 8px; flex-wrap: wrap; }
.suit__chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 14px; font-size: 12px; font-weight: 500;
}
.suit__chip--ok  { background: var(--green-bg); color: var(--green-ink); }
.suit__chip--mid { background: var(--gold-bg);  color: var(--gold-ink); }
.suit__chip--no  { background: var(--grey-bg);  color: var(--muted); }
.suit__chip small { font-size: 10px; opacity: .8; }

.crumbs { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 12px; color: var(--muted); }

/* ==========================================================================
   S4 名片库
   ========================================================================== */

.searchbar {
  flex: 1; display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--navy); border-radius: var(--radius);
  padding: 0 14px; height: 44px; box-shadow: 0 0 0 3px rgba(27,58,140,.08);
}
.searchbar input { flex: 1; border: 0; outline: 0; font-size: 14px; background: transparent; font-family: inherit; color: var(--ink); }
.searchbar__hint { font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; white-space: nowrap; }

.facets { padding: 14px; font-size: 12px; display: flex; flex-direction: column; gap: 14px; }
.facets__group > div:first-child { font-weight: 700; margin-bottom: 6px; }
.facets label { display: flex; align-items: center; gap: 6px; padding: 3px 0; cursor: pointer; }
.facets label.is-on { color: var(--navy); font-weight: 500; }
.facets__n { font: 400 11px var(--mono); color: var(--muted); }
.facets__foot { font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }

.empty { flex: 1; display: grid; place-items: center; padding: 40px; }
.empty__inner { text-align: center; max-width: 460px; }
.empty__mark {
  width: 56px; height: 56px; border-radius: 50%; background: var(--blue-bg);
  margin: 0 auto 14px; display: grid; place-items: center; font-size: 22px; color: var(--blue);
}
.empty__title { font-size: 16px; font-weight: 700; }
.empty__desc { color: var(--muted); margin-top: 6px; font-size: 13px; }

.cards__row { --cols: 44px 1.4fr 1fr 90px 90px 70px 110px 60px 90px; gap: 10px; padding: 9px 18px; }
.cards__thumb {
  width: 40px; height: 24px; border-radius: 2px; border: 1px solid var(--line-hard);
  background: repeating-linear-gradient(135deg, var(--line-mid) 0 3px, #E9EEF3 3px 6px);
}
.cat-tag { font-size: 10px; padding: 1px 6px; border-radius: 3px; color: #fff; white-space: nowrap; }

/* 抽屉 */
.scrim { position: absolute; inset: 0; background: rgba(26,35,51,.25); border: 0; width: 100%; cursor: pointer; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0; width: 440px; background: #fff;
  box-shadow: -8px 0 24px rgba(0,0,0,.12); padding: 20px 22px; overflow: auto;
  display: flex; flex-direction: column; gap: 14px;
  animation: rise .25s ease;
}
.drawer__img {
  height: 190px; border-radius: var(--radius-sm);
  background: repeating-linear-gradient(135deg, var(--line-mid) 0 8px, #E9EEF3 8px 16px);
  border: 1px solid var(--line-hard); display: grid; place-items: center;
  font-size: 11px; color: var(--muted);
}
.drawer__meta { display: flex; gap: 10px; font-size: 11px; color: var(--muted); }
.drawer__fields { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; font-size: 12px; }
.enriched { background: var(--gold-bg); padding: 1px 6px; border-radius: 3px; justify-self: start; }
.close-x { cursor: pointer; color: var(--muted); font-size: 18px; background: 0; border: 0; padding: 0 4px; line-height: 1; }

/* ==========================================================================
   S5 Agent 执行
   ========================================================================== */

.progress { height: 3px; background: var(--chip-bg); border-radius: 2px; overflow: hidden; }
.progress__bar { height: 100%; background: var(--blue); border-radius: 2px; transition: width .6s ease; }

.steps { display: flex; flex-direction: column; }
.step { display: grid; grid-template-columns: 24px 1fr 60px; gap: 10px; padding: 0 0 16px; transition: opacity .4s; }
.step.is-wait { opacity: .45; }
.step__rail { display: flex; flex-direction: column; align-items: center; }
.step__line { flex: 1; width: 2px; margin-top: 4px; background: var(--line-mid); transition: background .4s; }
.step__line.is-done { background: var(--green); }
.step__line.is-last { background: transparent; }
.step__mark { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 700; flex: none; }
.step__mark--done { background: var(--green); color: #fff; animation: rise .3s ease; }
.step__mark--run  { border: 2px solid var(--line-mid); border-top-color: var(--blue); animation: spin .8s linear infinite; }
.step__mark--wait { border: 2px solid var(--line-mid); }
.step__name { font-weight: 500; }
.step.is-running .step__name { color: var(--navy); }
.step__detail { font-size: 11px; color: var(--muted); }
.step__t { font: 400 11px var(--mono); color: var(--muted); text-align: right; }

.radar { border: 1px solid var(--line); border-radius: var(--radius); height: 420px; position: relative; overflow: hidden; }
.radar__wash { position: absolute; inset: 0; pointer-events: none; background: rgba(255,255,255,.18); }
.radar__ring {
  position: absolute; left: 50%; top: 50%; width: 388px; height: 388px; margin: -194px 0 0 -194px;
  border-radius: 50%; border: 2px dashed var(--blue); background: rgba(47,108,192,.08); pointer-events: none;
}
.radar__sweep {
  position: absolute; left: 50%; top: 50%; width: 388px; height: 388px; margin: -194px 0 0 -194px;
  border-radius: 50%; background: conic-gradient(from 0deg, rgba(47,108,192,.4), transparent 30%);
  animation: sweep 2.4s linear infinite; pointer-events: none;
}
.radar__origin {
  position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50% 50% 50% 0; background: var(--gold-mid); transform: rotate(-45deg); border: 2px solid #fff;
}
.radar__ping {
  position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; background: var(--blue); animation: ping 1.6s ease-out infinite;
}
.radar__hit { position: absolute; display: flex; align-items: center; gap: 6px; transition: opacity .5s; pointer-events: none; }
.radar__hit span:first-child { width: 10px; height: 10px; border-radius: 50%; background: var(--navy); box-shadow: 0 0 0 4px rgba(27,58,140,.15); }
.radar__hit span:last-child { font-size: 11px; font-weight: 700; background: #fff; padding: 1px 6px; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.15); white-space: nowrap; }
.radar__status {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  font-size: 12px; color: var(--navy); font-weight: 500; background: rgba(255,255,255,.92);
  padding: 4px 12px; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.15);
  white-space: nowrap; animation: pulse 1.4s ease-in-out infinite;
}
.radar__scale {
  position: absolute; right: 12px; top: 12px; font: 400 10px var(--mono); color: var(--muted);
  background: rgba(255,255,255,.9); padding: 2px 6px; border-radius: 3px;
}

.cand { padding: 14px 18px; display: grid; grid-template-columns: 24px 1fr auto; gap: 12px; animation: rise .45s ease both; }
.cand__name { font-weight: 700; font-size: 14px; }
.cand__dist { font: 500 11px var(--mono); color: var(--blue); }
.cand__why { font-size: 12px; margin-top: 8px; padding: 8px 10px; background: var(--paper); border-radius: 4px; }
.cand__side { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; font-size: 11px; white-space: nowrap; }

/* ==========================================================================
   S6 审批控制台
   ========================================================================== */

.s6 { display: grid; grid-template-columns: 250px 1fr 270px; gap: 14px; height: 100%; }

.maillist__item {
  padding: 12px 16px; border-bottom: 1px solid var(--line-soft); cursor: pointer;
  background: #fff; border-left: 0; border-right: 0; border-top: 0; width: 100%;
  text-align: left; font-family: inherit; font-size: 13px; color: inherit;
}
.maillist__item.is-on { background: var(--blue-bg); }
.maillist__item:hover { background: var(--blue-bg); }
.maillist__top { display: flex; justify-content: space-between; gap: 8px; }

.mailhead { padding: 12px 18px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 60px 1fr; gap: 4px 10px; font-size: 12px; }
.mailbody {
  flex: 1; border: 0; outline: 0; resize: none; padding: 18px;
  font-size: 13px; line-height: 1.8; color: var(--ink); background: #fff; font-family: var(--sans-ja);
}
.approved-strip {
  margin: 0 18px 12px; padding: 8px 12px; background: var(--green-bg); color: var(--green-ink);
  border-radius: 4px; font-size: 12px; display: flex; gap: 10px; animation: rise .3s ease;
}
.mailfoot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }

.comply { display: flex; flex-direction: column; gap: 8px; }
.comply div { display: flex; gap: 8px; }
.comply__ok { color: var(--green); font-weight: 700; }
.judgebox { margin-top: 12px; padding: 8px 10px; background: var(--paper); border-radius: 4px; }

.killswitch {
  border-radius: var(--radius); padding: 14px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 12px; border: 2px solid var(--red);
  background: var(--red-bg); color: var(--red); width: 100%; text-align: left; font-family: inherit;
}
.killswitch.is-on { background: var(--red); color: #fff; }
.killswitch__track { width: 38px; height: 22px; border-radius: 11px; background: #E8B4B0; position: relative; flex: none; }
.killswitch.is-on .killswitch__track { background: rgba(255,255,255,.3); }
.killswitch__knob { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.killswitch.is-on .killswitch__knob { left: 18px; }
.killswitch__title { font-weight: 700; font-size: 13px; }
.killswitch__sub { font-size: 11px; opacity: .9; }

/* ==========================================================================
   S7 发送结果
   ========================================================================== */

.s7 { display: grid; grid-template-columns: 400px 1fr; gap: 14px; height: 100%; }
.res__search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 10px; height: 34px; }
.res__search input { flex: 1; border: 0; outline: 0; font-size: 12px; background: transparent; font-family: inherit; color: var(--ink); }
.res__row { --cols: 1fr 90px 76px; gap: 8px; padding: 11px 14px; }
.res__row.is-on { background: var(--blue-bg); }
.res__head { --cols: 1fr 90px 76px; gap: 8px; padding: 7px 14px; }
.res__status { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 3px; white-space: nowrap; }
.judgepill { padding: 6px 14px; border-radius: 14px; font-weight: 700; font-size: 12px; white-space: nowrap; background: var(--grey-bg); color: var(--muted); }
.judgepill.is-pos { background: var(--green); color: #fff; }
.judgepill.is-neg { background: var(--slate); color: #fff; }
.judgepill--flat { font-weight: 400; border: 1px solid var(--line); background: #fff; }
.mailquote {
  font-size: 13px; line-height: 1.9; padding: 14px; background: var(--paper);
  border-radius: var(--radius-sm); white-space: pre-line;
}
.mailquote--sm { font-size: 12px; line-height: 1.8; color: var(--ink); max-height: 260px; overflow: auto; }
.placeholder-box { padding: 22px; border: 1px dashed var(--line-mid); border-radius: var(--radius-sm); text-align: center; color: var(--muted); font-size: 12px; }

/* ==========================================================================
   S8 简报 / S13-14 占位
   ========================================================================== */

.stub {
  max-width: 640px; margin: 60px auto 0; border: 2px dashed var(--line-dash);
  border-radius: 10px; padding: 32px 36px; background: #fff; text-align: center;
}
.stub--wide { max-width: 760px; margin-top: 40px; }
.stub__mark {
  width: 44px; height: 44px; border-radius: var(--radius); border: 2px dashed var(--muted-2);
  color: var(--muted); display: grid; place-items: center; margin: 0 auto 12px; font-size: 18px;
}
.stub__mark--code { font: 700 12px var(--mono); }
.stub__title { font-weight: 700; font-size: 16px; }
.stub__tag {
  display: inline-block; margin-top: 6px; font-size: 11px; border: 1px dashed var(--gold);
  color: var(--gold-ink); background: var(--gold-bg); border-radius: 3px; padding: 1px 8px;
}
.stub__desc { color: var(--muted); margin-top: 14px; line-height: 1.7; }
.stub__caps { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 20px; text-align: left; }
.stub__cap { border: 1px dashed var(--line-mid); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12px; color: var(--muted); }
.stub__note { font-size: 11px; color: var(--muted-2); margin-top: 18px; }

/* 「設計中」横幅：这一屏画的是构想，不是已确定的方案 */
.draft-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; margin-bottom: 14px;
  background: var(--gold-bg-2); border: 1px dashed var(--gold);
  border-radius: var(--radius-sm); font-size: 12px; color: var(--gold-ink);
  line-height: 1.6;
}
.draft-banner__tag {
  flex: none; font-size: 11px; font-weight: 700;
  background: var(--gold-bg); border: 1px solid var(--gold);
  border-radius: 3px; padding: 1px 8px; white-space: nowrap;
}

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button {
  padding: 8px 16px; font-size: 13px; cursor: pointer; background: 0; border: 0;
  border-bottom: 2px solid transparent; color: var(--muted); font-family: inherit;
}
.tabs button.is-on { border-bottom-color: var(--navy); color: var(--navy); font-weight: 700; }
.tabs__n { font: 400 11px var(--mono); color: var(--muted); }

.nlblock {
  display: grid; grid-template-columns: 16px 110px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
}
.nlblock.is-hi { background: var(--blue-bg); }
.nlblock__grip { color: var(--line-dash); font-size: 14px; }
.nlblock__kind {
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 3px;
  background: var(--chip-bg); color: var(--navy); text-align: center; white-space: nowrap;
}
.metric { padding: 10px; background: var(--paper); border-radius: var(--radius-sm); }
.metric__label { font-size: 11px; color: var(--muted); }
.metric__value { font-size: 22px; font-weight: 700; }

/* ==========================================================================
   S9 设置与审计
   ========================================================================== */

.radio-row {
  display: flex; gap: 8px; align-items: center; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
}
.radio-row.is-on { border-color: var(--navy); background: var(--blue-bg); }
.toggle-sm { width: 34px; height: 20px; border-radius: 10px; background: var(--line-dash); position: relative; border: 0; cursor: pointer; flex: none; }
.toggle-sm span { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.toggle-sm.is-on { background: var(--green); }
.toggle-sm.is-on span { left: 16px; }
.audit__row { --cols: 160px 160px 1fr 1.4fr; padding: 9px 18px; }
.audit__head { --cols: 160px 160px 1fr 1.4fr; padding: 8px 18px; }
.audit__op { font-size: 11px; padding: 1px 7px; border-radius: 3px; font-weight: 700; white-space: nowrap; }

/* ==========================================================================
   S10 帮助
   ========================================================================== */

.bizflow { display: grid; grid-template-columns: 1fr 24px 1fr 24px 1fr 24px 1fr 24px 1fr 24px 1fr; align-items: stretch; margin-top: 12px; }
.bizflow__arrow { display: grid; place-items: center; color: var(--muted-2); font-size: 16px; }
.biznode {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px 10px;
  cursor: pointer; display: flex; flex-direction: column; gap: 6px; background: #fff;
  text-align: left; font-family: inherit; font-size: 13px; color: inherit;
}
.biznode:hover { border-color: var(--navy); }
.biznode.is-human { background: var(--blue-bg); }
.biznode__n { width: 20px; height: 20px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none; }
.biznode__actor { font: 500 10px var(--mono); color: var(--muted); }
.biznode__title { font-weight: 700; font-size: 13px; }
.biznode__desc { font-size: 11px; color: var(--muted); line-height: 1.5; }
.biznode__go { margin-top: auto; font-size: 10px; color: var(--blue); }

.opstep { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; padding-bottom: 14px; }
.opstep__n { width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.opstep__line { flex: 1; width: 2px; background: var(--line-mid); margin-top: 4px; }
.opstep__line.is-last { background: transparent; }
.opstep__tip {
  font-size: 11px; color: var(--gold-ink); background: var(--gold-bg);
  border-radius: 4px; padding: 4px 8px; margin-top: 6px; display: inline-block;
}
.opstep__go { font-size: 11px; white-space: nowrap; align-self: start; border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; background: #fff; }
.rolerow { display: grid; grid-template-columns: 96px 1fr; gap: 10px; padding: 8px 10px; background: var(--paper); border-radius: var(--radius-sm); }
.termgrid { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 12px; }
.legend { display: flex; gap: 18px; margin-top: 12px; font-size: 11px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ==========================================================================
   S12 Agent 详情
   ========================================================================== */

.aghead { padding: 16px 20px; margin-bottom: 14px; display: flex; align-items: center; gap: 14px; }
.aghead__mark { width: 40px; height: 40px; border-radius: var(--radius); background: var(--navy); color: #fff; display: grid; place-items: center; font: 700 12px var(--mono); flex: none; }
.aghead__stats { display: flex; gap: 22px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.aghead__stats > div > div:first-child { font-size: 11px; }
.aghead__stat { font: 500 14px var(--mono); color: var(--ink); }
.running-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--green-ink); background: var(--green-bg); padding: 4px 10px; border-radius: 12px; white-space: nowrap; }

.pipeline { display: grid; grid-template-columns: 200px 24px 1fr 24px 180px; align-items: center; }
.pipeline__arrow { display: grid; place-items: center; color: var(--muted-2); }
.pipeline__col { display: flex; flex-direction: column; gap: 6px; }
.pipeline__lbl { font: 500 10px var(--mono); color: var(--muted); letter-spacing: .06em; }
.pipeline__box {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px;
  cursor: pointer; background: #fff; text-align: left; font-family: inherit; font-size: 13px; color: inherit;
  display: block; width: 100%;
}
.pipeline__box:hover { border-color: var(--navy); }
.pipeline__box--in { background: var(--paper); }
.pipeline__box--out { border-color: var(--navy); background: var(--blue-bg); }
.pipeline__box--out .pipeline__t { color: var(--navy); }
.pipeline__t { font-weight: 700; }
.pipeline__s { font-size: 11px; color: var(--muted); }

.skill { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 12px; background: #fff; transition: all .4s; }
.skill.is-on { border-color: var(--blue); background: var(--blue-bg); }
.skill__top { display: flex; align-items: center; gap: 6px; height: 18px; }
.skill__n { width: 18px; height: 18px; border-radius: 50%; background: var(--muted-2); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none; }
.skill.is-on .skill__n { background: var(--blue); }
.skill__spin { margin-left: auto; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-mid); border-top-color: var(--blue); animation: spin .8s linear infinite; opacity: 0; flex: none; }
.skill.is-on .skill__spin { opacity: 1; }
.skill__status { font-size: 11px; color: var(--muted); margin-top: 4px; }

.feed { display: flex; flex-direction: column; height: 392px; overflow: hidden; padding: 6px 0; }
.feed__row {
  display: grid; grid-template-columns: 64px 78px 1fr auto; gap: 10px;
  padding: 7px 18px; font-size: 12px; align-items: center;
  border-bottom: 1px solid var(--paper); animation: rise .4s ease;
}
.feed__time { font: 400 11px var(--mono); color: var(--muted); }
.feed__tag { font-size: 10px; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.feed__result { font: 400 11px var(--mono); white-space: nowrap; }
.cycle { height: 3px; background: var(--chip-bg); }
.cycle__bar { height: 100%; background: var(--blue); transition: width 1s linear; }
.agruns__head { --cols: 96px 96px 1fr 70px 90px; gap: 10px; padding: 8px 18px; }
.agruns__row  { --cols: 96px 96px 1fr 70px 90px; gap: 10px; padding: 9px 18px; }
.rules { display: flex; flex-direction: column; gap: 6px; }
.rules div { display: flex; gap: 8px; }
.rules i { color: var(--navy); font-style: normal; }

/* ==========================================================================
   状态栏 —— 剧本导航
   ========================================================================== */

.storyline { display: flex; align-items: center; gap: 6px; }
.storyline__btn {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 4px; width: 20px; height: 18px; line-height: 1; cursor: pointer;
  font-size: 11px; padding: 0; font-family: inherit;
}
.storyline__btn:hover:not([disabled]) { border-color: var(--navy); color: var(--navy); }
.storyline__btn[disabled] { opacity: .4; cursor: default; }
.storyline__label { font-family: var(--mono); }
