/* YXHC TECH — 前台样式
   设计约束：单文件、无外部依赖、支持 RTL（使用逻辑属性）
   目标：首屏 CSS < 20KB，无阻塞渲染的外部字体 */

:root {
  --ink: #0d1520;
  --ink-soft: #333f4f;
  --muted: #5c6a7c;
  --line: #e2e7ef;
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --accent: #0f5c4e;
  --accent-soft: #e6f2ef;
  --brand: #0a2540;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(13, 21, 32, 0.04), 0 8px 24px rgba(13, 21, 32, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", "Hiragino Sans",
    "Microsoft YaHei", "PingFang SC", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.2; letter-spacing: -0.015em; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.2vw, 3.15rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.15rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }

.container { width: min(1160px, 100% - 3rem); margin-inline: auto; }
.narrow { width: min(760px, 100% - 3rem); margin-inline: auto; }
.muted { color: var(--muted); }
.lead { font-size: 1.09rem; color: var(--ink-soft); max-width: 62ch; }

.skip-link {
  position: absolute; inset-inline-start: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 0.75rem 1.25rem; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { inset-inline-start: 0; }

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

/* ---------- 头部 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-block-end: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1.25rem; min-height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 0.65rem; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--brand); color: #fff; border-radius: 9px;
  font-weight: 800; font-size: 1.05rem; letter-spacing: -0.03em;
}
.brand-text { display: grid; line-height: 1.15; }
.brand-text strong { font-size: 1rem; letter-spacing: -0.01em; }
.brand-text small { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.01em; }

.site-nav { margin-inline-start: auto; display: flex; align-items: center; gap: 1.5rem; }
.site-nav ul { display: flex; gap: 1.35rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--ink-soft); font-size: 0.94rem; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); text-decoration: none; }
.site-nav a[aria-current="page"] { font-weight: 650; }

.nav-toggle {
  display: none; margin-inline-start: auto;
  width: 42px; height: 42px; padding: 0; border: 1px solid var(--line);
  background: #fff; border-radius: 9px; cursor: pointer;
  flex-direction: column; justify-content: center; align-items: center; gap: 4px;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.2s; }

.lang-switch { position: relative; }
.lang-switch summary {
  list-style: none; cursor: pointer; padding: 0.42rem 0.7rem;
  border: 1px solid var(--line); border-radius: 8px; font-size: 0.83rem; color: var(--ink-soft);
  white-space: nowrap;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch[open] summary { border-color: var(--accent); color: var(--accent); }
.lang-switch ul {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 0.35rem; margin: 0; list-style: none;
  min-width: 200px; max-height: 340px; overflow: auto; z-index: 60;
}
.lang-switch li a { display: block; padding: 0.42rem 0.6rem; border-radius: 6px; font-size: 0.86rem; color: var(--ink-soft); }
.lang-switch li a:hover { background: var(--bg-alt); text-decoration: none; }
.lang-switch li a[aria-current="true"] { color: var(--accent); font-weight: 650; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.72rem 1.35rem; border-radius: 9px; border: 1px solid transparent;
  background: var(--brand); color: #fff; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: background 0.18s, transform 0.18s;
}
.btn:hover { background: #14324f; text-decoration: none; transform: translateY(-1px); }
.btn-sm { padding: 0.5rem 0.95rem; font-size: 0.88rem; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-alt); }
.btn-light { background: #fff; color: var(--brand); }
.btn-light:hover { background: var(--accent-soft); }

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(3.5rem, 9vw, 6.5rem) clamp(3rem, 7vw, 5rem);
  background:
    radial-gradient(1100px 480px at 78% -12%, #eaf3f0 0%, transparent 62%),
    linear-gradient(180deg, #fbfcfd 0%, #ffffff 100%);
  border-block-end: 1px solid var(--line);
}
.hero-inner { max-width: 900px; }
.eyebrow {
  display: inline-block; margin: 0 0 1rem; padding: 0.3rem 0.75rem;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.01em;
}
.hero h1 { margin-block-end: 1rem; max-width: 20ch; }
.hero .lead { font-size: clamp(1.02rem, 1.5vw, 1.2rem); margin-block-end: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.stats { display: flex; flex-wrap: wrap; gap: 2.5rem; margin: 3rem 0 0; padding: 0; }
.stats div { min-width: 120px; }
.stats dt { font-size: 0.82rem; color: var(--muted); margin-block-end: 0.2rem; }
.stats dd { margin: 0; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; color: var(--brand); }

/* ---------- 区块 ---------- */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { max-width: 720px; margin-block-end: 2.5rem; }
.section-head .kicker {
  margin: 0 0 0.6rem; font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent);
}
.section-more { margin-block-start: 2rem; font-weight: 600; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.service-card, .value-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.6rem 1.5rem;
}
.service-card h3 { margin-block-end: 0.5rem; }
.service-card p { color: var(--muted); font-size: 0.95rem; margin-block-end: 1rem; }
.feature-list { margin: 0; padding-inline-start: 1.1rem; font-size: 0.9rem; color: var(--ink-soft); }
.feature-list li { margin-block-end: 0.35rem; }

.value-index {
  display: block; font-size: 0.78rem; font-weight: 700; color: var(--accent);
  font-family: var(--mono); margin-block-end: 0.7rem;
}
.value-card p { font-size: 0.93rem; color: var(--muted); margin: 0; }

.process { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.process li { position: relative; padding-inline-start: 3rem; }
.process li::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  position: absolute; inset-inline-start: 0; top: 0;
  width: 2.1rem; height: 2.1rem; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 8px; font-family: var(--mono); font-size: 0.8rem; font-weight: 700;
}
.process h3 { font-size: 1rem; margin-block-end: 0.35rem; }
.process p { font-size: 0.92rem; color: var(--muted); margin: 0; }

/* ---------- 卡片 ---------- */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: box-shadow 0.2s, transform 0.2s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-link { display: block; color: inherit; }
.card-link:hover { text-decoration: none; }
.card-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-alt); }
.card-cover.placeholder { background: linear-gradient(135deg, #eef2f7, #e3ecf5); }
.card-body { padding: 1.25rem 1.35rem 1.4rem; }
.card-meta { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.5rem; font-size: 0.8rem; color: var(--muted); }
.tag { display: inline-block; padding: 0.16rem 0.5rem; background: var(--accent-soft); color: var(--accent); border-radius: 999px; font-size: 0.74rem; font-weight: 650; }
.card-title { font-size: 1.06rem; margin-block-end: 0.4rem; }
.card-desc { font-size: 0.9rem; color: var(--muted); margin-block-end: 0.8rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-more { font-size: 0.86rem; font-weight: 600; color: var(--accent); }

/* ---------- CTA ---------- */
.cta-band { background: var(--brand); color: #fff; }
.cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; }
.cta-inner h2 { margin-block-end: 0.3rem; color: #fff; }
.cta-inner p { margin: 0; color: #b9c7d6; max-width: 56ch; }

/* ---------- 页头 ---------- */
.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) 2.5rem; background: var(--bg-alt); border-block-end: 1px solid var(--line); }
.breadcrumb { font-size: 0.83rem; color: var(--muted); margin-block-end: 1rem; }
.page-head h1 { margin-block-end: 0.6rem; }

/* ---------- 文章 ---------- */
.article { padding-block: clamp(2.5rem, 6vw, 4rem); }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; font-size: 0.85rem; color: var(--muted); margin-block-end: 1.75rem; }
.article-cover { width: 100%; border-radius: var(--radius-lg); margin-block-end: 2rem; }
.lang-note { padding: 0.12rem 0.45rem; border: 1px solid var(--line); border-radius: 5px; font-size: 0.74rem; }

.prose { font-size: 1.02rem; color: var(--ink-soft); }
.prose > * + * { margin-block-start: 1.1em; }
.prose h2 { font-size: 1.42rem; margin-block-start: 2em; color: var(--ink); }
.prose h3 { font-size: 1.14rem; margin-block-start: 1.6em; color: var(--ink); }
.prose ul, .prose ol { padding-inline-start: 1.4rem; }
.prose li + li { margin-block-start: 0.4em; }
.prose blockquote {
  margin-inline: 0; padding: 0.9rem 1.25rem;
  border-inline-start: 3px solid var(--accent); background: var(--bg-alt);
  border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink-soft);
}
.prose img { border-radius: var(--radius); margin-block: 1.5rem; }
.prose code { font-family: var(--mono); font-size: 0.9em; background: var(--bg-alt); padding: 0.12em 0.4em; border-radius: 4px; }
.prose pre { background: #0d1520; color: #e6edf3; padding: 1rem 1.15rem; border-radius: var(--radius); overflow: auto; }
.prose pre code { background: none; color: inherit; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 0.55rem 0.7rem; text-align: start; }
.prose th { background: var(--bg-alt); }
.prose a { text-decoration: underline; text-underline-offset: 2px; }

.meta-list { display: flex; flex-wrap: wrap; gap: 2rem; margin: 0 0 2rem; padding: 1rem 0; border-block: 1px solid var(--line); }
.meta-list dt { font-size: 0.78rem; color: var(--muted); }
.meta-list dd { margin: 0; font-weight: 600; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 1.25rem; margin-block-start: 3rem; font-size: 0.92rem; }
.pagination a { padding: 0.4rem 0.8rem; border: 1px solid var(--line); border-radius: 7px; }
.empty { padding: 2.5rem; text-align: center; color: var(--muted); background: var(--bg-alt); border-radius: var(--radius-lg); }

/* ---------- 联系与表单 ---------- */
.contact-layout { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.contact-info dl { display: grid; gap: 1rem; margin: 0; }
.contact-info dt { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-block-end: 0.15rem; }
.contact-info dd { margin: 0; font-weight: 600; }
.contact-info { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.75rem; }

.inquiry-form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: 0.35rem; }
.field-row { display: grid; gap: 1.1rem; grid-template-columns: 1fr 1fr; }
.field label { font-size: 0.86rem; font-weight: 600; color: var(--ink-soft); }
.req { color: #b42318; }
.field input, .field textarea {
  width: 100%; padding: 0.68rem 0.85rem; font: inherit; font-size: 0.95rem;
  color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 8px; transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #b42318; }
.field textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 0.8rem; color: var(--muted); margin: 0; }
.form-status { margin: 0; font-size: 0.9rem; min-height: 1.4em; }
.form-status.ok { color: var(--accent); }
.form-status.err { color: #b42318; }
.hp { position: absolute; inset-inline-start: -9999px; }

/* ---------- 页脚 ---------- */
.site-footer { background: #0a1521; color: #a9b8c8; padding-block: 3.5rem 1.5rem; margin-block-start: 0; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1.6fr 1fr 1fr 1fr; }
.footer-brand { font-size: 1.05rem; font-weight: 700; color: #fff; margin-block-end: 0.35rem; }
.footer-company { font-size: 0.86rem; color: #8fa2b4; margin-block-end: 0.8rem; }
.site-footer .muted { color: #7b8b9c; font-size: 0.86rem; }
.footer-title { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.07em; color: #fff; margin-block-end: 0.85rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; font-size: 0.88rem; }
.footer-links a { color: #a9b8c8; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between;
  margin-block-start: 2.5rem; padding-block-start: 1.25rem;
  border-block-start: 1px solid #1c2a3a; font-size: 0.8rem; color: #7b8b9c;
}
.footer-bottom a { color: #8fa2b4; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .contact-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .container, .narrow { width: min(100% - 2rem, 1160px); }
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; inset-inline: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-block-end: 1px solid var(--line);
    padding: 0.75rem 1rem 1rem; display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul li a { display: block; padding: 0.65rem 0; border-block-end: 1px solid var(--line); }
  .site-nav .btn { margin-block-start: 0.9rem; }
  .header-inner { position: relative; flex-wrap: wrap; }
  .field-row { grid-template-columns: 1fr; }
  .stats { gap: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { max-width: none; }
}

/* 阿拉伯语等 RTL 语言的字体与数字方向微调 */
[dir="rtl"] { font-family: "Noto Naskh Arabic", "Segoe UI", Tahoma, var(--font); }
[dir="rtl"] .brand-text small { letter-spacing: 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
