/* ============================================================
   V2Ray for Windows — 跨页面组件
   Tab / TOC / FAQ / 术语卡 / 下载卡 / 博客卡 / Callout / DL FAB
   ============================================================ */

/* ---------- Tab 切换 ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.tab-btn.is-active {
  color: var(--text);
  font-weight: 600;
}

.tab-btn.is-active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: -1px;
  height: 3px;
  border-radius: var(--radius-pill);
  background: var(--accent);
}

.tab-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--accent);
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: block;
}

/* ---------- 长页分类跳转导航 (TOC) ---------- */
.toc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  margin-bottom: 40px;
}

.toc-nav a {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.toc-nav a:hover,
.toc-nav a.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- FAQ 折叠项 ---------- */
.faq-item {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.faq-item[open] {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 20px 24px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  min-height: 48px;
  list-style: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question::marker {
  content: '';
}

.faq-question:hover {
  background: var(--bg-hover);
}

.faq-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.faq-item[open] .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 24px 20px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-muted);
}

.faq-answer p + p {
  margin-top: 12px;
}

/* ---------- 术语卡 ---------- */
.term-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.term-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}

.term-card .term-name {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-dark);
  margin-bottom: 8px;
}

.term-card .term-def {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
}

/* ---------- 下载客户端卡片 ---------- */
.dl-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 28px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.dl-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.dl-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.dl-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: contain;
}

.dl-card-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.dl-card-sub {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.dl-card-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.dl-card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dl-card-actions .btn {
  width: 100%;
  justify-content: space-between;
}

.dl-card-actions .btn .dl-btn-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dl-card-actions .btn .dl-btn-meta {
  font-size: 13px;
  font-weight: 400;
  color: inherit;
  opacity: 0.75;
}

.dl-card-actions .btn .dl-btn-meta .dl-version {
  font-family: var(--font-mono);
}

/* ---------- 博客文章卡 ---------- */
.blog-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.blog-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.blog-card .blog-tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}

.blog-card .blog-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 10px;
}

.blog-card .blog-summary {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 18px;
  flex: 1 1 auto;
}

.blog-card .blog-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-faint);
}

.blog-card .blog-meta .blog-date::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-faint);
  margin-right: 12px;
  vertical-align: middle;
}

/* ---------- Callout 引用块 ---------- */
.callout {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text);
  margin: 24px 0;
}

.callout svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 2px;
}

.callout .callout-body {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text);
}

.callout .callout-body p + p {
  margin-top: 8px;
}

.callout .callout-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.callout-warn {
  background: #FEF3E2;
  border-left-color: var(--warn);
}

.callout-warn svg {
  color: var(--warn);
}

.callout-error {
  background: #FCEBEB;
  border-left-color: var(--error);
}

.callout-error svg {
  color: var(--error);
}

/* ---------- DL FAB(右下角常驻下载浮层) ---------- */
.dl-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  background: var(--accent);
  border-radius: var(--radius-pill);
  box-shadow: 0 12px 32px -10px rgba(11, 122, 69, 0.55), 0 2px 8px rgba(11, 122, 69, 0.25);
  transition: background var(--transition), transform var(--transition);
}

.dl-fab:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.dl-fab svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---------- 裸表格横滑防御 ---------- */
.prose > .data-table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-weight: 600;
  color: var(--text);
  background: var(--bg-panel-2);
  font-size: 13.5px;
  letter-spacing: 0.02em;
}

.data-table td {
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .tabs {
    gap: 2px;
  }

  .tab-btn {
    padding: 10px 14px 12px;
    font-size: 14px;
  }

  .toc-nav {
    padding: 12px;
  }

  .toc-nav a {
    padding: 7px 12px;
    font-size: 13px;
  }

  .dl-card {
    padding: 20px;
  }

  .dl-card-actions .btn {
    white-space: normal;
    flex-wrap: wrap;
    row-gap: 6px;
    flex-direction: column;
    align-items: flex-start;
  }

  .dl-card-actions .btn .dl-btn-label {
    display: block;
    width: 100%;
  }

  .dl-card-actions .btn .dl-btn-label svg {
    display: inline-block;
    vertical-align: middle;
  }

  .dl-card-actions .btn .dl-btn-meta {
    flex: 0 1 auto;
    min-width: 0;
  }

  .dl-fab {
    right: 16px;
    bottom: 16px;
    padding: 12px 18px;
    font-size: 14px;
  }

  .callout {
    padding: 14px 16px;
  }
}