/* ==========================================================================
   V2Ray测评 — components.css
   Tab / TOC / FAQ / 术语卡 / 下载卡 / 博客卡 / Callout / dl-fab
   ========================================================================== */

/* ==========================================================================
   Tab 切换
   ========================================================================== */

.tabs {
  position: relative;
}

.tabs__list {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
  margin-bottom: 24px;
}

.tabs__tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--r-pill) var(--r-pill) 0 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  transition: color 0.15s ease, background-color 0.15s ease;
  min-height: 44px;
}

.tabs__tab:hover {
  color: var(--ink);
  background: var(--bg-panel2);
}

.tabs__tab[aria-selected="true"] {
  color: var(--ink);
  font-weight: 700;
  background: var(--bg);
  border-color: var(--border);
  border-bottom-color: var(--bg);
  margin-bottom: -1px;
}

.tabs__panel {
  padding: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.tabs__panel[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .tabs__list {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs__list::-webkit-scrollbar {
    display: none;
  }

  .tabs__tab {
    flex-shrink: 0;
    padding: 10px 16px;
    font-size: 14px;
  }

  .tabs__panel {
    padding: 18px;
  }
}

/* ==========================================================================
   长页分类跳转导航 (TOC)
   ========================================================================== */

.toc {
  position: sticky;
  top: 12px;
  z-index: 10;
  background: var(--bg-panel2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 6px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
}

.toc::-webkit-scrollbar {
  display: none;
}

.toc a {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: color 0.12s ease, background-color 0.12s ease;
  min-height: 36px;
  flex-shrink: 0;
}

.toc a:hover {
  color: var(--ink);
  background: var(--bg);
}

.toc a.is-active {
  color: var(--ink);
  background: var(--bg);
  font-weight: 700;
}

@media (max-width: 640px) {
  .toc {
    border-radius: var(--r-md);
    padding: 4px;
  }
}

/* ==========================================================================
   FAQ 折叠项
   ========================================================================== */

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.faq-item:hover {
  box-shadow: var(--shadow-card);
}

.faq-item__q {
  margin: 0;
}

.faq-item__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 22px;
  text-align: left;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  min-height: 56px;
  transition: background-color 0.12s ease;
}

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

.faq-item__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-muted);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.faq-item__btn[aria-expanded="true"] .faq-item__icon {
  transform: rotate(45deg);
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.faq-item__a {
  padding: 0 22px;
}

.faq-item__a-inner {
  padding: 0 0 20px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 18px;
}

/* ==========================================================================
   术语卡
   ========================================================================== */

.glossary-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.glossary-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.glossary-card__cat {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--tint-sky);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

.glossary-card__term {
  font-size: 18px;
  margin-bottom: 8px;
}

.glossary-card__def {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-muted);
}

/* ==========================================================================
   下载客户端卡片
   ========================================================================== */

.dl-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
}

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

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

.dl-card__name {
  font-size: 20px;
  margin: 0;
}

.dl-card__badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dl-card__desc {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.dl-card__meta {
  font-size: 13.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-bottom: 18px;
}

.dl-card__meta strong {
  color: var(--text);
  font-weight: 600;
}

.dl-card__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dl-card__version {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
}

.dl-card__version-label {
  font-weight: 600;
}

@media (max-width: 640px) {
  .dl-card {
    padding: 20px;
  }

  .dl-card__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .dl-card__version {
    margin-left: 0;
    justify-content: center;
  }
}

/* ==========================================================================
   博客文章卡
   ========================================================================== */

.blog-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 0;
}

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

.blog-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.blog-card__date {
  font-size: 12.5px;
  color: var(--text-muted);
}

.blog-card__title {
  font-size: 18px;
  line-height: 1.4;
  margin: 0;
}

.blog-card__title a {
  transition: color 0.12s ease;
}

.blog-card__title a:hover {
  color: var(--ink-deep);
}

.blog-card__summary {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-muted);
  flex-grow: 1;
}

.blog-card__more {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Callout 引用块
   ========================================================================== */

.callout {
  padding: 20px 22px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  margin: 1.4em 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg-panel2);
}

.callout__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 8px;
}

.callout__title svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.callout--tip {
  background: var(--tint-mint);
  border-color: rgba(34, 160, 107, 0.25);
}

.callout--tip .callout__title {
  color: var(--success);
}

.callout--warn {
  background: var(--tint-honey);
  border-color: rgba(217, 142, 4, 0.25);
}

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

.callout--error {
  background: #FBE9EB;
  border-color: rgba(214, 69, 80, 0.25);
}

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

/* ==========================================================================
   表格
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  margin: 1.4em 0;
}

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

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

.data-table th {
  background: var(--bg-panel2);
  font-weight: 700;
  color: var(--ink);
  font-size: 13.5px;
  letter-spacing: 0.03em;
}

.data-table td {
  color: var(--text);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.prose > .data-table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 640px) {
  .data-table th,
  .data-table td {
    padding: 11px 14px;
    font-size: 13.5px;
  }
}

/* ==========================================================================
   dl-fab 右下角常驻下载引导浮层
   ========================================================================== */

.dl-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-btn);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

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

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

@media (max-width: 640px) {
  .dl-fab {
    right: 12px;
    bottom: 12px;
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* ==========================================================================
   Hero 浮卡装置
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  min-height: 770px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero__glow {
  position: absolute;
  top: -260px;
  left: 50%;
  width: 1100px;
  height: 1100px;
  margin-left: -550px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, rgba(255, 197, 61, 0.16) 0%, rgba(255, 197, 61, 0.07) 38%, rgba(255, 197, 61, 0) 68%);
  animation: glow-breathe 9s ease-in-out infinite;
}

@keyframes glow-breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.06); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__glow {
    animation: none;
  }

  .float-card,
  .btn,
  .plat-badges a {
    transition: none;
  }
}

.hero__center {
  position: relative;
  z-index: 2;
  max-width: 780px;
  padding: 0 24px;
  text-align: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-panel2);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.hero__eyebrow i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  flex-shrink: 0;
  animation: dot-breathe 2.4s ease-in-out infinite;
}

@keyframes dot-breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.hero__desc {
  max-width: 620px;
  margin: 0 auto;
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--text-muted);
}

.hero__desc strong {
  color: var(--text);
  font-weight: 700;
}

.hero__cta {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.kw-underline {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}

.kw-underline::after {
  content: "";
  position: absolute;
  left: 1%;
  right: 1%;
  bottom: 2px;
  height: 8px;
  border-radius: 4px;
  background: var(--honey);
  z-index: -1;
}

/* 四平台徽章行 */
.plat-badges {
  margin-top: 34px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.plat-badges a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.plat-badges a:hover {
  transform: translateY(-2px);
  border-color: var(--text-muted);
  background: var(--bg-panel2);
}

.plat-badges svg {
  width: 15px;
  height: 15px;
  color: var(--ink);
  flex-shrink: 0;
}

/* 浮卡装置 */
.float-card {
  position: absolute;
  z-index: 1;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.float-card:hover {
  transform: rotate(var(--tilt, 0deg)) translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.float-card__label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.float-card__label i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.55;
  flex-shrink: 0;
}

/* 卡1:协议胶囊卡(薄荷) */
.fc-protocol {
  --tilt: -2.5deg;
  left: 5%;
  top: 96px;
  width: 228px;
  padding: 18px 20px 20px;
  background: var(--tint-mint);
}

.fc-protocol .chips {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fc-protocol .chips span {
  padding: 5px 13px;
  border-radius: var(--r-pill);
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* 卡2:订阅设置卡(天空蓝) */
.fc-sub {
  --tilt: 2deg;
  left: 4%;
  bottom: 118px;
  width: 250px;
  padding: 18px 20px 16px;
  background: var(--tint-sky);
}

.fc-sub ul {
  margin-top: 12px;
}

.fc-sub li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid rgba(233, 232, 227, 0.9);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.fc-sub li:first-child {
  border-top: 0;
}

.fc-sub li b {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fc-sub li b i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-on { background: var(--success); }
.dot-plan { background: var(--warn); }
.dot-test { background: var(--error); }

/* 卡3:路由规则片段卡(白底 + 窗口圆点) */
.fc-route {
  --tilt: 2.5deg;
  right: 3.5%;
  top: 78px;
  width: 288px;
  background: var(--bg);
  overflow: hidden;
}

.fc-route__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel2);
}

.fc-route__bar i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fc-route__bar i:nth-child(1) { background: var(--error); }
.fc-route__bar i:nth-child(2) { background: var(--warn); }
.fc-route__bar i:nth-child(3) { background: var(--success); }

.fc-route__bar em {
  margin-left: 6px;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

.fc-route pre {
  margin: 0;
  padding: 14px 18px 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 2;
  color: var(--text);
  white-space: pre;
  overflow-x: auto;
}

.fc-route .rt-arrow { color: var(--text-muted); }
.fc-route .rt-direct { color: var(--success); font-weight: 600; }
.fc-route .rt-proxy { color: var(--warn); font-weight: 600; }

/* 卡4:事实卡(丁香紫) */
.fc-fact {
  --tilt: 2deg;
  right: 5%;
  bottom: 96px;
  width: 222px;
  padding: 18px 20px 20px;
  background: var(--tint-lilac);
}

.fc-fact strong {
  display: block;
  margin-top: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.fc-fact small {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* 卡5:内核小卡(杏粉) */
.fc-core {
  --tilt: -2deg;
  right: 12%;
  top: 318px;
  padding: 12px 18px;
  background: var(--tint-apricot);
}

.fc-core p {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.fc-core p span {
  font-family: var(--font-mono);
  font-weight: 600;
}

/* 响应式收敛 */
@media (max-width: 1120px) {
  .float-card {
    display: none;
  }
}

@media (max-width: 640px) {
  .hero {
    min-height: auto;
    padding: 56px 0 48px;
  }

  .hero__cta {
    flex-direction: column;
  }

  .hero__cta .btn {
    width: 100%;
  }

  .plat-badges {
    flex-direction: row;
  }

  .plat-badges a {
    padding: 7px 12px;
    font-size: 12.5px;
  }

  .plat-badges svg {
    width: 13px;
    height: 13px;
  }
}

/* ==========================================================================
   design-preview 专用样式(仅预览页使用)
   ========================================================================== */

.ds-section {
  padding: 72px 0;
}

.ds-section--panel {
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.ds-eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.ds-title {
  margin-bottom: 36px;
}

.ds-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.ds-swatch {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ds-swatch__chip {
  display: block;
  height: 72px;
  border-radius: var(--r-md);
  background: var(--swatch);
  border: 1px solid var(--border);
}

.ds-swatch code {
  font-size: 12px;
  color: var(--text-muted);
}

.ds-type-sample {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ds-h1 {
  font-size: clamp(34px, 3.4vw, 48px);
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -0.015em;
}

.ds-h2 {
  font-size: clamp(26px, 2.4vw, 34px);
}

.ds-h3 {
  font-size: clamp(18px, 1.6vw, 21px);
}

.ds-body {
  font-size: 16px;
  color: var(--text);
}

.ds-muted {
  font-size: 15px;
  color: var(--text-muted);
}

.ds-mono {
  font-family: var(--font-mono);
  font-size: 14px;
}

.ds-btn-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.ds-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.ds-badge-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .ds-card-grid {
    grid-template-columns: 1fr;
  }

  .ds-section {
    padding: 48px 0;
  }
}