/* ============ Launchpad — 深色优先的个人导航页 ============ */

*,
*::before,
*::after { box-sizing: border-box; }

:root {
  color-scheme: dark;
  --bg: #06070a;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-hi: rgba(255, 255, 255, 0.065);
  --line: rgba(255, 255, 255, 0.085);
  --line-hi: rgba(255, 255, 255, 0.18);
  --text: #e9edf6;
  --muted: #98a1b5;
  --dim: #6a7285;
  --accent: #8b93ff;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f9;
  --panel: #ffffff;
  --panel-hi: #ffffff;
  --line: rgba(14, 18, 38, 0.10);
  --line-hi: rgba(14, 18, 38, 0.22);
  --text: #0f1327;
  --muted: #5a6178;
  --dim: #7c849a;
  --accent: #4f5bff;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(139, 147, 255, 0.35); }

/* ---------- 背景光晕 ---------- */

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(880px 520px at 10% -12%, rgba(99, 102, 241, 0.30), transparent 68%),
    radial-gradient(760px 460px at 92% -4%, rgba(236, 72, 153, 0.16), transparent 70%),
    radial-gradient(760px 560px at 84% 96%, rgba(16, 185, 129, 0.14), transparent 70%),
    radial-gradient(640px 440px at 24% 108%, rgba(56, 189, 248, 0.12), transparent 70%);
}

.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.030) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.030) 1px, transparent 1px);
  background-size: 66px 66px;
  -webkit-mask-image: radial-gradient(120% 70% at 50% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(120% 70% at 50% 0%, #000 0%, transparent 72%);
}

html[data-theme="light"] .aurora {
  background:
    radial-gradient(880px 520px at 8% -14%, rgba(99, 102, 241, 0.18), transparent 68%),
    radial-gradient(700px 420px at 94% -2%, rgba(236, 72, 153, 0.10), transparent 70%),
    radial-gradient(700px 520px at 86% 98%, rgba(16, 185, 129, 0.10), transparent 70%);
}

html[data-theme="light"] .aurora::after {
  background-image:
    linear-gradient(rgba(20, 26, 60, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 26, 60, 0.05) 1px, transparent 1px);
}

/* ---------- 布局 ---------- */

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 28px 56px;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 44px;
}

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

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #9aa1ff 0%, #5b6bff 52%, #22d3ee 100%);
  box-shadow: 0 10px 26px -10px rgba(99, 102, 241, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.brand-mark svg { width: 19px; height: 19px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text b { font-size: 15px; font-weight: 650; letter-spacing: 0.01em; }
.brand-text em {
  font-style: normal;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.topbar-right { display: flex; align-items: center; gap: 14px; }

.today, .clock {
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}

.clock {
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s, transform 0.18s;
}

.icon-btn:hover { color: var(--text); border-color: var(--line-hi); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .i-sun { display: none; }
html[data-theme="light"] .icon-btn .i-sun { display: block; }
html[data-theme="light"] .icon-btn .i-moon { display: none; }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 28px;
  align-items: start;
  margin-bottom: 34px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(27px, 3.3vw, 38px);
  line-height: 1.16;
  font-weight: 680;
  letter-spacing: -0.022em;
  background: linear-gradient(100deg, var(--text) 20%, color-mix(in srgb, var(--text) 55%, var(--accent)) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.sub .star { color: #fbbf24; font-weight: 400; }

/* ---------- 搜索框 ---------- */

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 16px 0 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: border-color 0.2s, box-shadow 0.24s, background 0.2s;
}

.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) 14%, transparent),
    0 22px 50px -34px color-mix(in srgb, var(--accent) 90%, transparent);
  background: var(--panel-hi);
}

.search-icon { width: 19px; height: 19px; flex: 0 0 auto; color: var(--dim); }
.search:focus-within .search-icon { color: var(--accent); }

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 15px;
}

.search input::placeholder { color: var(--dim); }

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  color: var(--dim);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  line-height: 1;
  vertical-align: middle;
}

.search kbd.hint { flex: 0 0 auto; }

/* ---------- 分类筛选 ---------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.filters button {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.16s, border-color 0.16s, background 0.16s;
}

.filters button:hover { color: var(--text); border-color: var(--line-hi); }

.filters button.on {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(140deg, #6d78ff, #4f5bff);
  box-shadow: 0 8px 22px -12px rgba(79, 91, 255, 0.95);
}

html[data-theme="light"] .filters button.on { color: #fff; }

/* ---------- 正在热议 ---------- */

.buzz {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  padding: 13px 15px 10px;
}

.buzz[hidden] { display: none; }

.buzz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.buzz-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.6);
  animation: pulse 2.4s var(--ease) infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.buzz-head button {
  border: 0;
  background: none;
  color: var(--dim);
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
  transition: color 0.16s, background 0.16s;
}

.buzz-head button:hover { color: var(--text); background: color-mix(in srgb, var(--text) 8%, transparent); }

#buzzList {
  list-style: none;
  margin: 0;
  padding: 2px 0 4px;
  counter-reset: buzz;
}

#buzzList li {
  counter-increment: buzz;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 9px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}

#buzzList li > div { min-width: 0; }

#buzzList li:last-child { border-bottom: 0; }

#buzzList li::before {
  content: counter(buzz);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 10.5px;
  color: var(--dim);
  text-align: right;
}

#buzzList a {
  display: block;
  color: var(--text);
  text-decoration: none;
  font-size: 12.8px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s;
}

#buzzList a:hover { color: var(--accent); }

#buzzList .src {
  margin-left: 6px;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--dim);
}

#buzzList .meta {
  display: block;
  font-size: 10.5px;
  color: var(--dim);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

#buzzList li.loading {
  grid-template-columns: 1fr;
  color: var(--dim);
  font-size: 12px;
}

#buzzList li.loading::before { content: none; }

.buzz-note {
  margin: 4px 0 2px;
  font-size: 11px;
  color: var(--dim);
  line-height: 1.6;
}

/* ---------- 分区与卡片 ---------- */

.section { margin-bottom: 30px; }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 13px;
}

.section-head h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--muted);
  white-space: nowrap;
}

.section-head .note {
  font-size: 11.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-head .rule {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
  transform: translateY(-3px);
}

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

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 15px 15px 13px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.24s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--a) 48%, var(--line));
  box-shadow: 0 24px 46px -30px color-mix(in srgb, var(--a) 85%, transparent),
    0 2px 10px -6px rgba(0, 0, 0, 0.5);
}

.card.kbd {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: inherit;
}

/* 整张卡片都可点击 */
.card-title::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  z-index: 1;
}

.tile {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--a);
  background: color-mix(in srgb, var(--a) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--a) 24%, transparent);
  transition: transform 0.2s var(--ease), background 0.2s;
}

.card:hover .tile { transform: scale(1.06) rotate(-2deg); }
.tile svg { width: 22px; height: 22px; }

.meta { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.meta b {
  font-size: 14.5px;
  font-weight: 620;
  letter-spacing: -0.006em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta em {
  font-style: normal;
  font-size: 11px;
  color: var(--dim);
  margin-top: 3px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.62;
  color: var(--muted);
}

.pin {
  position: absolute;
  top: 9px;
  right: 8px;
  z-index: 3;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.16s, color 0.16s, background 0.16s;
}

.card:hover .pin, .card.kbd .pin { opacity: 1; }

.pin:hover { color: var(--a); background: color-mix(in srgb, var(--a) 14%, transparent); }
.pin.is-on { opacity: 1; color: #fbbf24; }

.pills {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 2px;
}

.pills a {
  padding: 3.5px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.pills a:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--a) 55%, var(--line));
  background: color-mix(in srgb, var(--a) 12%, transparent);
}

/* ---------- 空状态 ---------- */

.empty {
  padding: 54px 24px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; font-weight: 600; }
.empty span { font-size: 12.5px; color: var(--dim); }

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

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 38px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--dim);
}

.foot .sep { opacity: 0.45; }
.foot .star { color: #fbbf24; font-weight: 400; }

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

@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}

@media (max-width: 640px) {
  .wrap { padding: 20px 16px 44px; }
  .topbar { margin-bottom: 30px; }
  .today { display: none; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 26px; }
  .search { height: 52px; }
  .card { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
