:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel2: #ffffff;
  --text: #101828;
  --muted: #667085;
  --brand: #2563eb;
  --brand2: #7c3aed;
  --border: rgba(16,24,40,0.12);
  --ok: #16a34a;
  --warn: #f59e0b;
  --bad: #ef4444;
  --shadow: 0 12px 28px rgba(16,24,40,0.10);
}

* { box-sizing: border-box; }

/* SEO/可访问性：隐藏但保留语义结构 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(180deg, #ffffff, var(--bg));
}

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

.container {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 18px 16px 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.80);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
}

.brand .title {
  font-weight: 800;
  letter-spacing: .3px;
}

.brand .sub {
  color: var(--muted);
  font-size: 13px;
}

.nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--text);
}

.nav a:hover {
  background: rgba(16,24,40,0.04);
  border-color: var(--border);
  text-decoration: none;
}

.hero {
  margin-top: 16px;
  border-radius: 18px;
  padding: 18px 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(255,255,255,0.75));
  box-shadow: var(--shadow);
}

.hero h1 { margin: 0 0 8px; font-size: 22px; }
.hero p { margin: 0; color: var(--muted); line-height: 1.55; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}

@media (min-width: 900px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
}

.card {
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.95);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card .hd {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(16,24,40,0.02);
}

.card .hd h2 {
  font-size: 16px;
  margin: 0;
}

.card .bd { padding: 12px 14px; }

.muted { color: var(--muted); }

.search {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search input, .search select {
  flex: 1;
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.95);
  color: var(--text);
}

.btn {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(37,99,235,0.35);
  background: linear-gradient(180deg, rgba(37,99,235,0.12), rgba(37,99,235,0.04));
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: rgba(37,99,235,0.55); }

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
}
.table th, .table td {
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table th { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .2px; }
.table tr:hover td { background: rgba(16,24,40,0.02); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(16,24,40,0.04);
  font-size: 12px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37,99,235,0.28);
  background: rgba(37,99,235,0.08);
  color: #1d4ed8;
  font-size: 12px;
  white-space: nowrap;
}
.badge2 {
  border-color: rgba(124,58,237,0.28);
  background: rgba(124,58,237,0.08);
  color: #6d28d9;
}

.updates {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.update-item {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(16,24,40,0.02);
}

.update-item:hover {
  background: rgba(16,24,40,0.03);
  border-color: rgba(16,24,40,0.14);
  text-decoration: none;
}

.update-item.no-link:hover { text-decoration: none; }

.update-left { min-width: 0; }
.update-title {
  font-weight: 700;
  letter-spacing: .2px;
  margin-bottom: 4px;
}
.update-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.update-ver {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: #0f172a;
  line-height: 1.1;
  white-space: nowrap;
}
.update-desc {
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.update-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
}
.link {
  color: var(--brand);
  font-weight: 600;
}

.router-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 720px) {
  .router-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1040px) {
  .router-grid { grid-template-columns: repeat(3, 1fr); }
}

.router-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(16,24,40,0.02);
  box-shadow: 0 10px 24px rgba(16,24,40,0.08);
}
.router-card:hover {
  border-color: rgba(16,24,40,0.14);
  background: rgba(16,24,40,0.03);
  text-decoration: none;
}
.router-card-img img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}
.router-card-main { min-width: 0; }
.router-card-title { font-weight: 800; margin-bottom: 4px; }
.router-card-sub { font-size: 12px; margin-bottom: 8px; }
.router-card-badges { display: flex; gap: 8px; flex-wrap: wrap; }

.router-head {
  display: flex;
  gap: 14px;
  align-items: center;
}
.router-head-img {
  width: 86px;
  height: 86px;
  object-fit: contain;
}
.router-head-title { font-size: 18px; font-weight: 900; margin-bottom: 4px; }
.router-head-sub { font-size: 12px; margin-bottom: 10px; }
.router-head-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(16,24,40,0.02);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}
.tab:hover { text-decoration: none; border-color: rgba(255,255,255,0.18); }
.tab.active {
  border-color: rgba(37,99,235,0.55);
  background: rgba(37,99,235,0.10);
}

.pager {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 12px;
}

.firmware-sections.tab-stable .firmware.dev { display: none; }
.firmware-sections.tab-dev .firmware.stable { display: none; }

.fw-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.fw-ver {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: #0f172a;
}

.fw-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(16, 24, 40, 0.10);
  background: rgba(16, 24, 40, 0.03);
}

.update-avatar img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.update-avatar { flex: 0 0 56px; }

.log-wrap { margin-top: 8px; }
.log {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.log p { margin: 0 0 8px; }
.log ol, .log ul { margin: 0 0 8px; padding-left: 18px; }
.log li { margin: 0 0 6px; }
.clamp-3.is-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.toggle {
  display: none;
  margin-top: 6px;
  font-size: 12px;
  color: var(--brand);
  font-weight: 700;
}
.toggle.is-visible { display: inline-block; }

.router {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  align-items: start;
}

.router img {
  width: 78px;
  height: 78px;
  object-fit: contain;
}

.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px 10px;
  font-size: 13px;
}
.kv .k { color: var(--muted); }

.footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* 手机端表格可读性增强 */
@media (max-width: 640px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  .table td { border: 0; padding: 6px 0; }
  .table td[data-label]::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 2px;
  }
}
.update-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.update-sub .date {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(16, 24, 40, 0.10);
  background: rgba(16, 24, 40, 0.03);
  white-space: nowrap;
}

@media (max-width: 420px) {
  .update-item { gap: 10px; }
  .update-ver { font-size: 17px; }
  .update-right { margin-top: 2px; }
}
