/* ============================================================================
   硬件资讯专栏 · 页面样式（复用 Amu tokens.css 的设计变量）
   ============================================================================ */

/* —— 顶部导航（与 amumusic.com 官网完全同一套，选择器作用域化避免误伤分页 nav） —— */
body > nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14,17,22,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
[data-theme="light"] body > nav { background: rgba(244,246,250,.92); border-bottom-color: var(--line); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.nav-in { display: flex; align-items: center; justify-content: flex-start; gap: 56px; height: 72px; }
.logo { display: flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 700; letter-spacing: 3px; white-space: nowrap; color: var(--tx); text-decoration: none; }
.logo-slogan { font-size: 13px; font-weight: 400; letter-spacing: 1px; color: var(--tx2); margin-left: 2px; }
@media(max-width:900px){ .logo-slogan { display: none; } }
.nav-links { display: flex; gap: 34px; font-size: 15px; color: var(--tx2); }
.nav-links a { white-space: nowrap; color: inherit; text-decoration: none; }
.nav-links a:hover { color: var(--c); }
.nav-links a.active { color: var(--c); }
/* 在线工具下拉菜单 */
.nav-drop { position: relative; }
.nav-drop > a { display: inline-flex; align-items: center; gap: 5px; }
.nav-drop .caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; margin-top: 2px; transition: transform .2s; }
.nav-drop-menu { position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(8px); min-width: 184px; margin-top: 10px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: 0 14px 34px rgba(0,0,0,.5); opacity: 0; visibility: hidden; transition: .18s; z-index: 60; }
.nav-drop:hover .nav-drop-menu, .nav-drop.open .nav-drop-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-drop-menu a { display: block; padding: 10px 13px; border-radius: 8px; color: var(--tx2); font-size: 14px; white-space: nowrap; text-decoration: none; }
.nav-drop-menu a:hover { background: var(--c-dim); color: var(--c); }
/* 手机端汉堡菜单 */
.mnav-btn { display: none; width: 38px; height: 38px; border: 1px solid var(--line); background: var(--bg2); border-radius: 10px; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0; flex: none; z-index: 95; }
.mnav-btn i { display: block; width: 16px; height: 2px; background: var(--tx); border-radius: 2px; transition: .2s; }
.mnav-btn.open i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.mnav-btn.open i:nth-child(2) { opacity: 0; }
.mnav-btn.open i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.mnav-panel { display: none; position: fixed; top: 62px; left: 10px; right: auto; width: min(250px, calc(100vw - 20px)); background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: 0 18px 40px rgba(0,0,0,.45); z-index: 94; }
.mnav-panel.open { display: block; }
.mnav-panel a { display: block; padding: 12px 14px; border-radius: 9px; color: var(--tx2); font-size: 15px; text-decoration: none; }
.mnav-panel a:hover { background: var(--c-dim); color: var(--c); }
.mnav-panel a.active { color: var(--c); font-weight: 700; }
@media(max-width:1280px){ .mnav-btn { display: inline-flex; margin-left: auto; } .nav-in { padding-right: 330px; } .nav-links { display: none; } }
@media(min-width:1281px) and (max-width:1440px){ .nav-in { gap: 24px; padding-right: 290px; } .nav-links { gap: 16px; font-size: 14px; } .logo-slogan { display: none; } }
@media(max-width:860px){ .nav-in { gap: 18px; } }
@media(max-width:640px){ .mnav-btn { position: fixed; top: 8px; left: 10px; } .nav-in { height: 54px; padding-left: 58px; padding-right: 196px; } .logo { font-size: 18px; letter-spacing: 1px; white-space: nowrap; } }

/* —— Hero —— */
.hero {
  background:
    radial-gradient(1200px 380px at 50% -120px, var(--brand-glow), transparent 70%),
    linear-gradient(180deg, var(--bg-3), var(--bg));
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  max-width: var(--w-wide); margin: 0 auto;
  padding: var(--sp-9) var(--sp-5) var(--sp-8);
  text-align: center;
}
.hero-pill {
  display: inline-block; padding: 5px 14px; border-radius: var(--r-pill);
  background: var(--brand-soft); color: var(--brand);
  border: 1px solid var(--brand); font-size: var(--fs-xs); font-weight: 700;
  margin-bottom: var(--sp-4);
}
.hero-title {
  font-size: clamp(30px, 5vw, 52px); line-height: 1.2; margin: 0 0 var(--sp-4);
  font-weight: 800; color: var(--tx);
  background: linear-gradient(180deg, #fff, var(--tx-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  max-width: 720px; margin: 0 auto var(--sp-6);
  color: var(--tx-2); font-size: 16px; line-height: 1.8;
}
.hero-stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-5);
}
.stat { display: flex; flex-direction: column; align-items: center; min-width: 92px; }
.stat b { font-size: 30px; font-weight: 800; color: var(--brand); font-family: var(--font-mono); }
.stat span { font-size: var(--fs-xs); color: var(--tx-2); margin-top: 4px; }

/* —— 容器 —— */
.container { max-width: var(--w-wide); margin: 0 auto; padding: var(--sp-6) var(--sp-5) var(--sp-8); }
body.has-compare { padding-bottom: 84px; }

/* —— 工具栏 —— */
.toolbar {
  display: flex; gap: var(--sp-4); align-items: center; flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}
.search-wrap { position: relative; flex: 1 1 320px; }
.search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); opacity: .6; font-size: 14px; }
#search { padding-left: 36px; }
.filters { display: flex; gap: var(--sp-3); flex-wrap: wrap; }
.filter-label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: var(--fs-xs); color: var(--tx-2); font-weight: 700;
}
.is-select { width: auto; min-width: 150px; padding-right: 28px; }
.is-select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--tx-2) 50%), linear-gradient(135deg, var(--tx-2) 50%, transparent 50%); background-position: right 12px center, right 7px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

/* —— 大类 / 子类 Tab —— */
.cat-tabs { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.cat-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--r-pill);
  background: var(--bg-2); border: 1px solid var(--line-2);
  color: var(--tx-2); font-size: var(--fs-sm); font-weight: 700; cursor: pointer;
  transition: all .15s;
}
.cat-tab:hover { color: var(--tx); border-color: var(--brand); }
.cat-tab.active { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.cat-tab .ico { font-size: 16px; }
.cat-tab .cnt, .sub-tab .cnt {
  display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 7px;
  border-radius: 999px; background: var(--bg-3, rgba(127,127,127,.14));
  color: var(--tx-2); font-size: 11px; font-weight: 700; line-height: 1.5;
  text-align: center;
}
.cat-tab.active .cnt { background: rgba(0,0,0,.16); color: var(--on-brand); }
.sub-tab.active .cnt { background: var(--brand); color: var(--on-brand); }

.sub-tabs { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.sub-tab {
  padding: 6px 12px; border-radius: var(--r-pill);
  background: transparent; border: 1px solid var(--line);
  color: var(--tx-2); font-size: var(--fs-xs); font-weight: 700; cursor: pointer;
  transition: all .15s;
}
.sub-tab:hover { color: var(--tx); border-color: var(--brand); }
.sub-tab.active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand); }

.result-meta { font-size: var(--fs-sm); color: var(--tx-2); margin-bottom: var(--sp-4); }
.result-meta b { color: var(--tx); }

/* —— 产品网格 —— */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-4); }
.card {
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); padding: var(--sp-5);
  cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.card:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: var(--shadow-1); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); }
.card-id { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.card-logo { flex: none; width: 52px; height: 52px; border-radius: 12px; background: #fff; padding: 6px; box-shadow: 0 0 0 1px var(--line); }
.card-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-brand { font-size: var(--fs-xs); color: var(--brand); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.card-model { font-size: var(--fs-h3); font-weight: 800; line-height: 1.25; margin-top: 2px; }
.card-tagline { font-size: var(--fs-sm); color: var(--tx-2); line-height: 1.6; min-height: 44px; }
.card-specs { display: flex; flex-direction: column; gap: 6px; margin-top: auto; }
.card-spec { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-xs); }
.card-spec .k { color: var(--tx-3); flex-shrink: 0; }
.card-spec .v { color: var(--tx); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.card-price { font-size: var(--fs-h4); font-weight: 800; color: var(--ok); font-family: var(--font-mono); }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-pill { font-size: 10px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--bg-2); border: 1px solid var(--line-2); color: var(--tx-2); }
.mini-pill.is-new { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.mini-pill.is-flag { background: rgba(90,176,255,.12); border-color: var(--info); color: var(--info); }

/* —— 翻页 —— */
.pager {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: var(--sp-2);
  margin: var(--sp-6) 0 0;
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
}
.pager[hidden] { display: none; }
.pg-btn, .pg-num {
  font: inherit; cursor: pointer;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  color: var(--tx-2);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font-size: var(--fs-sm);
  line-height: 1.2;
  transition: border-color .16s, color .16s, background .16s;
}
.pg-num { min-width: 40px; padding: 8px 10px; font-family: var(--font-mono); text-align: center; }
.pg-btn:hover:not(:disabled), .pg-num:hover:not(.active) { border-color: var(--brand); color: var(--brand); }
.pg-num.active { background: var(--brand); border-color: var(--brand); color: #1a1200; font-weight: 800; }
.pg-btn:disabled { opacity: .35; cursor: not-allowed; }
.pg-nums { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
.pg-gap { color: var(--tx-3); padding: 0 3px; user-select: none; }
.pg-info { color: var(--tx-3); font-size: var(--fs-xs); margin-left: var(--sp-3); white-space: nowrap; }
.pg-info b { color: var(--tx); font-family: var(--font-mono); }

.empty { text-align: center; color: var(--tx-2); padding: var(--sp-7) 0; }

/* —— 页脚 —— */
.site-foot { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: var(--sp-8); }
.foot-brand { font-size: 18px; font-weight: 700; letter-spacing: .3px; color: var(--tx); }
.foot-brand b { color: var(--brand); font-weight: 800; }
.foot-inner { max-width: var(--w-wide); margin: 0 auto; padding: var(--sp-6) var(--sp-5); display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.foot-note { color: var(--tx-3); font-size: var(--fs-xs); margin: var(--sp-2) 0 0; max-width: 560px; line-height: 1.7; }

/* —— 详情弹层 —— */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: var(--sp-4); }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
.modal-card { position: relative; width: min(640px, 100%); max-height: 86vh; overflow: auto; padding: var(--sp-6); }
.modal-close {
  position: absolute; top: 12px; right: 14px; width: 34px; height: 34px;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--tx-2);
  border-radius: 50%; font-size: 20px; line-height: 1; cursor: pointer;
}
.modal-close:hover { color: var(--tx); border-color: var(--brand); }
.m-head { display: flex; align-items: center; gap: 16px; margin-bottom: var(--sp-2); }
.m-logo { flex: none; width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 14px; padding: 8px; box-shadow: 0 0 0 1px var(--line); }
.m-head .m-model { margin-bottom: 0; }
.m-brand { color: var(--brand); font-weight: 800; font-size: var(--fs-sm); letter-spacing: .5px; text-transform: uppercase; }
.m-model { font-size: 26px; font-weight: 800; margin: 4px 0 var(--sp-2); }
.m-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--sp-3); }
.m-tag { font-size: var(--fs-xs); padding: 3px 10px; border-radius: var(--r-pill); background: var(--brand-soft); border: 1px solid var(--brand); color: var(--brand); }
.m-tag.sub { background: var(--bg-2); border-color: var(--line-2); color: var(--tx-2); }
.m-desc { color: var(--tx-2); line-height: 1.8; margin-bottom: var(--sp-4); }
.m-specs { display: grid; grid-template-columns: 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: var(--sp-4); }
.m-spec-row { display: flex; justify-content: space-between; gap: var(--sp-4); padding: 10px var(--sp-4); font-size: var(--fs-sm); border-bottom: 1px solid var(--line); }
.m-spec-row:last-child { border-bottom: none; }
.m-spec-row .k { color: var(--tx-3); white-space: nowrap; }
.m-spec-row .v { color: var(--tx); text-align: right; }
.m-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.m-price { font-size: var(--fs-h2); font-weight: 800; color: var(--ok); font-family: var(--font-mono); }
.m-link { display: inline-flex; align-items: center; gap: 6px; }

/* —— 卡片：预算档标签 + 对比按钮 —— */
.foot-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mini-pill.tier { background: transparent; border: 1px dashed var(--tx-3); color: var(--tx-2); }
.cmp-toggle {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--tx-2);
  font-size: 16px; line-height: 1; cursor: pointer; transition: all .15s;
  display: grid; place-items: center;
}
.cmp-toggle:hover { color: var(--brand); border-color: var(--brand); }
.cmp-toggle.on { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

/* —— 对比浮条 —— */
.cmp-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--bg-2); border-top: 1px solid var(--brand);
  box-shadow: 0 -8px 30px rgba(0,0,0,.35);
  padding: var(--sp-3) var(--sp-5);
  backdrop-filter: saturate(1.2) blur(6px);
}
.cmp-inner { max-width: var(--w-wide); margin: 0 auto; display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.cmp-count { font-size: var(--fs-sm); color: var(--tx-2); font-weight: 700; white-space: nowrap; }
.cmp-count b { color: var(--brand); font-family: var(--font-mono); }
.cmp-tip { font-size: var(--fs-xs); color: var(--warn, #ffb020); font-weight: 700; }
.cmp-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.cmp-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 6px 4px 10px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line-2); color: var(--tx);
  font-size: var(--fs-xs); font-weight: 700;
}
.cmp-chip-x {
  width: 18px; height: 18px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--line-2); color: var(--tx); font-size: 13px; line-height: 1;
  display: grid; place-items: center;
}
.cmp-chip-x:hover { background: var(--brand); color: var(--on-brand); }
.cmp-actions { display: flex; gap: var(--sp-2); margin-left: auto; }

/* —— 对比弹层 —— */
.cmp-card { width: min(940px, 100%); padding: var(--sp-6); }
.cmp-h { font-size: 22px; font-weight: 800; margin: 0 0 var(--sp-4); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cmp-h-sub { font-size: var(--fs-sm); font-weight: 600; color: var(--tx-2); }
.cmp-scroll { overflow-x: auto; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 480px; }
.cmp-table th, .cmp-table td { padding: 10px var(--sp-3); border: 1px solid var(--line); vertical-align: top; text-align: left; }
.cmp-table thead th { background: var(--brand-soft); color: var(--brand); font-size: var(--fs-sm); position: sticky; top: 0; }
.cmp-table tbody th { color: var(--tx-3); white-space: nowrap; background: var(--bg-2); font-weight: 700; width: 96px; }
.cmp-table .cmp-m { color: var(--tx-2); font-weight: 600; font-size: var(--fs-xs); }
.cmp-table td a { white-space: nowrap; }

/* —— 响应式 —— */
@media (max-width: 640px) {
  .hero-inner { padding: var(--sp-7) var(--sp-4) var(--sp-6); }
  .grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .filters { justify-content: space-between; }
  .cmp-inner { gap: var(--sp-2); }
  .cmp-actions { margin-left: 0; width: 100%; }
  .cmp-actions .amu-btn { flex: 1; }
  /* 翻页：窄屏去掉首尾省略页，按钮更紧凑 */
  .pager { gap: 6px; }
  .pg-btn { padding: 8px 10px; font-size: var(--fs-xs); }
  .pg-num { min-width: 34px; padding: 7px 8px; font-size: var(--fs-xs); }
  .pg-info { width: 100%; text-align: center; margin-left: 0; margin-top: 4px; }
}
