/* app.1216.top 产品门户 — 全站样式
 * 设计原则: 扁平克制 / 0.5px 细边框 / 8-12px 圆角 / 400-500 字重 / 双主题自适应
 */

:root {
  --c-primary: #5b5bd6;
  --c-primary-hover: #4f4fc4;
  --c-primary-soft: rgba(91, 91, 214, 0.08);

  --c-bg: #ffffff;
  --c-bg-alt: #f7f7f9;
  --c-card: #ffffff;
  --c-border: rgba(0, 0, 0, 0.12);
  --c-border-soft: rgba(0, 0, 0, 0.06);
  --c-text: #1a1a24;
  --c-text-2: #55555f;
  --c-text-3: #6f6f7a;
  --c-success: #2f9e6e;
  --c-wip: #c77f1d;

  --radius: 10px;
  --radius-sm: 8px;
  --max-w: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-primary: #7b7bf0;
    --c-primary-hover: #8f8ff5;
    --c-primary-soft: rgba(123, 123, 240, 0.12);

    --c-bg: #131318;
    --c-bg-alt: #191920;
    --c-card: #1c1c24;
    --c-border: rgba(255, 255, 255, 0.14);
    --c-border-soft: rgba(255, 255, 255, 0.07);
    --c-text: #ececf2;
    --c-text-2: #a8a8b4;
    --c-text-3: #82828e;
    --c-success: #4fc08d;
    --c-wip: #e0a04a;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 68px; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 400;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-hover); }

:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }

code, .mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.92em;
}

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* ── 顶栏 ───────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--c-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border-soft);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 15px; color: var(--c-text);
}
.brand:hover { color: var(--c-primary); }
.brand .dot {
  width: 10px; height: 10px; border-radius: 3px;
  background: var(--c-primary); display: inline-block;
}
.topnav { display: flex; gap: 4px; }
.topnav a {
  padding: 6px 12px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--c-text-2);
}
.topnav a:hover { color: var(--c-text); background: var(--c-bg-alt); }

/* ── Hero ───────────────────────────── */
.hero { padding: 72px 0 56px; text-align: center; }
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 600; letter-spacing: -0.02em;
}
.hero p {
  margin: 0 auto 28px;
  max-width: 560px;
  font-size: 17px; color: var(--c-text-2);
}
.hero .cta {
  display: inline-block;
  padding: 10px 22px; border-radius: var(--radius-sm);
  background: var(--c-primary); color: #fff;
  font-size: 15px; font-weight: 500;
}
.hero .cta:hover { background: var(--c-primary-hover); color: #fff; }

/* ── 分区 ───────────────────────────── */
.section { padding: 20px 0 36px; }
.section-title {
  display: flex; align-items: baseline; gap: 12px;
  margin: 0 0 18px;
  font-size: 18px; font-weight: 600;
}
.section-title .count {
  font-size: 13px; font-weight: 400; color: var(--c-text-3);
}

/* ── 产品卡片 ───────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px;
  background: var(--c-card);
  border: 1px solid var(--c-border-soft);
  border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover {
  border-color: var(--c-border);
  transform: translateY(-2px);
}
.card-head {
  display: flex; align-items: center; gap: 12px;
}
.card-icon {
  width: 40px; height: 40px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--c-primary-soft); color: var(--c-primary);
}
.card-icon svg { width: 22px; height: 22px; }
.card-name { font-size: 16px; font-weight: 600; }
.card-ver {
  font-size: 12px; font-weight: 400; color: var(--c-text-3);
  margin-left: 6px;
}
.card-desc {
  font-size: 13.5px; color: var(--c-text-2);
  min-height: 44px;
}
.card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
}
.badge {
  display: inline-block;
  padding: 2px 8px; border-radius: 99px;
  font-size: 12px; font-weight: 500;
}
.badge.ok { color: var(--c-success); background: rgba(47, 158, 110, 0.1); }
.badge.wip { color: var(--c-wip); background: rgba(199, 127, 29, 0.1); }
.card-link {
  font-size: 13px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}

/* ── 页脚 ───────────────────────────── */
.footer {
  margin-top: 48px; padding: 28px 0 40px;
  border-top: 1px solid var(--c-border-soft);
  font-size: 13px; color: var(--c-text-3);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ── 详情页 ─────────────────────────── */
.crumb {
  padding: 20px 0 0;
  font-size: 13px; color: var(--c-text-3);
}
.crumb a { color: var(--c-text-3); }
.crumb a:hover { color: var(--c-primary); }
.crumb .sep { margin: 0 8px; color: var(--c-border); }

.pd-head {
  display: flex; align-items: center; gap: 18px;
  padding: 20px 0 8px;
}
.pd-icon {
  width: 64px; height: 64px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: var(--c-primary-soft); color: var(--c-primary);
}
.pd-icon svg { width: 34px; height: 34px; }
.pd-head h1 {
  margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 12px;
}
.pd-tag { font-size: 12px; font-weight: 500; color: var(--c-text-3); }
.pd-desc { margin: 4px 0 0; color: var(--c-text-2); font-size: 15px; }

.pd-section { padding: 28px 0 4px; }
.pd-section > h2 {
  margin: 0 0 16px; font-size: 17px; font-weight: 600;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.feature {
  padding: 16px;
  border: 1px solid var(--c-border-soft);
  border-radius: var(--radius);
}
.feature .f-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 500; font-size: 14.5px; margin-bottom: 6px;
}
.feature .f-title svg { width: 18px; height: 18px; color: var(--c-primary); flex: none; }
.feature p { margin: 0; font-size: 13.5px; color: var(--c-text-2); }

/* 下载区 */
.dl-box {
  border: 1px solid var(--c-border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.dl-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border-soft);
}
.dl-row:last-child { border-bottom: none; }
.dl-os {
  width: 86px; flex: none;
  font-size: 13px; font-weight: 500; color: var(--c-text-2);
  display: flex; align-items: center; gap: 6px;
}
.dl-file { flex: 1; font-size: 13px; color: var(--c-text-3); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-btn {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: var(--radius-sm);
  background: var(--c-primary); color: #fff;
  font-size: 13.5px; font-weight: 500;
}
.dl-btn:hover { background: var(--c-primary-hover); color: #fff; }
.dl-meta { font-size: 12px; color: var(--c-text-3); margin-left: 8px; }
.dl-note {
  padding: 10px 18px;
  font-size: 12.5px; color: var(--c-text-3);
  background: var(--c-bg-alt);
}
.dl-note a { color: var(--c-text-2); text-decoration: underline; text-underline-offset: 3px; }

/* 快速开始 */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 18px 44px;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--c-border);
  font-size: 13px; font-weight: 500; color: var(--c-text-2);
}
.steps .s-title { font-size: 14.5px; font-weight: 500; }
.steps .s-desc { font-size: 13.5px; color: var(--c-text-2); margin-top: 2px; }
.steps code {
  display: inline-block;
  padding: 2px 8px; border-radius: 6px;
  background: var(--c-bg-alt); border: 1px solid var(--c-border-soft);
}

/* 更新日志 */
.changelog { border-left: 2px solid var(--c-border-soft); margin-left: 6px; }
.log-item { position: relative; padding: 0 0 20px 20px; }
.log-item::before {
  content: "";
  position: absolute; left: -5px; top: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-primary);
}
.log-date { font-size: 12px; color: var(--c-text-3); }
.log-ver { font-size: 14px; font-weight: 600; margin-left: 8px; }
.log-item p { margin: 4px 0 0; font-size: 13.5px; color: var(--c-text-2); }

/* ── 下载页(紧凑文件表) ─────────────── */
.dl-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-bottom: 22px; }
.dl-head h1 { margin: 0 0 4px; font-size: 24px; font-weight: 600; }
.dl-head p { margin: 0; font-size: 13.5px; color: var(--c-text-3); }
.dl-filter {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px;
  border: 1px solid var(--c-border-soft);
  border-radius: 99px;
  background: var(--c-bg-alt);
}
.f-btn {
  border: none; background: none; cursor: pointer;
  padding: 4px 13px; border-radius: 99px;
  font-size: 12.5px; color: var(--c-text-2);
  transition: color 0.15s;
}
.f-btn:hover { color: var(--c-text); }
.f-btn.active { background: var(--c-bg); color: var(--c-primary); font-weight: 500; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

.dl-table-wrap { border: 1px solid var(--c-border-soft); border-radius: var(--radius); overflow: hidden; }
.dl-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.dl-table th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--c-text-3);
  padding: 10px 16px;
  background: var(--c-bg-alt);
  border-bottom: 1px solid var(--c-border-soft);
  letter-spacing: 0.03em;
}
.dl-table td { padding: 11px 16px; border-bottom: 1px solid var(--c-border-soft); vertical-align: middle; }
.dl-table tbody tr:last-child td { border-bottom: none; }
.dl-table tbody tr { transition: background 0.1s; }
.dl-table tbody tr:hover { background: var(--c-primary-soft); }
/* 同产品合并组: 组首行上边线加深, 产品列垂直居中 */
.dl-table tr.g-start td { border-top: 1px solid var(--c-border); }
.t-prod[rowspan] { border-bottom: none !important; vertical-align: middle; }
.t-prod[rowspan] a { display: inline-flex; flex-direction: column; }
.t-prod[rowspan] a:hover { color: var(--c-primary); }
.t-file {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px; color: var(--c-text);
}
.t-prod a { color: var(--c-text); font-weight: 500; }
.t-prod a:hover { color: var(--c-primary); }
.t-ver { font-size: 11.5px; color: var(--c-text-3); margin-left: 7px; }
.t-os {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--c-text-2);
}
.t-size { font-size: 12.5px; color: var(--c-text-3); white-space: nowrap; }
.t-act { text-align: right; white-space: nowrap; }
.t-dl {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: var(--radius-sm);
  background: var(--c-primary); color: #fff;
  font-size: 12.5px; font-weight: 500;
}
.t-dl:hover { background: var(--c-primary-hover); color: #fff; }
.t-doc {
  margin-left: 8px;
  font-size: 12.5px; color: var(--c-text-3);
  text-decoration: underline; text-underline-offset: 3px;
}
.t-doc:hover { color: var(--c-primary); }

/* 外站发布区 */
.dl-ext { margin-top: 32px; }
.dl-ext h2 { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.dl-ext-link {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 6px 14px 0 0;
  font-size: 13.5px; font-weight: 500; color: var(--c-text);
}
.dl-ext-link:hover { color: var(--c-primary); }
.dl-ext-link span { font-size: 12px; font-weight: 400; color: var(--c-text-3); }

@media (max-width: 640px) {
  .dl-table th:nth-child(3), .dl-table td:nth-child(3),
  .dl-table th:nth-child(4), .dl-table td:nth-child(4) { display: none; }
  .dl-table .t-ver { display: none; }
}

/* ── 详情页左侧产品清单(可收缩) ─────── */
.pd-nav-wrap {
  position: fixed;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 168px;
  z-index: 50;
}
.pd-nav {
  max-height: 78vh;
  overflow-y: auto;
  font-size: 13px;
  scrollbar-width: none;
  background: var(--c-bg);
  border: 1px solid var(--c-border-soft);
  border-radius: var(--radius);
  padding: 10px 6px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.pd-nav::-webkit-scrollbar { display: none; }
/* 收缩态: 清单淡出左移 */
.pd-nav-wrap:not(.open) .pd-nav {
  opacity: 0;
  transform: translateX(-12px);
  pointer-events: none;
  visibility: hidden;
}
/* 把手: 常驻小圆钮 */
.pd-nav-handle {
  position: absolute;
  left: -8px; top: 14px;
  display: flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 10px 0 9px;
  border: 1px solid var(--c-border-soft);
  border-radius: 99px;
  background: var(--c-bg);
  color: var(--c-text-3);
  cursor: pointer;
  font-size: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.pd-nav-handle svg { width: 14px; height: 14px; }
.pd-nav-handle:hover { color: var(--c-primary); border-color: var(--c-primary); }
.pd-nav-wrap.open .pd-nav-handle {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s 0.25s; /* 展开后延迟隐藏, 避免误触 */
}
.pd-nav-wrap.auto-folded .pd-nav-handle::after {
  content: "";
}
.pd-nav-group { margin-bottom: 12px; }
.pd-nav-group:last-child { margin-bottom: 4px; }
.pd-nav-group .g-name {
  font-size: 11.5px; font-weight: 500; color: var(--c-text-3);
  padding: 0 10px 5px;
  letter-spacing: 0.04em;
}
.pd-nav a {
  display: block;
  padding: 4px 10px;
  border-radius: 6px;
  color: var(--c-text-2);
  line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pd-nav a:hover { color: var(--c-text); background: var(--c-bg-alt); }
.pd-nav a.cur {
  color: var(--c-primary); font-weight: 500;
  background: var(--c-primary-soft);
}
.pd-nav a.dim { opacity: 0.66; }
.pd-nav .ver { font-size: 11px; color: var(--c-text-3); margin-left: 5px; }
.pd-nav a.cur .ver { color: var(--c-primary); opacity: 0.8; }
/* 视口不够宽时隐藏 */
@media (max-width: 1239px) { .pd-nav-wrap { display: none; } }

/* ── install.md 模态框 ──────────────── */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: stretch; justify-content: flex-end;
}
.modal-mask.open { display: flex; }
.modal {
  width: min(720px, 92vw);
  height: 100%;
  background: var(--c-bg);
  border-left: 1px solid var(--c-border-soft);
  display: flex; flex-direction: column;
  animation: drawer-in 0.18s ease-out;
}
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--c-border-soft);
  flex: none;
}
.modal-head .m-title { font-size: 15px; font-weight: 600; }
.modal-actions { display: flex; align-items: center; gap: 6px; }
.modal-copy {
  border: 1px solid var(--c-border); background: var(--c-bg);
  color: var(--c-text-2); cursor: pointer;
  font-size: 13px; padding: 4px 12px; border-radius: var(--radius-sm);
}
.modal-copy:hover { color: var(--c-text); border-color: var(--c-text-3); }
.modal-copy.ok { color: var(--c-success); border-color: var(--c-success); }
.modal-close {
  border: none; background: none; cursor: pointer;
  font-size: 20px; line-height: 1; color: var(--c-text-3);
  padding: 4px 8px; border-radius: 6px;
}
.modal-close:hover { color: var(--c-text); background: var(--c-bg-alt); }
.modal-body {
  flex: 1; overflow-y: auto;
  padding: 20px 24px 40px;
}
.modal-body.loading { color: var(--c-text-3); font-size: 14px; }
.modal-body pre.md-fallback {
  white-space: pre-wrap; word-break: break-word;
  font-size: 13px; line-height: 1.7;
  background: var(--c-bg-alt); border: 1px solid var(--c-border-soft);
  border-radius: var(--radius-sm); padding: 16px;
}

/* 模态框内 markdown 渲染样式 */
.md { font-size: 14px; line-height: 1.75; }
.md h1 { font-size: 20px; font-weight: 600; margin: 8px 0 16px; }
.md h2 { font-size: 16px; font-weight: 600; margin: 28px 0 10px; }
.md h3 { font-size: 14.5px; font-weight: 600; margin: 20px 0 8px; }
.md p { margin: 8px 0; }
.md ul, .md ol { padding-left: 22px; margin: 8px 0; }
.md li { margin: 4px 0; }
.md code {
  display: inline-block;
  padding: 1px 6px; border-radius: 5px;
  background: var(--c-bg-alt); border: 1px solid var(--c-border-soft);
  font-size: 0.88em;
}
.md pre {
  background: var(--c-bg-alt); border: 1px solid var(--c-border-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px; overflow-x: auto; margin: 10px 0;
}
.md pre code { background: none; border: none; padding: 0; font-size: 12.5px; }
.md table { border-collapse: collapse; margin: 12px 0; width: 100%; font-size: 13px; }
.md th, .md td { border: 1px solid var(--c-border); padding: 6px 10px; text-align: left; }
.md th { background: var(--c-bg-alt); font-weight: 500; }
.md blockquote {
  margin: 12px 0; padding: 8px 14px;
  border-left: 3px solid var(--c-primary);
  background: var(--c-primary-soft); border-radius: 0 8px 8px 0;
  color: var(--c-text-2);
}
.md a { word-break: break-all; }

/* 响应式 */
@media (max-width: 640px) {
  .hero { padding: 48px 0 40px; }
  .pd-head { flex-direction: column; align-items: flex-start; }
  .dl-row { flex-wrap: wrap; }
  .dl-file { flex-basis: 100%; order: 3; }
}
