/* 系统更新页 —— 沿用首页的纸感与墨色 */
:root {
  --paper: #f6f4ef;
  --paper-deep: #efede6;
  --ink: #1a1a1a;
  --ink-soft: #55524b;
  --ink-faint: #a09c92;
  --line: #e2dfd6;
  --ok: #5c7a4a;
  --ok-bg: #f0f4ea;
  --warn: #a8762f;
  --warn-bg: #fbf4e6;
  --err: #a4482f;
  --err-bg: #fbf0ec;
  --mono: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- 顶栏 ---------- */
.site-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; text-decoration: none; color: var(--ink); }
.brand-logo { display: block; height: 60px; width: auto; }
.site-nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.nav-link {
  font-size: 14px; color: var(--ink-soft); text-decoration: none;
  transition: color .2s ease;
}
.nav-link:hover { color: var(--ink); }
.nav-link[aria-current="page"] { color: var(--ink); }
.dl-btn {
  display: inline-flex; align-items: center;
  background: var(--ink); color: #fff;
  padding: 10px 20px; border-radius: 10px;
  text-decoration: none; font-size: 14px; font-weight: 600;
  transition: transform .2s ease, box-shadow .2s ease;
}
.dl-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(26,26,26,.18); }

/* ---------- 页头 ---------- */
.page-head {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 46px 40px 0;
}
.eyebrow {
  font-size: 12px; letter-spacing: 7px;
  color: var(--ink-soft); margin-bottom: 20px;
}
h1 {
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 900; letter-spacing: 2px; line-height: 1.25;
}
.lede {
  max-width: 560px;
  margin-top: 16px;
  font-size: 16px; line-height: 1.85; color: var(--ink-soft);
}
.watermark {
  position: absolute; right: 24px; top: -18px;
  font-size: 200px; font-weight: 900; line-height: 1;
  letter-spacing: -12px;
  color: rgba(26,26,26,.04);
  pointer-events: none; user-select: none;
}
.head-rule {
  max-width: 1200px; margin: 32px auto 0;
  padding: 0 40px;
}
.head-rule::after {
  content: ""; display: block; border-top: 1px solid var(--line);
}

/* ---------- 更新区 ---------- */
.flash-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 40px 0;
}
.flash-grid {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* 固件卡 */
.fw-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px 26px 24px;
}
.fw-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.fw-badge {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: 999px; padding: 2px 10px;
  font-size: 11px; font-weight: 500; letter-spacing: 1.5px;
}
.fw-version {
  font-family: var(--mono);
  font-size: 12px; color: var(--ink-faint);
}
.fw-title { font-size: 22px; font-weight: 700; letter-spacing: .5px; margin-bottom: 8px; }
.fw-desc { font-size: 13.5px; line-height: 1.85; color: var(--ink-soft); }
.fw-features { list-style: none; margin: 18px 0 20px; }
.fw-features li {
  position: relative;
  padding: 3px 0 3px 15px;
  font-size: 13px; line-height: 1.95; color: var(--ink-soft);
}
.fw-features li::before {
  content: ""; position: absolute; left: 2px; top: 12px;
  width: 4px; height: 4px; border-radius: 50%;
  background: #c3bcae;
}
.fw-release { margin: 18px 0 20px; }
.fw-release-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.fw-release-title {
  font-size: 11px; letter-spacing: 2px; color: var(--ink-faint);
}
.fw-release-date {
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
}
.fw-release-notes { list-style: none; }
.fw-release-notes li {
  position: relative;
  padding: 3px 0 3px 13px;
  font-size: 13px; line-height: 1.85; color: var(--ink-soft);
}
.fw-release-notes li::before {
  content: ""; position: absolute; left: 2px; top: 11px;
  width: 3px; height: 3px; border-radius: 50%;
  background: #c3bcae;
}
.fw-meta {
  display: flex; align-items: center; gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px; color: var(--ink-faint);
}
.fw-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line); }

/* 更新步骤 */
.flow-kicker {
  font-size: 12px; letter-spacing: 3px;
  color: var(--ink-faint); margin-bottom: 6px;
}
.steps { list-style: none; }
.step {
  display: flex; gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.step:first-child { padding-top: 4px; }
.step-num {
  min-width: 22px;
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-faint); padding-top: 3px;
}
.step h3 { font-size: 15px; font-weight: 600; letter-spacing: .3px; margin-bottom: 4px; }
.step p { font-size: 13px; line-height: 1.7; color: var(--ink-soft); }

.mobile-hint {
  display: none;
  margin-top: 20px;
  font-size: 12.5px; color: var(--ink-faint);
}

/* 更新入口 */
.cta-row { margin-top: 26px; }
.btn-flash {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 14px 24px;
  background: var(--ink); color: #fff;
  border: none; border-radius: 10px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.btn-flash:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(26,26,26,.18); }
.cta-hint {
  margin-top: 10px;
  font-size: 12px; color: var(--ink-faint);
  text-align: center;
}
.cta-hint.is-error { color: var(--err); }
.env-alert {
  margin-top: 8px;
  font-size: 12.5px; line-height: 1.7; color: var(--err);
  text-align: center;
}
.btn-flash:disabled {
  opacity: .45; cursor: not-allowed;
  transform: none; box-shadow: none;
}
.data-note {
  margin-top: 24px;
  padding-left: 12px;
  border-left: 2px solid var(--ink);
  font-size: 12.5px; line-height: 1.85; color: var(--ink-soft);
}

/* ---------- 更新面板 ---------- */
.panel {
  margin-top: 40px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 28px 24px;
  scroll-margin-top: 24px;
}
.panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.panel-title { font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.panel-meta {
  margin-top: 5px;
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-faint);
}
.panel-close {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border: none; background: transparent;
  color: var(--ink-faint); font-size: 22px; line-height: 1;
  cursor: pointer; border-radius: 8px;
  transition: background .2s, color .2s;
}
.panel-close:hover { background: var(--paper-deep); color: var(--ink); }

.stages { display: flex; flex-wrap: wrap; gap: 9px 22px; list-style: none; margin: 20px 0 16px; }
.stage {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-faint);
  transition: color .2s;
}
.stage-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #d9d5ca;
  transition: background .2s, box-shadow .2s;
}
.stage.is-active { color: var(--ink); font-weight: 600; }
.stage.is-active .stage-dot { background: var(--ink); box-shadow: 0 0 0 4px rgba(26,26,26,.1); }
.stage.is-done { color: var(--ink-soft); }
.stage.is-done .stage-dot { background: var(--ink); }
.stage.is-failed { color: var(--err); font-weight: 600; }
.stage.is-failed .stage-dot { background: var(--err); box-shadow: 0 0 0 4px rgba(164,72,47,.12); }

.progress-track {
  height: 7px;
  background: var(--paper-deep);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0;
  background: var(--ink);
  border-radius: 999px;
  transition: width .2s linear;
}
.progress-meta {
  display: flex; justify-content: space-between; gap: 16px;
  margin-top: 8px;
  font-size: 12px; color: var(--ink-soft);
}
.progress-meta .pct { font-family: var(--mono); }

.device-row {
  display: flex; flex-wrap: wrap; gap: 8px 36px;
  margin-top: 14px;
  font-size: 12px; color: var(--ink-faint);
}
.device-row b { font-family: var(--mono); font-weight: 500; color: var(--ink); }

.panel-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.btn {
  padding: 10px 22px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent; color: var(--ink-soft);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: border-color .2s, color .2s;
}
.btn:hover { border-color: var(--ink); color: var(--ink); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover { background: #000; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.alert {
  margin-top: 16px;
  padding: 13px 16px;
  border-left: 2px solid;
  border-radius: 0 8px 8px 0;
  font-size: 13px; line-height: 1.7;
}
.alert strong { display: block; font-weight: 600; margin-bottom: 3px; }
.alert p { opacity: .86; }
.alert.ok { background: var(--ok-bg); border-color: var(--ok); color: #3f5732; }
.alert.warn { background: var(--warn-bg); border-color: var(--warn); color: #7a5a1f; }
.alert.err { background: var(--err-bg); border-color: var(--err); color: #7d3f22; }

body.is-flashing .panel-close { opacity: .3; pointer-events: none; }

/* ---------- FAQ ---------- */
.faq {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 40px 0;
}
.faq h2 {
  font-size: 22px; font-weight: 700; letter-spacing: 1px;
  margin-bottom: 18px;
}
.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-child { border-bottom: 1px solid var(--line); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0;
  font-size: 14px; font-weight: 600;
  cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--ink-faint); font-weight: 400; font-size: 16px; }
.faq-item[open] summary::after { content: "−"; }
.faq-item p {
  max-width: 760px;
  padding: 0 0 18px;
  font-size: 13px; line-height: 1.9; color: var(--ink-soft);
}

/* ---------- 页脚 ---------- */
footer {
  margin-top: 80px;
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
}
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 36px 40px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
}
.footer-brand { font-size: 15px; font-weight: 700; letter-spacing: 4px; }
.footer-links { display: flex; gap: 22px; font-size: 12px; color: var(--ink-soft); }
.footer-links a { color: var(--ink-soft); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.beian { font-size: 12px; color: var(--ink-faint); }
.beian a { color: var(--ink-faint); text-decoration: none; }
.beian a:hover { color: var(--ink-soft); }
.copyright { font-size: 11px; color: var(--ink-faint); letter-spacing: 1px; }

/* 版本信息到达前先隐藏，避免闪一下 HTML 里的旧版本号 */
body.meta-pending .lede,
body.meta-pending .fw-version,
body.meta-pending .fw-release,
body.meta-pending .fw-meta,
body.meta-pending .step-version,
body.meta-pending .panel-meta {
  visibility: hidden;
}

/* ---------- 响应式 ---------- */
.on-mobile { display: none; }
@media (max-width: 900px) {
  .lede-rest { display: block; }
  .page-head { padding: 30px 40px 0; }
  .watermark { display: none; }
  .head-rule { padding: 0 40px; margin-top: 26px; }
  .flash-section { padding: 32px 40px 0; }
  .flash-grid { grid-template-columns: 1fr; gap: 28px; }
  .flow-kicker { display: none; }
  .step:first-child { padding-top: 16px; }
  .mobile-hint { display: block; }
  .cta-row { max-width: none; margin-top: 22px; }
  .btn-flash { width: 100%; }
  .data-note { max-width: none; }
  .on-desktop { display: none; }
  .on-mobile { display: inline; }
  .btn-flash {
    background: transparent; color: var(--ink-faint);
    border: 1px dashed var(--line);
    box-shadow: none; cursor: default;
    pointer-events: none;
  }
  .btn-flash:hover { transform: none; box-shadow: none; }
  .panel { padding: 20px 18px; margin-top: 32px; }
  .faq { padding-left: 40px; padding-right: 40px; padding-top: 52px; }
  .footer-inner { padding: 30px 40px; }
}
