/* ==========================================================================
   Site — 页面级补充组件（不改动既有设计系统三件套）
   ========================================================================== */

/* ---- 卡片内的「我们的答案」行 ---- */
.card__fix {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--line);
  color: var(--accent) !important;
  font-size: var(--fs-300);
}
.card__fix b { font-weight: 600; letter-spacing: 0.02em; }

/* ---- 展厅：按图片真实纵横比微调取景 ---- */
.gallery .place:nth-child(1) img { object-position: 50% 42%; }
.gallery .place:nth-child(4) img { object-position: 50% 55%; }
.gallery .place:nth-child(5) img { aspect-ratio: 16 / 9; object-position: 50% 62%; }

/* ---- 展厅扩充至 13 处：6–13 号格位（编辑式非对称节奏） ---- */
.gallery .place:nth-child(6)  { grid-column: span 5; }
.gallery .place:nth-child(7)  { grid-column: span 7; }
.gallery .place:nth-child(8)  { grid-column: span 5; }
.gallery .place:nth-child(9)  { grid-column: span 7; }
.gallery .place:nth-child(10) { grid-column: span 5; }
.gallery .place:nth-child(11) { grid-column: span 7; }
.gallery .place:nth-child(12) { grid-column: span 5; }
.gallery .place:nth-child(13) { grid-column: span 12; }
.gallery .place:nth-child(13) img { aspect-ratio: 21 / 9; }
@media (max-width: 900px) {
  .gallery .place:nth-child(n) { grid-column: span 12; }
  .gallery .place:nth-child(n) img { aspect-ratio: 4 / 3; }
}

/* ---- 通用芯片行（实用 App 清单 / 助手联想） ---- */
.apps { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- 下载中心：三列 ---- */
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 940px) { .cards--3 { grid-template-columns: 1fr; } }

/* ---- 项目摘要 dl ---- */
.facts { margin: 0; }

/* ---- 折叠面板内部间距 ---- */
.acc__panel .table-wrap { margin-top: var(--space-3); }
.acc__panel .lede + .table-wrap { margin-top: var(--space-4); }
.acc__panel p + p { margin-top: var(--space-3); }

/* ---- 展厅详情灯箱 ---- */
dialog.pd {
  width: min(880px, calc(100vw - 32px));
  max-height: min(86vh, 780px);
  padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  background: var(--ink-700); color: var(--paper);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
dialog.pd::backdrop { background: rgba(8, 6, 4, 0.74); backdrop-filter: blur(5px); }
.pd__grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
@media (max-width: 720px) { .pd__grid { grid-template-columns: 1fr; } }
.pd__media { margin: 0; position: relative; min-height: 260px; }
.pd__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd__body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); overflow-y: auto; max-height: min(86vh, 780px); }
.pd__body h3 { font-size: var(--fs-700); }
.pd__body > p { color: var(--paper-dim); font-size: var(--fs-400); }
.pd__i18n { display: grid; gap: var(--space-3); border-top: 1px solid var(--line); padding-top: var(--space-4); }
.pd__i18n h4 {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 6px;
}
.pd__i18n p { margin: 0; color: var(--muted); font-size: var(--fs-300); line-height: 1.6; }
.pd__close { align-self: flex-start; margin-top: var(--space-2); }
.pd__x {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px;
  border-radius: 50%; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--ink-900) 62%, transparent); color: var(--mist);
  cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(6px);
}
.pd__x:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* ---- 轻提示 ---- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 300;
  transform: translate(-50%, 16px);
  max-width: min(460px, calc(100vw - 32px));
  padding: 13px 18px; border-radius: var(--radius-md);
  background: var(--ink-600); border: 1px solid var(--accent-line); color: var(--paper);
  font-size: var(--fs-300); box-shadow: var(--shadow-2);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--dur-base) ease-out, transform var(--dur-base) var(--ease-out), visibility var(--dur-base);
}
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

/* ---- 局部本地化提示（de/fr/it/es 正文回退英文时） ---- */
.i18n-note {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em;
  color: var(--accent); text-transform: uppercase;
}
.i18n-note::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ---- 长表格在小屏的横向滚动提示 ---- */
.table-wrap { position: relative; }
.table-wrap::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 0;
  pointer-events: none;
}

/* ---- 无 JS 降级：核心内容永远可见 ---- */
.no-js .reveal { opacity: 1; transform: none; }

/* ==========================================================================
   多城市扩展：六格图廊（1 通栏 + 2 + 3 编辑式节奏） / 城市门户
   ========================================================================== */
.gallery--six .place:nth-child(1) { grid-column: span 12; }
.gallery--six .place:nth-child(1) img { aspect-ratio: 21 / 9; object-position: 50% 45%; }
.gallery--six .place:nth-child(2),
.gallery--six .place:nth-child(3) { grid-column: span 6; }
.gallery--six .place:nth-child(2) img,
.gallery--six .place:nth-child(3) img { aspect-ratio: 3 / 2; object-position: 50% 50%; }
.gallery--six .place:nth-child(4),
.gallery--six .place:nth-child(5),
.gallery--six .place:nth-child(6) { grid-column: span 4; }
.gallery--six .place:nth-child(4) img,
.gallery--six .place:nth-child(5) img,
.gallery--six .place:nth-child(6) img { aspect-ratio: 3 / 2; object-position: 50% 50%; }
@media (max-width: 900px) {
  .gallery--six .place:nth-child(n) { grid-column: span 12; }
  .gallery--six .place:nth-child(n) img { aspect-ratio: 4 / 3; }
}
.gallery--six .place:nth-child(n) .place__body { padding: var(--space-4) var(--space-5); }
.gallery--six .place:nth-child(n) .place__body h3 { font-size: var(--fs-500); }

.place--typo {
  display: flex; flex-direction: column; justify-content: flex-end; min-height: 320px;
  background: linear-gradient(165deg, #ffffff 0%, var(--accent-wash) 100%);
  border: 1px solid var(--line);
  transition: transform var(--dur-slow) var(--ease-out), box-shadow var(--dur-slow) ease-out;
}
.place--typo:hover { transform: translateY(-5px); box-shadow: var(--shadow-2); }
.place--typo .typo__no {
  position: absolute; top: var(--space-4); right: var(--space-5);
  font-family: var(--font-display); font-size: clamp(2rem, 6vw, 3.25rem); font-weight: 600;
  color: var(--accent); opacity: 0.22; line-height: 1;
}
.place--typo .place__body { position: static; background: none; padding: var(--space-5); }
.place--typo .place__body h3 { color: var(--ink-900); font-size: var(--fs-500); }
.place--typo .place__body p { color: var(--paper-dim); max-width: none; }
.place--typo .place__tag { color: var(--accent); }
.place--typo .place__plus { color: var(--accent); }

/* ---- 门户 ---- */
.hero__grid--solo { align-items: center; }
.citygrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-4);
}
.citycard {
  position: relative; display: flex; flex-direction: column;
  text-decoration: none; color: inherit; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--color-surface);
  transition: transform var(--dur-slow) var(--ease-out), box-shadow var(--dur-slow) ease-out;
}
.citycard:hover { transform: translateY(-5px); box-shadow: var(--shadow-2); }
.citycard__imgwrap { position: relative; display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--ink-600); }
.citycard__imgwrap img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.82) contrast(1.03);
  transition: transform 0.45s var(--ease-out);
}
.citycard:hover .citycard__imgwrap img { transform: scale(1.05); }
.citycard__badge {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  background: var(--accent); color: var(--on-accent);
  font-size: 10px; font-family: var(--font-mono); letter-spacing: 0.12em;
  padding: 3px 8px; border-radius: var(--radius-sm);
}
.citycard__body { display: flex; flex-direction: column; gap: 2px; padding: var(--space-4) var(--space-5) var(--space-5); }
.citycard__zh { font-family: var(--font-display); font-size: clamp(1.4rem, 4.5vw, 1.625rem); font-weight: 700; color: var(--ink-900); }
.citycard__en { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }
.citycard__tag { margin-top: 6px; font-size: var(--fs-300); color: var(--paper-dim); }
.citycard__arrow {
  position: absolute; right: var(--space-4); bottom: var(--space-4);
  color: var(--accent); opacity: 0; transform: translateX(-6px);
  transition: opacity var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.citycard:hover .citycard__arrow { opacity: 1; transform: none; }

/* ==========================================================================
   13 城扩展：人文与历史编年 / 文化关键词 / 导航密度
   ========================================================================== */
.cards--era .card { background: linear-gradient(168deg, #ffffff 0%, var(--accent-wash) 100%); }
.cards--era .card__no { display: block; letter-spacing: 0.06em; }
.cards--era .card h3 { margin-top: var(--space-3); }

.eraphrase {
  margin-top: var(--space-6); padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}
.eraphrase__label {
  margin: 0 0 var(--space-3);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.eraphrase .apps { margin-top: 0; }
.eraphrase .chip { cursor: default; }
.eraphrase .chip:hover { border-color: var(--line-strong); color: var(--paper-dim); }

/* 8 项导航（含人文历史）在中等宽度下收窄，避免挤压品牌与操作区 */
@media (min-width: 901px) and (max-width: 1180px) {
  .nav a { padding: 10px 7px; font-size: 0.74rem; }
  .brand__text { font-size: var(--fs-400); }
}

/* ==========================================================================
   14. 古句牌（hero 右侧 —— 取代原 hero 大图）
   站点已整体撤掉插画：首屏以一句贴合的古典名句承担视觉重量。
   ========================================================================== */
.hero__verse { align-self: center; }
.hero__verse blockquote {
  margin: 0; padding: var(--space-6) var(--space-5);
  background: var(--color-surface); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); border-radius: var(--radius-lg);
  text-align: center;
}
.hero__verse-text {
  margin: 0;
  font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, var(--fs-700));
  line-height: 1.6; color: var(--ink-900); letter-spacing: 0.06em;
}
.hero__verse-src {
  display: block; margin-top: var(--space-4);
  font-family: var(--font-body); font-style: normal;
  font-size: var(--fs-300); color: var(--accent); letter-spacing: 0.06em;
}
.hero__verse-tr {
  margin: var(--space-4) 0 0; padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  font-size: var(--fs-300); color: var(--color-muted); line-height: 1.8;
}

/* ==========================================================================
   15. 诗意城市（城市展厅的文字版 —— 无图卡片）
   必须显式压掉 .place:nth-child(N) 的 12 栏跨列与 .place__body 的绝对定位。
   ========================================================================== */
.gallery--text { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-5); }
.gallery--text .place:nth-child(n) { grid-column: auto; }
.place--text {
  display: block; overflow: visible;
  background: var(--color-surface);
  transition: border-color var(--dur-base) ease-out, transform var(--dur-base) var(--ease-out);
}
.place--text:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.place--text .place__body {
  position: static; inset: auto; padding: var(--space-5); background: none;
}
.place--text .place__body h3 { color: var(--ink-900); }
.place--text .place__body p { color: var(--color-muted); max-width: none; }
@media (max-width: 1080px) { .gallery--text { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .gallery--text { grid-template-columns: 1fr; } }

/* ==========================================================================
   16. 典籍中国（页面收尾 —— 诗经 / 离骚 / 唐诗 / 宋词 / 儒家 / 道家 / 孙子兵法）
   中文原文一律保留、永不翻译；译文挂在原文之下。
   ========================================================================== */
.classics {
  display: grid; gap: var(--space-5);
  /* 七张卡：248px 下限让桌面端排成 4+3，避免最后一枚孤零零占一整行 */
  grid-template-columns: repeat(auto-fit, minmax(248px, 1fr));
}
.clscard {
  display: flex; flex-direction: column; padding: var(--space-6) var(--space-5);
  background: var(--color-surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur-base) ease-out, transform var(--dur-base) var(--ease-out);
}
.clscard:hover { border-color: var(--line-strong); transform: translateY(-3px); }
.clscard__tag {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent);
}
.clscard__quote { margin: var(--space-4) 0 0; padding: 0; }
.clscard__text {
  margin: 0;
  font-family: var(--font-display); font-size: var(--fs-500);
  line-height: 1.85; color: var(--ink-900); letter-spacing: 0.06em;
}
.clscard__src {
  display: block; margin-top: var(--space-3);
  font-family: var(--font-body); font-style: normal;
  font-size: var(--fs-300); color: var(--accent); letter-spacing: 0.04em;
}
.clscard__tr {
  margin: var(--space-4) 0 0; padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  font-size: var(--fs-300); color: var(--color-muted); line-height: 1.8;
}

/* 17. 门户（/）—— 撤图后的文字化承接
   首屏右侧改用 .hero__verse 古句牌（样式见第 14 节，无需另写）；
   14 张城市卡去掉缩略图，改由顶部天青短线 + 最小高度承接，避免卡片过扁。 */
.citygrid .citycard { min-height: 148px; }
.citygrid .citycard::before {
  content: ""; position: absolute; left: 0; top: 0;
  width: 44px; height: 3px; background: var(--accent);
}
.citygrid .citycard__body {
  padding-top: var(--space-5);
  padding-bottom: calc(var(--space-5) + 12px);   /* 给右下角箭头留位 */
}
/* 门户首屏是 --solo 双栏，古句牌落在右栏，与标题垂直居中 */
.hero__grid--solo .hero__verse { align-self: center; }
@media (max-width: 980px) {
  .citygrid .citycard { min-height: 0; }
}
