/*
 * 页面只使用 HTML 和 CSS，阅读顺序与视觉顺序一致。
 * 样式顺序：设计变量 → 基础规则 → 页头 → 首屏 → 研发方向 → 联系 → 手机适配。
 * 调整颜色、内容宽度与页头高度时，优先修改 :root，避免在多处重复维护。
 */

/* 公司名称使用自带的楷体字集；swap 让字体下载期间文字也能正常显示。 */
@font-face {
  font-family: "Huocong Company Kai";
  src: url("./assets/fonts/company-kai.woff") format("woff");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  --page: #ffffff;
  --text: #1d1d1f;
  --muted: #64646b;
  --accent: #e65325;
  --accent-strong: #c74420;
  --contact-surface: #fff1ea;
  --rule: #e1e3e7;
  --selection: #ffe3d6;
  --content-width: 1168px;
  --gutter: clamp(24px, 5vw, 64px);
  --header-height: 80px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* 锚点定位时预留吸顶页头的高度，防止栏目标题被遮住。 */
  scroll-padding-top: calc(var(--header-height) + 24px);
  scrollbar-color: #a1a1a6 var(--page);
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--selection);
  color: var(--text);
}

h1, h2, h3, p {
  margin: 0;
}

h1, h2, h3 {
  text-wrap: balance;
}

a {
  color: inherit;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
}

a:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 5px;
  border-radius: 3px;
}

.page-width {
  width: calc(100% - var(--gutter) * 2);
  max-width: var(--content-width);
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 16px;
  z-index: 20;
  padding: 10px 16px;
  background: var(--text);
  color: var(--page);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* 页头沿用白底与细线。加大文字，同时保留至少 44px 的链接点击高度。 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--page);
  border-bottom: 1px solid var(--rule);
}

.header-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 24px;
  min-height: var(--header-height);
  padding-block: 12px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  flex-shrink: 0;
  font-size: 26px;
  font-weight: 600;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 42px;
  height: 42px;
  object-fit: contain;
}

nav {
  display: flex;
  align-items: center;
  gap: 36px;
}

nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 20px;
  text-decoration-color: transparent;
  transition: color 160ms ease-out, text-decoration-color 160ms ease-out;
}

nav a:hover {
  color: var(--accent-strong);
  text-decoration-color: currentColor;
}

/* 首屏只保留公司名称、品牌主张和一句主营业务，避免多层说明争抢注意力。 */
.intro {
  container-type: inline-size;
  padding-block: 96px 88px;
  text-align: center;
}

.company-name {
  font-family: "Huocong Company Kai", "Kaiti SC", "STKaiti", "KaiTi", serif;
  font-size: clamp(24px, 4.4vw, 48px);
  font-size: clamp(24px, 4.4cqw, 48px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.04em;
}

h1 {
  margin-top: 24px;
  /* cqw 是当前内容容器宽度的 1%。按宽度缩放，让这句 13 字标题保持单行。
     第一行 vw 为旧浏览器提供回退；桌面字号上限为 80px。修改文案后需复查窄屏。 */
  font-size: min(6.2vw, 5rem);
  font-size: min(7.3cqw, 5rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.headline-accent {
  color: var(--accent);
}

.company-focus {
  margin-top: 24px;
  color: var(--muted);
  font-size: 24px;
  line-height: 1.6;
}

/* 开放的双列文字，通过短橙线与留白建立层级，不增加卡片外壳。 */
.research {
  padding-block: 64px;
  border-top: 1px solid var(--rule);
}

h2 {
  font-size: 40px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.research > h2 {
  text-align: center;
}

.research-list {
  display: grid;
  /* minmax(0, 1fr) 允许列宽正常收缩，长文字不会把另一列挤出页面。 */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 96px;
  margin-top: 32px;
}

.research-item::before {
  /* 这是纯装饰分隔线，不添加多余文字，也不改变正文的阅读顺序。 */
  content: "";
  display: block;
  width: 48px;
  margin-bottom: 24px;
  border-top: 4px solid var(--accent);
}

h3 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.research-item p {
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.8;
  text-wrap: pretty;
}

/* 背景由外层 section 铺满；内层负责对齐，避免用 100vw 造成横向滚动。 */
.contact {
  padding-block: 40px;
  background: var(--contact-surface);
}

.contact-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
}

.contact h2 {
  font-size: 32px;
}

.email-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  color: var(--text);
  font-size: 28px;
  line-height: 1.5;
  text-decoration-color: transparent;
  transition: text-decoration-color 160ms ease-out;
}

.email-link:hover {
  /* 邮箱在默认、悬停和已访问状态都保持黑色；下划线承担交互反馈。 */
  text-decoration-color: currentColor;
}

.email-link svg {
  flex-shrink: 0;
}

.email-link span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.site-footer {
  padding-block: 16px 22px;
  color: var(--muted);
}

.site-footer small {
  font-size: 13px;
}

/* 手机共用同一份内容：业务改为单列，联系方式自然换行，不缩小点击区域。 */
@media (max-width: 700px) {
  :root {
    --header-height: 72px;
  }
  .header-content {
    gap: 0 16px;
    padding-block: 10px;
  }
  .wordmark {
    gap: 6px;
    font-size: 20px;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
  }
  nav {
    gap: 20px;
  }
  nav a {
    font-size: 16px;
  }
  .intro {
    padding-block: 56px;
  }
  h1 {
    margin-top: 20px;
    line-height: 1.26;
  }
  .company-focus {
    margin-top: 20px;
    font-size: 18px;
  }
  .research {
    padding-block: 44px 48px;
  }
  h2 {
    font-size: 28px;
  }
  h3 {
    font-size: 22px;
  }
  .research-list {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .research-item::before {
    width: 40px;
    margin-bottom: 16px;
    border-top-width: 3px;
  }
  .research-item p {
    margin-top: 12px;
    font-size: 16px;
  }
  .contact {
    padding-block: 28px;
  }
  .contact h2 {
    font-size: 26px;
  }
  .email-link {
    font-size: 22px;
  }
}

@media (max-width: 360px) {
  :root {
    /* 320px 窄屏仍需为浏览器的纵向滚动条留出宽度，避免页头意外换行。 */
    --gutter: 16px;
  }
  .header-content {
    gap: 0 12px;
  }
  nav {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  a {
    transition: none;
  }
}

@media print {
  .site-header {
    position: static;
  }
  nav, .skip-link {
    display: none;
  }
  .intro {
    padding-block: 40px;
  }
  .research, .contact {
    padding-block: 32px;
  }
}
