/* ============================================================
   红虾网络官网 · components.css（按钮/卡片/导航/页脚/五态/徽章）
   依赖方向：components → base → tokens；禁止页面专属选择器。
   按钮/文字/圆角/边框背景一律消费 --el-* 语义层（禁裸默认契约）。
   ============================================================ */

/* ---------- 1. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  min-width: 44px;
  padding: 0 var(--space-4);
  font-family: inherit;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
  text-decoration: none;
  border: 0;
  border-radius: var(--el-radius-control);
  cursor: pointer;
  transition:
    transform var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard),
    background-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--el-primary-bg);
  color: var(--el-text-on-primary);
}
.btn-secondary {
  background: var(--color-bg-surface);
  color: var(--el-text-primary);
  border: var(--el-border-input);
}

/* 禁用态：独立列出，不替代五态（契约 §C） */
.is-disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

@media (hover: hover) {
  .btn-primary:hover {
    background: var(--el-primary-bg-hover);
    box-shadow: var(--shadow-card);
  }
  .btn-secondary:hover {
    background: var(--el-bg-surface-muted);
  }
}

.btn-nav { min-height: 44px; padding: 0 var(--space-4); }

/* 文字链接 */
.link-more {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  color: var(--el-link);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}
.link-more .arrow { transition: transform var(--duration-fast) var(--ease-standard); }
@media (hover: hover) {
  .link-more:hover { color: var(--el-primary-text); }
  .link-more:hover .arrow { transform: translateX(2px); }
}

/* ---------- 2. 固定顶部导航 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--color-bg-page);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.site-header.is-scrolled { box-shadow: var(--shadow-card); }

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.nav-logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-bold);
  color: var(--el-text-primary);
  text-decoration: none;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.nav-list {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  color: var(--el-text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}
.nav-link[aria-current="page"] { color: var(--el-text-primary); }
.nav-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 2px;
  border-radius: var(--el-radius-control);
  background: var(--el-primary-bg);
}
@media (hover: hover) {
  .nav-link:hover { color: var(--el-text-primary); }
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.nav-toggle-bar {
  width: 18px;
  height: 2px;
  background: var(--el-text-primary);
}

/* ---------- 3. 区块通用 ---------- */
.section { padding-block: var(--space-6); }
.section-head { margin: 0 0 var(--space-5); }
.section-head h2 { color: var(--el-text-primary); }
.section-lead {
  margin-top: var(--space-2);
  font-size: var(--font-size-body);
  line-height: 1.7;
  color: var(--el-text-secondary);
}

/* ---------- 4. 卡片（无边框 + 单层低透明阴影） ---------- */
.card {
  background: var(--color-bg-surface);
  border-radius: var(--el-radius-surface);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--duration-fast) var(--ease-standard);
}
.card h3 { margin: var(--space-3) 0 var(--space-1); }
.card p {
  font-size: var(--font-size-body);
  line-height: 1.7;
  color: var(--el-text-secondary);
  overflow-wrap: anywhere;
}
@media (hover: hover) {
  .card:hover { box-shadow: var(--shadow-raised); }
}

.card-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--el-radius-surface);
  background: var(--el-primary-tint-bg);
  color: var(--el-primary-text);
}
.card-icon--accent {
  background: var(--color-accent-tint);
  color: var(--color-accent);
}

/* 徽章（「界面示意」等标注） */
.badge {
  display: inline-block;
  padding: 2px var(--space-2);
  font-size: var(--font-size-small);
  line-height: 1.6;
  font-weight: var(--font-weight-medium);
  color: var(--el-text-secondary);
  background: var(--el-bg-surface-muted);
  border-radius: var(--el-radius-control);
}

/* ---------- 5. 页脚 ---------- */
.site-footer {
  background: var(--el-bg-surface-muted);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--el-text-secondary);
  padding: var(--space-5) 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
  padding-bottom: var(--space-4);
}
.footer-logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: var(--space-2);
  font-size: var(--font-size-h3);
  font-weight: var(--font-weight-bold);
  color: var(--el-text-primary);
  text-decoration: none;
}
.footer-tagline {
  max-width: 320px;
  font-size: var(--font-size-body);
  line-height: 1.7;
  color: var(--el-text-secondary);
}
.footer-col h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-semibold);
  color: var(--el-text-secondary);
}
.footer-col li + li { margin-top: var(--space-1); }
.footer-col a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 44px;
  min-height: 44px;
  font-size: var(--font-size-small);
  color: var(--el-text-secondary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-standard);
}
.footer-bottom {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: var(--space-3);
}
.footer-icp {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center; /* 链接因触屏可达性 min-height:44px，需与其余文本项垂直居中，否则备案号基线偏下 */
  gap: var(--space-1) var(--space-3);
}
.footer-icp a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.footer-icp a,
.footer-icp span {
  font-size: var(--font-size-small);
  line-height: 1.6;
  color: var(--el-text-secondary);
  overflow-wrap: anywhere;
}
.footer-icp a { text-decoration: none; }
@media (hover: hover) {
  .footer-col a:hover,
  .footer-icp a:hover {
    color: var(--el-text-primary);
    text-decoration: underline;
  }
}
@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* ---------- 6. 滚动浮现（渐进增强；--x-i 为登记的实现态局部变量） ---------- */
.js .reveal { opacity: 0; transform: translateY(12px); }
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}
.rv-0 { --x-i: 0; }
.rv-1 { --x-i: 1; }
.rv-2 { --x-i: 2; }

/* ---------- 7. 五态组件（契约 §C：五态类名 + .is-disabled 另列） ---------- */
.state-demo {
  background: var(--color-bg-surface);
  border-radius: var(--el-radius-surface);
  padding: var(--space-4);
  box-shadow: var(--shadow-card);
}
.state-demo-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.state-demo-bar .btn { min-height: 44px; }

.state-panel > .state { display: none; }
.state-panel > .state.is-active { display: block; }

/* loading：骨架屏 */
.state-loading .skeleton-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
}
.skeleton-block {
  background: var(--el-skeleton-bg);
  border-radius: var(--el-radius-control);
  min-height: 16px;
}
.skeleton-block--icon { width: 48px; height: 48px; flex-shrink: 0; border-radius: var(--el-radius-surface); }
.skeleton-block--line { flex: 1 1 auto; height: 16px; }
.skeleton-block--line-short { flex: 0 1 40%; height: 16px; }
.skeleton-block {
  animation: skeleton-pulse var(--duration-slow) var(--ease-standard) infinite alternate;
}
@keyframes skeleton-pulse {
  from { opacity: 1; }
  to { opacity: 0.55; }
}
.state-loading .state-hint {
  margin-top: var(--space-2);
  font-size: var(--font-size-small);
  color: var(--el-text-secondary);
}

/* empty：说明 + 行动 */
.state-empty .state-body,
.state-error .state-body,
.state-success .state-body,
.state-partial .state-body {
  font-size: var(--font-size-body);
  line-height: 1.7;
  color: var(--el-text-secondary);
}
.state-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

/* error：原因 + 重试按钮 + 镜像兜底链接 */
.state-error .state-title { color: var(--el-state-error-text); font-weight: var(--font-weight-semibold); }

/* success：内容 + 操作 */
.state-success .state-title { color: var(--color-state-success); font-weight: var(--font-weight-semibold); }

/* partial：部分可用说明 */
.state-partial .state-title { font-weight: var(--font-weight-semibold); color: var(--el-text-primary); }

.state-title {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--font-size-body);
}

/* SHA-256 校验值展示 */
.sha-line {
  font-size: var(--font-size-small);
  line-height: 1.6;
  color: var(--el-text-secondary);
  overflow-wrap: anywhere;
}
.sha-line code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--font-size-small);
}

/* ---------- 8. 桌面档微调（仅 1280 起步增强，无新断点值） ---------- */
@media (min-width: 1280px) {
  .section { padding-block: var(--space-6); }
}

/* ---------- 9. FAQ 手风琴（phase-4 QA 整改：补齐缺失样式，44px 触控基线） ---------- */
.faq { display: grid; gap: var(--space-2); }
.faq-item {
  background: var(--el-bg-surface-muted);
  border-radius: var(--el-radius-surface);
  padding: 0 var(--space-4);
}
.faq-q { margin: 0; }
.faq-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  min-height: 44px;
  padding: var(--space-2) 0;
  background: none;
  border: none;
  font: inherit;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  color: var(--el-text-primary);
  text-align: left;
  cursor: pointer;
}
.faq-trigger:focus-visible {
  outline: 2px solid var(--el-primary-bg);
  outline-offset: 2px;
  border-radius: var(--el-radius-control);
}
.faq-arrow { flex: none; transition: transform var(--duration-fast) var(--ease-standard); }
.faq-trigger[aria-expanded="true"] .faq-arrow { transform: rotate(180deg); }
.faq-panel { display: none; }
.faq-panel.is-open { display: block; }
.faq-panel-inner {
  padding: 0 0 var(--space-3);
  font-size: var(--font-size-body);
  line-height: 1.7;
  color: var(--el-text-secondary);
}
/* 行内文字链接触控热区扩展（负 margin 抵消，不影响排版） */
.download-notes a,
.faq-panel-inner a,
.state-body a,
.link-plain {
  padding: 14px 2px;
  margin: -14px -2px;
}
