/* 本月地形 VFTerrain（static/js/terrain.js）：照 uiarc Activity terrain 演示实测复刻，编号见 terrain.js 文件头（会话草稿 at/spec_layout.md）。
   原件的站点 CSS 只读来定数，没有拷进来；颜色一律站内 token（742 色库），浅一档用透明度叠。
   跟原件不同：卡底照拓己页别的几节（圆角 20、--shadow；原件 16）；标题照站内节标题（宋体 600）；小字一律 --text-soft（--text-muted 在雪白上不到 4.5:1）；
   原件标题下的说明与图下的操作提示都不出（用户不要灰色说明字），提示只给读屏。 */
.tr-root{container-type:inline-size;border-radius:20px;background-color:var(--gc-fill);border:1px solid var(--gc-edge);box-shadow:var(--gc-shadow);-webkit-backdrop-filter:var(--gc-blur);backdrop-filter:var(--gc-blur);
  font-size:13px;line-height:1.4;letter-spacing:-.01em;min-width:0}                               /* L-01 */
.tr-inner{display:grid;gap:16px;padding:16px 20px 20px;min-width:0}                                 /* L-02 */
.tr-head h2{margin:0;font-family:var(--serif);font-size:16px;font-weight:600;line-height:1.4;letter-spacing:0}   /* L-03 */
.tr-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;min-width:0}   /* L-04 */

/* 分段控件（segmented-control.module.css 的版式，原生重写；A 类，L-06〜L-08） */
.tr-seg{display:inline-flex;min-width:0;max-width:100%;flex-shrink:1;border:1px solid var(--border-strong);border-radius:18px;background:var(--surface-2)}
.tr-seg-track{position:relative;isolation:isolate;display:flex;min-width:0;gap:2px;overflow-x:auto;overscroll-behavior-x:contain;padding:3px;border-radius:inherit;scrollbar-width:none}
.tr-seg-track::-webkit-scrollbar{display:none}
.tr-seg button{position:relative;flex:0 0 auto;min-height:36px;border:0;border-radius:14px;padding:0 12px;background:transparent;color:var(--text-soft);
  font:inherit;font-size:14px;font-weight:500;letter-spacing:0;white-space:nowrap;cursor:pointer;-webkit-tap-highlight-color:transparent;
  transition:color .16s cubic-bezier(.22,1,.36,1)}                                                  /* L-07、M-37 字色 160ms standard */
@media (hover:hover) and (pointer:fine){.tr-seg button:hover{color:var(--text)}}
.tr-seg button:active,.tr-seg button[aria-pressed="true"]{color:var(--text)}
.tr-seg button:focus-visible{outline:2px solid var(--primary);outline-offset:1px}
.tr-seg-sel{position:absolute;z-index:-1;left:0;top:3px;bottom:3px;width:0;border:1px solid var(--border-strong);border-radius:14px;background:var(--surface);
  box-shadow:var(--shadow-sm);pointer-events:none}                                                   /* L-08 */
.tr-seg-l{position:relative;z-index:1}
@media (max-width:380px){.tr-seg button{padding:0 10px}}

/* 主体：≥881 两栏（统计在右 224）；≤880 统计挪到图下（L-09、W-01、W-03） */
.tr-body{display:grid;grid-template-columns:minmax(0,1fr) 224px;gap:20px;min-width:0}
.tr-stage{display:flex;flex-direction:column;gap:10px;min-width:0}
.tr-plot{position:relative;height:clamp(280px,44cqi,460px);border-radius:12px;overflow:hidden;touch-action:pan-y;
  -webkit-user-select:none;user-select:none;cursor:grab;outline:none;-webkit-tap-highlight-color:transparent}   /* L-10 */
.tr-plot:focus-visible{box-shadow:0 0 0 2px var(--primary) inset}
.tr-plot[data-over]{cursor:pointer}
.tr-plot[data-dragging]{cursor:grabbing}
.tr-canvas{position:absolute;inset:0;width:100%;height:100%;display:block}                         /* L-11 */

/* 提示框（L-19〜L-21、I-01：进 .12s、出 .16s） */
.tr-panel{position:absolute;left:0;top:0;z-index:2;width:208px;padding:10px 12px;border-radius:12px;
  background-color:var(--gc-fill);border:1px solid var(--gc-edge);box-shadow:var(--gc-shadow);font-size:12px;color:var(--text-soft);pointer-events:none;
  opacity:0;transition:opacity .16s cubic-bezier(.22,1,.36,1)}
.tr-panel[data-show]{opacity:1;transition-duration:.12s;-webkit-backdrop-filter:var(--gc-blur);backdrop-filter:var(--gc-blur)}   /* 磨砂只在露出来时开：收起只是透明、位置还留着，带磨砂的 WebKit 会把它算进页面宽（10-30 雷达在 1280 宽读过一维后缩到 320，页面宽成 871） */
.tr-p-h{display:flex;justify-content:space-between;gap:8px;margin:0;white-space:nowrap}
.tr-p-h b{font-weight:500;color:var(--text)}
.tr-p-h span{display:inline-flex;align-items:center;gap:5px;color:var(--text)}
.tr-p-h span::before{content:"";width:8px;height:8px;border-radius:2px;background:var(--tone)}
.tr-p-v{margin:2px 0 6px;color:var(--text)}
.tr-p-v b{font-size:18px;font-weight:500;font-variant-numeric:tabular-nums}
.tr-p-v small{font-size:12px;margin-left:3px;color:var(--text-soft)}
.tr-panel dl{margin:0;display:grid;gap:2px}
.tr-panel dl div{display:flex;justify-content:space-between;gap:8px}
.tr-panel dt{margin:0}
.tr-panel dd{margin:0;color:var(--text);font-variant-numeric:tabular-nums}
.tr-panel dd[data-tone="good"]{color:var(--success)}
.tr-panel dd[data-tone="bad"]{color:var(--danger)}
.tr-spark{display:grid;grid-template-columns:repeat(var(--n),1fr);gap:1px;align-items:end;height:22px;margin-top:10px}
.tr-spark i{display:block;height:calc(var(--v) * 100%);border-radius:1px;background:var(--border-strong);transition:height .24s cubic-bezier(.22,1,.36,1)}
.tr-spark i[data-on]{background:var(--tone)}

/* 复位（L-22、L-23） */
.tr-reset{position:absolute;top:10px;right:10px;z-index:3;display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px 0 10px;border-radius:10px;
  border:1px solid var(--border-strong);background:var(--surface);box-shadow:var(--shadow-sm);color:var(--text-soft);font:inherit;font-size:13px;font-weight:500;
  cursor:pointer;transition:opacity .16s cubic-bezier(.22,1,.36,1),transform .16s cubic-bezier(.22,1,.36,1),visibility .16s}
.tr-reset svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.tr-reset[data-hidden]{opacity:0;visibility:hidden;transform:translateY(-4px);pointer-events:none}
.tr-reset:focus-visible{outline:2px solid var(--primary);outline-offset:2px}

/* 图下一行：色阶（L-12〜L-14） */
.tr-legend{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 20px;font-size:12px;color:var(--text-soft)}
.tr-keys{display:flex;flex-wrap:wrap;gap:4px 12px}
.tr-key{display:inline-flex;align-items:center;gap:5px;transition:opacity .24s cubic-bezier(.22,1,.36,1)}
.tr-key i{width:8px;height:8px;border-radius:2px}
.tr-key[data-on]{color:var(--text);font-weight:600}
.tr-key[data-dim]{opacity:.8}   /* 跟画布上不相关几排同一档淡（DIM_ROW 往白叠 20%） */
/* 俯视热力图的色阶：低…高四格，格子是按钮（看得见 11px、点得到 15×20），钉住的一格内描 1.5px 墨线（activity-heatmap.module.css:51、:56-64）；
   深浅同画布：墨灰按 26/50/76/100% 叠在空格色上（各方面颜色不同，色阶用中性灰示意） */
.tr-scale{display:flex;flex:none;align-items:center;gap:8px;line-height:1}
.tr-root:not([data-view="top"]) .tr-scale{display:none}
.tr-sws{display:flex}
.tr-sw{position:relative;display:grid;width:15px;height:20px;place-items:center;padding:0;border:0;border-radius:4px;background:transparent;cursor:pointer;-webkit-tap-highlight-color:transparent}
.tr-sw::before{content:"";width:11px;height:11px;border-radius:3px;
  background:color-mix(in oklab,var(--text-soft) var(--p),color-mix(in oklab,var(--text) 6.5%,var(--surface)))}
.tr-sw[aria-pressed="true"]{box-shadow:inset 0 0 0 1.5px var(--text)}
.tr-sw:focus-visible{outline:2px solid var(--primary);outline-offset:1px}
.tr-root[data-view="top"] .tr-plot:not([data-over]){cursor:default}   /* 热力图不能拖 */

/* 统计（L-15〜L-18） */
.tr-stats{display:flex;flex-direction:column;padding-left:20px;border-left:1px solid var(--border-strong);min-width:0}
.tr-stat{display:flex;flex-direction:column;gap:4px;padding:16px 0;border-top:1px solid var(--border-strong);min-width:0}
.tr-stat:first-child{border-top:0;padding-top:0}
.tr-stat p{margin:0}
.tr-stat-l{position:relative;display:grid;font-size:13px;color:var(--text-soft)}
.tr-stat-l>span{grid-area:1/1}
.tr-big{margin-top:2px!important;font-size:28px;font-weight:500;letter-spacing:-.02em;line-height:1.15;color:var(--text);font-variant-numeric:tabular-nums}
.tr-mid{font-size:16px;font-weight:500;color:var(--text)}
.tr-small{font-size:12px;color:var(--text-soft);font-variant-numeric:tabular-nums;min-height:2lh}
.tr-peaks{display:grid;gap:2px}
.tr-peak{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:6px 12px;align-items:center;padding:7px 8px;margin:0 -8px;border:0;border-radius:8px;
  background:transparent;font:inherit;font-size:13px;color:var(--text);text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent;
  transition:background-color .16s cubic-bezier(.22,1,.36,1),transform .12s cubic-bezier(.22,1,.36,1)}
.tr-peak span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tr-peak .tr-pv{color:var(--text-soft);font-variant-numeric:tabular-nums}
.tr-rank{display:grid;place-items:center;width:14px;height:14px;border-radius:50%;background:var(--primary);color:var(--surface);font:600 9px/1 var(--sans);font-style:normal}   /* 跟画布上的名次圆章同号同色 */
@media (hover:hover) and (pointer:fine){.tr-peak:hover{background:var(--surface-2)}}
.tr-peak[aria-pressed="true"]{background:var(--surface-2);box-shadow:inset 3px 0 0 var(--primary)}
.tr-peak:active{transform:scale(.98)}
.tr-peak:focus-visible{outline:2px solid var(--primary);outline-offset:-2px}

/* 数字滚轮（animated-counter.module.css 的版式，原生重写；A 类） */
.tr-counter{display:inline-flex}
.tr-cv{display:inline-flex;align-items:flex-start;white-space:nowrap;-webkit-user-select:none;user-select:none}
.tr-col{--feather:.16em;position:relative;display:inline-block;overflow:hidden;margin-block:calc(var(--feather) * -1);padding-block:var(--feather);
  -webkit-mask-image:linear-gradient(to bottom,transparent,#000 calc(var(--feather) * 1.5),#000 calc(100% - var(--feather) * 1.5),transparent);
  mask-image:linear-gradient(to bottom,transparent,#000 calc(var(--feather) * 1.5),#000 calc(100% - var(--feather) * 1.5),transparent)}
.tr-sizer{visibility:hidden}
.tr-glyph{position:absolute;inset:var(--feather) 0;text-align:center}
.tr-sym{display:inline-block;overflow-x:clip}

.tr-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}   /* L-24 */

/* ≤880：统计挪到图下三列（W-03） */
@container (max-width:880px){
  .tr-body{grid-template-columns:minmax(0,1fr);gap:16px}
  .tr-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px;padding:16px 0 0;border-left:0;border-top:1px solid var(--border-strong)}
  .tr-stat{padding:0;border-top:0}
}
/* ≤560：内距 16、间距 12、图高 280、提示框 188、统计两列且「最高的三天」排最后跨两列、大数 22（W-04） */
@container (max-width:560px){
  .tr-inner{padding:16px;gap:12px}
  .tr-plot{height:280px}
  .tr-panel{width:188px}
  .tr-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 16px}
  .tr-stat[data-s="peaks"]{order:3;grid-column:1/-1}
  .tr-big{font-size:22px}
}

@media (prefers-reduced-motion:reduce){   /* P-06 */
  .tr-peak,.tr-reset,.tr-spark i,.tr-seg button,.tr-panel{transition:none}
}
