/* AIHUB front-end additions on top of the V1.13 baseline.
 * Keep this file small: the goal is to reuse V1.13, not to fork it.
 * Only classes that do not exist in the reference stylesheet belong here. */

.nav-soon {
    color: #a6b4c6;
    font-size: 13px;
    font-weight: 650;
    padding: 28px 0;
    white-space: nowrap;
    cursor: default;
}

.nav-soon:hover {
    color: #a6b4c6;
}

@media (max-width: 970px) {
    .nav-soon { padding: 14px 0; }
}

/* V1.13 renders the model card cover via JS; server-side we emit the same
 * class, so only the default spacing needs a rule when a cover is present. */
.model-card-cover {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin-bottom: 12px;
    display: block;
}

/* --- ranking list (V0.3 parity) ------------------------------------- */
.rank-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.rank-row{display:grid;grid-template-columns:56px 1fr 160px 160px;align-items:center;gap:16px;padding:16px 18px}
.rank-no{font:700 20px/1 Inter,-apple-system,sans-serif;color:var(--blue);opacity:.75}
.rank-main h3{margin:0;font-size:17px}
.rank-metric{display:flex;flex-direction:column;gap:2px;text-align:right}
.rank-metric strong{font-size:15px}
@media (max-width:760px){
  .rank-row{grid-template-columns:40px 1fr;grid-template-areas:"no main" "no metrics";gap:6px 12px}
  .rank-no{grid-area:no;align-self:start;font-size:16px}
  .rank-main{grid-area:main}
  .rank-metric{grid-area:metrics;text-align:left;display:inline-flex;flex-direction:row;gap:10px;font-size:13px}
}

/* --- home section hub: V1.13 has this block on the home page only ------ */
.seo-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.seo-cards .model-card{padding:18px}
.seo-cards .model-card h3{margin:0 0 10px;font-size:15px}
.seo-cards .model-card a{font-size:12px;color:var(--blue);font-weight:700}
@media (max-width:970px){.seo-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:590px){.seo-cards{grid-template-columns:1fr}}

/* --- GPU/IDC hardware cards (copied from the V1.13 prototype) --- */
.hardware-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:19px}
.hardware-card{border:1px solid #e0ebf7;border-radius:18px;overflow:hidden;background:white;transition:.2s;box-shadow:0 10px 30px rgba(33,75,129,.035)}
.hardware-card:hover{border-color:#bad7f5;box-shadow:var(--shadow);transform:translateY(-2px)}
.hardware-top{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:15px 18px;background:#fff}
.hardware-type{font-size:12px;color:#2867ba;font-weight:850}
.hardware-state{font-size:10px;background:#fff7e9;border:1px solid #f2dfb9;border-radius:7px;color:#9e7331;padding:6px 8px}
.hardware-visual{background:radial-gradient(circle at 80% 20%,rgba(123,180,246,.25),transparent 40%),linear-gradient(130deg,#eaf4ff,#f6fbff);padding:22px;min-height:142px;display:flex;align-items:center;gap:24px;border-top:1px solid #f0f5fb;border-bottom:1px solid #e9f1fa}
.hardware-visual small{display:block;font-size:9px;letter-spacing:2px;color:#76a0d2;font-weight:800}
.hardware-visual strong{display:block;font-size:19px;font-weight:850;line-height:1.4;color:#1d4c8a;margin-top:7px}
.hardware-visual em{display:block;font-size:11px;color:#6790bf;font-style:normal;margin-top:5px}
.hardware-body{padding:20px}
.hardware-body h3{font-size:17px;margin:0 0 8px}
.hardware-sku{font-size:11px;color:#91a2b7;margin-bottom:14px}
.hardware-spec{padding:0;margin:0}
.hardware-spec div{display:grid;grid-template-columns:50px minmax(0,1fr);gap:12px;padding:8px 0;border-top:1px solid #f0f4f8}
.hardware-spec dt{font-size:11px;color:#8e9eb5}
.hardware-spec dd{margin:0;font-size:11.5px;color:#3a587d;line-height:1.55}
.hardware-scenario{font-size:11px;line-height:1.75;color:#617c9c;background:#f4f9ff;padding:10px 12px;border-radius:8px;margin:14px 0}
.hardware-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.hardware-actions>a:last-child{font-size:11px;color:#3879c7;font-weight:750}
.hardware-grid+.notice-bar{margin-top:18px}
.hardware-grid{grid-template-columns:1fr}
.hardware-visual strong{font-size:16px}
.hardware-body{padding:17px}

/* The prototype's 2-column grid lives at top level; the extracted block above
   also pulled in the @media(max-width:1100px) inner rule, which forced 1fr at
   every width. Restore the desktop grid and re-scope the collapse. */
.hardware-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:19px}
@media (max-width:1100px){.hardware-grid{grid-template-columns:1fr}}
.hardware-card .hardware-details{border-top:1px solid #edf2f9;margin-top:12px;padding-top:10px}
.hardware-card .hardware-details summary{cursor:pointer;font-size:12px;font-weight:700;color:#3879c7;list-style:none}
.hardware-card .hardware-details summary::-webkit-details-marker{display:none}
.hardware-card .hardware-details p{font-size:11.5px;line-height:1.75;color:#617c9c;margin:10px 0 0}

/* --- model comparison bar ------------------------------------------- */
.compare-bar{position:sticky;bottom:16px;margin-top:18px;display:flex;align-items:center;gap:14px;
  background:#122342;color:#fff;border-radius:12px;padding:12px 16px;box-shadow:0 12px 30px rgba(18,35,66,.25)}
.compare-bar strong{color:#9fd0ff}
.compare-bar .btn{margin-left:auto}

/* --- collapsible category tree + single-row filter bar ---------------- */
.tree-group{border:0}
.tree-group>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:8px}
.tree-group>summary::-webkit-details-marker{display:none}
.tree-group>summary::after{content:"›";margin-left:8px;color:#9db0c8;font-size:14px;transform:rotate(90deg);transition:transform .15s}
.tree-group[open]>summary::after{transform:rotate(-90deg)}
.tree-ico{width:20px;height:20px;border-radius:6px;display:grid;place-items:center;background:#eaf4ff;
  color:#2b73c5;font-size:10px;font-weight:800;flex:0 0 auto}
.tree-name{margin-right:auto}
.tree-count{font-variant-numeric:tabular-nums}
.tree-menu{max-height:640px;overflow:auto}
.tree-sub{padding:2px 0 6px 14px}
.tree-sub .tree-sub-item{padding-left:10px;font-size:12px;color:#5b7191}

/* search + five selects on one line, as in the prototype */
.directory-filters{flex-wrap:nowrap;gap:10px}
.directory-filters .input.search{flex:1 1 auto;min-width:220px}
.directory-filters .select{flex:0 0 auto;min-width:132px}
@media (max-width:1100px){.directory-filters{flex-wrap:wrap}.directory-filters .select{flex:1 1 45%}}

/* --- offers: one wide card per row, like the reference ---------------- */
.offer-list{display:flex;flex-direction:column;gap:14px}
.offer-card .hardware-spec{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 18px;margin:10px 0 4px}
.offer-card .model-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
@media (max-width:760px){.offer-card .hardware-spec{grid-template-columns:1fr}}

/* --- article list: thumbnail column, as in the reference --------------- */
.article-list-row{display:flex;gap:16px;align-items:flex-start;padding:18px 0}
.article-thumb{width:132px;height:92px;object-fit:cover;border-radius:10px;flex:0 0 auto;border:1px solid #e3eaf3}
.article-thumb-empty{display:grid;place-items:center;background:#f3f8ff;color:#8aa6c8;font-size:13px;font-weight:700}
@media (max-width:640px){.article-thumb{width:88px;height:66px}}

/* --- tree parity with V1.13: dark label, tinted icon, pill count ------- */
.tree-leaf{color:#6b7f9a}
.tree-leaf .tree-name{color:#3a5170;font-weight:700}
.tree-leaf .tree-ico{background:#e8f1fd;color:#2f6fc0}
.tree-leaf .tree-count{background:#f2f6fb;color:#8896a8;border-radius:6px;padding:1px 8px;font-size:11px;font-weight:600}
.tree-leaf:hover{background:#f4f9ff}
.tree-leaf.is-current{background:#e9f3ff;color:#12325c;font-weight:800}
.tree-leaf.is-current .tree-name{color:#12325c;font-weight:800}
.tree-leaf.is-current .tree-ico{background:#d5e8ff;color:#1a5fb4}
.tree-leaf.is-current .tree-count{background:#dceafb;color:#2f6fc0}
.tree-sub .tree-sub-item{color:#7f8fa5;font-weight:500}
.tree-sub .tree-sub-item .tree-count{background:transparent;color:#9aa8ba}
.tree-sub .tree-sub-item.is-current{background:#eef5ff;color:#1a5fb4;font-weight:750}
/* left accent bar for the selected row, as in the resource tree */
.offer-tree .tree-leaf.is-current{box-shadow:inset 3px 0 0 #2f6fc0}

/* --- offers: two-column card grid, 11-row spec block ------------------ */
.offer-card .hardware-spec{display:grid;grid-template-columns:1fr;gap:0;margin:8px 0 12px}
.offer-card .hardware-spec div{grid-template-columns:150px minmax(0,1fr);padding:6px 0}
.offer-card .model-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
@media (max-width:760px){.offer-card .hardware-spec div{grid-template-columns:1fr}}

/* --- overflow guards: long spec values must not widen the grid --------- */
.model-layout{grid-template-columns:260px minmax(0,1fr)}
.directory-main{min-width:0}
.models-grid{min-width:0}
.offer-card{min-width:0;max-width:100%}
.offer-card .hardware-spec dd,
.offer-card .hardware-spec dt{min-width:0;overflow-wrap:anywhere;word-break:break-word}
.offer-card .tags{flex-wrap:wrap;min-width:0}
.offer-card .model-actions{min-width:0}
.offer-card .model-actions small{overflow-wrap:anywhere}
@media (max-width:1100px){.model-layout{grid-template-columns:1fr}}

/* --- global overflow guards (mobile) ---------------------------------- */
.table-scroll{min-width:0;max-width:100%;overflow-x:auto}
img,svg,video,table{max-width:100%}
.card,.feature,.model-card,.biz-card,.biz-hero,.biz-inquiry{min-width:0}
.biz-hero,.biz-inquiry{max-width:100%}
@media (max-width:590px){
  .biz-hero,.biz-inquiry{padding:16px}
  .biz-table{min-width:560px}
}

/* --- buttons inside card action rows must keep white text ------------- */
.model-actions .btn,
.offer-card .btn,
.model-card .btn{color:#fff}
.model-actions .btn-soft,
.offer-card .btn-soft{color:var(--blue)}
/* spec block: tighter label column, values left-aligned like the reference */
.offer-card .hardware-spec div{grid-template-columns:132px minmax(0,1fr);align-items:start}
.offer-card .hardware-spec dd{margin:0;text-align:left;color:#3a587d}

/* offers tree rows line up icon + label + count like the reference */
.tree-leaf .tree-ico + .tree-name{margin-left:2px}

/* --- business sidebar: never wider than the viewport ------------------ */
.biz-sidebar{min-width:0;max-width:100%}
.biz-sidebar .tree-menu{min-width:0}
.biz-sidebar .tree-leaf{min-width:0}
@media (max-width:900px){
  .biz-sidebar,.industry-sidebar{width:100%;min-width:0}
}

/* --- 1920 screens must keep the V1.13 frame: 1200 container, 260 sidebar */
@media (min-width:1100px){
  .container{width:min(1200px, calc(100% - 48px))}
  .model-layout{grid-template-columns:260px minmax(0,1fr);gap:24px}
}

/* --- ranking: 用原型自带的分段 tab（.ranking-shell/.ranking-tabs/.ranking-tab 在 app.css 里） */
.ranking-tab { display: flex; align-items: center; justify-content: center; gap: 8px; }
.ranking-tab-ico { font-size: 11px; color: #8fb3d8; }
.ranking-tab.active .ranking-tab-ico { color: #286ddd; }
.rank-panel { padding: 0; }
@media (max-width: 760px) {
  .ranking-tab { padding: 14px 10px; font-size: 12px; }
}

/* the page head carries too much bottom padding on the ranking page */
.pagehead{padding-bottom:22px}
.page>.container>.notice-bar:first-child{margin-top:0}

/* 模型卡：品牌名过长时类型徽标不再被挤到下一行（原型为同一行右对齐） */
.model-card-top { flex-wrap: nowrap; align-items: flex-start; gap: 10px; }
.model-card-top .model-title { min-width: 0; }
.model-card-top .model-title > div { min-width: 0; }
.model-card-top .model-title h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.model-card-top > .pill { flex: 0 0 auto; white-space: nowrap; }

/* 榜单 / 比价：行密度与字号对齐原型（原型行更紧凑、数字等宽） */
.table-scroll .table th { padding: 12px 14px; font-size: 11px; letter-spacing: .02em; }
.table-scroll .table td { padding: 12px 14px; font-size: 12px; }
.table-scroll .table td strong { font-size: 12.5px; }
.table-scroll .table td small { font-size: 11px; line-height: 1.65; }
.table-scroll .table .pill { padding: 2px 8px; font-size: 10px; }
.table-scroll .table td a.table-link + .pill { margin-left: 6px; }
.table-scroll .table { font-variant-numeric: tabular-nums; }

/* 移动端：行业方案页左栏不得撑破视口（QA mobile /business/ overflow=true） */
@media (max-width: 760px) {
  .industry-layout { display: block !important; }
  .industry-sidebar { position: static !important; width: auto !important; max-width: 100% !important; min-width: 0 !important; }
  .industry-sidebar .tree-menu,
  .industry-sidebar .tree-group,
  .industry-sidebar .tree-leaf,
  .industry-sidebar a { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
  .biz-hero { grid-template-columns: 1fr !important; }
  .biz-decide, .biz-table { max-width: 100%; }
}

/* 比价表：价格列用等宽数字，便于纵向比对（原型为左对齐，不改对齐） */
.pricing-table td:nth-child(n+2):nth-child(-n+5) { font-variant-numeric: tabular-nums; }
.pricing-table td:nth-child(6) small { font-size: 10.5px; }

/* 免费/优惠卡：字段表原本借用 GPU 硬件卡的 .hardware-spec（标签列只有 50px，
   长标签被挤成两行）。这里给它自己的类，标签列 104px、行距更紧。 */
.free-spec { margin: 0; }
.free-spec > div { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-top: 1px solid #f1f5fa; }
.free-spec > div:first-child { border-top: 0; }
.free-spec dt { font-size: 11px; color: #8e9eb5; line-height: 1.6; }
.free-spec dd { margin: 0; font-size: 11.5px; color: #3a587d; line-height: 1.65; }
@media (max-width: 590px) { .free-spec > div { grid-template-columns: 92px minmax(0, 1fr); } }

/* 比价表头：单位另起一行小字，避免"输入"这类简写看不懂口径 */
.pricing-table th .th-unit { display: block; font-size: 9.5px; font-weight: 600; color: #9aa9bd; margin-top: 2px; }

/* 首页：免责声明贴在首屏底边（原型如此），不再单独占一段留白 */
.hero .hero-notice { margin: 0 0 18px; background: rgba(255, 255, 255, .72); }

/* 模型广场 · 所有供应商：胶囊 + 商标位 + 收录数 */
.provider-pills { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 6px 4px; }
.provider-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e3ebf5;
  background: #fff; border-radius: 999px; padding: 6px 10px; font-size: 12px; color: #41536e; text-decoration: none; }
.provider-pill:hover { border-color: #bcd8f5; background: #f6fbff; color: #1b62c0; }
.provider-pill.is-current { background: #eaf4ff; border-color: #a9cdf4; color: #1b62c0; font-weight: 700; }
.provider-count { background: #f1f5fa; border-radius: 999px; padding: 1px 6px; font-size: 10.5px; color: #7b8ca3; }
.provider-pill.is-current .provider-count { background: #fff; }
.provider-logo { width: 16px; height: 16px; border-radius: 4px; object-fit: contain; flex: 0 0 auto; }
.provider-logo-letter { display: inline-grid; place-items: center; background: #eaf2ff; color: #2362db;
  font-size: 10px; font-weight: 800; }
.model-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }

/* 无障碍：键盘用户按一次 Tab 即可跳过导航直达内容 */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 200; background: #2362db; color: #fff;
  padding: 10px 16px; border-radius: 0 0 10px 0; font-size: 13px; font-weight: 700; text-decoration: none; }
.skip-link:focus { left: 0; }

/* 榜单表格：紧凑行距（后台「排行榜设置」可切换） */
.table.is-compact th,
.table.is-compact td { padding-top: 8px; padding-bottom: 8px; }

/* 供应商 Logo（AIHUB_Provider_Icons_Pack）：统一 20–24px，保持比例，不拉伸 */
.provider-mark .provider-logo,
.model-icon .provider-logo { object-fit: contain; border-radius: 0; }
.provider-mark .provider-logo-letter,
.model-icon .provider-logo-letter { width: 100%; height: 100%; display: inline-grid; place-items: center; }

/* 首页上下留白收紧：
   1) hero 底部原为 77px，导致热门标签与声明条之间空出一大块；
   2) 声明条之后紧接的 .section 顶部 58px，与 hero 底部叠加成约 90px。
   只作用于首页（.hero 仅首页使用），其它页面不受影响。 */
.hero-inner { padding: 44px 0 22px; }
.hero-notice { margin-top: 12px; margin-bottom: 16px; }
.hero + .section { padding-top: 26px; }

@media (max-width: 970px) {
    .hero-inner { padding: 32px 0 18px; }
    .hero + .section { padding-top: 22px; }
}
