/*
 * 托管补丁 —— 原型包本身不动。跟同系列另外两个原型同一套分工。
 * ① 不引 Google Fonts（大陆访客会卡在那次超时上）
 * ② 演示角标只在原型被单独打开时出现
 * ③ 功能视图 `?view=feature`：见下面那一大段
 */
body {
  font-family: Manrope, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', Roboto, Helvetica, Arial, sans-serif;
}

.demo-badge {
  position: fixed; z-index: 9; left: 16px; bottom: 16px;
  display: none; align-items: center; gap: 8px;
  padding: 8px 14px 8px 11px; border-radius: 30px;
  background: #1a1a1a; color: #fff; font-size: 11px; line-height: 1;
  text-decoration: none; box-shadow: 0 7px 24px #00000026;
}
.demo-badge b { color: #fb8c42; font-weight: 700; }
.demo-badge span { color: #b8b4b0; }
@media (max-width: 700px) { .demo-badge { display: none !important; } }

/* ══════════════════════════════════════════════════════════════════
 * 功能视图 `?view=feature`
 *
 * 跟 dealer-portal 是同一类：**这一层改的东西一大半不在面板里**，
 * 在左边那张地图和那份伙伴名单上。所以同样给两块挂橙色虚线，
 * 筛选一变就脉冲一次。
 *
 * ⚠️ 这个原型多一个尺寸问题：**地图很吃高度。**
 * 200 × 110 的 viewBox 在 470px 宽的左栏里会撑出 258px 高，
 * 加上标题和第一张伙伴卡就把 600px 的框吃光了。
 * 解决办法在 `script-host.js`：功能视图下把 viewBox 换成裁过的一段
 * （南北两极本来就是空的），高度降到 200 出头。**不要在这里用 height + overflow 裁** ——
 * 那样 SVG 会按高度缩放，左右留出两条大白边，地图反而更小。
 * ══════════════════════════════════════════════════════════════════ */
body.feature-view { height: 100dvh; overflow: hidden; }

body.feature-view .site-header { height: 56px; }
body.feature-view .locator-shell {
  margin-top: 34px;
  height: calc(100dvh - 90px);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d2ccc5 transparent;
  padding: 6px 34px 50px;
  padding-right: calc(46% + 30px);
}
body.feature-view .locator-shell::-webkit-scrollbar { width: 6px; }
body.feature-view .locator-shell::-webkit-scrollbar-thumb { border-radius: 10px; background: #d2ccc5; }

/* 上半截整体压扁，好让地图和第一张伙伴卡同时落在第一屏 —— 
   「一个 marker 淡出、一张卡变灰」是同一件事的两个说法，分开看就弱一半。 */
body.feature-view .locator-head { padding-bottom: 14px; }
body.feature-view .locator-head h1 { margin-top: 8px; font-size: 22px; }
body.feature-view .lede,
body.feature-view .net-stats { display: none; }
body.feature-view .map-panel { margin-top: 14px; }
body.feature-view .map-frame { padding: 10px 12px; }
body.feature-view .partner-section { margin-top: 18px; }
body.feature-view .partner-head h2 { font-size: 15px; }
body.feature-view .partner-list { grid-template-columns: 1fr; gap: 10px; margin-top: 12px; }
body.feature-view .partner-card { padding: 13px; }
body.feature-view .partner-card h3 { font-size: 13px; }

/* 「打开路由」的入口和关闭按钮在这个视图里没有意义 —— 它本来就是开的 */
body.feature-view .route-trigger,
body.feature-view .route-panel header > button { display: none; }

body.feature-view .route-panel {
  top: 90px;
  right: 18px;
  bottom: auto;
  left: auto;
  width: 46%;
  min-width: 340px;
  /* ⚠️ 高度写死。top + bottom 配 auto 高度时 bottom 被忽略，
     面板缩成半截，被切掉的正好是底下那张路由结果卡。 */
  height: calc(100dvh - 106px);
  min-height: 0;
  max-height: none;
  transform: none;
  visibility: visible;
  opacity: 1;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .16);
}

/* 字号：面板从 470px 的小挂件变成页面主体，整体上调 */
body.feature-view .route-panel header { padding: 15px 24px 13px; }
body.feature-view .route-panel header span { font-size: 10px; }
body.feature-view .route-panel header h2 { font-size: 20px; }
body.feature-view .route-content { padding: 16px 24px 22px; }
body.feature-view .route-intro { font-size: 13px; line-height: 1.72; }
body.feature-view .step-head span { font-size: 13px; }
body.feature-view .step-head em { font-size: 12px; }
body.feature-view .chip { font-size: 12px; padding: 9px 13px; }
body.feature-view .routed-card > b { font-size: 19px; }
body.feature-view .reasons li { font-size: 12px; }

/* ── 左边被这一层改写的两块 ────────────────────────────
   平时一圈很淡的橙虚线，筛选条件一变脉冲一次。
   只在功能视图里出现 —— 完整站视图是给录屏的，那里不该有标注。 */
body.feature-view [data-zone] {
  position: relative;
  outline: 1px dashed #f0b985;
  outline-offset: 6px;
  border-radius: 4px;
  transition: outline-color .5s;
}
body.feature-view [data-zone].zone-touched {
  outline-color: var(--orange);
  animation: zone-pulse .9s ease;
}
@keyframes zone-pulse {
  0% { box-shadow: 0 0 0 0 #ed650033; }
  40% { box-shadow: 0 0 0 10px #ed650000; }
  100% { box-shadow: 0 0 0 0 #ed650000; }
}

/* 两个区域标签。**这是这个视图里信息量最大的两行字。** */
.fv-tag {
  position: fixed; z-index: 4; top: 60px;
  display: none; align-items: center; gap: 7px;
  padding: 6px 12px; border-radius: 20px;
  font: 500 11px/1 DM Mono, monospace; letter-spacing: .3px; white-space: nowrap;
}
body.feature-view .fv-tag { display: inline-flex; }
.fv-tag:before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.fv-tag-base { left: 34px; background: #efece8; color: #6f6a66; }
.fv-tag-base:before { background: #b9b3ac; }
.fv-tag-built { left: calc(54% - 18px); background: #ed6500; color: #fff; }
.fv-tag-built:before { background: #ffd0aa; }

/* ══ 窄屏：上下分屏 ══════════════════════════════════════
 * 同 dealer-portal：**不能让面板铺满**。这个演示要证明的
 * 「一个 marker 淡出、一张卡变灰」全发生在面板外面，
 * 盖住了就只剩一个筛选表单。
 * ⚠️ 上下各半时别忘了减掉站点头那 56px。 */
@media (max-width: 900px) {
  body.feature-view { height: 100dvh; overflow: hidden; }
  body.feature-view .locator-shell {
    margin-top: 0;
    height: calc(52dvh - 56px);
    overflow-y: auto;
    padding: 10px 16px 16px;
  }
  body.feature-view .locator-head { display: none; }
  body.feature-view .map-panel { margin-top: 0; }
  body.feature-view .map-frame { padding: 8px 10px; }
  body.feature-view .partner-section { margin-top: 12px; }
  /* 375px 宽里「Partners in Germany」和「1 of 3 qualify」并排会各自换行，
     两行标题换不来任何信息 —— 留那句带数字的就够了。 */
  body.feature-view .partner-head h2 { display: none; }
  body.feature-view .partner-head p { font-size: 11px; }
  body.feature-view .partner-list { margin-top: 8px; }
  body.feature-view .partner-card { padding: 11px 12px; }
  body.feature-view .partner-terr { display: none; }
  body.feature-view .badges { margin-top: 8px; }
  body.feature-view .route-panel {
    top: auto; bottom: 0; left: 0; right: 0;
    width: auto; min-width: 0;
    height: 48dvh;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -14px 40px rgba(0, 0, 0, .14);
  }
  /* 只留 built 标签，骑在分界线上 —— 上半屏就是那张页面本身，不用标 */
  body.feature-view .fv-tag { display: none; }
  body.feature-view .fv-tag-built {
    display: inline-flex;
    top: auto; bottom: calc(48dvh - 13px);
    left: 50%; transform: translateX(-50%);
    z-index: 8;
  }
  body.feature-view [data-zone] { outline: none; }
}
