/* ==========================================================================
   「顺差去哪了」顺差解剖图 - 核心设计系统与样式表 (Pixel-Perfect 16:9 Desktop Edition)
   ========================================================================== */

:root {
  --ink: #111111;
  --ink-2: #555555;
  --ink-3: #8A8A8A;
  --ink-4: #A0A0A0;

  --line: #EAEAEA;
  --line-2: #F4F4F4;
  --line-subtle: #F4F4F4;
  --line-strong: #D9D9D9;

  --surplus: #0B3D91;     /* 顺差 / 主叙事蓝 */
  --surplus-bg: #EEF4FD;
  --deficit: #B23A2E;     /* 逆差 / 下跌红 */
  --deficit-bg: #FDF1EF;

  --private: #0B3D91;     /* 民营 */
  --foreign: #C9A227;     /* 外资 */
  --state: #5B6770;       /* 国企 */
  --gap: #D9D9D9;         /* 统计差异 / 未解释节点 */
  --seq-1: #EEF4FD; --seq-2: #C5D6F2; --seq-3: #8FAEE0; --seq-4: #4C77C4; --seq-5: #0B3D91;   /* 顺序渐变 5 档 */

  --gap-pattern: repeating-linear-gradient(
    45deg,
    #D9D9D9,
    #D9D9D9 4px,
    #FFFFFF 4px,
    #FFFFFF 8px
  );

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, Consolas, "Courier New", monospace;

  --duration-micro: 80ms;
  --duration-quick: 150ms;
  --duration-fast: 200ms;
  --duration-medium: 300ms;

  --ease-smooth-out: cubic-bezier(0.23, 1, 0.32, 1);      /* 强 ease-out：入场 / 悬停 */
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);         /* 屏上位移 / 形变 */
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);          /* iOS 抽屉曲线 */
  --ease-bounce: cubic-bezier(0.23, 1, 0.32, 1);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --shadow-hover: 0 2px 6px rgba(0,0,0,.06), 0 8px 20px rgba(0,0,0,.07);
  --shadow-popup: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);

  /* 置信度语义色（全站唯一定义处） */
  --conf-high: #1E5C43;  --conf-high-bg: #EAF4EF;
  --conf-mid:  #8A6A1F;  --conf-mid-bg:  #F7F1E3;
  --conf-low:  #8A4A42;  --conf-low-bg:  #F8EEEC;

  /* 单色系分类阶梯：堆叠面积 / 多系列图，蓝为主叙事，灰为陪衬 */
  --cat-1: #0B3D91; --cat-2: #35599F; --cat-3: #5B76B0; --cat-4: #8093C1;
  --cat-5: #A4B2D2; --cat-6: #C4CDE3; --cat-7: #DDE3F0; --cat-8: #B9B9B9;

  /* 移动端布局变量兜底（JS 运行时会覆盖） */
  --m-nav-h: 52px; --m-sheet-h: 0px; --safe-b: env(safe-area-inset-bottom, 0px);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  background-color: #FFFFFF;
  color: var(--ink);
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background-color: #FFFFFF;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
  outline: none;
}

/* 触屏点击不闪灰色高光；双击缩放延迟也一并去掉 */
button, a, [role="button"] {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

::selection {
  background: var(--surplus);
  color: #FFFFFF;
}

/* --------------------------------------------------------------------------
   按压反馈：所有可按元素在 :active 时轻微缩小，让界面"听得见"手指。
   幅度 0.96~0.985，配 micro 时长，松手即用元素本身的 transition 弹回。
   -------------------------------------------------------------------------- */
.tool-btn:active,
.panel-btn:active,
.view-btn:active,
.month-segment-btn:active,
.color-pill-btn:active,
.mover-chip:active,
.drilldown-view-treemap-btn:active,
.ledger-filter-item:active,
.r10-pill:active,
.r10-crumb:active,
.panel-close-btn:active,
.reset-drilldown-btn:active,
.sheet-collapse-btn:active,
.first-run-hint .tool-btn:active {
  transform: scale(0.96);
  transition-duration: var(--duration-micro);
}
.month-nav-btn:active:not(:disabled) {
  transform: scale(0.92);
  transition-duration: var(--duration-micro);
}
.pq-card:active,
.mini-card:active,
.spark-card:active,
.tm-crumb-card:active,
.command-item:active {
  transform: scale(0.985);
  transition-duration: var(--duration-micro);
}
.panel-sheet-handle:active .sheet-handle-cue { color: var(--ink); }

a {
  color: inherit;
  text-decoration: none;
}

/* Typography Hierarchy */
.display-num {
  font-size: 72px;
  font-weight: 300;
  line-height: 1.0;
  letter-spacing: -0.03em;
  font-feature-settings: "tnum" 1, "ss01" 1;
}

.num-l {
  font-size: 30px;
  font-weight: 400;
  line-height: 1.1;
  font-feature-settings: "tnum" 1, "ss01" 1;
}

h1, .h1 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

h2, .h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.body-text {
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.6;
}

.caption {
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink-3);
}

.micro {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.font-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  font-feature-settings: "tnum" 1;
  overflow-wrap: anywhere;
}

.tnum {
  font-feature-settings: "tnum" 1, "ss01" 1;
}

.val-up {
  color: var(--surplus);
}

.val-down {
  color: var(--deficit);
}

.val-flat {
  color: var(--ink-3);
}

.hatched-box {
  background: var(--gap-pattern);
  border: 1px solid rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   Header Component (56px) with Horizontal Month Track
   ========================================================================== */
#app-header {
  height: 56px;
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.header-logo {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.header-badge {
  font-size: 11.5px;
  color: var(--ink-3);
}

.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.month-caption {
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--ink-3);
  letter-spacing: 0.02em;
}

.month-controller {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.month-nav-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink-2);
  transition: transform var(--duration-quick) var(--ease-smooth-out),
              background-color var(--duration-quick) var(--ease-smooth-out),
              color var(--duration-quick) var(--ease-smooth-out),
              border-color var(--duration-quick) var(--ease-smooth-out);
}

.month-nav-btn:hover:not(:disabled) {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
  transform: scale(1.1);
}

.month-nav-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Month segmented buttons */
.month-segment-track {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #F4F4F5;
  padding: 3px;
  border-radius: 6px;
}

.month-segment-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--ink-2);
  border-radius: 5px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth-out);
  font-family: var(--font-mono);
}

.month-segment-btn:hover {
  color: var(--ink);
  background: rgba(0,0,0,0.03);
}

.month-segment-btn.active {
  background: var(--ink);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.view-segment-control {
  display: flex;
  align-items: center;
  background-color: #F1F1F3;
  padding: 3px;
  border-radius: 8px;
}

.view-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: var(--ink-2);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth-out);
}

.view-btn:hover {
  color: var(--ink);
}

.view-btn.active {
  background-color: #FFFFFF;
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* 视图组分隔：给 13 个平级 tab 一点节奏 */
.view-group-divider {
  width: 1px;
  height: 14px;
  background: var(--line-strong);
  margin: 0 3px;
  flex: 0 0 auto;
}

/* 时序类视图下的月份条置灰 */
.month-controller.month-disabled {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(1);
  transition: opacity var(--duration-fast) var(--ease-smooth-out);
}
.month-caption-muted {
  color: var(--ink-3) !important;
}

.tool-btn {
  height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background-color: #FFFFFF;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: transform var(--duration-quick) var(--ease-smooth-out),
              background-color var(--duration-quick) var(--ease-smooth-out),
              border-color var(--duration-quick) var(--ease-smooth-out),
              color var(--duration-quick) var(--ease-smooth-out);
}

.tool-btn:hover {
  background-color: #F7F7F8;
  border-color: var(--ink-3);
  transform: translateY(-1px);
}

.kbd-shortcut-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  background: #F0F0F2;
  border-radius: 4px;
  color: var(--ink-3);
  border: 1px solid rgba(0,0,0,0.06);
}

/* ==========================================================================
   Breadcrumb Bar (40px)
   ========================================================================== */
#breadcrumb-bar {
  height: 40px;
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  font-size: 12.5px;
  position: sticky;
  top: 56px;
  z-index: 90;
}

#breadcrumb-bar.hidden {
  display: none;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
}

.crumb-item {
  color: var(--ink-2);
  cursor: pointer;
  transition: color var(--duration-micro) var(--ease-smooth-out);
}

.crumb-item:hover {
  color: var(--surplus);
  text-decoration: underline;
}

.crumb-item.current {
  color: var(--ink);
  font-weight: 600;
  cursor: default;
  text-decoration: none;
}

.crumb-sep {
  color: var(--ink-4);
  font-size: 11px;
}

.reset-drilldown-btn {
  font-size: 11.5px;
  color: var(--ink-3);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all var(--duration-fast) var(--ease-smooth-out);
}

.reset-drilldown-btn:hover {
  color: var(--deficit);
  background-color: var(--deficit-bg);
}

/* ==========================================================================
   App Body & 16:9 PC Layout
   ========================================================================== */
#app-body {
  flex: 1;
  max-width: 1760px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 48px 48px 48px;
  display: flex;
  gap: 24px;
  position: relative;
}

#view-viewport {
  flex: 1;
  min-width: 0;
  background-color: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px 32px;
}

/* ==========================================================================
   Right Inspect Panel (400px Sticky Sidebar)
   ========================================================================== */
#inspect-panel {
  width: 400px;
  flex-shrink: 0;
  background-color: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  align-self: flex-start;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#inspect-panel::-webkit-scrollbar {
  width: 4px;
}
#inspect-panel::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.panel-close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--ink-3);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: all var(--duration-fast) var(--ease-smooth-out);
}

.panel-close-btn:hover {
  color: var(--ink);
  background: #F4F4F5;
}

.panel-main-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.panel-grid-2x2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  background-color: #F8F9FA;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.03);
}

.panel-grid-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.panel-grid-label {
  font-size: 11px;
  color: var(--ink-3);
}

.panel-grid-val {
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-mono);
}

.panel-section-divider {
  height: 1px;
  background-color: var(--line);
  margin: 2px 0;
}

.panel-judge-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.judge-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
}

.judge-sparkline {
  width: 56px;
  height: 18px;
}

.judge-conclusion-box {
  background-color: #F8F9FA;
  border-left: 3px solid var(--ink);
  padding: 8px 10px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-2);
  margin-top: 8px;
  border-radius: 0 4px 4px 0;
}

.stacked-bar-container {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 4px;
  overflow: hidden;
  margin: 6px 0;
}

.stacked-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  color: #FFFFFF;
  font-weight: 500;
}

.owner-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  margin-top: 5px;
}

.owner-dot-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
}

.owner-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.methodology-mini-card {
  background-color: #F8F9FA;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
}

.method-row {
  display: flex;
  margin-bottom: 4px;
  gap: 6px;
  line-height: 1.4;
}

.method-key {
  color: var(--ink-3);
  width: 44px;
  flex-shrink: 0;
}

.method-val {
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.method-link {
  display: inline-block;
  color: var(--surplus);
  font-weight: 500;
  margin-top: 5px;
  cursor: pointer;
}

.method-link:hover {
  text-decoration: underline;
}

.panel-action-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.panel-btn {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  background-color: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth-out);
}

.panel-btn:hover {
  background-color: #F8F9FA;
  border-color: var(--ink-3);
  transform: translateY(-1px);
}

/* ==========================================================================
   River View (Hero 7:5 & Flow)
   ========================================================================== */
.river-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero-stats-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-2);
}

.hero-explain-line {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
}

.hero-right-cards {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.mini-card {
  background-color: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 116px;
  cursor: default;
  transition: border-color var(--duration-quick) var(--ease-smooth-out),
              transform var(--duration-quick) var(--ease-smooth-out),
              box-shadow var(--duration-quick) var(--ease-smooth-out);
}

.mini-card:hover {
  border-color: var(--ink-2);
}

.mini-card-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.mini-card-desc {
  font-size: 10.5px;
  color: var(--ink-3);
  line-height: 1.35;
}

.price-segments-grid {
  display: flex;
  gap: 2px;
  height: 12px;
  margin: 6px 0;
}

.price-segment-cell {
  background-color: #DDE2E8;
  border-radius: 1px;
  cursor: pointer;
  transition: transform var(--duration-micro) var(--ease-smooth-out);
}

.price-segment-cell:hover {
  transform: scaleY(1.3);
}

.price-segment-cell.down {
  background-color: var(--deficit);
}

.gap-mini-card {
  background: #F8F9FA;
  border: 1px solid var(--line);
  cursor: pointer;
}

.sankey-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.color-mode-pills {
  display: flex;
  gap: 6px;
}

.color-pill-btn {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #FFFFFF;
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth-out);
}

.color-pill-btn:hover {
  background: #F4F4F5;
  color: var(--ink);
}

.color-pill-btn.active {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
}

.sankey-columns-header {
  display: grid;
  grid-template-columns: 0.18fr 0.28fr 0.26fr 0.28fr;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 10px;
}

#drilldown-sankey-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--line-strong);
  scroll-margin-top: 100px;
}

.drilldown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.drilldown-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--surplus);
}

.drilldown-collapse-btn {
  font-size: 11px;
  color: var(--ink-3);
  background: transparent;
  border: none;
  cursor: pointer;
}

.drilldown-collapse-btn:hover {
  color: var(--ink);
}

.drilldown-columns-header {
  display: grid;
  grid-template-columns: 0.3fr 0.28fr 0.26fr 0.16fr;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 8px;
}

/* ==========================================================================
   Treemap View
   ========================================================================== */
#treemap-view-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.treemap-breadcrumb-cards {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.tm-crumb-card {
  background-color: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-fast) var(--ease-smooth-out);
}

.tm-crumb-card:hover {
  border-color: var(--surplus);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* 结构视图工具栏：选中章芯片 + 图例 + 单元格悬停 */
.tm-selected-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding: 5px 12px;
  background: #F8F9FA;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12.5px;
}
.tm-selected-code {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}
.tm-selected-name {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 16em;
}
.tm-selected-vals {
  color: var(--ink-3);
  font-size: 12px;
  white-space: nowrap;
}
.tm-legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--ink-2);
}
.tm-legend-chip { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tm-legend-chip i {
  display: inline-block;
  width: 40px; height: 8px;
  border-radius: 2px;
}
.tm-legend-note { color: var(--ink-3); white-space: nowrap; }

.tm-cell rect.tm-bg { transition: opacity var(--duration-quick) var(--ease-smooth-out); }
@media (hover: hover) and (pointer: fine) {
  .tm-cell:hover rect.tm-bg { stroke: var(--ink); stroke-width: 1.5; }
}

#treemap-canvas-container {
  position: relative;
  width: 100%;
  height: 640px;
  background-color: #FAFAFA;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.treemap-node {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid #FFFFFF;
  border-radius: 6px;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-smooth-out), box-shadow var(--duration-fast) var(--ease-smooth-out);
  overflow: hidden;
}

.treemap-node:hover {
  z-index: 10;
  transform: translateY(-2px);
  box-shadow: var(--shadow-popup);
  border-color: var(--ink);
}

.tm-stripe {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.tm-stripe.up {
  background-color: var(--surplus);
}

.tm-stripe.down {
  background-color: var(--deficit);
}

#treemap-tooltip {
  position: fixed;
  pointer-events: none;
  background-color: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: var(--shadow-popup);
  z-index: 1000;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-smooth-out);
  width: 220px;
}

/* --------------------------------------------------------------------------
   全站统一图表悬浮卡（ChartKit.tooltip）：替代原生 <title>
   -------------------------------------------------------------------------- */
#chart-tooltip {
  position: fixed;
  pointer-events: none;
  background: rgba(17, 17, 17, 0.94);
  color: #FFFFFF;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
  max-width: 280px;
  z-index: 1200;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--duration-quick) var(--ease-smooth-out),
              transform var(--duration-quick) var(--ease-smooth-out);
  box-shadow: var(--shadow-popup);
}
#chart-tooltip.visible { opacity: 1; transform: translateY(0); }
#chart-tooltip .tt-title { font-weight: 600; font-size: 12.5px; margin-bottom: 4px; }
#chart-tooltip .tt-row { display: flex; justify-content: space-between; gap: 16px; color: rgba(255,255,255,0.82); }
#chart-tooltip .tt-row b { color: #FFFFFF; font-weight: 600; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
#chart-tooltip .tt-note { color: rgba(255,255,255,0.6); margin-top: 4px; font-size: 11px; }
/* 量价视图沿用其 pq-tt-* 内容结构时，在深色悬浮卡里保持可读 */
#chart-tooltip .pq-tt-title { font-size: 12.5px; font-weight: 600; color: #FFFFFF; margin-bottom: 4px; }
#chart-tooltip .pq-tt-row { display: flex; justify-content: space-between; gap: 16px; color: rgba(255,255,255,0.82); }
#chart-tooltip .pq-tt-row span:last-child { font-family: var(--font-mono); color: #FFFFFF; font-variant-numeric: tabular-nums; }
#chart-tooltip .pq-tt-row span[style*="--deficit"] { color: #F0997B !important; }
#chart-tooltip .pq-tt-row span[style*="--surplus"] { color: #9FC2F0 !important; }
#chart-tooltip .pq-tt-note { margin-top: 4px; font-size: 11px; color: rgba(255,255,255,0.6); }

/* 置信度徽标：全站唯一实现 */
.conf-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.conf-badge.high { background: var(--conf-high-bg); color: var(--conf-high); }
.conf-badge.mid  { background: var(--conf-mid-bg);  color: var(--conf-mid); }
.conf-badge.low  { background: var(--conf-low-bg);  color: var(--conf-low); }

/* 图表入场动效：容器统一淡入上浮 */
@keyframes chart-enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chart-enter { animation: chart-enter var(--duration-medium) var(--ease-smooth-out) both; }

/* 桑基水路高亮过渡：悬停聚焦时其余水路平滑退隐 */
.sankey-ribbon, .main-left-ribbon {
  transition: opacity var(--duration-fast) var(--ease-smooth-out);
}
.sankey-node-g rect {
  transition: opacity var(--duration-quick) var(--ease-smooth-out);
}
@media (prefers-reduced-motion: reduce) {
  .chart-enter { animation: none; }
  #chart-tooltip { transition: none; }
}

/* ==========================================================================
   Time View
   ========================================================================== */
#time-view-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.time-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.small-multiples-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.spark-card {
  background-color: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-fast) var(--ease-smooth-out);
}

.spark-card:hover {
  transform: translateY(-2px);
  border-color: var(--surplus);
  box-shadow: var(--shadow-hover);
}

.spark-card.active {
  border-color: var(--surplus);
  box-shadow: 0 0 0 2px rgba(11, 61, 145, 0.2);
}

/* ==========================================================================
   Where Attribution View
   ========================================================================== */
#where-view-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.where-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.waterfall-guideline {
  stroke: #C8C8C8;
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.waterfall-explaining-card {
  background-color: #F8F9FA;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.waterfall-hatch-preview {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  flex-shrink: 0;
}

.waterfall-path-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
}

.waterfall-path-item {
  padding: 4px 6px;
  border-radius: 4px;
  color: var(--ink-2);
}

/* ==========================================================================
   Ledger View
   ========================================================================== */
#ledger-view-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ledger-hero-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ledger-main-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
}

.ledger-sidebar {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ledger-filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink-2);
  transition: all var(--duration-fast) var(--ease-smooth-out);
}

.ledger-filter-item:hover {
  background-color: #F1F1F3;
  color: var(--ink);
}

.ledger-filter-item.active {
  background-color: var(--ink);
  color: #FFFFFF;
  font-weight: 600;
}

.ledger-badge {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 8px;
  background-color: #E8E8E8;
  color: var(--ink-2);
}

.ledger-filter-item.active .ledger-badge {
  background-color: rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
}

.ledger-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background-color: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 12px;
}

.ledger-search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 12.5px;
}

.ledger-table-container {
  background-color: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.ledger-table th {
  background-color: #F8F9FA;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.ledger-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-subtle);
  color: var(--ink);
}

.ledger-table tr:hover td {
  background-color: #FBFBFC;
}

/* ==========================================================================
   Command Palette (Cmd+K / Ctrl+K)
   ========================================================================== */
.command-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-smooth-out);
}

.command-dialog-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.command-dialog-card {
  width: 100%;
  max-width: 560px;
  background: #FFFFFF;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-popup);
  overflow: hidden;
  /* 退场比入场快：关掉的东西要立刻让路 */
  transform: translateY(8px) scale(0.97);
  transition: transform var(--duration-quick) var(--ease-smooth-out);
}

.command-dialog-overlay.active .command-dialog-card {
  transform: none;
  transition-duration: var(--duration-medium);
}

.command-search-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.command-search-input {
  flex: 1;
  border: none;
  font-size: 14px;
  background: transparent;
}

.command-results-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
}

.command-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px;
  transition: background var(--duration-micro) var(--ease-smooth-out);
}

.command-item:hover, .command-item.selected {
  background: #F1F1F4;
}

.command-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  background: #FAFAFA;
  font-size: 10.5px;
  color: var(--ink-3);
}

/* ==========================================================================
   Modals & Toasts
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-smooth-out);
}

.badge-allocated {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  color: var(--foreign);
  background: #FFFDF5;
  border: 1px solid #EAD8A4;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: #FFFFFF;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-popup);
  width: 100%;
  max-width: 460px;
  padding: 20px;
  transform: translateY(10px) scale(0.97);
  transition: transform var(--duration-quick) var(--ease-smooth-out);
}

.modal-overlay.active .modal-card {
  transform: none;
  transition-duration: var(--duration-medium);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

#toast-msg {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--ink);
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: var(--shadow-popup);
  z-index: 3000;
  opacity: 0;
  transform: translateY(10px) scale(0.97);
  pointer-events: none;
  transition: opacity var(--duration-quick) var(--ease-smooth-out),
              transform var(--duration-quick) var(--ease-smooth-out);
}

#toast-msg.show {
  opacity: 1;
  transform: none;
  transition-duration: var(--duration-medium);
}

#app-footer {
  background-color: #FFFFFF;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 16px;
  font-size: 11px;
  color: var(--ink-3);
  margin-top: auto;
}
#app-footer .footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 6px;
  line-height: 1.6;
}
#app-footer .footer-row--brand { color: var(--ink-4); }
#app-footer .footer-sep { color: var(--ink-4); }
#app-footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
#app-footer a:hover { color: var(--ink-2); border-bottom-color: var(--line); }
#app-footer .footer-brand-link { color: var(--ink-2); font-weight: 500; }
#app-footer .footer-beian-icon {
  width: 12px; height: 12px;
  vertical-align: -2px;
  margin-right: 3px;
}
#app-footer .footer-kbd-hint { margin-left: 10px; color: var(--ink-4); }
#app-footer .footer-row--legal {
  display: block; max-width: 980px; margin: 6px auto 0;
  color: var(--ink-4); font-size: 11.5px; line-height: 1.65;
  text-align: left;   /* 法务长句左对齐，居中会让末行参差难读 */
}

/* ==========================================================================
   New Views Extensions (Province, PriceQty, HS4, Industry, Truth Badges)
   ========================================================================== */

.truth-badge-pill {
  transition: all 0.15s ease;
}
.truth-badge-pill:hover {
  background: #E4E4E7 !important;
  color: #000000 !important;
}

.prov-rank-item:hover {
  background: var(--line-2) !important;
}

.ledger-table th, .ledger-table td {
  border-bottom: 1px solid var(--line-2);
}

.ledger-table tr:hover {
  background: #F8FAFC;
}

/* Placeholder for missing data */
.data-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--ink-3);
  font-size: 13px;
  text-align: center;
  line-height: 1.6;
}

/* Pending data text - uniform gray, normal weight */
.pending-data {
  color: var(--ink-3);
  font-weight: 400;
}

/* nowrap utility */
.nowrap {
  white-space: nowrap;
}

/* Task 2: Hero thesis line */
.hero-thesis {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
  margin-top: 10px;
}

/* Task 3: Mover chips */
.mover-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #FFFFFF;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth-out);
  font-family: inherit;
}
.mover-chip:hover {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
}
.mover-chip:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.mover-chip.chip-positive { color: var(--surplus); }
.mover-chip.chip-negative { color: var(--deficit); }
.mover-chip.chip-positive:hover,
.mover-chip.chip-negative:hover { color: #FFFFFF; }

.mover-chips-caption {
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 4px;
}

/* Task 7: View question subtitle */
.view-question {
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 8px;
}

/* Task 9: Global focus-visible */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Task 6: Drilldown caption */
.drilldown-edge-caption {
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 8px;
}

/* Task 9: View treemap button in drilldown */
.drilldown-view-treemap-btn {
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #FFFFFF;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth-out);
  font-family: inherit;
  color: var(--ink);
}
.drilldown-view-treemap-btn:hover {
  background: var(--ink);
  color: #FFFFFF;
  border-color: var(--ink);
}


/* ==========================================================================
   首屏骨架 / 启动帮助 / 首次访问引导（首次价值触达）
   ========================================================================== */
.boot-skeleton { position: relative; min-height: 420px; }
.skeleton-line, .skeleton-block {
  border-radius: 4px;
  background: linear-gradient(90deg, #F4F4F5 25%, #FAFAFA 50%, #F4F4F5 75%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.skeleton-block { width: 100%; }
@keyframes skeleton-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.boot-status {
  position: absolute; left: 0; right: 0; top: 240px;
  text-align: center; font-size: 12.5px; color: var(--ink-3);
}

.boot-help { max-width: 560px; margin: 48px auto; }
.boot-help-title { font-size: 22px; font-weight: 700; color: var(--ink); margin-top: 4px; }
.boot-help-desc { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); margin-top: 10px; }
.boot-help-detail { color: var(--ink-4); font-size: 12px; }
.boot-help-desc a, .boot-help-steps a { color: var(--ink); text-decoration: underline; }
.boot-help-desc code, .boot-help-steps code {
  font-family: var(--font-mono); font-size: 12.5px; background: #F4F4F5; padding: 1px 6px; border-radius: 4px; color: var(--ink);
}
.boot-help-steps { margin: 14px 0 0 18px; font-size: 13.5px; line-height: 1.8; color: var(--ink-2); }
.boot-help-copy { margin-top: 20px; padding: 8px 14px; font-weight: 500; }
.boot-help-side { font-size: 12.5px; line-height: 1.7; color: var(--ink-3); padding: 8px 4px; }

.first-run-hint {
  position: fixed; left: 48px; bottom: 56px; z-index: 40;
  width: 340px; padding: 16px 18px;
  background: #FFFFFF; border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: var(--shadow-popup);
  animation: hint-in var(--duration-medium) var(--ease-smooth-out);
}
.first-run-hint.leaving { opacity: 0; transform: translateY(6px); transition: opacity var(--duration-fast), transform var(--duration-fast); }
@keyframes hint-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.first-run-hint-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.first-run-hint-steps { margin: 10px 0 0 18px; font-size: 12.5px; line-height: 1.65; color: var(--ink-2); }
.first-run-hint-steps li + li { margin-top: 4px; }
.first-run-hint-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2);
  font-size: 11.5px; color: var(--ink-3);
}


/* ==========================================================================
   响应式适配（平板 ≤1099px / 手机 ≤767px）
   阈值与 js/responsive.js 的 Layout 一致，改一处必须同时改另一处。
   视图层大量使用内联样式，故此处的覆盖多数必须带 !important。
   ========================================================================== */

:root {
  --m-nav-h: 50px;     /* 手机端底部视图导航条高度 */
  --m-sheet-h: 46px;   /* 手机端检视面板把手高度 */
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* 仅手机端出现的元素（搜索入口、横滑提示等），桌面端隐藏 */
.mobile-only,
.mobile-only-block { display: none !important; }

/* 抽屉把手 / 遮罩 / 收起按钮：桌面端完全不存在 */
.panel-sheet-handle,
.sheet-backdrop,
.sheet-collapse-btn { display: none; }

/* --------------------------------------------------------------------------
   平板与窄桌面：单列，检视面板落到内容下方
   -------------------------------------------------------------------------- */
@media (max-width: 1099px) {
  #app-header {
    height: auto;
    flex-wrap: wrap;
    align-items: stretch;
    padding: 0 20px;
  }
  .header-left  { order: 1; height: 52px; flex: 1 1 auto; }
  .header-right { order: 2; height: 52px; }
  .header-center {
    order: 3;
    flex: 1 0 100%;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    padding-bottom: 8px;
  }
  .header-center > div:first-child { min-width: 0; }
  .month-caption { text-align: left !important; }
  .month-controller { justify-content: flex-start; }
  .month-segment-track { flex: 1; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding: 0 12px; }
  .month-segment-track::-webkit-scrollbar { display: none; }
  .month-segment-btn { flex: 0 0 auto; scroll-snap-align: center; }

  #app-header .view-segment-control {
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  #app-header .view-segment-control::-webkit-scrollbar { display: none; }
  #app-header .view-btn { flex: 0 0 auto; }

  #breadcrumb-bar { position: static; padding: 0 20px; }

  #app-body {
    flex-direction: column;
    padding: 16px 20px 32px;
    gap: 16px;
  }
  #inspect-panel {
    position: static;
    top: auto;
    width: 100%;
    max-height: none;
    overflow: visible;
    order: 2;
  }
  .panel-content { height: auto !important; overflow: visible !important; }

  /* 视图内部的独立滚动容器在单列下交回给页面滚动 */
  .hs4-view-layout,
  .industry-view-layout,
  .ledger-view-layout,
  .price-qty-view-layout,
  .time-view-layout,
  .where-view-layout,
  .treemap-view-layout,
  .province-view-layout {
    height: auto !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }
}

/* --------------------------------------------------------------------------
   手机端
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  /* 底部固定：视图导航 + 面板把手，页面需要为它们留出空间 */
  body { padding-bottom: calc(var(--m-nav-h) + var(--m-sheet-h) + var(--safe-b)); }

  .mobile-only { display: inline-flex !important; }
  .mobile-only-block { display: block !important; }

  /* 可横滑的表格/图表，右缘留一道阴影提示"右边还有"（r10-canvas 承载伙伴/方式/量价十年的宽图） */
  .table-scroll, .chart-scroll-x, .r10-canvas {
    background: linear-gradient(to left, rgba(0, 0, 0, 0.07), rgba(0, 0, 0, 0)) right center / 16px 100% no-repeat;
  }
  .r10-canvas { -webkit-overflow-scrolling: touch; }

  /* ---- 顶栏 ---- */
  #app-header { padding: 0 14px; }
  .header-left  { height: 46px; }
  .header-right { height: 46px; gap: 6px; }
  .header-logo { font-size: 15px; }
  .header-badge { display: none; }
  #truth-badge-top { display: none !important; }
  .tool-btn { height: 30px; padding: 0 9px; font-size: 11.5px; }
  .header-center { gap: 4px !important; padding-bottom: 6px; }
  .month-caption { font-size: 10px; }
  .month-nav-btn { display: none; }
  .month-segment-btn { padding: 6px 14px; font-size: 12.5px; }

  /* ---- 视图切换 → 底部固定导航 ---- */
  #app-header .view-segment-control {
    position: fixed !important;
    left: 0; right: 0; bottom: 0;
    height: calc(var(--m-nav-h) + var(--safe-b));
    padding: 0 2px var(--safe-b) 2px !important;
    background: rgba(255, 255, 255, 0.97) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    border-radius: 0 !important;
    display: flex !important;
    gap: 0 !important;
    justify-content: space-between;
    z-index: 1300;
  }
  #app-header .view-btn {
    flex: 1 1 0;
    min-width: 0;
    height: var(--m-nav-h);
    padding: 0 4px;
    font-size: 12.5px;
    border-radius: 0;
    color: var(--ink-3);
    white-space: nowrap;
  }
  #app-header .view-btn.active {
    background: transparent !important;
    box-shadow: inset 0 -2px 0 var(--ink) !important;
    color: var(--ink);
  }

  .breadcrumb-trail { min-width: 0; }
  .crumb-item.current {
    max-width: 58vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .reset-drilldown-btn { flex-shrink: 0; white-space: nowrap; }

  /* 下钻后面包屑要一直看得见（"重置"是唯一的返回口），吸在顶栏下沿 */
  #breadcrumb-bar {
    position: sticky;
    top: var(--header-h, 92px);
    padding: 0 14px;
    height: 38px;
    font-size: 12px;
  }

  /* ---- 主体 ---- */
  #app-body { padding: 12px 12px 24px; gap: 12px; }
  #view-viewport { padding: 14px 12px; }
  #app-footer {
    padding: 12px 16px 16px;
    font-size: 10.5px;
    line-height: 1.7;
    text-align: center;
    gap: 6px;
  }
  /* 只藏那条快捷键提示（手机端没有键盘），「最近更新」与备案信息必须留着 */
  #app-footer .footer-kbd-hint { display: none; }

  /* ---- 检视面板 → 底部抽屉 ---- */
  #inspect-panel {
    position: fixed;
    /* 桌面端的 sticky top:80px 必须清掉，否则 fixed 元素按 top 定位、bottom 失效 */
    top: auto;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    max-height: 78vh;
    padding: 0;
    gap: 0;
    border: 1px solid var(--line);
    border-bottom: none;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.16);
    transform: translateY(105%);
    transition: transform 420ms var(--ease-drawer);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    z-index: 1500;
  }
  body.sheet-open #inspect-panel { transform: none; }
  /* 手指跟随拖拽期间由 JS 直接写 transform，过渡必须让位 */
  #inspect-panel.dragging,
  .sheet-backdrop.dragging { transition: none !important; }
  /* 抽屉顶部的拖拽提示条（iOS 习惯语汇：这个面板可以往下甩） */
  #inspect-panel::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--line-strong);
    margin: 8px auto 0;
    flex-shrink: 0;
  }
  #inspect-panel .panel-content {
    padding: 16px 14px calc(var(--m-nav-h) + var(--safe-b) + 56px) 14px !important;
    gap: 14px !important;
  }

  .panel-sheet-handle {
    position: fixed;
    left: 0; right: 0;
    bottom: calc(var(--m-nav-h) + var(--safe-b));
    height: var(--m-sheet-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 14px;
    background: #FFFFFF;
    border: none;
    border-top: 1px solid var(--line);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    text-align: left;
    z-index: 1400;
    transition: opacity var(--duration-fast) var(--ease-smooth-out);
  }
  .sheet-handle-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  .sheet-handle-title {
    font-size: 12.5px; font-weight: 600; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .sheet-handle-value {
    font-size: 11px; font-family: var(--font-mono); color: var(--ink-2);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .sheet-handle-cue {
    display: inline-flex; align-items: center; gap: 3px;
    flex-shrink: 0; font-size: 11.5px; font-weight: 500; color: var(--ink-3);
  }
  body.sheet-open .panel-sheet-handle { opacity: 0; pointer-events: none; }

  .sheet-collapse-btn {
    position: fixed;
    left: 50%;
    bottom: calc(var(--m-nav-h) + var(--safe-b) + 12px);
    transform: translateX(-50%) translateY(8px);
    display: block;
    height: 32px;
    padding: 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-2);
    box-shadow: var(--shadow-popup);
    opacity: 0;
    pointer-events: none;
    z-index: 1600;
    transition: all var(--duration-fast) var(--ease-smooth-out);
  }
  body.sheet-open .sheet-collapse-btn {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }

  .sheet-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    opacity: 0;
    pointer-events: none;
    z-index: 1450;
    transition: opacity var(--duration-fast) var(--ease-smooth-out);
  }
  body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }

  /* ---- 排版 ---- */
  .display-num { font-size: 42px; letter-spacing: -0.02em; }
  .num-l { font-size: 24px; }
  h1, .h1 { font-size: 21px; }
  h2, .h2 { font-size: 16px; }

  /* ---- 河流视图 ---- */
  .river-hero { gap: 14px; margin-bottom: 16px; }
  .hero-stats-line { flex-wrap: wrap; gap: 4px 8px; font-size: 12px; }
  .hero-right-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  #hero-gap-card { grid-column: 1 / -1; }
  .mini-card { height: auto; min-height: 100px; padding: 10px; }
  .sankey-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .color-mode-pills { overflow-x: auto; scrollbar-width: none; }
  .color-mode-pills::-webkit-scrollbar { display: none; }
  .color-pill-btn { flex: 0 0 auto; padding: 5px 10px; }
  .sankey-columns-header, .drilldown-columns-header { font-size: 9.5px; }
  #drilldown-sankey-section { margin-top: 18px; }

  /* ---- 表格：横向滑动，不压缩列 ---- */
  .table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* 660px 时"商品名称"列会被数字列挤成竖排单字，给足到 860px 再横滑 */
  .table-scroll > .ledger-table { min-width: 860px; }
  .table-scroll > .ledger-table td, .table-scroll > .ledger-table th { min-width: 56px; }
  .ledger-table th, .ledger-table td { padding: 7px 9px !important; font-size: 11.5px; }

  /* ---- 省份视图 ---- */
  .province-view-layout { flex-direction: column !important; gap: 12px !important; }
  .province-ranking-pane {
    width: 100% !important;
    height: auto !important;
    border-right: none !important;
    border-bottom: 1px solid var(--line);
    padding-right: 0 !important;
    padding-bottom: 12px;
  }
  .province-list-scroll { max-height: 38vh; }
  .province-chapters-pane { height: auto !important; overflow: visible !important; }
  #province-treemap-container { height: 340px !important; }

  /* ---- 版图视图 ---- */
  .tm-canvas-stack { overflow: visible !important; }
  .tm-selected-chip { flex-wrap: wrap; row-gap: 2px; }
  .tm-selected-name { max-width: 11em; }
  .tm-selected-vals { white-space: normal; }
  .tm-legend { margin-left: 0 !important; width: 100%; justify-content: flex-start; }
  #treemap-chapters-canvas { flex: none !important; height: 320px; }
  .tm-provinces-box { flex: none !important; }
  #treemap-provinces-canvas { height: 260px; }
  #treemap-canvas-container { height: 420px; }
  #treemap-tooltip { display: none !important; }  /* 触屏没有 hover，改由底部面板承接 */

  /* ---- 品目 / 行业 / 量价 ---- */
  #hs4-treemap-container { height: 360px !important; }
  .scatter-box { height: 340px !important; }
  .view-head-row { flex-direction: column; align-items: flex-start !important; gap: 8px; }

  /* ---- 时间视图 ---- */
  .time-charts-grid { grid-template-columns: 1fr !important; }
  #customs-small-multiples { grid-template-columns: repeat(2, 1fr) !important; }
  .small-multiples-grid { grid-template-columns: repeat(2, 1fr); }
  #industry-select-dropdown { max-width: 100%; }

  /* ---- 归属视图 ---- */
  .where-triplet-grid { grid-template-columns: 1fr !important; gap: 10px !important; }
  .chart-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ---- 账本视图 ---- */
  .ledger-main-layout { grid-template-columns: 1fr; }
  .ledger-filter-row { flex-wrap: wrap; }

  /* ---- 弹层 ---- */
  .modal-overlay { padding: 0 14px; }
  .modal-card { max-width: none; padding: 16px; }
  .command-dialog-overlay { padding: 8vh 12px 0; }
  .command-dialog-card { max-width: none; }
  .command-results-list { max-height: 46vh; }
  .command-footer { display: none; }

  #toast-msg {
    left: 12px; right: 12px;
    bottom: calc(var(--m-nav-h) + var(--m-sheet-h) + var(--safe-b) + 12px);
    text-align: center;
  }
  .first-run-hint {
    left: 12px; right: 12px; width: auto;
    bottom: calc(var(--m-nav-h) + var(--m-sheet-h) + var(--safe-b) + 12px);
  }
  .first-run-hint-footer > span { display: none; }

  .boot-skeleton { min-height: 300px; }
  .boot-status { top: 200px; }
  .boot-help { margin: 24px auto; }
  .boot-help-title { font-size: 19px; }

  /* Task 2: hero-thesis mobile */
  .hero-thesis { font-size: 14px; }

  /* Task 4: drilldown scroll-margin mobile */
  #drilldown-sankey-section { scroll-margin-top: 80px; }

  /* Task 9: minimum caption sizes */
  .caption { font-size: 11.5px; color: var(--ink-2); }
  .mover-chips-caption { font-size: 11.5px; }
  .drilldown-edge-caption { font-size: 11.5px; }
}

/* 触屏：去掉悬停位移与阴影，避免点一下就"抖"；按压反馈仍保留 */
@media (hover: none) {
  .tool-btn:hover,
  .mini-card:hover,
  .spark-card:hover,
  .panel-btn:hover,
  .tm-crumb-card:hover,
  .treemap-node:hover,
  .pq-card:hover,
  .month-nav-btn:hover:not(:disabled) {
    transform: none;
    box-shadow: none;
  }
  .tool-btn:active,
  .panel-btn:active,
  .month-nav-btn:active:not(:disabled) { transform: scale(0.96); }
  .pq-card:active, .mini-card:active, .spark-card:active, .tm-crumb-card:active { transform: scale(0.985); }
}

/* 手机端把手内容更新时的一次轻提示 */
@media (max-width: 767px) {
  .panel-sheet-handle.updated { animation: sheet-handle-flash 900ms var(--ease-smooth-out); }
  @keyframes sheet-handle-flash {
    0%   { background: #EEF4FD; }
    100% { background: #FFFFFF; }
  }
  .panel-sheet-handle.updated .sheet-handle-cue { color: var(--surplus); }
}

/* ==========================================================================
   Price & Qty View — 四象限金额看板 + 蜂群带
   ========================================================================== */
.price-qty-view-layout {
  container: price-qty / inline-size;
}

.pq-head-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pq-capsule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-2);
  background: #F4F4F5;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
}
.pq-capsule strong { color: var(--ink); }
.pq-capsule-muted { background: #FFFFFF; border: 1px solid var(--line); color: var(--ink-3); }
.pq-capsule-click {
  background: #FFFFFF;
  border: 1px solid var(--line);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}
.pq-capsule-click:hover { border-color: var(--line-strong); }
.pq-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }

/* ---- 四象限金额卡片 ---- */
.pq-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pq-card {
  position: relative;
  background: #FAFAFA;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background var(--duration-quick) var(--ease-smooth-out),
              border-color var(--duration-quick) var(--ease-smooth-out),
              box-shadow var(--duration-quick) var(--ease-smooth-out),
              transform var(--duration-quick) var(--ease-smooth-out);
}
.pq-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: 8px 8px 0 0;
  background: var(--pq-c, var(--line-strong));
}
.pq-card:hover,
.pq-card.active {
  background: #FFFFFF;
  border-color: var(--line-strong);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}
.pq-card.active { border-color: var(--pq-c, var(--line-strong)); }

.pq-card-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}
.pq-card-count { font-size: 11px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.pq-card-amount {
  font-size: clamp(17px, 1.45vw, 21px);
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--ink);
  white-space: nowrap;
}
.pq-card-share { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.pq-card-share strong { color: var(--ink-2); }
.pq-card-bar {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  margin: 10px 0;
  overflow: hidden;
}
.pq-card-bar-fill { height: 100%; border-radius: 2px; }
.pq-card-items { font-size: 11.5px; color: var(--ink-2); line-height: 1.5; }

/* ---- 蜂群带 ---- */
/* 视图列足够宽时四张卡片一行排开，窄列自动折成 2×2 */
@container price-qty (min-width: 880px) {
  .pq-cards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.pq-swarm-box {
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px 8px;
}
.pq-swarm-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.pq-swarm-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.pq-swarm-hint { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.pq-swarm-canvas { width: 100%; height: 300px; position: relative; }

/* ---- 账本联动 ---- */
.pq-row {
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  transition: background var(--duration-quick) var(--ease-smooth-out);
}
.pq-row:hover { background: #F8FAFC; }
.pq-row.pq-row-flash { background: #FEF3C7; }

/* ---- 浮动 Tooltip ---- */
.pq-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  width: 236px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: var(--shadow-popup);
  transition: opacity var(--duration-fast) var(--ease-smooth-out);
}
.pq-tt-title { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.pq-tt-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.8;
}
.pq-tt-row span:last-child { font-family: var(--font-mono); color: var(--ink); }
.pq-tt-note { margin-top: 6px; font-size: 11px; color: #B45309; }

@media (max-width: 767px) {
  .pq-cards-grid { gap: 10px; }
  .pq-card-amount { font-size: 19px; }
  .pq-swarm-canvas { height: 340px; }
  .pq-swarm-hint { display: none; }
  .pq-tooltip { display: none !important; }  /* 触屏没有 hover，改由底部面板承接 */
}


/* ==========================================================================
   十年时序层视图（河流 / 伙伴 / 方式 / 量价十年）与时间轨
   ========================================================================== */
.r10-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; flex-wrap:wrap; margin-bottom:8px; }
.r10-stack { display:flex; align-items:center; gap:6px; flex-wrap:wrap; min-height:28px; }
.r10-crumb { border:0; background:transparent; padding:4px 6px; border-radius:4px; font-size:13px; color:var(--ink-2); cursor:pointer; font-family:inherit; transition: transform var(--duration-quick) var(--ease-smooth-out), background-color var(--duration-quick) var(--ease-smooth-out), color var(--duration-quick) var(--ease-smooth-out); }
.r10-crumb:hover { background:var(--line-subtle); color:var(--ink); }
.r10-crumb.current { color:var(--ink); font-weight:600; cursor:default; }
.r10-crumb-sep { color:var(--ink-3); font-size:12px; }
.r10-when { margin-left:10px; font-size:12px; color:var(--ink-3); }
.r10-controls { display:flex; align-items:center; gap:10px; }
.r10-seg { display:flex; gap:2px; background:#F1F1F3; padding:3px; border-radius:6px; }
.r10-pill { border:0; background:transparent; padding:4px 10px; border-radius:5px; font-size:12px; color:var(--ink-2); cursor:pointer; font-family:inherit; white-space:nowrap; transition: transform var(--duration-quick) var(--ease-smooth-out), background-color var(--duration-quick) var(--ease-smooth-out), color var(--duration-quick) var(--ease-smooth-out); }
.r10-pill.on { background:#fff; color:var(--ink); font-weight:600; box-shadow:var(--shadow-sm); }
.r10-select { font-family:inherit; font-size:12px; padding:4px 8px; border:1px solid var(--line); border-radius:6px; background:#fff; color:var(--ink); max-width:260px; }
.r10-hero { display:flex; align-items:baseline; gap:18px; flex-wrap:wrap; margin:4px 0 6px; }
.r10-hero-num { display:flex; align-items:baseline; gap:6px; }
.r10-big { font-size:44px; font-weight:300; letter-spacing:-0.02em; line-height:1; font-variant-numeric:tabular-nums; }
.r10-unit { font-size:13px; color:var(--ink-3); }
.r10-hero-sub { display:flex; gap:14px; flex-wrap:wrap; }
.r10-hero-sub b { color:var(--ink); font-weight:500; }
.r10-hero-sub b.up { color:var(--surplus); } .r10-hero-sub b.down { color:var(--deficit); }
.r10-canvas { width:100%; overflow-x:auto; }
.r10-canvas svg { display:block; max-width:100%; }
.r10-band { transition: opacity var(--duration-fast) var(--ease-smooth-out); }
.r10-note { margin-top:6px; color:var(--ink-3); }
.timerail { margin-top:14px; padding:8px 0 4px; border-top:1px solid var(--line); outline:none; user-select:none; cursor:col-resize; }
.timerail:focus-visible { outline:2px solid var(--ink); outline-offset:2px; }
.timerail-caption { font-size:11px; color:var(--ink-3); margin-top:4px; }
.md-grid { display:grid; grid-template-columns: 1.15fr 1fr; gap:20px; align-items:start; }
.md-title { font-size:13px; font-weight:600; margin:6px 0 4px; }
.sh-table { margin-top:12px; }
.sh-table .num { font-family:var(--font-mono); text-align:right; }
.ledger-table th, .ledger-table td { padding:6px 8px; border-bottom:1px solid var(--line-subtle); text-align:left; font-size:12px; }
.ledger-table th { background:#F4F4F5; color:var(--ink-2); font-weight:500; }
@media (max-width: 1099px) {
  .md-grid { grid-template-columns: 1fr; }
  .r10-big { font-size:34px; }
}
@media (max-width: 767px) {
  .r10-controls { flex-wrap:wrap; gap:6px; width:100%; }
  .r10-pill { padding:4px 8px; font-size:11.5px; }
  .r10-select { max-width:100%; }
  .r10-hero-sub { gap:8px; }
  .timerail { touch-action: none; }
  /* 河流/斜率图在手机上保持可读尺寸，在自己的容器内横向滚动，不整体缩小 */
  .r10-canvas svg { max-width:none; }
  /* 13 个视图按钮：底部导航改为可横向滑动，不再均分挤压 */
  #app-header .view-segment-control { justify-content:flex-start !important; overflow-x:auto; -webkit-overflow-scrolling:touch; scroll-snap-type:x proximity; }
  #app-header .view-btn { flex:0 0 auto; padding:0 12px; scroll-snap-align:center; }
}

/* ==========================================================================
   全局收尾：细滚动条 / 减弱动效偏好
   ========================================================================== */
.table-scroll::-webkit-scrollbar,
.chart-scroll-x::-webkit-scrollbar,
.r10-canvas::-webkit-scrollbar,
.command-results-list::-webkit-scrollbar {
  height: 5px;
  width: 5px;
}
.table-scroll::-webkit-scrollbar-thumb,
.chart-scroll-x::-webkit-scrollbar-thumb,
.r10-canvas::-webkit-scrollbar-thumb,
.command-results-list::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.14);
  border-radius: 4px;
}

/* 系统层面选择了"减弱动态效果"的用户：保留透明度渐变，去掉一切位移与循环动画 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 伙伴迁移：表头与数值保持同一对齐基线，窄屏在表格容器内滚动。 */
.sh-table {overflow-x:auto;scrollbar-width:thin;}
.sh-table .ledger-table {table-layout:fixed;min-width:620px;}
.sh-table .ledger-table th,.sh-table .ledger-table td {padding:10px 12px;white-space:nowrap;}
.sh-table .ledger-table th:first-child {width:22%;}
.sh-table .ledger-table th:last-child {width:24%;}
.sh-table .ledger-table th.num,.sh-table .ledger-table td.num {text-align:right;font-variant-numeric:tabular-nums;}
.sh-table .ledger-table th.num {font-family:var(--font-sans);}

/* ==========================================================================
   首屏钩子 · G20 焦点条 · 无 JS 静态摘要（2026-09 传播期加入）
   ========================================================================== */
.hero-hook {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--surplus);
  line-height: 1.4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-hook-arrow { display: inline-block; animation: hook-bob 1.6s var(--ease-smooth-out, ease-out) infinite; }
@keyframes hook-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { .hero-hook-arrow { animation: none; } }

/* 焦点条：由 js/focus.js 按 data/focus.json 渲染，过期或 enabled=false 时不出现 */
#focus-strip { display: none; }
#focus-strip.on {
  display: block;
  max-width: 1760px;
  margin: 0 auto;
  padding: 12px 48px 0;
}
.focus-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--surplus);
  border-radius: 8px;
  background: var(--surplus-bg);
}
.focus-label { font-size: 12px; font-weight: 600; color: var(--surplus); white-space: nowrap; letter-spacing: 0.02em; }
.focus-label small { display: block; font-weight: 400; color: var(--ink-3); margin-top: 2px; }
.focus-cards { display: flex; gap: 8px; flex-wrap: wrap; }
.focus-card {
  appearance: none; border: 1px solid var(--line-strong); background: #fff; border-radius: 6px;
  padding: 7px 12px; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  display: flex; flex-direction: column; gap: 2px; min-width: 180px; max-width: 300px;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast), transform var(--duration-fast);
}
.focus-card:hover { border-color: var(--surplus); box-shadow: var(--shadow-hover); }
.focus-card:active { transform: scale(0.98); }
.focus-card strong { font-size: 13px; font-weight: 600; line-height: 1.35; }
.focus-card span { font-size: 11.5px; color: var(--ink-2); line-height: 1.4; }
.focus-card em { font-style: normal; color: var(--surplus); font-weight: 600; }
.focus-card em.down { color: var(--deficit); }
.focus-close {
  appearance: none; border: 0; background: transparent; color: var(--ink-3); cursor: pointer;
  font-size: 18px; line-height: 1; padding: 4px 6px; border-radius: 4px;
}
.focus-close:hover { color: var(--ink); background: rgba(0,0,0,0.04); }
@media (max-width: 1099px) { #focus-strip.on { padding: 10px 20px 0; } }
@media (max-width: 767px) {
  #focus-strip.on { padding: 8px 12px 0; }
  .focus-inner { grid-template-columns: 1fr auto; row-gap: 8px; padding: 10px 10px 8px 12px; }
  .focus-label { grid-column: 1; }
  .focus-close { grid-column: 2; grid-row: 1; }
  .focus-cards { grid-column: 1 / -1; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; scrollbar-width: none; }
  .focus-cards::-webkit-scrollbar { display: none; }
  .focus-card { min-width: 200px; flex: 0 0 auto; }
}

/* 无 JS / 爬虫可见的静态摘要：脚本一旦渲染视图就会被替换掉 */
.static-summary {
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line-2);
  max-width: 760px; font-size: 13.5px; line-height: 1.7; color: var(--ink-2);
}
.static-summary h1 { font-size: 20px; font-weight: 600; color: var(--ink); margin: 0 0 6px; line-height: 1.35; }
.static-summary h2 { font-size: 14px; font-weight: 600; color: var(--ink); margin: 14px 0 4px; }
.static-summary ul { margin: 4px 0 0 18px; padding: 0; }
.static-summary li { margin: 2px 0; }
.static-summary .num { font-feature-settings: "tnum" 1; }

/* 十年时序视图禁用币种切换时的按钮态 */
.tool-btn:disabled, .tool-btn.is-disabled { opacity: .45; cursor: not-allowed; }
