/* GEO v1 visual templates. The page shell and data bindings are shared.
   The scale uses 16px body text, fluid Chinese display type and 4px spacing.
   Each layout uses one paper/surface pair, one accent and its own section rhythm. */

.template-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  gap: 6px 12px;
  padding: 5px max(20px, calc((100% - 1200px) / 2));
  border-bottom: 1px solid #d7dedb;
  background: #edf1ef;
  color: #253832;
  color-scheme: light;
  font-size: .85rem;
  font-weight: 650;
}
.template-preview select {
  min-height: 44px;
  max-width: 100%;
  padding-inline: 10px;
  border: 1px solid #9eada7;
  border-radius: 4px;
  background: #fff;
  color: #253832;
  font: inherit;
}
.template-preview select:focus-visible { outline: 2px solid #0b5e55; outline-offset: 2px; }

:root[data-template^="geo-"] {
  & :is(h1, h2, h3, .brand, .eyebrow, .facts-table td, figcaption) { overflow-wrap: anywhere; }
  & h1 { text-wrap: balance; }
  & .brand { min-width: 0; }
  & #nav a { display: flex; align-items: center; min-height: 44px; }
  & .hero h1, & .hero .entity-answer, & .hero .text-link { color: inherit; }
  & .hero-desc, & .hero figcaption { color: var(--muted); }
  & .hero-grid:not(:has(> .hero-media)) { grid-template-columns: minmax(0, 1fr); }
  & .hero-media { width: 100%; }
  & .article-cover { max-height: none; border-radius: 0; }
  & .article-cover img { width: 100%; max-height: 480px; object-fit: contain; }
  & .brand-logo img { max-width: min(100%, 160px); max-height: 72px; object-fit: contain; object-position: left; }
  & .search input, & .pagination button, & .menu { min-height: 44px; }
  & .prose { color: var(--ink); }
  & .site-footer a:not(.footer-brand) { text-decoration: underline; text-underline-offset: .2em; }

  @media (max-width: 900px) {
    & .header-row { flex-wrap: wrap; min-height: 68px; }
    & .brand { max-width: calc(100% - 92px); }
    & .menu { display: block; }
    & .header-row:has(.header-phone) { gap: 8px 10px; }
    & .header-row:has(.header-phone) .brand { flex: 1 1 0; }
    & .header-phone { max-width: 48%; }
    & #nav {
      display: none;
      flex-direction: column;
      align-items: stretch;
      width: 100%;
      gap: 0;
      padding-bottom: 12px;
    }
    & .header-row:has(.header-phone) #nav { order: 1; flex-wrap: nowrap; }
    & #nav.open { display: flex; }
    & #nav a { padding: 8px 2px; border-top: 1px solid var(--line); font-size: .95rem; }
    & #nav a[aria-current="page"] { color: var(--teal); box-shadow: none; font-weight: 700; }
  }
  @media (max-width: 700px) {
    & .section-heading { flex-wrap: wrap; gap: 8px 16px; }
    & .hero .hero-grid { grid-template-columns: minmax(0, 1fr); }
    & .article-cover img { max-height: 340px; }
  }
}

/* 墨纸画册 · 企业简介与配图形成跨页，品类按图录条目排列。 */
:root[data-template="geo-editorial-v1"] {
  --bg: #f6f2e8;
  --surface: #fcf9f1;
  --ink: #24352c;
  --muted: #535d50;
  --teal: #275440;
  --deep: #273a31;
  --orange: #89472d;
  --line: #d4cbb7;
  --soft: #eee8da;

  & .site-header { background: var(--bg); }
  & .brand { letter-spacing: .035em; }
  & .hero { background: var(--bg); color: var(--ink); }
  & .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, .92fr);
    gap: clamp(28px, 5vw, 72px);
    padding-block: clamp(44px, 6vw, 84px);
    border-bottom: 1px solid var(--line);
  }
  & .hero h1 { max-width: 16em; font-size: clamp(2.15rem, 4.3vw, 4.25rem); font-weight: 700; line-height: 1.18; }
  & .hero .entity-answer { font-weight: 500; }
  & .hero-media { max-width: none; padding: 12px; border: 1px solid var(--line); background: var(--surface); }
  & .hero-media img { max-height: 450px; aspect-ratio: 5 / 4; border-radius: 0; }
  & .button, & .menu, & .search input, & .pagination button { border-radius: 0; }
  & .page-head { background: var(--bg); padding-block: clamp(32px, 5vw, 70px); }
  & .page-head h1, & .article-intro h1 { font-size: clamp(2rem, 3.9vw, 3.65rem); }
  & .page-head .answer { font-weight: 500; }
  & .section + .section { border-top-color: var(--line); }
  & .category-grid { display: block; border-block: 1px solid var(--line); }
  & .category {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(0, 2fr) auto;
    align-items: baseline;
    gap: 8px 30px;
    padding: 22px 0;
  }
  & .category + .category { border: 0; border-top: 1px solid var(--line); }
  & .category :is(h3, p, .read) { margin: 0; }
  & .category h3 { font-family: var(--font-heading); font-size: 1.25rem; }
  & .category .read { grid-column: 3; }
  & .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
  & .news-card .article-thumb img { aspect-ratio: 5 / 3; border-radius: 0; }
  & .news-content h3 { font-family: var(--font-heading); font-size: 1.24rem; }
  & .site-footer { background: var(--soft); color: var(--ink); border-top: 1px solid var(--line); }
  & .site-footer :is(a, .entity-anchor) { color: var(--ink); }
  & .footer-anchor { border-color: var(--line); }

  @media (min-width: 701px) {
    & .hero-grid:has(> .hero-media) > .hero-copy { grid-area: 1 / 2; }
    & .hero-grid > .hero-media { grid-area: 1 / 1; }
  }
  @media (max-width: 700px) {
    & .hero-grid { padding-block: 36px; }
    & .hero-media { padding: 8px; }
    & .hero-media img { aspect-ratio: 16 / 10; }
    & .category { grid-template-columns: minmax(0, 1fr); gap: 5px; padding: 15px 0; }
    & .category .read { grid-column: 1; }
    & .news-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  }
}

/* 工程蓝图 · 主导航是索引边栏，品类、资料与知识文章采用表格节奏。 */
:root[data-template="geo-blueprint-v1"] {
  --bg: #f7faff;
  --surface: #ffffff;
  --ink: #142942;
  --muted: #425872;
  --teal: #164e92;
  --deep: #163454;
  --orange: #215b9e;
  --line: #becfe2;
  --soft: #e9f0fa;
  --font-heading: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --grid-line: #c5d6ea8c;

  & .site-header { background: var(--soft); }
  & .hero, & .page-head {
    background-color: #e6effb;
    background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
                      linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 24px 24px;
    color: var(--ink);
    border-bottom: 1px solid var(--line);
  }
  & .hero-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 32px; padding-block: 52px; }
  & .hero h1 { max-width: 17em; font-size: clamp(2rem, 3.4vw, 3.2rem); font-weight: 800; }
  & .hero-media { max-width: none; padding: 8px; border: 1px solid var(--teal); background: var(--surface); }
  & .hero-media img { border-radius: 0; aspect-ratio: 4 / 3; }
  & .hero figcaption { margin: 0; padding: 7px 3px 2px; }
  & .hero .button.orange { background: var(--teal); border-color: var(--teal); }
  & .hero .button.orange:hover { background: var(--deep); border-color: var(--deep); }
  & .button, & .menu, & .search input, & .pagination button { border-radius: 2px; }
  & .section h2 { letter-spacing: .015em; }
  & .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    border: 1px solid var(--line);
    background: var(--line);
  }
  & .category { padding: 18px 20px 20px; background: var(--surface); }
  & .category + .category { border: 0; }
  & .category h3 { margin-top: 0; }
  & .category .read { margin-top: 10px; }
  & .facts-table th { background: var(--soft); }
  & .news-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  & .news-card { padding-block: 16px; }
  & .news-card:has(> .article-thumb) {
    display: grid;
    grid-template-columns: minmax(120px, .3fr) minmax(0, 1fr);
    align-items: start;
    gap: 24px;
  }
  & .news-card .article-thumb img { border-radius: 0; }
  & .news-content { padding: 0; }
  & .news-content h3 { margin-top: 4px; }

  @media (min-width: 1100px) {
    & body {
      display: grid;
      grid-template-columns: clamp(190px, 17vw, 252px) minmax(0, 1fr);
      grid-template-rows: auto auto 1fr auto;
    }
    & .template-preview { grid-area: 1 / 1 / 2 / -1; }
    & .site-header { grid-area: 2 / 1 / 5 / 2; border-bottom: 0; border-right: 1px solid var(--line); }
    & body > .breadcrumb { grid-area: 2 / 2; }
    & #main { grid-area: 3 / 2; min-width: 0; }
    & .site-footer { grid-area: 4 / 2; }
    & .header-row {
      position: sticky;
      top: 24px;
      display: block;
      width: 100%;
      padding: 22px clamp(12px, 1.4vw, 24px);
    }
    & .brand { display: block; font-size: 1.2rem; line-height: 1.5; }
    & #nav { display: block; margin-top: 24px; border-top: 1px solid var(--line); }
    & #nav a { padding: 6px 8px; border-bottom: 1px solid var(--line); }
    & #nav a[aria-current="page"] { box-shadow: none; background: var(--surface); font-weight: 700; }
    & .header-phone { margin-top: 16px; }
  }
  @media (max-width: 700px) {
    & .hero-grid { padding-block: 34px; gap: 22px; }
    & .category-grid { grid-template-columns: minmax(0, 1fr); }
    & .category { padding: 15px; }
  }
  @media (max-width: 500px) {
    & .news-card:has(> .article-thumb) { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  }
}

/* 夜幕展厅 · 简介与事实并列，真实企业配图随后展开为一整幅展图。 */
:root[data-template="geo-gallery-v1"] {
  color-scheme: dark;
  --bg: #231e19;
  --surface: #2d261e;
  --ink: #f7eedf;
  --muted: #d4c4ae;
  --teal: #f0c688;
  --deep: #191511;
  --orange: #edbd7e;
  --line: #57483a;
  --soft: #30271e;

  & .site-header, & .hero, & .page-head { background: var(--deep); color: var(--ink); }
  & .brand { color: var(--ink); }
  & .header-row { min-height: 76px; }
  & .hero-grid { display: block; padding-block: clamp(36px, 5vw, 72px) 28px; }
  & .hero-copy {
    display: grid;
    grid-template-columns: minmax(0, 1.24fr) minmax(0, .76fr);
    column-gap: clamp(32px, 6vw, 84px);
    align-items: start;
  }
  & .hero-copy .eyebrow { grid-column: 1 / -1; }
  & .hero-copy h1 {
    grid-area: 2 / 1 / span 3 / 2;
    max-width: none;
    font-size: clamp(2.25rem, 4.25vw, 4.45rem);
    line-height: 1.15;
  }
  & .hero-copy > :is(.entity-answer, .hero-desc, .hero-actions) { grid-column: 2; }
  & .hero .entity-answer { margin-top: 0; color: var(--ink); font-weight: 500; }
  & .hero-media { max-width: none; margin-top: 30px; }
  & .hero-media img { max-height: 432px; aspect-ratio: 5 / 2; object-fit: cover; border-radius: 0; }
  & .hero figcaption { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  & .page-head { padding-block: clamp(32px, 6vw, 72px); }
  & .section { padding-block: clamp(38px, 5vw, 65px); }
  & .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
  & .category { padding: 22px; background: var(--surface); }
  & .category + .category { border: 0; }
  & .category h3 { margin-top: 0; font-family: var(--font-heading); font-size: 1.24rem; }
  & .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  & .article-thumb img { border-radius: 0; }
  & .button, & .button.orange, & .button:hover, & .button.orange:hover {
    background: var(--teal);
    color: var(--deep);
    border-color: var(--teal);
    border-radius: 0;
  }
  & .button:hover, & .button.orange:hover { background: #ffdbac; border-color: #ffdbac; }
  & .search input, & .pagination button, & .menu {
    background: var(--surface);
    color: var(--ink);
    border-color: #9a8268;
    border-radius: 0;
  }
  & .pagination button:disabled { color: var(--muted); opacity: .62; }
  & .site-footer, & .footer-anchor .entity-anchor { color: var(--muted); }
  & .site-footer .footer-brand { color: var(--ink); }
  & .site-footer a:not(.footer-brand) { color: var(--teal); }

  @media (max-width: 700px) {
    & .hero-copy { display: block; }
    & .hero .entity-answer { margin-top: 16px; }
    & .hero-media { margin-top: 24px; }
    & .hero-media img { aspect-ratio: 16 / 10; }
    & .category-grid, & .news-grid { grid-template-columns: minmax(0, 1fr); }
    & .category { padding: 16px; }
  }
}

/* 企业公报 · 通栏刊头、正文与图注分栏，知识条目像报纸版面。 */
:root[data-template="geo-gazette-v1"] {
  --bg: #f9f6f2;
  --surface: #fffcf8;
  --ink: #28211f;
  --muted: #574c46;
  --teal: #852d2d;
  --deep: #30231f;
  --orange: #8d322e;
  --line: #d2c7bd;
  --soft: #f0eae3;

  & .site-header { background: var(--bg); border-bottom: 3px double var(--ink); }
  & .header-row { display: block; }
  & .brand { display: inline-block; padding-block: 16px 12px; font-size: clamp(1.65rem, 3.1vw, 3rem); line-height: 1.2; }
  & #nav { border-top: 1px solid var(--line); gap: clamp(18px, 3vw, 44px); }
  & #nav a[aria-current="page"] { font-weight: 700; }
  & .hero { background: var(--bg); color: var(--ink); }
  & .hero-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, .7fr);
    align-items: start;
    gap: clamp(26px, 5vw, 70px);
    padding-block: clamp(38px, 5vw, 65px);
  }
  & .hero h1 { max-width: 16em; font-size: clamp(2.15rem, 4.35vw, 4.4rem); line-height: 1.15; }
  & .hero .entity-answer { font-weight: 500; }
  & .hero-media { max-width: none; border-left: 1px solid var(--line); padding-left: 20px; }
  & .hero-media img { aspect-ratio: 1; border-radius: 0; max-height: 390px; }
  & .hero-actions { border-top: 1px solid var(--line); padding-top: 16px; }
  & .button, & .menu, & .search input, & .pagination button { border-radius: 0; }
  & .page-head { background: var(--bg); border-bottom: 3px double var(--ink); }
  & .section { padding-block: clamp(34px, 4vw, 58px); }
  & .section + .section { border-top: 0; }
  & .section > .wrap > h2, & .section-heading { border-top: 2px solid var(--ink); padding-top: 12px; }
  & .section-soft, & .faq-section { background: var(--bg); }
  & .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); border: 0; column-gap: 32px; }
  & .category, & .category + .category { border: 0; border-top: 1px solid var(--line); padding: 16px 0 22px; }
  & .category h3 { margin-top: 0; font-family: var(--font-heading); font-size: 1.25rem; }
  & .news-grid { gap: 22px 28px; }
  & .search-item { border-block: 1px solid var(--line); }
  & .news-card .article-thumb img { aspect-ratio: 3 / 2; border-radius: 0; }
  & .news-content h3 { font-family: var(--font-heading); font-size: 1.2rem; }
  & .article-intro h1 { max-width: none; font-size: clamp(2rem, 4vw, 3.8rem); }
  & .article-intro { border-bottom: 3px double var(--ink); padding-bottom: 24px; }

  @media (min-width: 901px) {
    & .header-row:has(.header-phone) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 18px; }
    & .header-row:has(.header-phone) .brand { grid-column: 1 / -1; }
    & .header-row:has(.header-phone) #nav { margin-inline-start: 0; align-self: stretch; }
  }
  @media (max-width: 900px) {
    & .header-row { display: flex; }
    & #nav { border-top: 0; gap: 0; }
  }
  @media (max-width: 700px) {
    & .hero-grid { padding-block: 32px 38px; }
    & .hero-media { border-left: 0; padding-left: 0; }
    & .hero-media img { aspect-ratio: 16 / 10; }
    & .category-grid { grid-template-columns: minmax(0, 1fr); }
  }
}

/* 橙白导览 · 色块承接企业入口，沿编号目录浏览已有服务品类。 */
:root[data-template="geo-wayfinding-v1"] {
  --bg: #f8f3e9;
  --surface: #fffdf8;
  --ink: #33241b;
  --muted: #604b3c;
  --teal: #8e3516;
  --deep: #40261a;
  --orange: #a43913;
  --line: #decab6;
  --soft: #f1e5d5;
  --intro: #f1c895;
  --font-heading: 'PingFang SC', 'Microsoft YaHei', sans-serif;

  & .site-header { background: var(--surface); }
  & .brand { font-weight: 800; }
  & .hero { background: var(--bg); color: var(--ink); padding-block: clamp(18px, 3vw, 40px); }
  & .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
    align-items: stretch;
    gap: 0;
    padding: 0;
    background: var(--intro);
  }
  & .hero-copy { padding: clamp(24px, 4vw, 56px); align-self: center; }
  & .hero h1 { max-width: 16em; font-size: clamp(2.1rem, 3.9vw, 3.9rem); font-weight: 850; line-height: 1.18; }
  & .hero .entity-answer { font-weight: 500; }
  & .hero .eyebrow, & .hero .text-link { color: #753317; }
  & .hero-media { display: flex; flex-direction: column; max-width: none; background: var(--soft); }
  & .hero-media img { flex: 1 1 0; min-height: 280px; max-height: none; aspect-ratio: auto; border-radius: 0; }
  & .hero figcaption { margin: 0; padding: 10px 16px; }
  & .button, & .menu, & .search input, & .pagination button { border-radius: 0; }
  & .page-head { background: var(--bg); border-bottom: 0; padding-block: 22px 0; }
  & .page-head > .wrap { background: var(--intro); padding: clamp(22px, 4vw, 52px); }
  & .section { padding-block: clamp(36px, 4.5vw, 64px); }
  & .category-grid { display: block; border-block: 1px solid var(--line); counter-reset: offer; }
  & .category {
    counter-increment: offer;
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 16px;
    padding: 18px 0;
  }
  & .category + .category { border: 0; border-top: 1px solid var(--line); }
  & .category::before {
    content: counter(offer, decimal-leading-zero);
    grid-area: 1 / 1 / span 2 / 2;
    display: grid;
    place-items: center;
    width: 3rem;
    min-height: 3rem;
    background: var(--soft);
    color: var(--teal);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }
  & .category :is(h3, p) { grid-column: 2; margin: 0; }
  & .category .read { grid-area: 1 / 3 / span 2 / 4; margin: 0; }
  & .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  & .search-item { padding: 16px; background: var(--surface); border: 1px solid var(--line); }
  & .news-card .article-thumb img { aspect-ratio: 16 / 9; border-radius: 0; }
  & .news-content { padding-bottom: 4px; }

  @media (max-width: 700px) {
    & .hero-copy { padding: 24px; }
    & .hero-media img { flex: none; min-height: 0; max-height: 280px; aspect-ratio: 16 / 10; }
    & .category { grid-template-columns: 2.6rem minmax(0, 1fr); gap: 5px 12px; }
    & .category::before { grid-row: 1 / span 3; align-self: start; width: 2.5rem; min-height: 2.5rem; }
    & .category .read { grid-area: auto / 2; }
    & .news-grid { grid-template-columns: minmax(0, 1fr); }
  }
}
