/* 995 LAB · 主样式 */

:root {
  --bg: #fbfbfc;
  --panel: #ffffff;
  --line: #e9eaef;
  --line-strong: #d8dae2;
  --text: #101216;
  --text-2: #565d6d;
  --text-3: #8b90a0;
  --accent: #2f5bff;
  --accent-soft: #eef2ff;
  --radius: 15px;
  --shadow-1: 0 1px 2px rgba(16, 18, 22, .04);
  --shadow-2: 0 10px 28px -14px rgba(16, 18, 22, .22);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0d10;
    --panel: #141519;
    --line: #23252c;
    --line-strong: #31343d;
    --text: #f2f3f5;
    --text-2: #a3a8b5;
    --text-3: #767b88;
    --accent: #7b93ff;
    --accent-soft: #1a2035;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-2: 0 12px 30px -14px rgba(0, 0, 0, .8);
  }
}

* { box-sizing: border-box; }

/* hidden 属性优先于组件自身的 display */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { flex: 1 0 auto; }

/* 背景细网格，顶部淡出 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(120, 130, 160, .07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(120, 130, 160, .07) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 0%, transparent 72%);
          mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 0%, transparent 72%);
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

a { color: inherit; text-decoration: none; }

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.topbar.scrolled { border-bottom-color: var(--line); }

.topbar-inner {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  font-size: 15px;
  line-height: 26px;
  text-align: center;
  letter-spacing: -.02em;
}

.brand-text {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .01em;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-2);
}
.topnav a { transition: color .15s ease; }
.topnav a:hover { color: var(--text); }

.mono {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: -.01em;
}

.sep {
  width: 1px;
  height: 12px;
  background: var(--line-strong);
  display: inline-block;
}

/* ---------- Hero ---------- */

.hero {
  padding: 88px 24px 0;
  text-align: center;
}

.eyebrow {
  margin: 0 0 20px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow .sep { height: 10px; }

h1 {
  margin: 0;
  font-size: clamp(32px, 5.2vw, 52px);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -.035em;
}

.sub {
  margin: 20px auto 0;
  max-width: 540px;
  font-size: 14.5px;
  color: var(--text-2);
  line-height: 1.75;
}

/* 搜索 */
.search {
  margin: 34px auto 0;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-1);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.search:focus-within {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 12%, transparent), var(--shadow-1);
}

.i-search {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: var(--text-3);
  stroke-width: 2;
  stroke-linecap: round;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
}
.search input::placeholder { color: var(--text-3); }

.search kbd {
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  padding: 4px 6px;
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--bg);
}

/* ---------- 工具区 ---------- */

.tools { padding-top: 64px; padding-bottom: 40px; }

.tools-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tools-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.count {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2px 8px;
}

.filters {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.filters button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 12.5px;
  padding: 5px 11px;
  border-radius: 7px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.filters button:hover { color: var(--text); }
.filters button.on {
  background: var(--text);
  color: var(--bg);
}

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

.card {
  position: relative;
  display: flex;
  gap: 13px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  transition: transform .18s cubic-bezier(.2, .7, .3, 1),
              box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
}

.card.live { cursor: pointer; }
.card.live:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
}
.card.live::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(120px 60px at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%);
  transition: opacity .2s ease;
}
.card.live:hover::after { opacity: 1; }

.card-icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  border: 1px solid var(--line);
}
.card-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-2);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card.live .card-icon { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 18%, var(--line)); }
.card.live .card-icon svg { stroke: var(--accent); }

.card-body { min-width: 0; flex: 1; }

.card-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card.soon .card-title { color: var(--text-2); }

.tag {
  display: inline-block;
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 4px;
  letter-spacing: .02em;
  color: var(--text-3);
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.card-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-3);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-arrow {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 14px;
  height: 14px;
  stroke: var(--text-3);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity .18s ease, transform .18s ease;
}
.card.live:hover .card-arrow { opacity: 1; transform: translateX(0); }

/* 占位（还没有工具时） */
.placeholder {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  padding: 56px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--panel) 55%, transparent);
}
.placeholder .ph-dot {
  display: block;
  width: 7px;
  height: 7px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--text-3);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--text) 5%, transparent);
}
.placeholder p {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -.005em;
}
.placeholder span:last-child {
  font-size: 12.5px;
  color: var(--text-3);
}

/* 空状态 */
.empty {
  text-align: center;
  padding: 64px 0 40px;
  color: var(--text-3);
}
.empty svg {
  width: 26px; height: 26px;
  fill: none; stroke: var(--text-3); stroke-width: 1.6; stroke-linecap: round;
  margin-bottom: 10px;
}
.empty p { margin: 0 0 4px; font-size: 14px; color: var(--text-2); }
.empty span { font-size: 12.5px; }
.empty a { color: var(--accent); border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }

/* ---------- 页脚 ---------- */

footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
  font-size: 12px;
  color: var(--text-3);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.f-left { display: flex; align-items: center; gap: 10px; }
.f-right a { transition: color .15s ease; }
.f-right a:hover { color: var(--text-2); }

/* ---------- 响应式 ---------- */

@media (max-width: 720px) {
  .wrap { padding: 0 18px; }
  .hero { padding-top: 56px; }
  .br-pc { display: none; }
  .tools { padding-top: 48px; }
  .grid { grid-template-columns: 1fr; }
  .tools-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .filters { overflow-x: auto; max-width: 100%; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 8px; }
  .topnav .sep, .topnav .host { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
