/* ============================================================
   有用吧 · YYB.AI —— 设计系统
   主题：暗夜灯塔 —— 深色星海 + 暖色灯塔光束
   ============================================================ */

/* ---------- 设计变量 ---------- */
:root {
  /* 深色主题（默认） */
  --bg: #05070d;
  --bg-soft: #090c14;
  --surface: rgba(17, 21, 32, 0.72);
  --surface-solid: #10141f;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #eef1f7;
  --text-2: #a8b0c2;
  --text-3: #6b7288;
  --accent: #ffb14d;            /* 灯塔光束 */
  --accent-2: #ff8a4c;          /* 光束渐变色 */
  --accent-soft: rgba(255, 177, 77, 0.12);
  --accent-glow: rgba(255, 177, 77, 0.35);
  --link: #5b8cff;
  --danger: #ff5b7f;
  --green: #38d39f;
  --header-h: 64px;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.55);
  --font-display: "Space Grotesk", "Inter", ui-sans-serif, system-ui,
    -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 浅色主题 */
html[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-soft: #eef1f7;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-solid: #ffffff;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #10151f;
  --text-2: #4a5468;
  --text-3: #8a93a8;
  --accent: #e8890c;
  --accent-2: #f05e2e;
  --accent-soft: rgba(232, 137, 12, 0.1);
  --accent-glow: rgba(232, 137, 12, 0.25);
  --shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.12);
}

/* ---------- 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
}

/* 星海背景：固定的多层径向渐变 + 噪点 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(91, 140, 255, 0.10), transparent 60%),
    radial-gradient(1000px 500px at -10% 20%, rgba(124, 108, 255, 0.10), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(255, 138, 76, 0.06), transparent 60%),
    var(--bg);
  transition: background var(--transition);
}
html[data-theme="light"] body::before {
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(91, 140, 255, 0.12), transparent 60%),
    radial-gradient(1000px 500px at -10% 20%, rgba(124, 108, 255, 0.08), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(255, 138, 76, 0.08), transparent 60%),
    var(--bg);
}

::selection { background: var(--accent-soft); color: var(--accent); }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }

img, svg { display: block; }

.container {
  width: min(1200px, calc(100% - 40px));
  margin-inline: auto;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 顶部导航 ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.2px;
}
.logo-mark {
  width: 34px;
  height: 34px;
  flex: none;
  filter: drop-shadow(0 0 10px var(--accent-glow));
}
.logo .domain { color: var(--text-3); font-weight: 500; font-size: 14px; }
.logo .cn { color: var(--accent); font-weight: 700; }

.nav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}
.nav a {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
  transition: color var(--transition), background var(--transition);
}
.nav a:hover { color: var(--text); background: var(--accent-soft); }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: all var(--transition);
  font-size: 16px;
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.kbd-hint {
  font-size: 11px;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  background: var(--surface);
  white-space: nowrap;
}

/* ---------- 英雄区 ---------- */
.hero {
  position: relative;
  padding: 96px 0 56px;
  text-align: center;
  overflow: hidden;
}
/* 灯塔旋转光束 */
.beacon {
  position: absolute;
  top: -320px;
  left: 50%;
  transform: translateX(-50%);
  width: 1300px;
  height: 1300px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.5;
  animation: beacon-sweep 14s linear infinite;
}
html[data-theme="light"] .beacon { opacity: 0.28; }
.beacon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    transparent 300deg,
    var(--accent-glow) 348deg,
    rgba(255, 200, 120, 0.5) 355deg,
    transparent 360deg
  );
  -webkit-mask: radial-gradient(closest-side, black 30%, transparent 72%);
  mask: radial-gradient(closest-side, black 30%, transparent 72%);
}
@keyframes beacon-sweep { to { transform: translateX(-50%) rotate(360deg); } }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 24px;
  backdrop-filter: blur(8px);
}
.hero-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.4; } }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 55%, #ffd28f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .subtitle {
  margin-top: 18px;
  font-size: clamp(16px, 2.4vw, 20px);
  color: var(--text-2);
}
.hero .subtitle em {
  font-style: normal;
  color: var(--text);
  position: relative;
}
.hero .subtitle em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 6px;
  background: var(--accent-soft);
  border-radius: 4px;
  z-index: -1;
}

/* 搜索框 */
.search-wrap {
  margin: 36px auto 0;
  max-width: 620px;
  position: relative;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 20px;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-lg);
}
.search-box .icon { color: var(--text-3); font-size: 18px; }
.search-box input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 16px;
  min-width: 0;
}
.search-box input::placeholder { color: var(--text-3); }
.search-btn {
  padding: 10px 20px;
  border-radius: 12px;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  color: #1a1206;
  font-weight: 700;
  font-size: 14px;
  transition: filter var(--transition), transform var(--transition);
}
.search-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.search-btn:active { transform: translateY(0); }

/* 热门搜索词 */
.hot-tags {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
}
.hot-tags .label { margin-right: 2px; }
.hot-tags button {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  color: var(--text-2);
  font-size: 13px;
  transition: all var(--transition);
}
.hot-tags button:hover {
  border-color: var(--accent);
  color: var(--accent);
  border-style: solid;
}

/* 统计 */
.stats {
  margin-top: 44px;
  display: flex;
  justify-content: center;
  gap: clamp(28px, 6vw, 64px);
}
.stat { text-align: center; }
.stat .num {
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  background: linear-gradient(100deg, var(--text), var(--text-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat .num em { font-style: normal; }
.stat .label { font-size: 13px; color: var(--text-3); margin-top: 2px; }

/* ---------- 通用区块 ---------- */
.section { padding: 56px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.3px;
}
.section-title .ico { margin-right: 8px; }
.section-desc { color: var(--text-2); font-size: 14px; margin-top: 6px; }
.section-link {
  flex: none;
  font-size: 14px;
  color: var(--link);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.section-link:hover { text-decoration: underline; }

/* ---------- 专题 ---------- */
.collections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.collection {
  position: relative;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}
.collection::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, var(--accent-soft), transparent 55%);
  opacity: 0;
  transition: opacity var(--transition);
}
.collection:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}
.collection:hover::before { opacity: 1; }
.collection .c-icon { font-size: 26px; }
.collection h3 { font-size: 16px; margin-top: 10px; font-family: var(--font-display); }
.collection p { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.collection .c-count {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ---------- 工具区 ---------- */
.toolbar {
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  margin: 0 0 22px;
  padding: 12px 0;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}
.toolbar-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cat-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 200px;
}
.cat-pill {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text-2);
  border: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cat-pill:hover { color: var(--text); border-color: var(--border-strong); }
.cat-pill.active {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  color: #1a1206;
  border-color: transparent;
  font-weight: 600;
}
.toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.filter-chip:hover { color: var(--text); border-color: var(--border-strong); }
.filter-chip.on {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
select.sort-select {
  appearance: none;
  padding: 8px 34px 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238a93a8' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 14px center;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--transition);
}
select.sort-select:hover { border-color: var(--border-strong); color: var(--text); }

.result-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-3);
  flex-wrap: wrap;
}
.result-meta .count { color: var(--text-2); }
.result-meta .count b { color: var(--accent); font-weight: 700; }
.result-meta .clear-btn {
  color: var(--link);
  font-size: 13px;
}
.result-meta .clear-btn:hover { text-decoration: underline; }

/* 工具网格 */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 14px;
}
.tool-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--transition);
  animation: card-in 0.4s ease both;
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  background: var(--surface-solid);
}
html[data-theme="light"] .tool-card:hover { box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1); }

.tool-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.tool-icon {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 23px;
  border-radius: 13px;
  background: var(--icon-bg, var(--accent-soft));
  border: 1px solid var(--border);
}
.fav-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--text-3);
  transition: all var(--transition);
  opacity: 0.4;
}
.tool-card:hover .fav-btn, .fav-btn.on { opacity: 1; }
.fav-btn:hover { background: var(--accent-soft); color: var(--accent); }
.fav-btn.on { color: var(--accent); opacity: 1; }
.fav-btn.on .heart { animation: heart-pop 0.35s ease; }
@keyframes heart-pop { 40% { transform: scale(1.35); } }

.tool-card h3 {
  margin-top: 12px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tool-card .desc {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
}
.tool-card .tags {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-size: 11.5px;
  padding: 2.5px 9px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-3);
}
.tool-card .foot {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tool-card .cat-label {
  font-size: 12px;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.visit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  color: var(--text);
  transition: all var(--transition);
}
.visit-btn:hover {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: #1a1206;
}

/* 徽标 */
.badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  line-height: 1.5;
}
.badge.hot { background: rgba(255, 91, 127, 0.14); color: #ff6b92; border: 1px solid rgba(255, 91, 127, 0.3); }
.badge.new { background: rgba(56, 211, 159, 0.13); color: var(--green); border: 1px solid rgba(56, 211, 159, 0.3); }
.badge.free { background: rgba(91, 140, 255, 0.13); color: #7da4ff; border: 1px solid rgba(91, 140, 255, 0.3); }
.badge.cn { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(255, 177, 77, 0.35); }
.badge.region { background: var(--bg-soft); color: var(--text-3); border: 1px solid var(--border); }

/* 空状态 */
.empty {
  text-align: center;
  padding: 72px 20px;
  color: var(--text-3);
}
.empty .big { font-size: 44px; margin-bottom: 12px; }
.empty h3 { color: var(--text-2); font-size: 17px; }
.empty p { font-size: 14px; margin-top: 6px; }

/* ---------- 快讯 ---------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.news-card {
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.news-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}
.news-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.news-meta .tag {
  color: var(--accent);
  border-color: rgba(255, 177, 77, 0.35);
  background: var(--accent-soft);
}
.news-card h3 { font-size: 15.5px; line-height: 1.5; font-weight: 700; }
.news-card h3 a:hover { color: var(--link); }
.news-card p { font-size: 13px; color: var(--text-2); line-height: 1.6; }
.news-card .src {
  margin-top: auto;
  font-size: 12px;
  color: var(--link);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.news-card .src:hover { text-decoration: underline; }

/* ---------- 提交 / 页脚 ---------- */
.submit-banner {
  margin-top: 24px;
  padding: 40px 32px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background:
    radial-gradient(600px 300px at 80% 20%, var(--accent-soft), transparent 60%),
    var(--surface);
  text-align: center;
}
.submit-banner h3 {
  font-family: var(--font-display);
  font-size: 24px;
}
.submit-banner p { color: var(--text-2); font-size: 14px; margin-top: 8px; }
.submit-banner .actions {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-primary {
  padding: 12px 26px;
  border-radius: 12px;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  color: #1a1206;
  font-weight: 700;
  font-size: 15px;
  transition: filter var(--transition), transform var(--transition);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-2px); }
.btn-ghost {
  padding: 12px 26px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 15px;
  transition: all var(--transition);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.footer {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  padding: 40px 0 32px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-brand { max-width: 320px; }
.footer-brand .logo { margin-bottom: 10px; }
.footer-brand p { font-size: 13px; color: var(--text-3); line-height: 1.7; }
.footer-links { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-size: 13px; color: var(--text-3); margin-bottom: 12px; font-weight: 600; }
.footer-col a {
  display: block;
  font-size: 13.5px;
  color: var(--text-2);
  margin-bottom: 8px;
  transition: color var(--transition);
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-3);
}
.footer-bottom a { color: var(--text-3); }
.footer-bottom a:hover { color: var(--accent); }

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface-solid);
  border: 1px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--text-2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: all var(--transition);
  z-index: 90;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 滚动入场 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .nav { display: none; }
  .hero { padding: 64px 0 40px; }
  .kbd-hint { display: none; }
  .toolbar { position: static; }
  .tools-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 520px) {
  .container { width: calc(100% - 28px); }
  .tools-grid { grid-template-columns: 1fr; }
  .stats { gap: 24px; }
  .footer-links { gap: 32px; }
  .search-btn span { display: none; }
  .search-btn { padding: 10px 14px; }
  .hide-mobile { display: none; }
}

/* ---------- 减少动效偏好 ---------- */
@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; }
}
