@import url("../../cosmos/lessons/style.css");

/* ───────────────────────────────────────────────────────────────
   世界的逻辑 / world_regions track (a linear walk around the world:
   geography → history → culture → today, region by region).
   Reuses the cosmos component sheet verbatim (kicker / source-note /
   takeaway / mini-flow / lesson-flow / trade-table / toc-grid / widget /
   kpi-grid / dist-canvas) and adds:
     .chain       linear-position strip (baton in → this lesson → baton out)
     .hand-card   发牌卡: the five geographic variables 热·河·海·墙·邻
     .force-strip 出牌条: the outside forces 农·马·经·船·旗 in arrival order
     .board-card  牌面卡: the four readings 权·钱·人·盟
     .mech        这一站的机制: the one mechanism a region teaches
   ─────────────────────────────────────────────────────────────── */
.chain {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 16px 0 22px;
}
.chain > span {
  position: relative;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-mute);
}
.chain > span b {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
}
.chain > span.this {
  border-color: #b9c4f5;
  background: var(--accent-soft, #eef2ff);
  color: var(--text);
}
.chain > span + span::before {
  content: "→";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 12px;
}

/* 发牌卡 · 五个地理变量 */
.hand-card, .board-card {
  display: grid;
  gap: 8px;
  margin: 16px 0 20px;
}
.hand-card { grid-template-columns: repeat(5, 1fr); }
.board-card { grid-template-columns: repeat(4, 1fr); }
.hand-card > div, .board-card > div {
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elev);
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}
.hand-card .k, .board-card .k {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
  font-weight: 700;
  color: var(--accent);
}
.hand-card .k b, .board-card .k b {
  font-size: 18px;
  line-height: 1;
}
.hand-card .k span, .board-card .k span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-mute);
}
.board-card > div { background: #f5f7ff; }
.board-card .k { color: #7c3aed; }

/* 出牌条 · 外力按到达顺序 */
.force-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 18px;
  padding: 0;
  list-style: none;
}
.force-strip li {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-size: 12.5px;
  color: var(--text);
}
.force-strip li b {
  color: #d97706;
  font-size: 14px;
}
.force-strip li i {
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
}

/* 这一站的机制 */
.mech {
  margin: 18px 0;
  padding: 14px 16px;
  border-left: 4px solid #0891b2;
  border-radius: 6px;
  background: #ecfeff;
  font-size: 14.5px;
  line-height: 1.65;
}
.mech .label {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: #0e7490;
  margin-bottom: 4px;
}
.mech .name { font-weight: 700; font-size: 16px; color: #0f172a; margin-bottom: 4px; }

/* 国家速览 */
.trade-table.countries td:nth-child(3), .trade-table.countries td:nth-child(4) { white-space: nowrap; }

@media (max-width: 760px) {
  .hand-card { grid-template-columns: 1fr 1fr; }
  .board-card { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .chain { grid-template-columns: 1fr; }
  .chain > span + span::before { content: "↓"; left: 50%; top: -10px; transform: translateX(-50%); }
  .hand-card, .board-card { grid-template-columns: 1fr; }
  table { display: block; overflow-x: auto; }
}

/* KPI labels carry units — keep them as written */
.kpi .k { text-transform: none; letter-spacing: 0.02em; }

/* pressed state for preset / toggle buttons inside widgets */
.widget button[aria-pressed="true"] { background: #2563eb; color: #fff; border-color: #2563eb; }
.widget button[aria-pressed="true"]:hover { background: #1d4ed8; }
