/* 汉字宫官网 - 响应式样式 */
:root {
  --brand-red: #b80000;
  --brand-red-dark: #8f0000;
  --ink: #1a1a1a;
  --ink-soft: #444;
  --muted: #6b6b6b;
  --line: #e8e4df;
  --paper: #faf8f5;
  --paper-warm: #f3efe8;
  --white: #fff;
  --header-h: 64px;
  --radius: 8px;
  --shadow: 0 8px 28px rgba(26, 26, 26, 0.08);
  --max: 1120px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-display: "Source Han Serif SC", "Noto Serif SC", "STSong", "SimSun", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

.container {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo img {
  height: 40px;
  width: auto;
}

.nav-desktop {
  display: none;
  align-items: center;
  gap: 8px;
}

.nav-desktop a {
  padding: 8px 16px;
  font-size: 15px;
  color: var(--ink-soft);
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.nav-desktop a:hover,
.nav-desktop a.is-active {
  color: var(--brand-red);
  background: rgba(184, 0, 0, 0.06);
}

.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  background: var(--brand-red);
  color: var(--white) !important;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  transition: background 0.2s, transform 0.2s;
}

.btn-download:hover {
  background: var(--brand-red-dark);
  color: var(--white) !important;
}

.menu-toggle {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 6px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.25s, opacity 0.25s;
}

.menu-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-mobile {
  display: none;
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px 20px;
  box-shadow: var(--shadow);
}

.nav-mobile.is-open {
  display: block;
}

.nav-mobile a {
  display: block;
  padding: 14px 12px;
  font-size: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.nav-mobile a:last-child {
  border-bottom: 0;
  margin-top: 8px;
  text-align: center;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: max(220px, 52vw);
  max-height: 560px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #1a120c;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(20, 12, 8, 0.15) 0%,
    rgba(20, 12, 8, 0.55) 70%,
    rgba(20, 12, 8, 0.75) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 28px 0 36px;
  color: var(--white);
}

.hero-brand {
  font-family: var(--font-display);
  font-size: clamp(28px, 7vw, 48px);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.hero-desc {
  font-size: clamp(13px, 3.2vw, 16px);
  opacity: 0.92;
  max-width: 32em;
  margin-bottom: 18px;
}

/* 移动端隐藏「立即下载」上方的标题与说明文字 */
@media (max-width: 639px) {
  .hero-brand,
  .hero-desc {
    display: none;
  }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* 移动端：按钮靠右，与右边缘保留间距 */
@media (max-width: 639px) {
  .hero-content {
    padding-bottom: 28px;
  }

  .hero-actions {
    justify-content: flex-end;
    padding-right: 12px;
    margin-right: 4px;
  }
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  background: var(--brand-red);
  color: var(--white);
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  transition: background 0.2s, transform 0.2s;
}

.btn-primary:hover {
  background: var(--brand-red-dark);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  color: var(--white);
  font-size: 15px;
  border-radius: 6px;
  transition: background 0.2s, border-color 0.2s;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--white);
}

/* ---------- Sections ---------- */
.section {
  padding: 48px 0;
}

.section--alt {
  background: var(--paper);
}

.section-title {
  text-align: center;
  margin-bottom: 28px;
}

.section-title h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 700;
  letter-spacing: 0.12em;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.section-title h2::before,
.section-title h2::after {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--ink);
}

.about-grid {
  display: grid;
  gap: 28px;
}

.about-text .company {
  font-size: clamp(20px, 4.5vw, 28px);
  font-weight: 700;
  margin-bottom: 8px;
}

.about-text .tagline {
  font-size: 15px;
  color: var(--muted);
  margin-bottom: 16px;
  font-weight: 600;
}

.about-text p,
.about-text li {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.85;
  margin-bottom: 8px;
}

.about-text ul {
  margin-top: 8px;
}

.about-text li {
  padding-left: 1em;
  position: relative;
}

.about-text li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--brand-red);
  font-weight: 700;
}

.about-visual {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--paper-warm);
}

.about-visual img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
}

.stat-card .num {
  font-size: clamp(22px, 5vw, 32px);
  font-weight: 700;
  color: var(--brand-red);
  line-height: 1.2;
}

.stat-card .unit {
  font-size: 13px;
  color: var(--ink);
  margin-left: 2px;
}

.stat-card .label {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

/* ---------- Advantages ---------- */
.adv-list {
  display: grid;
  gap: 20px;
}

.adv-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
}

.adv-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--paper-warm);
}

.adv-card .body {
  padding: 18px 16px 20px;
}

.adv-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--ink);
  position: relative;
  padding-left: 12px;
}

.adv-card h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 3px;
  height: 1em;
  background: var(--brand-red);
  border-radius: 2px;
}

.adv-card p,
.adv-card li {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.75;
  margin-bottom: 6px;
}

.adv-card ul {
  margin-top: 4px;
}

/* ---------- Honor ---------- */
.honor-lead {
  text-align: center;
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 40em;
  margin: 0 auto 24px;
  line-height: 1.8;
}

.honor-grid {
  display: grid;
  gap: 16px;
}

.honor-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.honor-item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--paper-warm);
}

.honor-item .cap {
  padding: 12px 14px 16px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.65;
}

.honor-intro {
  background: var(--paper-warm);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.85;
  text-align: justify;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #1f1a17;
  color: rgba(255, 255, 255, 0.82);
  padding: 40px 0 28px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.footer-brand img {
  height: 48px;
  width: auto;
  border-radius: 4px;
}

.footer-mission {
  font-size: 13px;
  line-height: 1.85;
  margin-bottom: 24px;
}

.footer-mission div + div {
  margin-top: 4px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 20px;
  font-size: 13px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.2s;
}

.footer-links a:hover {
  color: #ffb3b3;
}

.footer-copy {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- Back to top ---------- */
.back-top {
  position: fixed;
  right: 14px;
  bottom: 20px;
  z-index: 90;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--brand-red);
  color: var(--white);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(184, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s, background 0.2s;
  font-size: 18px;
  line-height: 1;
}

.back-top.is-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-top:hover {
  background: var(--brand-red-dark);
}

/* ---------- Tablet+ ---------- */
@media (min-width: 640px) {
  :root {
    --header-h: 72px;
  }

  .logo img {
    height: 48px;
  }

  .hero {
    min-height: 380px;
  }

  .section {
    padding: 64px 0;
  }

  .stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .adv-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .honor-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  .menu-toggle {
    display: none;
  }

  .nav-desktop {
    display: flex;
  }

  .nav-mobile {
    display: none !important;
  }

  .hero {
    min-height: 480px;
    max-height: 620px;
  }

  .hero-content {
    padding: 48px 0 56px;
  }

  .about-grid {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: 48px;
  }

  .about-grid--reverse {
    grid-template-columns: 0.85fr 1.15fr;
  }

  .about-grid--reverse .about-visual {
    order: -1;
  }

  .section {
    padding: 80px 0;
  }

  .section-title {
    margin-bottom: 40px;
  }

  .adv-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .adv-card {
    grid-template-columns: 1fr 1.1fr;
    align-items: stretch;
  }

  .adv-card:nth-child(even) {
    grid-template-columns: 1.1fr 1fr;
  }

  .adv-card:nth-child(even) img {
    order: 2;
  }

  .adv-card img {
    aspect-ratio: auto;
    height: 100%;
    min-height: 220px;
  }

  .honor-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .honor-intro {
    padding: 24px 28px;
    font-size: 15px;
  }
}

@media (min-width: 1100px) {
  .container {
    width: min(100% - 48px, var(--max));
  }
}

/* reduce motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
