/* ============================================================
   刷机包下载 / Firmware finder
   ============================================================ */

.fw-hero { padding-bottom: 10px; }
.fw-hero .lead { max-width: 760px; }

.fw-shell {
  background: var(--surface);
  border: 1px solid #e4e4e7;
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(9,9,11,.04), 0 18px 40px -26px rgba(9,9,11,.14);
  padding: 24px 26px;
  margin: 10px 0 12px;
}

.fw-tabs {
  display: flex;
  gap: 8px;
  padding: 5px;
  background: var(--subtle);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 22px;
}
.fw-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: .15s var(--ease);
}
.fw-tab:hover { color: var(--ink); }
.fw-tab.active { background: #ffffff; color: #09090b; box-shadow: 0 1px 2px rgba(9,9,11,.06); }
.fw-tab small { display: inline-block; margin-left: 6px; font-size: 11px; color: var(--dim); font-weight: 600; }
.fw-tab.active small { color: #52525b; }

.fw-panel { display: none; }
.fw-panel.active { display: block; }

.fw-label { display: block; font-size: 13px; font-weight: 700; color: var(--ink); margin: 0 0 7px; }
.fw-label span { color: var(--muted); font-weight: 500; }

.fw-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.fw-ac-wrap { position: relative; flex: 1; min-width: 240px; }
.fw-ac-wrap .fw-input { width: 100%; min-width: 0; }
.fw-input {
  flex: 1;
  min-width: 240px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fafafa;
  font: inherit;
  font-size: 16px;
  letter-spacing: .03em;
  color: #09090b;
  padding: 12px 14px;
  outline: none;
  transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
}
.fw-input:focus { background: #ffffff; border-color: #09090b; box-shadow: 0 0 0 3px rgba(9,9,11,.08); }
.fw-input::placeholder { color: var(--dim); letter-spacing: 0; font-size: 14px; }

.fw-ac {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 14px;
  box-shadow: 0 20px 44px -16px rgba(9,9,11,.18), 0 2px 6px rgba(9,9,11,.04);
}
.fw-ac[hidden] { display: none; }
.fw-ac-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #09090b;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .12s var(--ease);
}
.fw-ac-item:hover,
.fw-ac-item.is-active { background: #f4f4f5; }
.fw-ac-left { display: flex; align-items: baseline; gap: 8px; min-width: 0; flex-wrap: wrap; }
.fw-ac-sku { font-family: var(--mono); font-size: 13px; font-weight: 700; color: #09090b; }
.fw-ac-name { font-size: 13px; color: #52525b; }
.fw-ac-code {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: #52525b;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 999px;
  padding: 2px 8px;
}
.fw-ac-item:hover .fw-ac-code,
.fw-ac-item.is-active .fw-ac-code { background: #ffffff; border-color: #d4d4d8; color: #09090b; }
.fw-btn {
  border: 0;
  border-radius: 10px;
  background: #09090b;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 22px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none;
  transition: background .15s var(--ease);
}
.fw-btn:hover { background: #27272a; }
.fw-btn:disabled { opacity: .55; cursor: not-allowed; }

.fw-help { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.fw-help a { color: var(--brand); font-weight: 600; }

.fw-quota {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: #3f3f46;
  background: #f4f4f5;
  border: 1px solid #e4e4e7;
  border-radius: 999px;
  padding: 4px 11px;
  white-space: nowrap;
}
.fw-quota b { font-family: var(--mono); color: #09090b; font-weight: 700; }

.fw-turnstile { margin-top: 16px; min-height: 0; }
.fw-turnstile:empty { display: none; }

.fw-msg { margin-top: 14px; border-radius: 12px; padding: 12px 14px; font-size: 13.5px; line-height: 1.65; display: none; }
.fw-msg.show { display: block; }
.fw-msg.err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.fw-msg.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.fw-msg.info { background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--brand-deep); }

.fw-result { margin-top: 24px; scroll-margin-top: 88px; }
.fw-result:empty { display: none; }

.fw-device {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 18px 20px;
  border: 1px solid #e4e4e7;
  border-radius: 16px;
  background: #fafafa;
}
.fw-device h2 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.025em; color: var(--ink); line-height: 1.25; }
.fw-kicker { display: block; font-family: var(--mono); font-size: 11px; font-weight: 650; letter-spacing: .12em; color: #71717a; text-transform: uppercase; margin-bottom: 6px; }
.fw-meta { display: flex; flex-wrap: wrap; gap: 7px; }
.fw-meta span {
  font-size: 12px;
  color: var(--muted);
  background: var(--subtle);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}
.fw-meta b { color: var(--ink-2); font-weight: 650; }
.fw-imei { font-family: var(--mono); font-size: 12.5px; color: var(--muted); background: var(--subtle); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; white-space: nowrap; }

.fw-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 24px 0 10px; }
.fw-section-title h3 { margin: 0; font-size: 15px; color: var(--ink); }
.fw-section-title p { margin: 0; font-size: 12.5px; color: var(--muted); }

.fw-carriers { display: flex; flex-wrap: wrap; gap: 8px; }
.fw-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e4e4e7;
  background: #ffffff;
  color: var(--text);
  border-radius: 999px;
  padding: 7px 13px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease), transform .12s var(--ease);
}
.fw-chip:hover { border-color: #09090b; background: #fafafa; color: #09090b; }
.fw-chip.active { background: #09090b; border-color: #09090b; color: #ffffff; }
.fw-chip .y { opacity: .72; font-weight: 500; margin-left: 6px; font-family: var(--mono); font-size: 11.5px; }

/* 支持解锁的 MTK 机型在原字母位置内高亮区分 */
.fw-chip.is-mtk {
  background: linear-gradient(180deg, #eff6ff 0%, #e4efff 100%);
  border-color: #93c5fd;
  color: #1e3a8a;
  font-weight: 650;
  box-shadow: 0 1px 2px rgba(37,99,235,.08);
}
.fw-chip.is-mtk:hover {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #172554;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -6px rgba(37,99,235,.34);
}
.fw-chip.is-mtk.active {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 4px 12px -4px rgba(29,78,216,.38);
}
.fw-mtk-tag {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.45;
}
.fw-chip.is-mtk.active .fw-mtk-tag {
  background: rgba(255,255,255,.22);
  color: #ffffff;
}
.fw-chip.is-mtk .y { color: #3b82f6; opacity: .95; }
.fw-chip.is-mtk.active .y { color: rgba(255,255,255,.84); }

.fw-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.fw-step-head .fw-step-title { margin-bottom: 0; }
.fw-mtk-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 11.5px;
  font-weight: 600;
  color: #1d4ed8;
}
.fw-mtk-legend[hidden] { display: none; }
.fw-mtk-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2563eb;
  display: inline-block;
}

.fw-files { display: grid; gap: 9px; margin-top: 14px; }
.fw-file {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  transition: .15s var(--ease);
}
.fw-file:hover { border-color: var(--brand-line); box-shadow: var(--sh-1); }
.fw-file-main { min-width: 240px; flex: 1; }
.fw-file-name { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); word-break: break-all; line-height: 1.5; }
.fw-file-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; font-size: 11.5px; color: var(--dim); }
.fw-file-meta b { color: var(--muted); font-weight: 600; }
.fw-file .btn, .fw-file .fw-btn { flex: 0 0 auto; padding: 8px 16px; font-size: 12.5px; border-radius: 9px; text-decoration: none; }
.fw-badge { display: inline-block; font-size: 10.5px; font-weight: 750; border-radius: 999px; padding: 2px 8px; background: var(--ok-soft); color: var(--ok); border: 1px solid #a7f3d0; }
.fw-badge.muted { background: var(--subtle); color: var(--muted); border-color: var(--line); }

.fw-empty {
  padding: 26px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  background: var(--subtle);
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}
.fw-empty b { color: var(--ink); }
.fw-empty a { color: var(--brand); font-weight: 650; }

.fw-split { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px; margin-top: 20px; }
.fw-card { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 16px 18px; }
.fw-card h4 { margin: 0 0 7px; font-size: 13.5px; color: var(--ink); }
.fw-card p { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.fw-card a { color: var(--brand); font-weight: 600; }

.fw-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  display: inline-block; vertical-align: -3px; margin-right: 7px;
  animation: fw-spin .8s linear infinite;
}
@keyframes fw-spin { to { transform: rotate(360deg); } }

.fw-loading { display: flex; align-items: center; gap: 8px; padding: 12px 0; color: var(--muted); font-size: 13px; }
.fw-loading .dot { width: 7px; height: 7px; border-radius: 50%; background: #09090b; animation: fw-pulse 1s infinite alternate; }
.fw-loading .dot:nth-child(2) { animation-delay: .2s; }
.fw-loading .dot:nth-child(3) { animation-delay: .4s; }
@keyframes fw-pulse { from { opacity: .25; } to { opacity: 1; } }

/* ── 年份 / 运营商 浏览区（导航栏下方） ─────────────────── */
.fw-browse {
  margin: 22px 0 0;
  background: #ffffff;
  border: 1px solid #e4e4e7;
  border-radius: 20px;
  box-shadow: 0 1px 3px rgba(9,9,11,.04), 0 18px 40px -26px rgba(9,9,11,.14);
  padding: 22px 24px;
}
/* 2026-11-10：大 hero 已删，筛选区标题升级为页面 h1 */
.fw-browse-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.fw-browse-copy h1, .fw-browse-copy h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.025em; color: var(--ink); }
.fw-browse-copy p { margin: 5px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; max-width: 720px; }
.fw-browse-body { margin-top: 16px; border-top: 1px solid #f0f0f3; padding-top: 6px; }
.fw-step { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; align-items: start; padding: 13px 0; }
.fw-step[hidden] { display: none !important; }
.fw-step + .fw-step { border-top: 1px solid #f0f0f3; }
.fw-step-n {
  width: 24px; height: 24px; border-radius: 50%;
  background: #f4f4f5; color: #09090b;
  border: 1px solid #e4e4e7;
  font-family: var(--mono);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 0;
}
.fw-step-main { min-width: 0; }
.fw-step-title { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 9px; }
.fw-scroll { max-height: 216px; overflow: auto; padding: 2px 6px 4px 2px; }
.fw-scroll::-webkit-scrollbar { width: 6px; }
.fw-scroll::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 999px; }
.fw-scroll::-webkit-scrollbar-track { background: transparent; }
.fw-browse-hint { margin: 0; font-size: 12.5px; color: var(--dim); line-height: 1.6; }
.fw-browse-files { margin-top: 4px; }
.fw-browse-files:empty { display: none; }

.fw-btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand-line); box-shadow: none; }
.fw-btn.ghost:hover { background: var(--brand-soft); }
.fw-chip.muted { color: var(--dim); cursor: default; }
.fw-section-title.sub { margin-top: 14px; }

/* 2026-11-10：ROM 列表默认只显示 1 个最新的，其余收进 details */
.fw-more-files { margin-top: 10px; }
.fw-more-files > summary {
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; list-style: none;
  font-size: 12.5px; font-weight: 600; color: #09090b;
  background: #fafafa; border: 1px solid #e4e4e7;
  border-radius: 999px; padding: 7px 14px;
}
.fw-more-files > summary::-webkit-details-marker { display: none; }
.fw-more-files > summary::after { content: '\25BE'; font-size: 10px; }
.fw-more-files[open] > summary::after { content: '\25B4'; }
.fw-more-files > summary:hover { border-color: #09090b; }
.fw-more-files .fw-files.rest { display: grid; gap: 9px; margin-top: 10px; }

/* 不可解锁的包：置底 + 标红 */
.fw-file.blocked { border-color: #fecaca; background: #fff8f8; }
.fw-file.blocked .fw-file-name { color: #991b1b; }
.fw-file.blocked:hover { border-color: #f0a9a9; }
.fw-badge.danger { background: #fef2f2; color: #b3261e; border-color: #fecaca; }
.fw-btn.danger { background: #b3261e; box-shadow: none; }
.fw-btn.danger:hover { background: #8f1d17; }

@media (max-width: 720px) {
  .fw-shell { padding: 18px; border-radius: var(--r-lg); }
  .fw-split { grid-template-columns: 1fr; }
  .fw-device { padding: 15px; }
  .fw-device h2 { font-size: 19px; }
  .fw-ac-wrap { flex: 1 1 100%; min-width: 0; }
  .fw-input { font-size: 16px; min-width: 0; }
  .fw-btn { width: 100%; }
  .fw-quota { margin-left: 0; }
  .fw-file { align-items: flex-start; }
  .fw-file .btn, .fw-file .fw-btn { width: 100%; text-align: center; }
  .fw-browse { padding: 14px; border-radius: var(--r-lg); }
  .fw-browse-head .fw-btn { width: 100%; }
  .fw-scroll { max-height: 220px; }
}

#drivers { scroll-margin-top: 84px; }
