/*
Theme Name: Xiaofan NiceHua 0718151327
Theme URI: https://nicehuasteel.com
Author: 小樊发大财
Author URI: https://nicehuasteel.com
Description: TMK-inspired industrial theme for NiceHua. Mood=tmk-industrial. GEO ready.
Version: 2.2.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: xiaofan-nicehua-0718151327
*/

:root {
  --xf-primary: #262626;
  --xf-accent: #C9A227;
  --xf-bg: #F4F4F2;
  --xf-ink: #1a1a1a;
  --xf-muted: #6b6b6b;
  --xf-white: #ffffff;
  --xf-line: rgba(38,38,38,0.12);
  --xf-header-h: 108px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Source Sans 3", "Noto Sans SC", system-ui, sans-serif;
  color: var(--xf-ink);
  background: var(--xf-bg);
  line-height: 1.65;
  font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--xf-accent); text-decoration: none; transition: color .25s ease; }
a:hover { color: var(--xf-primary); }
h1,h2,h3,h4 {
  font-family: "Montserrat", "Montserrat", sans-serif;
  font-weight: 700;
  line-height: 1.2;
  color: var(--xf-primary);
  margin: 0 0 12px;
}
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ===== Header / dual-row nav (TMK industrial) ===== */
.site-header {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(28,28,28,.62);
  color: #fff;
  border-bottom: none;
  backdrop-filter: saturate(120%) blur(2px);
  transition: background .3s ease, box-shadow .3s ease;
}
.site-header.is-scrolled {
  position: fixed;
  background: rgba(20,20,20,.94);
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  min-height: var(--xf-header-h);
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 80px;
  padding: 6px;
  background: #fff;
  border-radius: 2px;
  line-height: 0;
}
.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
}
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  border: none;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px; background: var(--xf-accent);
  transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.header-nav-stack {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
}
.nav-secondary {
  min-width: 0;
  overflow: hidden;
}
.nav-secondary ul,
.nav-primary ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center;
}
.nav-secondary ul { gap: 2px 14px; }
.nav-primary ul { gap: 4px 18px; }
.nav-secondary a,
.nav-tagline {
  color: rgba(255,255,255,.78);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  text-transform: none;
  padding: 2px 0;
  border-bottom: none;
  line-height: 1.35;
  max-width: none;
  display: inline-block;
  white-space: nowrap;
  text-decoration: none !important;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-tagline:hover {
  color: var(--xf-accent);
  border-bottom: none;
  text-decoration: none !important;
}
.nav-primary {
  padding-top: 2px;
  border-top: 1px solid rgba(255,255,255,.18);
}
.nav-primary a {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 6px 0 2px;
  border-bottom: 2px solid transparent;
  font-family: "Montserrat", sans-serif;
  text-decoration: none !important;
  white-space: nowrap;
}
.nav-secondary a:hover,
.nav-primary a:hover,
.nav-secondary .current-menu-item > a,
.nav-primary .current-menu-item > a {
  color: var(--xf-accent);
  text-decoration: none !important;
}
.nav-primary a:hover,
.nav-primary .current-menu-item > a {
  border-bottom-color: var(--xf-accent);
}
.header-tools {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
}
.lang-switch a {
  color: rgba(255,255,255,.7);
  padding: 2px 0;
  border-bottom: 1px solid transparent;
}
.lang-switch a.is-active,
.lang-switch a:hover {
  color: var(--xf-accent);
  border-bottom-color: var(--xf-accent);
  text-decoration: none;
}
.lang-switch .sep { color: rgba(255,255,255,.35); }

/* ===== Hero carousel ===== */
.tmk-hero {
  position: relative;
  min-height: 520px;
  background: #111;
  overflow: hidden;
}
.tmk-hero-slides { position: absolute; inset: 0; }
.tmk-hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity .8s ease;
  background-size: cover;
  background-position: center;
}
.tmk-hero-slide.is-active { opacity: 1; z-index: 1; }
.tmk-hero-slide::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(38,38,38,.88) 0%, rgba(38,38,38,.45) 55%, rgba(38,38,38,.25) 100%);
}
.tmk-hero-copy {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 130px max(24px, calc((100% - 1240px) / 2)) 80px;
  color: #fff;
  pointer-events: none;
}
.tmk-hero-copy a { pointer-events: auto; }
.tmk-hero-copy .eyebrow {
  color: var(--xf-accent);
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0 0 14px;
}
.tmk-hero-copy h1 {
  color: #fff;
  font-size: clamp(32px, 5vw, 52px);
  max-width: 16ch;
  margin-bottom: 18px;
}
.tmk-hero-copy p {
  max-width: 36rem;
  font-size: 17px;
  opacity: .92;
  margin: 0 0 28px;
}
.tmk-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}
.tmk-btn {
  display: inline-block;
  width: auto;
  max-width: none;
  padding: 14px 28px;
  background: var(--xf-accent);
  color: var(--xf-primary);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform .25s ease, background .25s ease, box-shadow .25s ease;
}
.tmk-btn:hover {
  background: #fff;
  color: var(--xf-primary);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0,0,0,.25);
}
.tmk-btn-outline {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,.55);
  margin-left: 0;
}
.tmk-btn-outline:hover { background: var(--xf-accent); border-color: var(--xf-accent); color: var(--xf-primary); }
.tmk-hero-nav {
  position: absolute; z-index: 3; bottom: 28px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 10px; align-items: center;
}
.tmk-hero-dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1px solid #fff; background: transparent; cursor: pointer; padding: 0;
}
.tmk-hero-dot.is-active { background: var(--xf-accent); border-color: var(--xf-accent); }
.tmk-hero-arrows {
  position: absolute; z-index: 3; inset: 0; pointer-events: none;
}
.tmk-hero-arrows button {
  pointer-events: auto;
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.35);
  color: #fff; cursor: pointer; font-size: 20px;
}
.tmk-hero-arrows .prev { left: 16px; }
.tmk-hero-arrows .next { right: 16px; }
.tmk-hero-arrows button:hover { background: var(--xf-accent); color: var(--xf-primary); border-color: var(--xf-accent); }

/* ===== Sections ===== */
.tmk-section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 72px 24px;
}
.tmk-section-head {
  display: flex; justify-content: space-between; align-items: end;
  gap: 24px; margin-bottom: 36px;
  border-bottom: 1px solid var(--xf-line);
  padding-bottom: 16px;
}
.tmk-section-head h2 {
  font-size: clamp(24px, 3vw, 34px);
  margin: 0;
}
.tmk-section-head .sub {
  color: var(--xf-muted); font-size: 14px; max-width: 28rem; margin: 0;
}
.tmk-band {
  background: var(--xf-primary);
  color: #fff;
}
.tmk-band h2 { color: #fff; }
.tmk-band .sub { color: rgba(255,255,255,.7); }

.tmk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.tmk-card {
  background: var(--xf-white);
  border: 1px solid var(--xf-line);
  overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease;
}
.tmk-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0,0,0,.12);
}
.tmk-card .media {
  overflow: hidden; height: 180px; background: #ddd;
}
.tmk-card .media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .45s ease;
}
.tmk-card:hover .media img { transform: scale(1.06); }
.tmk-card .body { padding: 18px 18px 22px; }
.tmk-card h3 { font-size: 17px; margin-bottom: 8px; }
.tmk-card p { margin: 0; color: var(--xf-muted); font-size: 14px; }

.tmk-split {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 36px;
  align-items: center;
}
.tmk-split img {
  width: 100%;
  border: 3px solid var(--xf-accent);
}
.geo-answer {
  background: #fff;
  border-left: 4px solid var(--xf-accent);
  padding: 14px 16px;
  margin: 16px 0;
}

.tmk-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.tmk-chip {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--xf-line);
  background: #fff;
  color: var(--xf-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tmk-chip:hover { border-color: var(--xf-accent); color: var(--xf-accent); text-decoration: none; }

.tmk-cta {
  background: linear-gradient(120deg, var(--xf-primary), #1a1a1a);
  color: #fff;
  padding: 56px 24px;
  text-align: center;
}
.tmk-cta h2 { color: #fff; margin-bottom: 12px; }
.tmk-cta p { max-width: 40rem; margin: 0 auto 24px; opacity: .9; }

.tmk-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 16px;
}
.tmk-stat {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(201,162,39,.35);
  padding: 22px 16px;
  text-align: center;
}
.tmk-stat .num {
  font-family: "Montserrat", sans-serif;
  font-size: 32px;
  color: var(--xf-accent);
  font-weight: 700;
}
.tmk-stat .label { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .8; margin-top: 6px; }

/* reveal on scroll */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* Inner page — TMK about-style shell */
.page-hero {
  background: var(--xf-primary);
  color: #fff;
  padding: calc(var(--xf-header-h) + 48px) 24px 48px;
  border-bottom: 3px solid var(--xf-accent);
}
.page-hero-inner { max-width: 1240px; margin: 0 auto; }
.page-hero h1 { color: #fff; font-size: clamp(28px, 4vw, 42px); margin: 0 0 10px; letter-spacing: .04em; text-transform: uppercase; }
.breadcrumb {
  font-size: 13px; color: rgba(255,255,255,.7);
}
.breadcrumb a { color: var(--xf-accent); text-decoration: none; }
.tmk-page-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 40px 24px 72px;
  background: transparent;
}
.tmk-page-layout {
  display: block !important;
  width: 100%;
  max-width: none;
  grid-template-columns: none !important;
}
.tmk-page-layout--full { width: 100%; max-width: none; }
.tmk-page-side { display: none !important; }
.tmk-page-main { min-width: 0; width: 100%; }
.entry-body {
  background: #fff;
  border: 1px solid var(--xf-line);
  padding: 32px 36px 40px;
  line-height: 1.75;
  width: 100%;
  box-sizing: border-box;
}
.entry-body p { margin: 0 0 14px; }
.entry-body ul { margin: 0 0 16px; padding-left: 1.2em; }
.entry-body .geo-answer { display: none; }
.entry-body img {
  max-width: 100%;
  width: 100%;
  height: auto;
  margin: 16px 0;
  display: block;
}
.entry-body .wp-block-image {
  margin: 16px 0;
  width: 100%;
  max-width: 100%;
}
.entry-body .wp-block-image img {
  width: 100%;
  max-width: 100%;
  height: auto;
}
.entry-body .wp-block-gallery {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 16px 0;
  width: 100%;
}
.entry-body .wp-block-gallery figure,
.entry-body .wp-block-gallery .wp-block-image {
  margin: 0;
  width: 100% !important;
  flex: 0 0 auto !important;
  max-width: 100% !important;
}
.entry-body .wp-block-gallery img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}
.content-wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}
.content-wrap.wide { max-width: 1240px; }
.entry-content img {
  margin: 18px 0;
  border: 1px solid var(--xf-line);
}

/* Footer */
.site-footer {
  background: #1a1a1a;
  color: #cfcfcf;
  border-top: 3px solid var(--xf-accent);
  padding: 48px 24px 28px;
  font-size: 14px;
}
.footer-grid {
  max-width: 1240px; margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 28px;
}
.site-footer h4 {
  color: #fff; font-size: 13px; letter-spacing: .12em;
  text-transform: uppercase; margin-bottom: 14px;
}
.site-footer a { color: #cfcfcf; }
.site-footer a:hover { color: var(--xf-accent); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 8px; }
.footer-bottom {
  max-width: 1240px; margin: 28px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex; justify-content: center; gap: 12px; flex-wrap: wrap;
  text-align: center;
  font-size: 12px; color: #999;
}

/* legacy hp-* compatibility */
.hp-hero, .hp-section, .hp-grid, .hp-card, .hp-split, .hp-cta, .hp-chips, .hp-chip { }
.home-designed .hp-hero { display: none; } /* 首页由 front-page 轮播承担时可隐藏旧双栏 */

@media (max-width: 980px) {
  .tmk-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tmk-split, .footer-grid, .tmk-stats { grid-template-columns: 1fr 1fr; }
  .nav-primary ul { gap: 4px 16px; }
  .nav-secondary ul { gap: 4px 12px; }
}
@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .header-nav-stack {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: rgba(18,18,18,.97);
    border-bottom: 2px solid var(--xf-accent);
    padding: 16px 24px 22px;
    gap: 16px;
  }
  .header-nav-stack.is-open { display: flex; }
  .nav-secondary ul,
  .nav-primary ul { flex-direction: column; align-items: flex-start; gap: 0; }
  .nav-secondary a,
  .nav-primary a,
  .nav-tagline { display: block; width: 100%; padding: 10px 0; max-width: none; }
  .header-tools { margin-left: 0; }
  .tmk-hero-copy { padding: 110px 20px 64px; }
}
@media (max-width: 768px) {
  .tmk-grid, .tmk-split, .footer-grid, .tmk-stats { grid-template-columns: 1fr; }
  .tmk-hero { min-height: 440px; }
  .brand-logo { width: 76px; height: 66px; }
}
