:root {
  --brand: #1a5cff;
  --brand-dark: #0d47d9;
  --brand-soft: #eef3ff;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1f2329;
  --text-2: #5a606b;
  --text-3: #8a8f99;
  --border: #e8eaed;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --max: 1100px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

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

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

a {
  color: var(--brand);
  text-decoration: none;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── 顶部导航 ─────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 16px;
  color: var(--text);
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
}

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
}

.nav-links a {
  color: var(--text-2);
}

.nav-links a:hover {
  color: var(--brand);
}

/* ── Hero ─────────────────────────────────── */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 60px 0 52px;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.hero p {
  margin: 0;
  color: var(--text-2);
  font-size: 16px;
  max-width: 620px;
}

.hero-meta {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 13px;
}

.chip.neutral {
  background: #f1f3f5;
  color: var(--text-2);
}

.chip.ok {
  background: #e8f8ef;
  color: #0a7a42;
}

/* ── 区块 ─────────────────────────────────── */
.section {
  padding: 44px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.section-head .count {
  color: var(--text-3);
  font-size: 14px;
}

.search {
  margin-left: auto;
  position: relative;
}

.search input {
  width: 220px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}

.search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 92, 255, 0.12);
}

/* ── 文档卡片 ─────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: #d9e2f5;
}

.card-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.doc-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}

.card .desc {
  margin: 0 0 14px;
  color: var(--text-2);
  font-size: 14px;
  flex: 1;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.tag {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 6px;
  background: #f4f5f7;
  color: var(--text-2);
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
  text-decoration: none;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

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

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.card-foot .meta {
  margin-left: auto;
  color: var(--text-3);
  font-size: 12px;
}

/* ── 空状态 ───────────────────────────────── */
.empty {
  padding: 60px 0;
  text-align: center;
  color: var(--text-3);
}

/* ── 文档预览页 ───────────────────────────── */
.viewer-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.viewer-bar .wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.viewer-bar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.viewer-bar .spacer {
  margin-left: auto;
}

.pdf-frame {
  width: 100%;
  height: calc(100vh - 160px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin: 22px 0;
}

.fallback {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  margin: 22px 0;
}

/* ── 二维码页 ─────────────────────────────── */
.qr-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px;
  max-width: 480px;
  margin: 44px auto;
  text-align: center;
}

.qr-panel h1 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
}

.qr-panel .sub {
  color: var(--text-2);
  font-size: 14px;
  margin: 0 0 24px;
}

.qr-img {
  width: 260px;
  height: 260px;
  display: block;
  margin: 0 auto 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fff;
}

.qr-url {
  font-size: 13px;
  color: var(--text-3);
  word-break: break-all;
  background: #f7f8fa;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 20px;
}

/* ── 页脚（备案信息）──────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 32px 0;
  margin-top: 40px;
  color: var(--text-3);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
}

.footer a {
  color: var(--text-3);
}

.footer a:hover {
  color: var(--brand);
}

.footer .beian {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.footer .beian img {
  height: 14px;
  width: 14px;
  vertical-align: middle;
}

@media (max-width: 640px) {
  .hero {
    padding: 40px 0 34px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .search {
    margin-left: 0;
    width: 100%;
  }

  .search input {
    width: 100%;
  }

  .section-head {
    flex-wrap: wrap;
  }

  .nav-links {
    gap: 16px;
    font-size: 13px;
  }
}

/* ── PDF.js 阅读器 ─────────────────────────────────────── */
.pdf-viewer {
  background: #525659;
  border-radius: 10px;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  min-height: 320px;
}

.pdf-loading {
  color: #e8e8e8;
  padding: 120px 0;
  font-size: 14px;
}

.pdf-page {
  position: relative;
  width: min(100%, 860px);
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  border-radius: 2px;
  overflow: hidden;
}

.pdf-page canvas {
  display: block;
}

.pdf-page.pdf-pending {
  background: #f2f2f2 url('') no-repeat center;
}

.pdf-page-num {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-size: 11px;
  color: #999;
  background: rgba(255, 255, 255, 0.85);
  padding: 2px 8px;
  border-radius: 10px;
}

.pdf-page-error {
  padding: 40px 16px;
  color: #c0392b;
  font-size: 13px;
  text-align: center;
}

.page-indicator {
  font-size: 13px;
  color: #888;
  white-space: nowrap;
}

.fallback {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 40px 24px;
  text-align: center;
  color: #555;
}

.fallback-hint {
  font-size: 13px;
  color: #999;
  margin-top: 8px;
}

@media (max-width: 640px) {
  .pdf-viewer {
    padding: 10px 4px;
  }

  .viewer-bar .wrap {
    flex-wrap: wrap;
    gap: 8px;
  }

  .viewer-bar h1 {
    font-size: 15px;
  }
}

/* ── 顶栏图片 logo ─────────────────────────────────────── */
.logo-img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
  border: 1px solid #eee;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .logo-img {
    width: 30px;
    height: 30px;
  }
}

/* ── Infineon 风格首页改版（v4）───────────────────────── */
:root {
  --green: #2f9e44;
  --green-dark: #1e7a33;
  --green-light: #e9f7ec;
}

/* 导航：白底细线，企业官网式 */
body > .nav {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: none;
}

body > .nav .nav-inner {
  max-width: 1140px;
  padding: 0 20px;
}

body > .nav .nav-links a {
  color: #1f2937;
  font-weight: 500;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}

body > .nav .nav-links a:hover {
  color: var(--green);
  border-bottom-color: var(--green);
}

/* 大横幅 */
.hero-banner {
  background: linear-gradient(120deg, #0b3d1f 0%, #14532d 55%, #1e7a33 100%);
  color: #fff;
  overflow: hidden;
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 380px;
  padding-top: 48px;
  padding-bottom: 48px;
}

.hero-copy { flex: 1; }

.hero-banner h1 {
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.25;
  margin: 0 0 14px;
  color: #fff;
}

.hero-desc {
  font-size: 16px;
  color: #d3ecd9;
  max-width: 560px;
  margin: 0 0 24px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.btn-lg {
  padding: 12px 26px;
  font-size: 15px;
}

.hero-banner .btn-primary {
  background: #fff;
  color: var(--green-dark);
}

.hero-banner .btn-primary:hover {
  background: var(--green-light);
}

.btn-ghost-light {
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #fff;
}

.btn-ghost-light:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hero-art {
  flex-shrink: 0;
  width: min(300px, 32vw);
}

.hero-art img {
  width: 100%;
  border-radius: 18px;
  opacity: 0.95;
  filter: drop-shadow(0 14px 30px rgba(0, 0, 0, 0.35));
}

/* 数据带 */
.stats-band {
  background: #f5f6f7;
  padding: 56px 0 64px;
}

.stats-title {
  text-align: center;
  font-size: 26px;
  margin: 0 0 36px;
  color: #111827;
}

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

.stat {
  text-align: center;
  background: #fff;
  border-radius: 12px;
  padding: 28px 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.stat-num {
  font-size: 30px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 6px;
}

.stat-label {
  font-size: 14px;
  color: #4b5563;
}

/* 资料卡片：Infineon 产品卡风格 */
.grid .card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.grid .card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  border-color: transparent;
}

.card .doc-icon {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #fff;
}

/* 深色页脚 */
.footer-dark {
  background: #14201a;
  color: #cbd5d1;
  margin-top: 0;
}

.footer-dark .footer-cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  padding: 44px 20px 36px;
}

.footer-brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  vertical-align: middle;
  margin-right: 10px;
  background: #fff;
}

.footer-brand strong {
  color: #fff;
  font-size: 17px;
}

.footer-brand p {
  margin: 12px 0 0;
  font-size: 13px;
  color: #9fb3aa;
  max-width: 320px;
}

.footer-col h4 {
  color: #fff;
  font-size: 14px;
  margin: 0 0 14px;
}

.footer-col a,
.footer-col span {
  display: block;
  color: #9fb3aa;
  font-size: 13px;
  margin-bottom: 10px;
  text-decoration: none;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bar {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-bar .footer-inner {
  padding: 16px 0;
  font-size: 12px;
}

.footer-bar .footer-inner a.beian,
.footer-bar .footer-inner a,
.footer-bar .footer-inner span {
  color: #9fb3aa;
}

.footer-bar .footer-inner a.beian img {
  filter: none;
}

/* 响应式 */
@media (max-width: 800px) {
  .hero-inner {
    flex-direction: column-reverse;
    text-align: center;
    min-height: 0;
    padding-top: 40px;
  }

  .hero-copy .hero-desc,
  .hero-actions,
  .hero-meta {
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
  }

  .hero-art {
    width: min(200px, 48vw);
  }

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

  .footer-dark .footer-cols {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
