
  .browser-support-notice { padding: 16px 20px; margin-bottom: 20px; border: 1px solid #f3b5b5; border-radius: 10px; background: #fff1f1; color: #8b2020; }
  .browser-support-notice p { margin: 0 0 10px; line-height: 1.7; }
  .browser-support-notice button { padding: 8px 14px; cursor: pointer; }
  .browser-support-notice input { width: 100%; padding: 8px; user-select: text; }
  .page-container.guide-layout { max-width: 1400px; }
  .firmware-release-notes {
    flex: 1 1 100%;
    min-width: 0;
    padding: 14px 18px;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: #f8fafc;
  }
  .firmware-release-notes h3 { margin: 0 0 8px; font-size: 14px; color: var(--text-main); }
  .firmware-release-notes p { margin: 0; font-size: 13px; line-height: 1.8; color: var(--text-sub); white-space: pre-wrap; overflow-wrap: anywhere; }

  :root {
    --bg: #f4f6f9;
    --card-bg: #ffffff;
    --card-hover-bg: #fff5f5;       /* 淡红渐变终点 */
    --card-border: #e2e8f0;
    --text-main: #1e293b;
    --text-sub: #64748b;
    --accent: #e53e3e;              /* 选中/强调红 */
  }

  * { box-sizing: border-box; }

  body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--text-main);
  }

  [hidden] { display: none !important; }
  .site-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    min-height: 60px;
    padding: 10px 24px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
  }
  .brand-icon { color: var(--accent); font-size: 22px; }
  .brand-badge {
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 4px 10px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 500;
  }
  .page-nav { display: flex; gap: 8px; }
  .nav-link {
    padding: 7px 18px;
    border: 1px solid var(--card-border);
    border-radius: 999px;
    color: var(--text-sub);
    text-decoration: none;
    font-size: 14px;
    white-space: nowrap;
  }
  .nav-link:hover { border-color: var(--accent); color: var(--accent); }
  .nav-link[aria-current="page"] {
    color: var(--accent);
    background: var(--card-hover-bg);
    border-color: var(--accent);
  }
  .nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
  .page-container {
    width: calc(100% - 40px);
    max-width: 960px;
    margin: 36px auto;
  }
  .page-view { margin-bottom: 32px; }
  @media (max-width: 680px) {
    .site-header { grid-template-columns: 1fr; gap: 14px; padding: 14px 20px; }
    .page-nav { justify-content: center; }
    .page-container { margin-top: 24px; }
  }

  .help-card { font-size: 14px; line-height: 1.8; color: var(--text-sub); }
  .help-card > p:first-child { margin-top: 0; }
  .help-card > p:last-child { margin-bottom: 0; }
  .help-card table { border-collapse: collapse; }
  .help-card th, .help-card td { padding: 12px 14px; border-bottom: 1px solid var(--card-border); }
  .help-card thead { background: #f8fafc; color: var(--text-main); }
  .help-card table th:nth-child(n+2),
  .help-card table td:nth-child(n+2) { text-align: center; }
  .help-card tbody th { color: var(--text-main); }
  .help-card tbody tr:last-child > * { border-bottom: 0; }
  .help-notice {
    padding: 12px 16px;
    border: 1px solid #f5b5b5;
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    background: #fff0f0;
    color: #b91c1c;
    font-weight: 600;
  }

  .app-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
  .app-card { min-width: 0; margin: 0; padding: 20px; border: 1px solid var(--card-border); border-radius: 12px; background: var(--card-bg); }
  .app-card legend { font-weight: 700; padding: 0 8px; }
  .app-subsection {
    padding: 14px;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: #f8fafc;
  }
  .app-subsection + .app-subsection { margin-top: 16px; }
  .app-settings-card { align-self: stretch; }
  @media (max-width: 680px) {
    .app-settings-card .app-subsection { min-height: 0 !important; }
  }
  .app-subsection > label:first-child { margin-top: 0; }
  .app-subsection > :last-child { margin-bottom: 0; }
  .app-card label { display: block; font-size: 14px; margin: 12px 0 7px; }
  .app-card input:not([type=checkbox]):not([type=radio]), .app-card select { width: 100%; min-height: 40px; padding: 9px; border: 1px solid var(--card-border); border-radius: 7px; font: inherit; color: var(--text-main); background: var(--bg); }
  .app-card input:focus-visible, .app-card select:focus-visible { outline: 2px solid var(--accent); }
  .app-card input:disabled { opacity: .6; }
  .app-help { font-size: 13px; line-height: 1.7; color: var(--text-sub); }
  #appFileName.file-selected,
  #appKeyName.file-selected {
    padding: 10px 14px;
    border: 1px solid #f5b5b5;
    border-radius: 8px;
    background: #fff0f0;
    color: #b91c1c;
    overflow-wrap: anywhere;
  }
  .app-check input { accent-color: var(--accent); margin-right: 8px; }
  .app-card .app-mac-option {
    display: flex;
    align-items: baseline;
  }
  .app-mac-option input { flex-shrink: 0; }
  .app-mac-name { flex: 0 0 6em; }
  .app-mac-address { min-width: 0; }
  .app-drop { border: 1px dashed var(--card-border); border-radius: 10px; padding: 16px; text-align: center; }
  .app-drop .nav-link:disabled {
    color: #94a3b8;
    border-color: var(--card-border);
    background: #f1f5f9;
    cursor: not-allowed;
    box-shadow: none;
  }
  .app-drop.dragging { border-color: var(--accent); background: var(--card-hover-bg); }
  .app-result { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
  .app-result p { width: 100%; margin: 0; overflow-wrap: anywhere; }
  .app-checksum-box {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--accent);
    border-radius: 10px;
    background: #fff0f0;
    color: #b91c1c;
    font-weight: 600;
  }
  #appChecksum { font-family: monospace; font-size: 22px; font-weight: 700; }
  .app-result .upgrade-progress-row { width: 100%; margin-top: 8px; }
  #appStatus[data-error="true"] { color: #dc2626; }
  @media (max-width: 680px) { .app-grid { grid-template-columns: 1fr; } }

  /* ===== 顶部固定操作区 ===== */
  .top-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: stretch;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 32px;
  }

  .field {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    flex: 1 1 200px;
    min-width: 0;
    min-height: 96px;
    padding: 16px 18px;
    border: 2px solid var(--card-border);
    border-radius: 10px;
    background: #f8fafc;
  }
  .field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-sub);
  }
  .field .fixed-value {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-main);
  }

  /* 维护者统一部署的固件状态 */
  .firmware-preset { flex: 2 1 360px; }

  /* 下载按钮 */
  .btn-download {
    padding: 12px 32px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .1s;
    flex: 0 0 auto;
    align-self: center;
  }
  .btn-download:hover  { background: #c53030; }
  .btn-download:active { transform: scale(.97); }
  .btn-download:disabled { background: #cbd5e1; cursor: not-allowed; }

  /* 预设固件状态 */
  .file-status {
    margin-top: 8px;
    color: var(--text-sub);
    font-size: 13px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  .file-status.ready {
    color: var(--text-main);
  }

  .upgrade-progress-row {
    display: flex;
    align-items: center;
    gap: 14px;
    --progress-color: #16a34a;
  }
  .upgrade-progress-row.failed { --progress-color: #dc2626; }
  .upgrade-progress-row progress {
    appearance: none;
    flex: 1;
    min-width: 0;
    height: 16px;
    border: 0;
    border-radius: 999px;
    overflow: hidden;
    background: #e2e8f0;
    accent-color: var(--progress-color);
  }
  .upgrade-progress-row progress::-webkit-progress-bar { background: #e2e8f0; }
  .upgrade-progress-row progress::-webkit-progress-value { background: var(--progress-color); }
  .upgrade-progress-row progress::-moz-progress-bar { background: var(--progress-color); }
  .upgrade-progress-row output {
    min-width: 4ch;
    text-align: right;
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
  }

  /* 独立日志分区 */
  .log-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 32px;
  }
  .log-area {
    height: 300px;
    background: #f8fafc;
    color: var(--text-sub);
    border: 1px solid var(--card-border);
    border-left: 3px solid var(--accent);
    font-family: "Consolas", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.7;
    padding: 12px 16px;
    border-radius: 10px;
    overflow-y: auto;
    white-space: pre-wrap;
  }

  /* ===== 芯片选择区 ===== */
  .section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 20px;
  }
  .section-title::before {
    content: "";
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
  }

  .chip-section-title {
    max-width: 960px;
  }
  .chip-section-title::before,
  #versionOptions .section-title::before,
  #appUpdatePanel .section-title::before,
  #customPage .section-title::before,
  #upgradeLogSection .section-title::before {
    flex-shrink: 0;
    border-radius: 50%;
    transform: none;
  }
  .chip-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    margin-left: 4px;
    background: var(--card-border);
  }
  .chip-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    max-width: 960px;
  }
  .chip-icon {
    display: block;
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
    color: var(--text-main);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  @media (max-width: 800px) {
    .chip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (max-width: 540px) {
    .chip-grid { grid-template-columns: minmax(0, 1fr); }
  }

  /* 卡片基础样式 */
  .chip-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 18px;
    min-height: 148px;
    min-width: 0;
    overflow-wrap: anywhere;
    box-shadow: 0 1px 2px rgba(30, 41, 59, .05);
    cursor: pointer;                         /* 手型光标 */
    transition: background .25s ease,       /* 渐变背景 */
                border-color .25s ease,
                box-shadow .25s ease,
                transform .15s ease;
    position: relative;
  }

  /* 鼠标悬停：淡红渐变 + 上浮 + 阴影 */
  .chip-card:hover {
    background: var(--card-hover-bg);
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(229, 62, 62, .12);
    transform: translateY(-3px);
  }

  /* 选中状态 */
  .chip-card.selected {
    border-color: var(--accent);
    background: #fff0f0;
    box-shadow: 0 0 0 2px var(--accent), 0 6px 18px rgba(229, 62, 62, .16);
  }
  .chip-card.selected .chip-icon,
  .chip-card.selected h3 { color: #b91c1c; }

  #versionOptions .nav-link {
    cursor: pointer;
    font-family: inherit;
    background: var(--card-bg);
    transition: background .2s, color .2s, border-color .2s;
  }
  #versionOptions .nav-link[aria-expanded="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(229, 62, 62, .2);
  }
  #versionOptions .nav-link[aria-expanded="true"]::before {
    content: "✓ ";
  }

  .chip-card h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
  }
  .chip-card .chip-desc {
    margin: 0;
    font-size: 13px;
    color: var(--text-sub);
    line-height: 1.5;
  }
  .chip-support { padding-top: 2px; }
  .chip-model-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: grid;
    gap: 4px;
    font-variant-numeric: tabular-nums;
    line-height: 1.6;
  }
