/* SIL OFL Chinese fonts, loaded from Google Fonts with per-character
   unicode-range subsetting so only the glyphs we use get downloaded (~few KB total):
     - Noto Sans SC (思源黑体) — for the hero 众开 wordmark (weight 400/500 loaded)
     - Liu Jian Mao Cao (刘建毛草) — for the nav motto 众志成城 / 金石为开 */
@import url('https://fonts.googleapis.com/css2?family=Liu+Jian+Mao+Cao&family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
  --paper: #fbfaf7;
  --paper-2: #f4f1ea;
  --ink: #111;
  --ink-2: #2a2724;
  --muted: #6f6a60;
  --muted-2: #9b9689;
  --line: #e6e2d8;
  --line-strong: #1a1a1a;
  --iron: #7d4a24;
  --iron-soft: #a86a3f;
  --nav-max: 1080px;
  --page-max: 960px;

  --sans: 'PingFang SC', 'Hiragino Sans GB', 'HarmonyOS Sans SC',
          -apple-system, BlinkMacSystemFont, 'Inter', 'Helvetica Neue',
          'Microsoft YaHei', sans-serif;
  --serif: 'Songti SC', 'STSong', SimSun, 'Noto Serif SC',
           'Times New Roman', serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

html, body {
  height: 100vh;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
}

body {
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  font-feature-settings: "kern", "palt";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Hero-face stack — Noto Sans SC (OSS) as the primary hero face, with system
   sans fallbacks in case the webfont fails to load. Motto has its own
   font-family override in .nav-motto (Liu Jian Mao Cao), so this stack only
   affects the hero 众开 in practice. Weight 500 (Medium) — chosen to be
   noticeably lighter than the Round-2 board's 900 (Black) which read too bold. */
.brush {
  font-family: 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB',
               'Microsoft YaHei', sans-serif;
  font-weight: 500;
}

.serif { font-family: var(--serif); }

/* ── Nav ─────────────────────────────────────── */

nav {
  flex: 0 0 auto;
  max-width: var(--nav-max);
  width: 100%;
  margin: 0 auto;
  padding: 24px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-mark {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  transition: opacity 0.2s ease;
}
.nav-mark:hover { opacity: 0.72; }
.nav-mark img {
  height: 46px;
  width: auto;
  display: block;
  mix-blend-mode: multiply;
}

.nav-motto {
  display: flex;
  flex-direction: column;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  font-family: 'Liu Jian Mao Cao', 'STKaiti', 'Kaiti SC', 'Songti SC', serif;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.2em;
  padding-right: 0.2em;
  color: var(--iron);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 40px;
}

.nav-links a {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.26em;
  padding-left: 0.26em;
  padding-bottom: 6px;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-links a:hover { color: var(--ink); }
.nav-links a.active {
  color: var(--ink);
  border-bottom-color: var(--iron);
}

/* ── Main (viewport-fit) ─────────────────────── */

main {
  flex: 1 1 auto;
  overflow: hidden;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 40px;
  position: relative;  /* anchor for .hero-couplet */
}

/* Right-side vertical block — business-card style: 主营业务 label + 优质生铁
   category + 3 product uses. Chinese vertical reading order = right to left,
   so the rightmost column (主营业务) is read first, then 优质生铁, then the
   three uses (风电用 / 铸造用 / 炼钢用). */
.hero-couplet {
  position: absolute;
  /* Center of couplet aligns with the nav/footer's right edge.
     nav max-width = var(--nav-max) = 1080px, centered. Nav's right edge in
     viewport coords = 50vw + (nav-max/2). Couplet's right edge should be at
     that x + half of couplet's own width (~65px). So `right` from viewport-right
     edge = 50vw - (nav-max/2) - 65px. Guarded with a 64px minimum for narrow
     desktops so the couplet never spills past the right edge. */
  right: max(64px, calc(50vw - (var(--nav-max) / 2) - 65px));
  top: 58%;                          /* slightly below vertical center */
  transform: translateY(-50%);
  display: flex;
  gap: 12px;                         /* tight spacing for the 4 content columns */
  color: var(--iron);
  pointer-events: none;
}
.hero-couplet .line {
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.9em;             /* uses (风电用/铸造用/炼钢用) — taller columns */
  white-space: nowrap;
  line-height: 1;
}
.hero-couplet .line.category {
  color: var(--ink-2);
  letter-spacing: 0.3em;             /* category stays tight, header-like */
}
.hero-couplet .line.label {
  color: var(--ink);
  font-weight: 700;                  /* bold, header emphasis */
  letter-spacing: 0.32em;
  margin-left: 12px;                 /* extra separation from category (24px total) */
}

.page {
  width: 100%;
  max-width: var(--page-max);
  text-align: center;
}

.page.wide { max-width: var(--nav-max); }
.page.left  { text-align: left; }

/* ── Hero (home) ─────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  transform: translateY(-28px);  /* nudge name up from viewport center */
}

.mark-hero {
  font-size: clamp(64px, 7vw, 88px);  /* smaller — breathing room to sub */
  letter-spacing: 0.37em;             /* wider gap between 众 and 开 */
  padding-left: 0.37em;
  color: var(--ink);
  line-height: 1;
  margin-top: 25px;                   /* nudge 众开 down (sub stays put) */
}

.mark-sub {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.18em;
  padding-left: 0.18em;
  color: var(--ink-2);
  margin-top: 51px;                  /* 76 - 25 · sub's absolute position unchanged */
}

.mark-tag {
  font-size: 12px;
  letter-spacing: 0.4em;
  padding-left: 0.4em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 56px;
}

.mark-tag em {
  font-style: normal;
  color: var(--iron);
  padding: 0 4px;
}

/* Slim brand ribbon under the hero — a "proof strip" */
.brand-ribbon {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  max-width: 720px;
}

.brand-ribbon .tag {
  color: var(--muted);
}

/* ── Subpage headings ────────────────────────── */

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.5em;
  padding-left: 0.5em;
  color: var(--iron);
  text-transform: uppercase;
  margin-bottom: 12px;
  font-weight: 500;
}

h1 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: 0.35em;
  padding-left: 0.35em;
  margin-bottom: 14px;
  color: var(--ink);
}

.lead {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 32px;
  line-height: 1.9;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

hr.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 22px auto;
  max-width: 80px;
}

hr.rule.iron { border-top-color: var(--iron); max-width: 40px; }

/* ── Product lines (products.html) ───────────── */

.lines {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  text-align: left;
  margin-bottom: 20px;
}

.line-card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 2px solid var(--iron);
  padding: 22px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.line-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px -18px rgba(0,0,0,0.35);
}

.line-card h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.16em;
  padding-left: 0.16em;
  color: var(--ink);
  line-height: 1.4;
}

.line-card .sub {
  font-size: 12px;
  letter-spacing: 0.28em;
  padding-left: 0.28em;
  color: var(--iron);
  text-transform: uppercase;
  margin-top: -4px;
}

.line-card .desc {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.75;
}

.spec {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  font-size: 12.5px;
  color: var(--muted);
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.spec dt {
  letter-spacing: 0.12em;
  padding-left: 0.12em;
}

.spec dd { color: var(--ink-2); font-variant-numeric: tabular-nums; }

.suppliers-label {
  font-size: 11px;
  letter-spacing: 0.32em;
  padding-left: 0.32em;
  color: var(--muted);
  margin-top: 2px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.chip, .tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  background: var(--paper-2);
  border-radius: 2px;
  line-height: 1.5;
  white-space: nowrap;
}

.tag { background: transparent; border: 1px solid var(--line); }

.chip.iron, .tag.iron {
  color: var(--iron);
  background: transparent;
  border: 1px solid var(--iron);
}

/* ── Brand grid (brands.html) ────────────────── */

.brand-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 4px;
  text-align: left;
}

.brand-card {
  background: #fff;
  border: 1px solid var(--line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px -18px rgba(0,0,0,0.35);
}

.brand-card .photo {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--paper-2);
}

.brand-card .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.brand-card:hover .photo img { transform: scale(1.03); }

.brand-card .meta {
  padding: 8px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-card .name {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink);
  letter-spacing: 0.08em;
  line-height: 1.35;
}

.brand-card .region {
  font-size: 10px;
  letter-spacing: 0.22em;
  padding-left: 0.22em;
  color: var(--iron);
  text-transform: uppercase;
  line-height: 1.4;
}

.brand-card .grade {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
  line-height: 1.4;
}

/* ── Modal (brand photo + cert) ──────────────── */

.brand-card { cursor: pointer; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 15, 0.92);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.modal-overlay.open {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: var(--paper);
  width: 100%;
  max-width: 1180px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 24px 32px 28px;
  position: relative;
  border-top: 3px solid var(--iron);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 4px 8px;
  transition: color 0.15s ease;
}

.modal-close:hover { color: var(--ink); }

.modal-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-right: 40px;
}

.modal-head .name {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--ink);
  letter-spacing: 0.1em;
  line-height: 1.3;
}

.modal-head .region {
  font-size: 11px;
  letter-spacing: 0.28em;
  padding-left: 0.28em;
  color: var(--iron);
  text-transform: uppercase;
}

.modal-head .grade {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.modal-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.modal-images figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.modal-images .frame {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper-2);
  border: 1px solid var(--line);
  height: 70vh;
  max-height: 640px;
  overflow: hidden;
}

.modal-images .frame img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

.modal-images figcaption {
  font-size: 11px;
  letter-spacing: 0.24em;
  padding-left: 0.24em;
  color: var(--muted);
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .modal-overlay { padding: 12px; }
  .modal-card { padding: 18px 18px 20px; }
  .modal-head .name { font-size: 18px; }
  .modal-head { margin-bottom: 12px; gap: 10px; }
  .modal-images { grid-template-columns: 1fr; gap: 12px; }
  .modal-images .frame { height: 34vh; }
}

/* Content-heavy pages trim chrome so they fit one viewport at 800h */
.page.brands .eyebrow { margin-bottom: 6px; }
.page.brands h1 { font-size: 24px; margin-bottom: 8px; }
.page.brands .lead { margin-bottom: 12px; font-size: 14px; line-height: 1.7; }
main.brands-main { padding-top: 16px; padding-bottom: 16px; }

.page.products .lead { margin-bottom: 22px; }
main.products-main { padding-top: 20px; padding-bottom: 20px; }

/* ── Prose (about) ───────────────────────────── */

.prose {
  text-align: left;
  max-width: 560px;
  margin: 0 auto 24px;
  font-family: var(--serif);
}

.prose p {
  margin-bottom: 14px;
  text-align: justify;
  text-justify: inter-ideograph;
  font-size: 15px;
  line-height: 1.9;
  color: var(--ink-2);
}

/* ── Info / Contact dl ───────────────────────── */

.info,
.contact {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 44px;
  row-gap: 14px;
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
}

.info dt,
.contact dt {
  color: var(--muted);
  letter-spacing: 0.32em;
  font-size: 12px;
  padding-top: 3px;
  padding-left: 0.32em;
}

.info dd,
.contact dd {
  color: var(--ink);
  font-size: 15px;
  font-family: var(--serif);
}

.link {
  color: var(--iron);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.link:hover { border-bottom-color: var(--iron); }

/* 备案号 — must stay legible and clickable, but no louder than the footer
   it sits in, so it inherits .fine's muted colour instead of using --iron. */
.beian {
  color: inherit;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.beian:hover { border-bottom-color: var(--muted); }

.fine {
  color: var(--muted);
  font-size: 12px;
  margin-top: 14px;
  letter-spacing: 0.1em;
}

/* ── Highlights row (about) ──────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 560px;
  margin: 0 auto;
}

.stat {
  text-align: center;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.stat .n {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--iron);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat .k {
  font-size: 11px;
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Footer ──────────────────────────────────── */

footer {
  flex: 0 0 auto;
  max-width: var(--nav-max);
  width: 100%;
  margin: 0 auto;
  padding: 20px 40px 24px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.1em;
}

footer p + p { margin-top: 4px; }

/* ── Mobile ──────────────────────────────────── */

@media (max-width: 720px) {
  html, body { overflow: auto; height: auto; min-height: 100vh; }

  nav { padding: 16px 20px; }
  .nav-brand { gap: 10px; }
  .nav-mark img { height: 36px; }
  .nav-motto {
    font-size: 10px;
    line-height: 1.45;
    padding-left: 10px;
    letter-spacing: 0.15em;
    padding-right: 0.15em;
  }
  .nav-links { gap: 18px; }
  .nav-links a {
    font-size: 11px;
    letter-spacing: 0.16em;
    padding-left: 0.16em;
  }

  main { padding: 32px 20px; }

  .mark-hero {
    letter-spacing: 0.12em;
    padding-left: 0.12em;
  }
  .mark-sub {
    font-size: 16px;
    letter-spacing: 0.15em;
    padding-left: 0.15em;
    margin-top: 20px;
  }
  .hero-couplet { display: none; }  /* couplet is desktop-only */

  h1 { font-size: 24px; margin-bottom: 12px; }
  .lead { font-size: 14px; margin-bottom: 24px; }

  .lines {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .brand-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .stat .n { font-size: 20px; }

  .info,
  .contact {
    grid-template-columns: 1fr;
    row-gap: 4px;
  }
  .info dt,
  .contact dt { margin-top: 12px; }

  footer { padding: 16px 20px 22px; font-size: 11px; }
}
