/* ==========================================================================
   AIYUN 软件资源库 - 全站样式
   说明：单文件样式表，包含变量、布局骨架、组件、响应式与动效。
   约定：类名使用中划线小写，状态类统一 is- 前缀。
   ========================================================================== */

/* ---------- 1. 变量 ---------- */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --primary: #2f6bff;
  --primary-hover: #1f56e0;
  --primary-soft: rgba(47, 107, 255, 0.12);
  --text: #1f2733;
  --muted: #6b7686;
  --line: #e8ecf2;
  --line-strong: #dfe5ee;
  --header-1: #141821;
  --header-2: #1e2536;
  --radius-lg: 16px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-hover: 0 10px 24px rgba(15, 23, 42, 0.10);
  --shadow-panel: 0 12px 32px rgba(15, 23, 42, 0.12);
  --maxw: 1400px;
  --header-height: 64px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---------- 2. 重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, p, ul, ol, figure {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

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

a:hover {
  color: var(--primary-hover);
}

button {
  font-family: inherit;
  cursor: pointer;
}

input {
  font-family: inherit;
}

svg {
  display: block;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #eef1f6;
}

::-webkit-scrollbar-thumb {
  background: #c3ccda;
  border-radius: 6px;
  border: 2px solid #eef1f6;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8b4c6;
}

/* ---------- 3. 布局容器 ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.page {
  padding: 22px 0 10px;
}

.noscript-tip {
  background: #fff4e5;
  color: #8a5300;
  padding: 12px 20px;
  font-size: 13px;
  text-align: center;
  border-bottom: 1px solid #f6dfbf;
}

/* ---------- 4. 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: linear-gradient(135deg, var(--header-1), var(--header-2));
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--header-height);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1;
  background: linear-gradient(138deg, #ffffff, #c8d2e6, #8894ae);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.brand-divider {
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.18);
}

.brand-sub {
  font-size: 12px;
  color: #9aa6bd;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.main-nav a {
  position: relative;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #c9d3e6;
  transition: background-color 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.main-nav a.is-active {
  color: #ffffff;
}

.main-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--primary);
}

.nav-toggle {
  display: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: #e6ecf7;
  align-items: center;
  justify-content: center;
}

.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* 搜索行 */
.search-row {
  padding: 0 20px 14px;
}

.search-inner {
  position: relative;
  display: flex;
  max-width: var(--maxw);
  margin: 0 auto;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  height: 44px;
  padding: 0 6px 0 14px;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.10);
  transition: box-shadow 0.2s ease;
}

.search-box.is-focus {
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.15);
}

.search-icon {
  flex: 0 0 auto;
  color: #9aa6bd;
}

.search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text);
}

.search-input::placeholder {
  color: #a9b3c2;
}

.search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-clear {
  flex: 0 0 auto;
  display: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #eef1f6;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

.search-clear.is-show {
  display: flex;
}

.search-clear:hover {
  background: #e2e7f0;
  color: var(--text);
}

.btn-search {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 18px;
  border: 0;
  border-radius: 17px;
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.18s ease;
}

.btn-search:hover {
  background: var(--primary-hover);
}

/* 搜索建议面板 */
.suggest-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 90;
  padding: 8px;
  background: #ffffff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
  max-height: 420px;
  overflow-y: auto;
}

.suggest-panel[hidden] {
  display: none;
}

.sg-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
}

.sg-item:hover,
.sg-item.is-active {
  background: #f2f6ff;
}

.sg-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background-color: var(--icon-color, var(--primary));
  background-image: linear-gradient(140deg, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.22));
}

.sg-main {
  min-width: 0;
  flex: 1 1 auto;
}

.sg-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sg-name mark,
.card-name mark,
.search-title mark {
  background: rgba(47, 107, 255, 0.16);
  color: var(--primary);
  border-radius: 3px;
  padding: 0 1px;
}

.sg-cat {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.sg-empty {
  padding: 18px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.sg-tip {
  padding: 6px 10px 2px;
  font-size: 11px;
  color: #9aa6bd;
}

/* ---------- 5. 提示条 / 面板 ---------- */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  color: #7a6320;
  background: #fffaf0;
  border: 1px solid #f6e7c8;
  border-radius: 10px;
}

.notice-bar .notice-dot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #e8a33d;
}

.panel {
  padding: 4px 0 8px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.panel-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.panel-desc {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 6. 分类胶囊 Tab ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
}

.tab {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: #ffffff;
  color: #4a5568;
  font-size: 13px;
  transition: all 0.18s ease;
}

.tab:hover {
  border-color: #c3d2f5;
  color: var(--primary);
}

.tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(47, 107, 255, 0.28);
}

/* ---------- 7. 资源网格与卡片 ---------- */
.grid-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.grid-meta strong {
  color: var(--text);
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.grid.is-fade {
  animation: gridFade 0.28s ease both;
}

@keyframes gridFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  text-align: center;
  animation: cardIn 0.28s ease both;
  animation-delay: var(--delay, 0ms);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(47, 107, 255, 0.2);
  color: var(--text);
}

.card-icon {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  color: #ffffff;
  letter-spacing: 0.5px;
  background-color: var(--icon-color, var(--primary));
  background-image: linear-gradient(140deg, rgba(255, 255, 255, 0.26), rgba(0, 0, 0, 0.24));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.card-icon.is-long {
  font-size: 14px;
}

.card-icon.is-cn {
  font-size: 17px;
}

.card-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.card-sub {
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 空态 */
.empty-state {
  padding: 46px 20px;
  text-align: center;
  background: #ffffff;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--muted);
}

.empty-state .empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.empty-state .empty-desc {
  font-size: 12px;
  margin-bottom: 16px;
}

.empty-state .empty-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* 加载更多 */
.load-more-wrap {
  display: flex;
  justify-content: center;
  padding: 22px 0 6px;
}

.btn-outline {
  height: 38px;
  padding: 0 26px;
  border: 1px solid var(--line-strong);
  border-radius: 19px;
  background: #ffffff;
  color: #4a5568;
  font-size: 13px;
  transition: all 0.18s ease;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f7faff;
}

/* ---------- 8. 列表页头部 ---------- */
.list-head {
  padding: 18px 20px;
  margin-bottom: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.list-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.list-desc {
  font-size: 12px;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chip {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #ffffff;
  color: #54617a;
  font-size: 12px;
  transition: all 0.18s ease;
}

.chip:hover {
  border-color: #c3d2f5;
  color: var(--primary);
}

.chip.is-active {
  background: var(--primary-soft);
  border-color: rgba(47, 107, 255, 0.35);
  color: var(--primary);
  font-weight: 600;
}

/* ---------- 9. 详情页 ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 0 14px;
  font-size: 12px;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .crumb-sep {
  color: #c3ccda;
}

.breadcrumb .crumb-current {
  color: var(--text);
  font-weight: 600;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}

.detail-main {
  min-width: 0;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.detail-icon {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  background-color: var(--icon-color, var(--primary));
  background-image: linear-gradient(140deg, rgba(255, 255, 255, 0.26), rgba(0, 0, 0, 0.24));
}

.detail-head > div {
  min-width: 0;
}

.detail-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 6px;
  word-break: break-word;
}

.detail-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 10px;
}

.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 10px;
  border-radius: 12px;
  background: #f4f6f9;
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.badge b {
  color: var(--text);
  font-weight: 600;
}

.badge.is-primary {
  background: var(--primary-soft);
  border-color: rgba(47, 107, 255, 0.22);
  color: var(--primary);
}

.article {
  padding: 22px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}

.article-body {
  font-size: 15px;
  line-height: 1.85;
  color: #2b3444;
}

.article-body p {
  margin: 0 0 1em;
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body h2 {
  position: relative;
  margin: 26px 0 12px;
  padding-left: 12px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}

.article-body h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: var(--primary);
}

.article-body h2:first-child {
  margin-top: 0;
}

.feature-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.feature-item {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfd;
}

.feature-item .f-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.feature-item .f-desc {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.bullet-list {
  display: grid;
  gap: 6px;
}

.bullet-list li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  line-height: 1.8;
  color: #2b3444;
}

.bullet-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.req-list {
  display: grid;
  gap: 8px;
}

.req-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 14px;
  line-height: 1.7;
}

.req-row .req-key {
  flex: 0 0 72px;
  color: var(--muted);
  font-size: 13px;
}

.req-row .req-val {
  flex: 1 1 auto;
  color: #2b3444;
}

.step-list {
  counter-reset: step;
  display: grid;
  gap: 8px;
}

.step-list li {
  position: relative;
  padding-left: 30px;
  font-size: 14px;
  line-height: 1.75;
  color: #2b3444;
  counter-increment: step;
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

/* 下载卡片 */
.download-card {
  padding: 20px 22px;
  background: linear-gradient(180deg, #f2f7ff, #eaf2ff);
  border: 1px solid rgba(47, 107, 255, 0.35);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  scroll-margin-top: 148px; /* 粘性顶栏高度补偿，锚点定位时不被遮挡 */
}

.download-card .dl-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.download-card .dl-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}

.dl-list {
  display: grid;
  gap: 10px;
}

.dl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid rgba(47, 107, 255, 0.16);
  border-radius: 12px;
}

.dl-row .dl-label {
  flex: 1 1 200px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.dl-row .dl-note {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

.dl-row .dl-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 17px;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.18s ease;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(47, 107, 255, 0.24);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: #ffffff;
}

.btn-ghost {
  background: #ffffff;
  border-color: rgba(47, 107, 255, 0.4);
  color: var(--primary);
}

.btn-ghost:hover {
  background: #f2f7ff;
  color: var(--primary-hover);
}

.code-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px 0 10px;
  border: 1px dashed rgba(47, 107, 255, 0.45);
  border-radius: 8px;
  background: #ffffff;
}

.code-pill .code-label {
  font-size: 11px;
  color: var(--muted);
}

.code-pill .code-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--primary);
}

.copy-btn {
  height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
}

.copy-btn:hover {
  background: rgba(47, 107, 255, 0.2);
}

/* 上一篇 / 下一篇 */
.page-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.page-nav a,
.page-nav span {
  display: block;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.page-nav a:hover {
  border-color: rgba(47, 107, 255, 0.3);
  box-shadow: var(--shadow-sm);
  color: var(--muted);
}

.page-nav .pn-label {
  display: block;
  font-size: 11px;
  color: #9aa6bd;
  margin-bottom: 2px;
}

.page-nav .pn-name {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-nav .is-empty {
  opacity: 0.55;
}

/* 免责声明 */
.disclaimer {
  padding: 14px 16px;
  background: #fafbfd;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.9;
  color: #8a94a6;
}

.disclaimer p {
  margin: 0;
}

/* 侧栏 */
/* 右栏承载「远程协助安装」卡片 +「热门排行 TOP 10」两张卡片。
   默认自然流动（高度自适应内容、不产生内部滚动条）；
   仅当内容装得下视口时由 JS 打上 .is-stuck 才吸附跟随（见 app.js initStickyAside）。 */
.detail-side {
  display: grid;
  gap: 16px;
  align-content: start;
  align-self: start;
}

@media (min-width: 993px) {
  .detail-side.is-stuck {
    position: sticky;
    top: calc(var(--header-height) + 16px);
  }
}

.side-card {
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.side-title .side-more {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

/* 侧栏卡片标题下的小字说明（如「Windows软件 · CAD制图 · 按热度排序」） */
.side-sub {
  margin: -6px 0 8px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

.rec-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 6px;
  border-radius: 10px;
  color: var(--text);
}

.rec-item:hover {
  background: #f6f9ff;
  color: var(--text);
}

.rec-item .rec-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  background-color: var(--icon-color, var(--primary));
  background-image: linear-gradient(140deg, rgba(255, 255, 255, 0.26), rgba(0, 0, 0, 0.24));
}

.rec-item .rec-main {
  min-width: 0;
}

.rec-item .rec-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rec-item .rec-sub {
  display: block;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  color: var(--text);
  min-width: 0;
}

.rank-item:hover {
  color: var(--primary);
}

.rank-no {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #eef1f6;
  color: #8a94a6;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.rank-no.top-1 {
  background: var(--primary);
  color: #ffffff;
}

.rank-no.top-2 {
  background: #ff8a3d;
  color: #ffffff;
}

.rank-no.top-3 {
  background: #9aa6bd;
  color: #ffffff;
}

.rank-name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-views {
  flex: 0 0 auto;
  font-size: 11px;
  color: #9aa6bd;
}

/* 搜索结果标题 */
.search-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
  word-break: break-word;
}

/* ---------- 10. 页脚 ---------- */
.site-footer {
  margin-top: 40px;
  background: #ffffff;
  border-top: 1px solid var(--line);
}

.footer-cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
  padding: 34px 0 26px;
}

.footer-brand-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.footer-desc {
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
  max-width: 420px;
}

.footer-col-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.footer-links {
  display: grid;
  gap: 7px;
}

.footer-links a {
  font-size: 12px;
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-friend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.footer-friend a {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.footer-friend a:hover {
  color: var(--primary);
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 14px 0 18px;
  font-size: 12px;
  color: #9aa6bd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- 11. 返回顶部 / Toast ---------- */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 26px;
  z-index: 70;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #ffffff;
  color: var(--muted);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.22s ease;
}

.to-top.is-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  color: var(--primary);
  border-color: rgba(47, 107, 255, 0.4);
}

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 40px;
  z-index: 120;
  max-width: min(88vw, 420px);
  padding: 10px 18px;
  border-radius: 22px;
  background: rgba(20, 24, 33, 0.92);
  color: #ffffff;
  font-size: 13px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.24);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 12px);
  transition: all 0.24s ease;
  pointer-events: none;
}

.toast-host.is-show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* ---------- 12. 404 ---------- */
.error-page {
  padding: 60px 20px 70px;
  text-align: center;
}

.error-code {
  font-size: 76px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 2px;
  background: linear-gradient(138deg, #2f6bff, #7aa2ff, #c8d2e6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.error-title {
  margin: 14px 0 8px;
  font-size: 18px;
  font-weight: 700;
}

.error-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 22px;
}

.error-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.error-hot {
  margin-top: 34px;
  text-align: left;
}

.error-hot .panel-title {
  text-align: left;
}

/* ---------- 12.5 分类页两栏布局 ---------- */
.list-layout {
  display: block;
}

.list-main {
  min-width: 0;
}

.list-aside {
  margin-top: 20px;
}

/* ---------- 12.6 远程协助卡片 ---------- */
.assist-card {
  padding: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
  border: 1px solid #d9e4ff;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 28px rgba(47, 107, 255, 0.10);
}

.assist-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.assist-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(140deg, #5b8cff, #2f6bff);
  box-shadow: 0 6px 14px rgba(47, 107, 255, 0.28);
}

.assist-head-text {
  min-width: 0;
}

.assist-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.assist-desc {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}

.assist-points {
  list-style: none;
  margin: 14px 0 16px;
  display: grid;
  gap: 8px;
}

.assist-points li {
  position: relative;
  padding-left: 16px;
  font-size: 12px;
  line-height: 1.6;
  color: #4a5568;
}

.assist-points li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.65;
}

.assist-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 12px;
}

.assist-price .p-now {
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
}

.assist-price .p-now em {
  font-size: 13px;
  font-style: normal;
  margin-right: 1px;
}

.assist-price .p-origin {
  font-size: 12px;
  color: #9aa4b6;
  text-decoration: line-through;
}

.assist-price .p-unit {
  font-size: 12px;
  color: var(--muted);
}

.assist-btn {
  display: block;
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #3f7bff, #2f6bff);
  box-shadow: 0 8px 18px rgba(47, 107, 255, 0.28);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.assist-btn:hover {
  background: linear-gradient(135deg, #2f6bff, var(--primary-hover));
  box-shadow: 0 10px 22px rgba(47, 107, 255, 0.34);
  transform: translateY(-1px);
}

.assist-btn:active {
  transform: translateY(0);
}

.assist-foot {
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.6;
  color: #8a94a6;
  text-align: center;
}

/* ---------- 12.7 弹窗 ---------- */
body.is-modal-open {
  overflow: hidden;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: maskIn 0.2s ease both;
}

.modal-mask[hidden] {
  display: none;
}

@keyframes maskIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  position: relative;
  width: min(430px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 22px 22px 18px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
  animation: modalIn 0.24s ease both;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #8a94a6;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.modal-close:hover {
  background: #f2f5fa;
  color: var(--text);
}

.modal-head {
  padding-right: 28px;
}

.modal-kicker {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
}

.modal-title {
  margin: 8px 0 4px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.modal-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.modal-body {
  margin-top: 16px;
}

.pay-panel {
  padding: 14px;
  background: #f7faff;
  border: 1px solid #e2ecff;
  border-radius: 14px;
  text-align: center;
}

.pay-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.pay-now {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
}

.pay-now em {
  font-size: 14px;
  font-style: normal;
  margin-right: 1px;
}

.pay-origin {
  font-size: 12px;
  color: #9aa4b6;
  text-decoration: line-through;
}

.qr-box {
  width: 172px;
  height: 172px;
  margin: 0 auto;
  padding: 8px;
  background: #ffffff;
  border: 1px solid #e2ecff;
  border-radius: 12px;
}

.qr-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pay-tip {
  margin-top: 10px;
  font-size: 12px;
  color: #5b6678;
}

.assist-unlock {
  margin-top: 12px;
}

.modal-btn {
  display: block;
  width: 100%;
  height: 42px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 12px;
}

.unlock-note {
  margin-top: 8px;
  font-size: 11px;
  color: #8a94a6;
  text-align: center;
}

/* 支付结果回传中：按钮加载态 */
.modal-btn[disabled] {
  opacity: 0.85;
  cursor: wait;
}

.pay-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 7px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: pay-spin 0.8s linear infinite;
}

@keyframes pay-spin {
  to {
    transform: rotate(360deg);
  }
}

/* 支付成功回执 */
.pay-success {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(16, 185, 105, 0.35);
  border-radius: 12px;
  background: rgba(16, 185, 105, 0.1);
  text-align: left;
}

.ps-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #10b969;
  color: #ffffff;
}

.ps-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ps-text strong {
  font-size: 13px;
  color: #0f8a4a;
}

.ps-sub {
  font-size: 11px;
  color: #5b6678;
}

@media (prefers-reduced-motion: reduce) {
  .pay-spinner {
    animation-duration: 2.4s;
  }
}

.assist-wechat {
  margin-top: 12px;
  padding: 14px;
  border: 1px dashed rgba(47, 107, 255, 0.35);
  border-radius: 14px;
  background: #f2f7ff;
  text-align: center;
}

.wechat-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #3b4960;
}

.wechat-badge {
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  color: #0f8a4a;
  background: rgba(16, 185, 105, 0.14);
}

.wechat-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.wechat-id {
  padding: 7px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #d9e4ff;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--text);
  user-select: all;
}

.btn-mini {
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 9px;
}

.wechat-qr {
  display: block;
  width: 120px;
  height: 120px;
  margin: 12px auto 0;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2ecff;
  object-fit: contain;
}

.wechat-tip {
  margin-top: 8px;
  font-size: 11px;
  line-height: 1.7;
  color: #6b7686;
}

.modal-points {
  list-style: none;
  margin: 16px 0 0;
  display: grid;
  gap: 7px;
}

.modal-points li {
  position: relative;
  padding-left: 20px;
  font-size: 12px;
  line-height: 1.6;
  color: #4a5568;
}

.modal-points li::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--primary);
  opacity: 0.5;
  transform: rotate(45deg);
}

.modal-note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.8;
  color: #8a94a6;
}

/* ---------- 13. 响应式 ---------- */
@media (min-width: 1200px) {
  .list-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 22px;
    align-items: start;
  }

  .list-aside {
    margin-top: 0;
  }

  /* 与详情页一致：内容装得下视口时才由 JS 打上 .is-stuck 吸附 */
  .list-aside.is-stuck {
    position: sticky;
    top: calc(var(--header-height) + 16px);
  }

  .list-layout .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

@media (max-width: 1400px) {
  .grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .detail-grid {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

@media (max-width: 992px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-cols {
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 768px) {
  .header-inner {
    gap: 10px;
    padding: 0 14px;
  }

  .brand-logo {
    font-size: 19px;
  }

  .brand-sub {
    display: none;
  }

  .brand-divider {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    margin: 0;
    padding: 8px 12px 14px;
    background: linear-gradient(180deg, #1b2231, #171d29);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.28);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  body.nav-open .main-nav {
    display: flex;
  }

  .main-nav a {
    padding: 11px 12px;
    font-size: 14px;
    border-radius: 10px;
  }

  .main-nav a.is-active {
    background: rgba(47, 107, 255, 0.16);
  }

  .main-nav a.is-active::after {
    display: none;
  }

  .search-row {
    padding: 0 14px 12px;
  }

  .container {
    padding: 0 14px;
  }

  .page {
    padding-top: 16px;
  }

  .btn-search {
    padding: 0 14px;
  }

  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }

  .card {
    padding: 14px 8px 12px;
  }

  .card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 16px;
  }

  .card-name {
    font-size: 11px;
  }

  .detail-head {
    padding: 16px;
  }

  .detail-title {
    font-size: 18px;
  }

  .article {
    padding: 16px;
  }

  .article-body {
    font-size: 14.5px;
  }

  .detail-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding: 26px 0 20px;
  }

  .footer-bottom {
    justify-content: center;
    text-align: center;
  }

  .to-top {
    right: 14px;
    bottom: 16px;
  }
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    font-size: 17px;
  }

  .dl-row {
    align-items: flex-start;
  }
}

/* ---------- 14. 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
