/* ============================================================
   Arduino IDE 中文推广站 — 全局样式
   主色：#00878F（Arduino 品牌青）
   风格：扁平现代专业 · 浅色主题
   ============================================================ */

:root {
  --teal: #00878f;
  --teal-600: #007078;
  --teal-700: #00565c;
  --teal-800: #00454a;
  --teal-050: #eaf5f5;
  --teal-100: #d5ebec;
  --teal-200: #b3dcdd;

  --ink-900: #132729;
  --ink-800: #1d3537;
  --ink-700: #31494b;
  --ink-600: #476164;
  --ink-500: #5f787a;
  --ink-400: #829698;

  --bg: #ffffff;
  --bg-soft: #f5f9f9;
  --bg-teal: #eef7f7;
  --line: #e2ecec;
  --line-strong: #cfdede;

  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(19, 39, 41, .06), 0 1px 3px rgba(19, 39, 41, .08);
  --shadow-md: 0 4px 14px rgba(19, 39, 41, .08), 0 2px 4px rgba(19, 39, 41, .06);
  --shadow-lg: 0 16px 40px rgba(19, 39, 41, .14);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", Menlo, monospace;

  --maxw: 1180px;
  --header-h: 68px;
}

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

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

body {
  font-family: var(--font-sans);
  color: var(--ink-700);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-600); }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--teal); color: #fff; }

/* ---------- 布局工具 ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 76px 0; }
.section--soft { background: var(--bg-soft); }
.section--teal { background: var(--bg-teal); }

.section-head { max-width: 720px; margin: 0 auto 44px; text-align: center; }
.section-head .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--teal);
  background: var(--teal-050); border: 1px solid var(--teal-100);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.section-head h2 { font-size: 32px; line-height: 1.3; color: var(--ink-900); font-weight: 700; letter-spacing: -.01em; }
.section-head p { margin-top: 14px; font-size: 17px; color: var(--ink-500); }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  height: var(--header-h);
}
.nav { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink-900); font-size: 18px; }
.brand .logo { width: 34px; height: 26px; flex: 0 0 auto; }
.brand:hover { color: var(--teal); }

.nav-links { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-links a {
  padding: 8px 14px; border-radius: 8px;
  color: var(--ink-600); font-weight: 500; font-size: 15px;
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--teal); background: var(--teal-050); }
.nav-links a.active { color: var(--teal); background: var(--teal-050); font-weight: 600; }

.nav-cta {
  margin-left: 6px;
  background: var(--teal); color: #fff !important;
  padding: 9px 18px !important; border-radius: 9px; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.nav-cta:hover { background: var(--teal-600) !important; }

.nav-toggle {
  display: none; margin-left: auto;
  width: 42px; height: 42px; border-radius: 9px;
  background: transparent; border: 1px solid var(--line);
  align-items: center; justify-content: center;
}
.nav-toggle svg { width: 22px; height: 22px; stroke: var(--ink-800); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(0, 135, 143, .10), transparent 60%),
    linear-gradient(180deg, #fbfdfd 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
}
.hero .container { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 72px; }

.hero-copy .badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--teal-050); border: 1px solid var(--teal-100);
  color: var(--teal-700); font-size: 13px; font-weight: 600;
  padding: 6px 13px; border-radius: 999px; margin-bottom: 22px;
}
.hero-copy h1 { font-size: 46px; line-height: 1.16; font-weight: 800; color: var(--ink-900); letter-spacing: -.02em; }
.hero-copy h1 .accent { color: var(--teal); }
.hero-copy .lead { margin-top: 20px; font-size: 18px; color: var(--ink-500); max-width: 520px; }

.hero-actions { display: flex; align-items: center; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 600; font-size: 16px; border-radius: 10px;
  padding: 13px 24px; transition: transform .12s, box-shadow .12s, background .15s, color .15s;
  border: 1px solid transparent; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 8px 20px rgba(0, 135, 143, .28); }
.btn-primary:hover { background: var(--teal-600); color: #fff; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0, 135, 143, .34); }
.btn-ghost { background: var(--white); color: var(--ink-800); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-lg { padding: 15px 30px; font-size: 17px; }

.hero-meta { display: flex; gap: 24px; margin-top: 30px; flex-wrap: wrap; }
.hero-meta .m-item { display: flex; flex-direction: column; }
.hero-meta .m-num { font-size: 22px; font-weight: 800; color: var(--ink-900); }
.hero-meta .m-label { font-size: 13px; color: var(--ink-500); }

/* 代码卡片 */
.code-card {
  background: #0f1f21; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden; color: #d7e5e6;
}
.code-card .cc-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; background: #0a1719; border-bottom: 1px solid #1d3032; }
.code-card .cc-bar .dot { width: 11px; height: 11px; border-radius: 50%; }
.code-card .cc-bar .dot:nth-child(1){ background:#ff5f57; } .dot:nth-child(2){ background:#febc2e; } .dot:nth-child(3){ background:#28c840; }
.code-card .cc-bar .fname { margin-left: 10px; font-size: 12.5px; font-family: var(--font-mono); color: #7e9698; }
.code-card pre { padding: 22px 22px 26px; font-family: var(--font-mono); font-size: 13.5px; line-height: 1.75; overflow-x: auto; }
.code-card pre .c { color: #6b8a8c; }
.code-card pre .k { color: #4dd0e1; }
.code-card pre .s { color: #9ccc65; }
.code-card pre .f { color: #ffb74d; }

/* ---------- 特性卡片 ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.feature-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 28px 26px;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--teal-100); }
.feature-card .f-icon {
  width: 50px; height: 50px; border-radius: 13px;
  background: var(--teal-050); display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.feature-card .f-icon svg { width: 26px; height: 26px; stroke: var(--teal); }
.feature-card h3 { font-size: 18px; color: var(--ink-900); font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 15px; color: var(--ink-500); }

/* ---------- 使用场景 ---------- */
.scene-card {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg); border: 1px solid var(--line);
  background: var(--white); padding: 26px;
  transition: transform .16s, box-shadow .16s;
}
.scene-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.scene-card .s-tag { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--teal-700); background: var(--teal-050); border-radius: 6px; padding: 3px 9px; display: inline-block; margin-bottom: 14px; }
.scene-card h3 { font-size: 19px; color: var(--ink-900); font-weight: 700; margin-bottom: 8px; }
.scene-card p { font-size: 15px; color: var(--ink-500); }

/* ---------- 用户评价 ---------- */
.quote-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 30px 28px;
  display: flex; flex-direction: column; gap: 18px;
}
.quote-card .q-text { font-size: 16.5px; color: var(--ink-700); line-height: 1.75; }
.quote-card .q-text::before { content: "\201C"; color: var(--teal); font-size: 30px; font-weight: 800; line-height: 0; margin-right: 2px; vertical-align: -8px; }
.quote-card .q-author { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.quote-card .avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--teal-100); color: var(--teal-700);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.quote-card .q-name { font-weight: 700; color: var(--ink-900); font-size: 15px; }
.quote-card .q-role { font-size: 13px; color: var(--ink-500); }
.quote-card .q-stars { color: #f5a623; font-size: 14px; letter-spacing: 2px; }

/* ---------- CTA 横幅 ---------- */
.cta-band {
  background: var(--teal); color: #fff; border-radius: var(--radius-lg);
  padding: 52px 48px; text-align: center; position: relative; overflow: hidden;
}
.cta-band::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(600px 260px at 50% -40%, rgba(255,255,255,.16), transparent 65%);
  pointer-events: none;
}
.cta-band h2 { font-size: 30px; font-weight: 800; color: #fff; }
.cta-band p { margin-top: 12px; font-size: 17px; color: rgba(255,255,255,.9); }
.cta-band .btn { margin-top: 26px; }
.cta-band .btn-primary { background: #fff; color: var(--teal-700); box-shadow: none; }
.cta-band .btn-primary:hover { background: var(--teal-050); color: var(--teal-800); }

/* ---------- 下载中心 ---------- */
.dl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.dl-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 32px 28px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  transition: transform .16s, box-shadow .16s;
}
.dl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.dl-card.featured { border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-050); }
.dl-card .os-icon { width: 62px; height: 62px; border-radius: 16px; background: var(--teal-050); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.dl-card .os-icon svg { width: 32px; height: 32px; stroke: var(--teal); }
.dl-card h3 { font-size: 20px; color: var(--ink-900); font-weight: 700; }
.dl-card .arch { font-size: 13px; color: var(--ink-500); margin-top: 4px; }
.dl-card .size { font-size: 13px; color: var(--ink-400); margin-top: 10px; }
.dl-card .btn { margin-top: 20px; width: 100%; }

.spec-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.spec-table th, .spec-table td { text-align: left; padding: 14px 20px; border-bottom: 1px solid var(--line); font-size: 15px; }
.spec-table th { background: var(--bg-soft); color: var(--ink-800); font-weight: 600; width: 200px; }
.spec-table tr:last-child td { border-bottom: none; }
.spec-table td { color: var(--ink-600); }

/* ---------- 关于 / 时间线 ---------- */
.timeline { position: relative; padding-left: 32px; }
.timeline::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--teal-100); }
.timeline li { position: relative; padding-bottom: 30px; }
.timeline li::before { content: ""; position: absolute; left: -29px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: var(--teal); border: 3px solid var(--teal-050); }
.timeline .t-year { font-weight: 800; color: var(--teal); font-size: 15px; }
.timeline .t-title { font-weight: 700; color: var(--ink-900); margin: 2px 0 4px; }
.timeline .t-desc { color: var(--ink-500); font-size: 15px; }

/* ---------- 指南步骤 ---------- */
.step { display: flex; gap: 20px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border-bottom: none; }
.step .s-num {
  flex: 0 0 44px; height: 44px; border-radius: 12px;
  background: var(--teal); color: #fff; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.step h3 { font-size: 18px; color: var(--ink-900); font-weight: 700; margin-bottom: 6px; }
.step p { color: var(--ink-500); font-size: 15px; }
.step code { font-family: var(--font-mono); background: var(--teal-050); color: var(--teal-700); padding: 2px 7px; border-radius: 5px; font-size: 13.5px; }

.faq-item { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; background: var(--white); }
.faq-item summary { cursor: pointer; padding: 18px 22px; font-weight: 600; color: var(--ink-900); font-size: 16px; display: flex; justify-content: space-between; align-items: center; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .plus { font-size: 22px; color: var(--teal); font-weight: 400; transition: transform .2s; }
.faq-item[open] summary .plus { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 22px 20px; color: var(--ink-600); font-size: 15px; }

/* ---------- 面包屑 ---------- */
.breadcrumb { padding: 18px 0; font-size: 13.5px; color: var(--ink-500); border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.breadcrumb a { color: var(--ink-500); }
.breadcrumb a:hover { color: var(--teal); }
.breadcrumb .sep { margin: 0 8px; color: var(--line-strong); }
.breadcrumb .current { color: var(--ink-800); font-weight: 600; }

/* 页面内页 hero */
.page-hero { background: var(--bg-teal); border-bottom: 1px solid var(--line); padding: 56px 0 48px; text-align: center; }
.page-hero h1 { font-size: 36px; color: var(--ink-900); font-weight: 800; letter-spacing: -.01em; }
.page-hero p { margin-top: 14px; font-size: 17px; color: var(--ink-500); max-width: 680px; margin-left: auto; margin-right: auto; }

/* ---------- 页脚 ---------- */
.site-footer { background: #0f1f21; color: #9fb4b5; padding: 56px 0 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 36px; }
.footer-brand .brand { color: #fff; margin-bottom: 12px; }
.footer-brand .brand .logo { filter: brightness(0) invert(1); opacity: .9; }
.footer-brand p { font-size: 14px; color: #7e9698; max-width: 320px; }
.footer-col h4 { color: #fff; font-size: 14px; font-weight: 700; margin-bottom: 14px; letter-spacing: .04em; }
.footer-col a { display: block; color: #9fb4b5; font-size: 14px; padding: 5px 0; }
.footer-col a:hover { color: #4dd0e1; }
.footer-bottom { margin-top: 40px; padding-top: 22px; border-top: 1px solid #1d3032; font-size: 13px; color: #6b8a8c; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer-bottom a { color: #9fb4b5; }

/* ---------- 下载弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 31, 33, .55);
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-mask.open { display: flex;  left: 0;
  right: 0;
  top: 0;
  bottom: 0; }
  button { outline: none } 
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  max-width: 720px; width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-lg); position: relative;
}
.modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--white);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--bg-soft); }
.modal-close svg { width: 18px; height: 18px; stroke: var(--ink-700); }
.modal-head { padding: 28px 30px 6px; text-align: center; }
.modal-head .m-logo { width: 56px; height: 43px; margin: 0 auto 14px; }
.modal-head h3 { font-size: 22px; color: var(--ink-900); font-weight: 800; }
.modal-head p { margin-top: 8px; font-size: 14.5px; color: var(--ink-500); }

.modal-body { padding: 22px 30px 32px; }
.qr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 6px; }
.qr-box {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; text-align: center; background: var(--bg-soft);
}
.qr-box img { width: 150px; height: 150px; margin: 0 auto 14px; border-radius: 8px; background: #fff; padding: 8px; border: 1px solid var(--line); }
.qr-box .qr-title { font-weight: 700; color: var(--ink-900); font-size: 16px; }
.qr-box .qr-sub { font-size: 13px; color: var(--ink-500); margin-top: 4px; }

.modal-divider { display: flex; align-items: center; gap: 14px; margin: 26px 0 18px; color: var(--ink-400); font-size: 13px; }
.modal-divider::before, .modal-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.direct-links { display: flex; flex-direction: column; gap: 10px; }
.direct-links a {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink-700); font-weight: 500; transition: border-color .15s, background .15s;
}
.direct-links a:hover { border-color: var(--teal); background: var(--teal-050); color: var(--teal-700); }
.direct-links a svg { width: 20px; height: 20px; stroke: var(--teal); flex: 0 0 auto; }
.direct-links a .d-meta { margin-left: auto; font-size: 13px; color: var(--ink-400); }

.modal-note { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--ink-400); }

/* ---------- 返回顶部 ---------- */
.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--teal); color: #fff; border: none;
  display: none; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
}
.to-top.show { display: flex; }
.to-top:hover { background: var(--teal-600); }
.to-top svg { width: 20px; height: 20px; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .hero .container { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 48px; }
  .hero-copy h1 { font-size: 36px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .dl-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  .section { padding: 52px 0; }
  .section-head h2 { font-size: 26px; }
  .hero-copy h1 { font-size: 30px; }
  .nav-links {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--white); border-bottom: 1px solid var(--line);
    padding: 12px 18px 18px; display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; }
  .nav-toggle { display: flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .qr-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 40px 24px; }
  .spec-table th { width: 130px; }
}

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

/* 跳转焦点可见性 */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--teal-200); outline-offset: 2px; border-radius: 6px;
}

/* 打印 */
@media print {
  .site-header, .site-footer, .to-top, .nav-cta, .modal-mask { display: none !important; }
}
