/* ==========================================================================
   华新视界 · 知识解答中心样式（知识类 / 软件下载）
   命名空间 kw- ，复用 pro.css 的 :root 变量与 .hx-wrap / .hx-sec / .hx-btn
   ========================================================================== */

/* ---------- 两个板块大卡 ---------- */
.kw-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.kw-bcard {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 30px 30px 26px;
  background: #fff;
  border: 1px solid var(--hx-line);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--hx-shadow);
  overflow: hidden;
  transition: transform .32s var(--hx-ease), box-shadow .32s var(--hx-ease), border-color .32s;
}
.kw-bcard::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--hx-brand-d), var(--hx-brand));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--hx-ease);
}
.kw-bcard:hover {
  transform: translateY(-4px);
  border-color: rgba(31, 194, 255, .5);
  box-shadow: var(--hx-shadow-h);
}
.kw-bcard:hover::before { transform: scaleX(1); }

.kw-bcard .top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.kw-bcard .ico {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: linear-gradient(150deg, rgba(31, 194, 255, .14), rgba(11, 127, 191, .07));
  color: var(--hx-brand-d);
}
.kw-bcard .no {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--hx-brand);
  padding-top: 4px;
  font-variant-numeric: tabular-nums;
}
.kw-bcard h2 {
  font-size: 23px;
  font-weight: 700;
  color: var(--hx-ink);
  margin: 0 0 9px;
  letter-spacing: -.01em;
}
.kw-bcard .desc {
  font-size: 14px;
  line-height: 1.8;
  color: var(--hx-muted);
  margin: 0 0 18px;
}
.kw-bcard .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.kw-bcard .tags li {
  font-size: 12px;
  line-height: 1;
  padding: 6px 10px;
  border-radius: 4px;
  background: var(--hx-bg);
  color: var(--hx-body);
  border: 1px solid var(--hx-line);
}
.kw-bcard .foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px dashed var(--hx-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--hx-muted);
}
.kw-bcard .foot .latest {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 78%;
}
.kw-bcard .foot .go {
  flex: 0 0 auto;
  font-weight: 600;
  color: var(--hx-brand-d);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.kw-bcard .foot .go svg { transition: transform .28s var(--hx-ease); }
.kw-bcard:hover .foot .go svg { transform: translateX(4px); }

/* ---------- 知识列表 ---------- */
.kw-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.kw-item {
  display: flex;
  flex-direction: column;
  padding: 24px 26px;
  background: #fff;
  border: 1px solid var(--hx-line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform .3s var(--hx-ease), box-shadow .3s var(--hx-ease), border-color .3s;
}
.kw-item:hover {
  transform: translateY(-3px);
  border-color: rgba(31, 194, 255, .5);
  box-shadow: var(--hx-shadow-h);
}
.kw-item .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--hx-muted);
  margin-bottom: 11px;
}
.kw-item .meta .cat {
  color: var(--hx-brand-d);
  font-weight: 600;
  letter-spacing: .02em;
}
.kw-item .meta i {
  font-style: normal;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: .45;
}
.kw-item h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--hx-ink);
  margin: 0 0 10px;
  transition: color .2s;
}
.kw-item:hover h3 { color: var(--hx-brand-d); }
.kw-item p {
  font-size: 13.5px;
  line-height: 1.78;
  color: var(--hx-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kw-item .more {
  margin-top: 15px;
  font-size: 13px;
  font-weight: 500;
  color: var(--hx-brand-d);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.kw-item .more svg { transition: transform .28s var(--hx-ease); }
.kw-item:hover .more svg { transform: translateX(4px); }

/* ---------- 软件下载列表 ---------- */
.kw-soft {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.kw-sitem {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--hx-line);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform .3s var(--hx-ease), box-shadow .3s var(--hx-ease), border-color .3s;
}
.kw-sitem:hover {
  transform: translateY(-3px);
  border-color: rgba(31, 194, 255, .5);
  box-shadow: var(--hx-shadow-h);
}
.kw-sitem .ico {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(150deg, rgba(31, 194, 255, .14), rgba(11, 127, 191, .07));
  color: var(--hx-brand-d);
}
.kw-sitem .txt { min-width: 0; }
.kw-sitem h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--hx-ink);
  margin: 0 0 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .2s;
}
.kw-sitem:hover h3 { color: var(--hx-brand-d); }
.kw-sitem .specs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--hx-muted);
}
.kw-sitem .specs em {
  font-style: normal;
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--hx-bg);
  border: 1px solid var(--hx-line);
  color: var(--hx-body);
  font-variant-numeric: tabular-nums;
}
.kw-sitem .specs em:empty { display: none; }
.kw-sitem .specs i {
  font-style: normal;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: .45;
}
.kw-sitem .specs i:first-child { display: none; }
.kw-sitem .dl {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 17px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  border-radius: 8px;
  background: linear-gradient(96deg, var(--hx-brand-d), var(--hx-brand));
  white-space: nowrap;
  transition: box-shadow .25s, transform .25s;
}
.kw-sitem:hover .dl {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(11, 127, 191, .3);
}

/* ---------- 空态 ---------- */
.kw-empty {
  text-align: center;
  padding: 62px 24px;
  border: 1px dashed var(--hx-line);
  border-radius: 12px;
  background: #fff;
}
.kw-empty .ico {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--hx-bg);
  color: var(--hx-brand-d);
}
.kw-empty h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--hx-ink);
  margin: 0 0 9px;
}
.kw-empty p {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--hx-muted);
  margin: 0 auto 20px;
  max-width: 520px;
}
.kw-empty .links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

/* 有内容时隐藏空态，无内容时隐藏网格（浏览器不支持 :has 则都显示，不影响可用性） */
.kw-hasempty .kw-list:has(.kw-item) + .kw-empty,
.kw-hasempty .kw-soft:has(.kw-sitem) + .kw-empty { display: none; }
.kw-hasempty .kw-list:not(:has(.kw-item)),
.kw-hasempty .kw-soft:not(:has(.kw-sitem)) { display: none; }

/* ==========================================================================
   知识详情 / 软件详情
   ========================================================================== */
.kw-head {
  padding: 26px 0 30px;
  border-bottom: 1px solid var(--hx-line);
}
.kw-head h1 {
  font-size: clamp(24px, 3.4vw, 34px);
  line-height: 1.35;
  font-weight: 700;
  color: var(--hx-ink);
  margin: 14px 0 16px;
  letter-spacing: -.01em;
}
.kw-head .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--hx-muted);
}
.kw-head .meta .cat {
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(31, 194, 255, .1);
  color: var(--hx-brand-d);
  font-weight: 600;
}
.kw-head .meta span { display: inline-flex; align-items: center; gap: 5px; }

.kw-body {
  padding: 40px 0 20px;
  font-size: 15.5px;
  line-height: 1.95;
  color: var(--hx-body);
  max-width: 860px;
}
.kw-body h2 {
  font-size: 21px;
  font-weight: 700;
  color: var(--hx-ink);
  margin: 40px 0 14px;
  padding-left: 13px;
  border-left: 3px solid var(--hx-brand);
  line-height: 1.4;
}
.kw-body h2:first-child { margin-top: 0; }
.kw-body h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--hx-ink);
  margin: 28px 0 10px;
}
.kw-body p { margin: 0 0 17px; }
.kw-body strong { color: var(--hx-ink); font-weight: 600; }
.kw-body ul, .kw-body ol { margin: 0 0 18px; padding-left: 22px; }
.kw-body li { margin-bottom: 8px; }
.kw-body img { max-width: 100%; height: auto; border-radius: 8px; }
.kw-body figure { margin: 0 0 20px; max-width: 100%; }
.kw-body blockquote {
  margin: 22px 0;
  padding: 16px 20px;
  border-left: 3px solid var(--hx-brand);
  background: var(--hx-bg);
  border-radius: 0 8px 8px 0;
  color: var(--hx-body);
}
.kw-body blockquote p:last-child { margin-bottom: 0; }
.kw-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 22px;
  font-size: 14px;
}
.kw-body th, .kw-body td {
  border: 1px solid var(--hx-line);
  padding: 10px 13px;
  text-align: left;
}
.kw-body th { background: var(--hx-bg); font-weight: 600; color: var(--hx-ink); }
.kw-body a { color: var(--hx-brand-d); text-decoration: underline; text-underline-offset: 3px; }

/* 上下篇 */
.kw-pn {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 46px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--hx-line);
}
.kw-pn a {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--hx-line);
  border-radius: 10px;
  text-decoration: none;
  color: var(--hx-body);
  transition: border-color .25s, color .25s;
  min-width: 0;
}
.kw-pn a:hover { border-color: rgba(31, 194, 255, .55); color: var(--hx-brand-d); }
.kw-pn .lab { font-size: 12px; color: var(--hx-muted); display: block; margin-bottom: 6px; }
.kw-pn .tt {
  font-size: 14px;
  font-weight: 500;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kw-pn .next { text-align: right; }

/* ---------- 软件详情 ---------- */
.kw-shero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 46px;
  align-items: start;
  padding: 34px 0 46px;
}
.kw-shero h1 {
  font-size: clamp(23px, 3.2vw, 32px);
  font-weight: 700;
  line-height: 1.35;
  color: var(--hx-ink);
  margin: 12px 0 14px;
}
.kw-shero .brief {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--hx-muted);
  margin: 0 0 24px;
}
.kw-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--hx-line);
  border: 1px solid var(--hx-line);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 0 26px;
}
.kw-specs div {
  background: #fff;
  padding: 15px 17px;
}
.kw-specs dt {
  font-size: 12px;
  color: var(--hx-muted);
  margin: 0 0 6px;
  letter-spacing: .02em;
}
.kw-specs dd {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--hx-ink);
  margin: 0;
  word-break: break-all;
}
.kw-specs dd:empty::after {
  content: "—";
  color: var(--hx-muted);
  font-weight: 400;
}

.kw-dlbox {
  background: var(--hx-bg);
  border: 1px solid var(--hx-line);
  border-radius: 12px;
  padding: 26px 24px;
  text-align: center;
}
.kw-dlbox .big {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 15px 22px;
  font-size: 15.5px;
  font-weight: 600;
  color: #fff;
  border-radius: 9px;
  background: linear-gradient(96deg, var(--hx-brand-d), var(--hx-brand));
  text-decoration: none;
  transition: transform .25s, box-shadow .25s;
}
.kw-dlbox .big:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(11, 127, 191, .32);
}
.kw-dlbox .big.off {
  background: #e7eef5;
  color: var(--hx-muted);
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}
.kw-dlbox .hint {
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--hx-muted);
  margin: 14px 0 0;
}
.kw-dlbox .alt {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(107, 130, 153, .28);
  font-size: 13px;
  color: var(--hx-body);
}
.kw-dlbox .alt a { color: var(--hx-brand-d); text-decoration: none; font-weight: 500; }

/* ---------- 内页小标题（列表页顶部） ---------- */
.kw-lhead {
  padding: 8px 0 30px;
}
.kw-lhead h1 {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  color: var(--hx-ink);
  margin: 0 0 12px;
  letter-spacing: -.01em;
}
.kw-lhead p {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--hx-muted);
  margin: 0;
  max-width: 760px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 991px) {
  .kw-board,
  .kw-list,
  .kw-soft { grid-template-columns: 1fr; }
  .kw-shero { grid-template-columns: 1fr; gap: 28px; }
  .kw-sec { padding: 46px 0; }
}

@media (max-width: 575px) {
  .kw-bcard { padding: 24px 20px 22px; }
  .kw-bcard h2 { font-size: 20px; }
  .kw-item { padding: 20px 19px; }
  .kw-item h3 { font-size: 16px; }
  .kw-sitem {
    grid-template-columns: 44px 1fr;
    gap: 13px;
    padding: 17px 18px;
  }
  .kw-sitem .ico { width: 44px; height: 44px; border-radius: 10px; }
  .kw-sitem .dl {
    grid-column: 1 / -1;
    justify-content: center;
    margin-top: 4px;
    padding: 11px 16px;
  }
  .kw-specs { grid-template-columns: 1fr; }
  .kw-pn { grid-template-columns: 1fr; }
  .kw-pn .next { text-align: left; }
  .kw-body { font-size: 15px; line-height: 1.9; }
}

@media (prefers-reduced-motion: reduce) {
  .kw-bcard, .kw-item, .kw-sitem, .kw-dlbox .big { transition: none !important; }
}

/* ---------- 补充：hero 高亮（pro.css 未定义 .hx-hero h1 span） ---------- */
.hx-hero h1 span { color: var(--hx-brand); }

/* ---------- 补充：只有一条内容时占满整行，避免右侧大片空白 ---------- */
.kw-soft:has(.kw-sitem:only-child),
.kw-list:has(.kw-item:only-child) { grid-template-columns: 1fr; }

/* ---------- 补充：板块卡底部「最新」为空时右对齐进入按钮 ---------- */
.kw-bcard .foot .go { margin-left: auto; }
.kw-bcard .foot .latest:empty { display: none; }
.kw-bcard .foot .latest:not(:empty)::before {
  content: "最新：";
  color: #9fb0c0;
}

/* ---------- 补充：知识类主题分类 tab ---------- */
.kw-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0 0 26px;
}
.kw-tabs a {
  display: inline-flex;
  align-items: center;
  padding: 9px 17px;
  font-size: 13.5px;
  line-height: 1;
  color: var(--hx-body);
  background: #fff;
  border: 1px solid var(--hx-line);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: color .22s, border-color .22s, background .22s, box-shadow .22s;
}
.kw-tabs a:hover {
  color: var(--hx-brand-d);
  border-color: rgba(31, 194, 255, .55);
}
.kw-tabs a.on {
  color: #fff;
  font-weight: 600;
  background: linear-gradient(96deg, var(--hx-brand-d), var(--hx-brand));
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(11, 127, 191, .22);
}
@media (max-width: 575px) {
  .kw-tabs { gap: 7px; margin-bottom: 20px; }
  .kw-tabs a { padding: 8px 13px; font-size: 12.5px; }
}

/* ---------- 补充：正文表格在手机端横向滑动，避免撑破版面 ---------- */
.kw-body code {
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--hx-bg);
  border: 1px solid var(--hx-line);
  font-size: .92em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-all;
}
@media (max-width: 767px) {
  .kw-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  .kw-body table th,
  .kw-body table td { white-space: nowrap; }
}

/* ---------- 补充：长标题均衡断行，避免末行只剩一两个字 ---------- */
.kw-head h1 { text-wrap: balance; }
.kw-item h3 { text-wrap: balance; }

/* ---------- 补充：小屏 hero 眉标不换行 ---------- */
@media (max-width: 575px) {
  .hx-hero .eyebrow { font-size: 10.5px; letter-spacing: .08em; }
}
