/* ============================================================
   工具箱 · 破碎流星的小窝 — 纸墨风设计
   暖白纸底 + 墨色文字 + 米色纸块卡片（借鉴 MiMo 美学）
   ============================================================ */

/* ========== 1. Design Tokens ========== */
:root {
  --bg: #fcfaf8;
  --bg-soft: #f5f4ef;
  --card: #ffffff;
  --card-muted: #f7f5f1;
  --chip: #f3f0ef;
  --ink: #26251e;
  --ink-soft: #504f49;
  --ink-muted: #8f8b81;
  --line: rgba(38, 37, 30, 0.1);
  --line-strong: rgba(38, 37, 30, 0.24);
  --accent: #d97e1f;
  --accent-deep: #b3620f;
  --accent-wash: rgba(217, 126, 31, 0.09);
  --gold: #8a6d1d;
  --gold-wash: rgba(208, 168, 63, 0.14);
  --success: #16a34a;
  --danger: #c0392b;
  --radius: 10px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(38, 37, 30, 0.08);
  --shadow-md: 0 12px 32px rgba(38, 37, 30, 0.1);
  --font-sans: MiSans, "PingFang SC", -apple-system, "Segoe UI", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "LXGW WenKai Screen", "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, "Times New Roman", serif;
}

/* ========== 2. Reset & Base ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(ellipse 62% 52% at 32% 10%, rgba(217, 126, 31, 0.16) 0%, transparent 62%),
    radial-gradient(ellipse 48% 42% at 72% 88%, rgba(38, 37, 30, 0.08) 0%, transparent 62%),
    radial-gradient(rgba(38, 37, 30, 0.16) 1.5px, transparent 2.5px),
    #f3eee3;
  background-size: auto, auto, 20px 20px, auto;
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Sticky Footer:内容不足时 main 撑满,footer 贴底 */
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 8px 16px;
  background: var(--ink);
  color: #fafafa;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.skip-link:focus { left: 8px; }

/* ========== 3. Layout ========== */
main { position: relative; z-index: 2; flex: 1; }

/* 全局纸色遮罩层：fixed 跟随视口，鼠标移动擦除露出底层背景 */
.fx-mask {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 24px 72px;
  position: relative;
  z-index: 2;
}

.section { padding: 40px 0; }
.padding-top-0 { padding-top: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.text-center { text-align: center; }
.color-text-tertiary { color: var(--ink-muted); }

.mt-md { margin-top: 20px; }
.mt-xl { margin-top: 40px; }
.mb-lg { margin-bottom: 24px; }
.margin-bottom-lg { margin-bottom: 24px; }
.display-none { display: none !important; }
.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;
}

/* ========== 4. 入场动画 ========== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in {
  opacity: 0;
  animation: fadeSlideUp 0.6s ease forwards;
}
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }

/* 仅在 JS 可用时隐藏(reveal 靠 JS 加 .visible);无 JS 时内容始终可见 */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.js .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

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

/* ========== 5. 导航栏 ========== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(252, 250, 248, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  text-decoration: none;
  white-space: nowrap;
}
.nav-logo .logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--ink);
  color: #fafafa;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}
.nav-link {
  position: relative;
  display: inline-block;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 2px;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after,
.nav-link.active::after { transform: scaleX(1); }
.nav-link.active { color: var(--ink); }

.nav-link:focus-visible,
.nav-toggle:focus-visible,
.btn:focus-visible,
.filter-btn:focus-visible,
.sort-btn:focus-visible,
.page-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 10px 16px 16px;
    background: rgba(252, 250, 248, 0.98);
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 12px 14px; }
}

/* ========== 6. 页脚 ========== */
.footer { position: relative; z-index: 2; }
.footer-inner {
  text-align: center;
  padding: 28px 24px;
  font-size: 12px;
  line-height: 1.7;
  border-top: 1px solid var(--line);
  color: rgba(38, 37, 30, 0.5);
}
.footer-inner a {
  color: rgba(38, 37, 30, 0.6);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 0.5px;
  transition: opacity 0.2s;
}
.footer-inner a:hover { opacity: 0.7; }
.footer-brand { margin-bottom: 4px; }
.icp { font-size: 12px; color: rgba(38, 37, 30, 0.5); }
.beian-icon { width: 14px; height: 14px; vertical-align: -2px; }
.disclaimer {
  max-width: 560px;
  margin: 0 auto;
  color: rgba(38, 37, 30, 0.45);
  font-size: 12px;
}

/* ========== 7. 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  color: var(--ink);
  white-space: nowrap;
  transition: transform 0.2s, background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover {
  background: var(--ink);
  color: #fafafa;
  border-color: var(--ink);
  transform: translateY(-1px);
}
.btn-primary {
  background: var(--ink);
  color: #fafafa;
  border-color: var(--ink);
}
.btn-primary:hover {
  background: #3a3933;
  border-color: #3a3933;
}
.btn__arrow {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0;
  margin-left: -14px;
  transition: opacity 200ms ease, margin-left 200ms ease;
}
.btn:hover .btn__arrow,
.btn-primary .btn__arrow {
  opacity: 1;
  margin-left: 2px;
}

/* ========== 8. 首页 Hero ========== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 64px 0 40px;
  text-align: center;
}
/* hero 与入口卡之间的墨色分隔线 */
.hero-divider {
  width: min(480px, 60%);
  margin: 0 auto 48px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--chip);
  border-radius: 999px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 20px;
}
.hero-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(38px, 6.5vw, 56px);
  font-weight: 500;
  letter-spacing: 0.4px;
  line-height: 1.2;
  color: var(--ink);
}
.hero-name .grad {
  font-weight: 600;
  color: var(--accent-deep);
}
.hero-subtitle {
  margin-top: 14px;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.4px;
  color: var(--ink);
}
.hero-signature {
  margin-top: 10px;
  color: var(--ink-muted);
  font-size: 15px;
}
.hero-links {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* ========== 9. 首页入口卡片 ========== */
.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 40px;
}
.entry-card {
  position: relative;
  display: block;
  padding: 36px 32px;
  border-radius: var(--radius);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s, background-color 0.25s;
  animation: cardIn 0.5s ease both;
}
.entry-card.software {
  background: #f5ead6;
}
.entry-card.sites {
  background: #e8ede3;
}
.entry-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.entry-card:hover.software { background: #f7eede; }
.entry-card:hover.sites { background: #edf1e8; }
.entry-card.tutorial-entry { background: #ece7dc; }
.entry-card.contact-entry { background: #e9e7ed; }
.entry-card:hover.tutorial-entry { background: #f1ece3; }
.entry-card:hover.contact-entry { background: #efedf3; }
.tutorial-entry .entry-icon { color: var(--accent-deep); }
.contact-entry .entry-icon { color: #68617f; }
.entry-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: rgba(252, 250, 248, 0.85);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 20px;
}
.entry-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.entry-title .count-badge {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-deep);
  background: var(--accent-wash);
  padding: 2px 12px;
  border-radius: 999px;
}
.entry-card.sites .count-badge {
  color: #556b43;
  background: rgba(85, 107, 67, 0.14);
}
.entry-desc {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 20px;
}
.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.entry-tag {
  font-size: 12px;
  padding: 4px 12px;
  background: rgba(252, 250, 248, 0.75);
  color: var(--ink-soft);
  border-radius: 999px;
}

/* ========== 10. 首页精选区 ========== */
.home-section-title {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.3px;
  margin: 56px 0 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.home-section-title svg { color: var(--accent) !important; }
.home-section-sub {
  color: var(--ink-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

/* 今日精选 换一批按钮 */
.featured-refresh {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.featured-refresh:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-wash);
}
.featured-refresh svg {
  flex-shrink: 0;
}
.featured-refresh.spin-once svg {
  animation: spin 0.6s ease-in-out;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.section-more {
  margin-top: 32px;
  text-align: center;
}

/* ========== 11. 卡片（列表页通用） ========== */
.software-card {
  position: relative;
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s, background-color 0.22s;
  animation: cardIn 0.45s ease both;
}
.software-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.software-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  min-width: 0;
}
.software-name {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.software-card-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.site-card-badges {
  min-width: 0;
  max-width: 50%;
}
.software-platform {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink-soft);
  line-height: 1;
}
.site-domain {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.software-platform .platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.software-stars {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--gold-wash);
  color: var(--gold);
}
.software-desc {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
}
.software-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.tag {
  font-size: 11px;
  padding: 3px 10px;
  background: var(--chip);
  color: var(--ink-soft);
  border-radius: 999px;
  font-weight: 500;
}

/* ========== 12. 列表页头部 ========== */
.detail-header {
  padding: 56px 0 36px;
  text-align: center;
}
.detail-title {
  font-family: var(--font-serif);
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 500;
  letter-spacing: 0.4px;
}
.header-divider {
  width: 44px;
  height: 2px;
  background: var(--ink);
  margin: 18px auto;
  opacity: 0.8;
}
.hero-enname {
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--ink-muted);
  text-transform: uppercase;
  font-family: var(--font-serif);
}
.software-disclaimer {
  max-width: 640px;
  margin: 16px auto 0;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.7;
}
/* 列表页头部内的容器不需要底部大留白（全局 container 底部 72px） */
.detail-header .container { padding-bottom: 0; }
.detail-platform {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 8px;
  flex-wrap: wrap;
}
.detail-platform span {
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink-soft);
}

/* ========== 13. 搜索框 ========== */
.search-wrapper {
  position: relative;
  max-width: 640px;
  margin: 0 auto 24px;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 12px 18px 12px 44px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.search-input::placeholder { color: var(--ink-muted); }
.search-input:focus {
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(38, 37, 30, 0.06);
}
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ========== 14. 筛选折叠区 ========== */
.filter-wrapper {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  max-width: 900px;
  margin: 0 auto 20px;
  transition: padding 0.25s;
}
.filter-wrapper.collapsed { padding: 10px 20px; }
.filter-wrapper.collapsed .filter-bar { display: none; }

.filter-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.filter-wrapper.collapsed .filter-summary-row { margin-bottom: 0; }
.filter-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-summary-tag {
  font-size: 12px;
  padding: 4px 12px;
  background: var(--chip);
  color: var(--ink-soft);
  border-radius: 999px;
}

.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.filter-toggle:hover { color: var(--ink); }
.filter-toggle-icon {
  width: 16px; height: 16px;
  transition: transform 0.25s;
}
.filter-wrapper.collapsed .filter-toggle-icon { transform: rotate(180deg); }

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-bar:last-of-type { margin-bottom: 0; }
.filter-label {
  font-size: 13px;
  color: var(--ink-muted);
  flex-shrink: 0;
}

.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.filter-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.filter-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fafafa;
  font-weight: 500;
}
.filter-count {
  font-size: 11px;
  opacity: 0.7;
  margin-left: 2px;
}

/* ========== 15. 排序栏 ========== */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.sort-btn {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.sort-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.sort-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fafafa;
  font-weight: 500;
}
.sort-arrow { font-size: 10px; margin-left: 2px; }

/* ========== 16. 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-muted);
  font-size: 15px;
}

/* ========== 17. 分页 ========== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 14px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}
.page-btn:hover:not(:disabled) {
  border-color: var(--ink);
  color: var(--ink);
}
.page-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fafafa;
  font-weight: 500;
}
.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.page-ellipsis {
  color: var(--ink-muted);
  min-width: 24px;
  text-align: center;
  font-size: 13px;
}

/* ========== 18. 详情页 ========== */
.detail-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.detail-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--ink);
}
.svg-icon-sm {
  color: var(--ink-soft);
  flex-shrink: 0;
}
.detail-desc {
  font-size: 15px;
  color: var(--ink-soft);
}
.detail-intro {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.9;
}
.detail-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}
.feature-checkmark {
  color: var(--success);
  flex-shrink: 0;
  margin-top: 3px;
}
.detail-tips {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.8;
}
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 链接区 */
.link-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}
.link-item > svg { color: var(--ink-soft); flex-shrink: 0; }
.link-item-name {
  flex: 1;
  min-width: 120px;
  font-size: 14px;
  font-weight: 600;
}
.link-item-actions {
  display: flex;
  gap: 8px;
}
.link-item-actions .btn { height: 36px; padding: 0 18px; font-size: 13px; }

/* ========== 19. Toast ========== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: var(--ink);
  color: #fafafa;
  border-radius: 999px;
  padding: 11px 24px;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  z-index: 100;
}

/* ========== 20. 回到顶部 ========== */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s, color 0.2s, border-color 0.2s;
  z-index: 90;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ========== 21. 响应式 ========== */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
}

@media (max-width: 768px) {
  .section { padding: 28px 0; }
  .hero { padding: 56px 0 36px; }
  .hero-subtitle { font-size: 16px; }
  .entry-grid { grid-template-columns: 1fr; }
  .home-section-title { margin-top: 48px; }
  .detail-section { padding: 22px 20px; }
  .link-item { flex-direction: column; align-items: flex-start; }
  .link-item-actions { width: 100%; }
  .link-item-actions .btn { flex: 1; }
}

/* ========== 22. 减少动画 ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ========== 23. 目录与详情页第二版布局 ========== */
.filter-result-count {
  color: var(--ink-muted);
  font-size: 12px;
  white-space: nowrap;
}

.filter-bar > [role="group"],
.filter-bar > #category-filter,
.filter-bar > #sites-category-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.filter-wrapper {
  box-shadow: 0 5px 18px rgba(38, 37, 30, 0.045);
}

.filter-toggle-summary {
  color: var(--accent-deep);
  background: var(--accent-wash);
}

.filter-toggle-summary:hover {
  color: var(--accent-deep);
  background: rgba(217, 126, 31, 0.15);
}

body[data-page="software"] .detail-header,
body[data-page="sites"] .detail-header {
  padding: 38px 0 24px;
}

body[data-page="software"] .detail-header .hero-signature,
body[data-page="sites"] .detail-header .hero-signature {
  margin-top: 7px;
}

body[data-page="software"] .search-wrapper,
body[data-page="sites"] .search-wrapper {
  max-width: 760px;
  margin-bottom: 16px;
}

body[data-page="software"] .filter-wrapper,
body[data-page="sites"] .filter-wrapper {
  max-width: 100%;
  margin-bottom: 16px;
}

body[data-page="software"] .sort-bar,
body[data-page="sites"] .sort-bar {
  justify-content: space-between;
  margin-top: 0;
  margin-bottom: 20px;
  padding-inline: 2px;
}

body[data-page="software"] .grid,
body[data-page="sites"] .grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

body[data-page="software"] .software-card,
body[data-page="sites"] .software-card {
  min-height: 214px;
  min-width: 0;
  padding: 21px;
  display: flex;
  flex-direction: column;
}

body[data-page="software"] .software-name,
body[data-page="sites"] .software-name {
  font-size: 18px;
}

body[data-page="software"] .software-desc,
body[data-page="sites"] .software-desc {
  min-height: 0;
  margin-bottom: 12px;
}

.software-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--ink-muted);
  font-size: 11px;
  line-height: 1.4;
}

.software-card-meta span + span::before {
  content: "·";
  margin-right: 8px;
  color: var(--line-strong);
}

.software-card-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  margin-top: auto;
  padding-top: 14px;
}

.software-card-footer .software-tags {
  flex: 1;
  min-width: 0;
}

.software-card-arrow {
  flex: 0 0 auto;
  color: var(--accent-deep);
  font-size: 18px;
  line-height: 1;
  transition: transform 0.2s ease, color 0.2s ease;
}

.software-card:hover .software-card-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

body[data-page="sites"] .site-card .software-card-arrow {
  color: #5b7249;
}

body[data-page="detail"] .detail-header,
body[data-page="site-detail"] .detail-header {
  padding: 32px 0 22px;
}

.detail-back-link {
  margin-bottom: 16px;
}

.detail-kicker {
  margin-bottom: 8px;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.detail-primary-action {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.detail-primary-action .btn {
  height: 38px;
  padding-inline: 18px;
  font-size: 13px;
}

body[data-page="detail"] .detail-section,
body[data-page="site-detail"] .detail-section {
  max-width: 860px;
  margin-inline: auto;
  padding: 24px 28px;
}

body[data-page="detail"] .detail-desc,
body[data-page="site-detail"] .detail-desc {
  text-align: left;
}

@media (max-width: 1024px) {
  body[data-page="software"] .grid,
  body[data-page="sites"] .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  body[data-page="software"] .detail-header,
  body[data-page="sites"] .detail-header {
    padding: 32px 0 20px;
  }

  body[data-page="software"] .detail-header .container,
  body[data-page="sites"] .detail-header .container {
    padding-bottom: 0;
  }

  body[data-page="software"] .filter-wrapper,
  body[data-page="sites"] .filter-wrapper {
    padding: 12px 14px;
  }

  body[data-page="software"] .filter-wrapper.collapsed,
  body[data-page="sites"] .filter-wrapper.collapsed {
    padding: 9px 14px;
  }

  body[data-page="software"] .filter-summary-row,
  body[data-page="sites"] .filter-summary-row {
    min-height: 30px;
    margin-bottom: 10px;
  }

  body[data-page="software"] .filter-wrapper.collapsed .filter-summary-row,
  body[data-page="sites"] .filter-wrapper.collapsed .filter-summary-row {
    margin-bottom: 0;
  }

  body[data-page="software"] .filter-bar,
  body[data-page="sites"] .filter-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  body[data-page="software"] .sort-bar,
  body[data-page="sites"] .sort-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
  }

  body[data-page="software"] .grid,
  body[data-page="sites"] .grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

body[data-page="software"] .software-card,
body[data-page="sites"] .software-card {
    min-height: 0;
    min-width: 0;
    padding: 18px;
  }

  body[data-page="detail"] .detail-header,
  body[data-page="site-detail"] .detail-header {
    padding: 28px 0 18px;
  }

  body[data-page="detail"] .detail-section,
  body[data-page="site-detail"] .detail-section {
    padding: 20px 18px;
  }

  .detail-primary-action {
    margin-top: 14px;
  }
}

@media (max-width: 420px) {
  .filter-summary-row {
    gap: 8px;
  }

  .filter-summary {
    min-width: 0;
  }

  .filter-summary-text {
    min-width: 0;
  }

  .filter-result-count {
    font-size: 11px;
  }

  .filter-toggle-summary {
    padding-inline: 4px;
    font-size: 11px;
  }
}
