:root {
  --ink: #080d14;
  --ink-2: #0b121b;
  --panel: rgba(255, 255, 255, .032);
  --panel-hi: rgba(255, 255, 255, .055);
  --line: rgba(255, 255, 255, .075);
  --line-hi: rgba(255, 255, 255, .16);
  --fg: #e5ecf4;
  --dim: #8ea0b5;
  --faint: #63758b;
  --sea: #63cfe0;
  --sea-dim: rgba(99, 207, 224, .16);
  --gold: #e8b45a;
  --rose: #ff8fa8;
  --blue: #6fa8ff;
  --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SF Mono", "Courier New", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink);
  color: var(--fg);
  font: 14px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* 背景：深海的一点点光，别太亮，抢字 */
.glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(1100px 620px at 8% -12%, rgba(99, 207, 224, .13), transparent 62%),
    radial-gradient(900px 560px at 92% -6%, rgba(157, 140, 255, .10), transparent 58%),
    radial-gradient(1200px 800px at 50% 108%, rgba(232, 180, 90, .055), transparent 62%),
    linear-gradient(180deg, var(--ink-2), var(--ink) 42%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

::selection { background: rgba(99, 207, 224, .28); }

.masthead {
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 24px 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 16px; }

.mark {
  width: 44px;
  height: 44px;
  color: var(--sea);
  flex: 0 0 auto;
  opacity: .95;
}

.eyebrow {
  margin: 0 0 5px;
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--faint);
  font-family: var(--sans);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.15;
}

.mast-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 12px;
  color: var(--dim);
  font-family: var(--mono);
}
.mast-meta b { color: var(--fg); font-weight: 500; }
.mast-meta .dot {
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--sea);
  box-shadow: 0 0 0 4px rgba(99, 207, 224, .12);
  vertical-align: 1px;
}
.dim { color: var(--dim); }

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 72px;
}

.lede { margin: 40px 0 6px; }

.lede p {
  margin: 0;
  max-width: 62ch;
  color: #b9c6d6;
  font-size: 15px;
  line-height: 1.95;
}

.figures {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 30px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}

.figures > div {
  padding: 0 28px 0 0;
  margin-right: 28px;
  border-right: 1px solid var(--line);
}
.figures > div:last-child { border-right: 0; margin-right: 0; padding-right: 0; }

.figures dt {
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--faint);
  margin-bottom: 4px;
}

.figures dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 26px;
  line-height: 1.2;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.figures dd small { font-size: 12px; color: var(--faint); margin-left: 4px; font-family: var(--sans); }

.tabs {
  display: inline-flex;
  gap: 2px;
  margin: 34px 0 18px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .02);
}

.tab {
  border: 0;
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 13px;
  padding: 6px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: color .16s, background .16s;
}
.tab:hover { color: var(--fg); }
.tab.on { background: rgba(99, 207, 224, .13); color: #d6f6fb; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
  max-width: 320px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .025);
  transition: border-color .16s, background .16s;
}
.search:focus-within { border-color: rgba(99, 207, 224, .45); background: rgba(99, 207, 224, .04); }
.search svg { width: 15px; height: 15px; color: var(--faint); flex: 0 0 auto; }
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
}
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { filter: invert(.6); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: .16s;
  white-space: nowrap;
}
.chip:hover { color: var(--fg); border-color: var(--line-hi); }
.chip em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 11px;
  margin-left: 5px;
  color: var(--faint);
}
.chip.on { color: #d9f7fc; border-color: rgba(99, 207, 224, .5); background: rgba(99, 207, 224, .10); }
.chip.on em { color: rgba(217, 247, 252, .6); }

.sort {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--faint);
  margin-left: auto;
}
.sort select {
  font: inherit;
  font-size: 12px;
  color: var(--fg);
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  outline: 0;
}

.hint {
  margin: 0 0 18px;
  font-size: 12px;
  color: var(--faint);
  line-height: 1.7;
}

/* ---------- 卡片 ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(252px, 1fr));
  gap: 12px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px 16px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .038), rgba(255, 255, 255, .012));
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
  animation: rise .34s both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 207, 224, .38);
  background: linear-gradient(180deg, rgba(99, 207, 224, .07), rgba(255, 255, 255, .015));
  box-shadow: 0 16px 34px -20px rgba(0, 0, 0, .9);
}
.card:focus-visible { outline: 2px solid rgba(99, 207, 224, .6); outline-offset: 2px; }

.card-top { display: flex; align-items: center; gap: 10px; min-width: 0; }

.avatar {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 14px;
  color: hsl(var(--h) 60% 88%);
  background: linear-gradient(160deg, hsl(var(--h) 46% 30%), hsl(calc(var(--h) + 40) 50% 18%));
  border: 1px solid rgba(255, 255, 255, .10);
}
.avatar.lg { width: 52px; height: 52px; font-size: 22px; }

.card-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: #eef4fa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lv {
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--c-line, var(--line));
  background: var(--c-bg, transparent);
  color: var(--c, var(--dim));
  letter-spacing: .04em;
}

.card-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12px;
  color: var(--faint);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.card-meta b { color: var(--dim); font-weight: 500; }
.card-meta .sep { opacity: .45; }

.bar {
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .07);
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: var(--w);
  background: var(--c, var(--sea));
  opacity: .8;
  border-radius: 2px;
}

.card-snippet {
  font-size: 12.5px;
  color: #93a5ba;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.card-snippet .q { color: #6f8399; margin-right: 4px; }
.card-snippet.blank { color: #5a6c81; font-style: italic; }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: #5d6f84;
  border-top: 1px solid rgba(255, 255, 255, .05);
  padding-top: 8px;
  margin-top: auto;
}
.now { color: var(--sea); }
.now::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 5px;
  vertical-align: 1px;
  box-shadow: 0 0 0 3px rgba(99, 207, 224, .14);
}

.empty {
  padding: 60px 0;
  text-align: center;
  color: var(--dim);
  font-size: 14px;
}

/* ---------- 时间线 ---------- */

.feed { display: flex; flex-direction: column; gap: 26px; }

.day { position: relative; }

.day-h {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}
.day-h b {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .04em;
}
.day-h span { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.ev {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, .045);
}
.ev:last-child { border-bottom: 0; }

.ev-t {
  font-family: var(--mono);
  font-size: 11px;
  color: #5d6f84;
  padding-top: 3px;
  font-variant-numeric: tabular-nums;
}

.ev-b { min-width: 0; }

.ev-top {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.ev-name {
  font-size: 13px;
  color: #d9e4ef;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
  border-bottom: 1px dotted rgba(255, 255, 255, .18);
}
.ev-name:hover { color: var(--sea); border-color: rgba(99, 207, 224, .5); }

.kind {
  font-size: 10px;
  letter-spacing: .1em;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--faint);
}
.kind.chat { color: rgba(99, 207, 224, .85); border-color: rgba(99, 207, 224, .25); }
.kind.dm { color: rgba(157, 140, 255, .9); border-color: rgba(157, 140, 255, .28); }
.kind.dyn { color: rgba(232, 180, 90, .9); border-color: rgba(232, 180, 90, .28); }
.kind.bait { color: rgba(255, 143, 168, .9); border-color: rgba(255, 143, 168, .28); }

.ev-her { font-size: 13.5px; color: #cfdae7; line-height: 1.65; }
.ev-them {
  margin-top: 3px;
  font-size: 12px;
  color: #6f8399;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ev-them::before { content: "「"; }
.ev-them::after { content: "」"; }
.ev-bvid {
  font-family: var(--mono);
  font-size: 10.5px;
  color: #4f6176;
  text-decoration: none;
  margin-left: 6px;
}
.ev-bvid:hover { color: var(--sea); }

/* ---------- 抽屉 ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(3, 7, 11, .62);
  backdrop-filter: blur(2px);
  animation: fade .2s both;
}
@keyframes fade { from { opacity: 0; } }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(580px, 100vw);
  background: linear-gradient(180deg, #0e1722, #0a1119 70%);
  border-left: 1px solid var(--line);
  box-shadow: -30px 0 80px -30px rgba(0, 0, 0, .9);
  transform: translateX(102%);
  transition: transform .28s cubic-bezier(.22, .8, .3, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.drawer.open { transform: none; }
.drawer[hidden] { display: none; }

.drawer-inner { padding: 22px 26px 60px; }

.d-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
  color: var(--dim);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: .16s;
}
.d-close:hover { color: var(--fg); border-color: var(--line-hi); transform: rotate(90deg); }

.d-hero { display: flex; gap: 14px; align-items: center; padding-right: 40px; }
.d-hero h2 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 600;
  letter-spacing: .03em;
  line-height: 1.3;
  word-break: break-word;
}
.d-hero .sub {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  flex-wrap: wrap;
}
.d-hero .sub a { color: #59708a; text-decoration: none; border-bottom: 1px dotted #3d4f63; }
.d-hero .sub a:hover { color: var(--sea); border-color: rgba(99, 207, 224, .5); }

.d-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 22px 0 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}
.d-stats > div { background: #0d1620; padding: 11px 12px; }
.d-stats dt { font-size: 10.5px; color: var(--faint); letter-spacing: .1em; margin-bottom: 3px; }
.d-stats dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 16px;
  color: #e3ecf5;
  font-variant-numeric: tabular-nums;
}
.d-stats dd small { font-size: 10px; color: var(--faint); }

.d-note {
  margin: 16px 0 0;
  padding: 11px 14px;
  border-left: 2px solid rgba(99, 207, 224, .35);
  background: rgba(99, 207, 224, .045);
  border-radius: 0 8px 8px 0;
  font-size: 12.5px;
  color: #9fb2c6;
  line-height: 1.8;
}

h3.sec {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 28px 0 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .16em;
  color: #7b8ea4;
  text-transform: uppercase;
}
h3.sec::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}
h3.sec em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0;
  color: #52657a;
  text-transform: none;
}

.notes { list-style: none; margin: 0; padding: 0; }
.notes li {
  position: relative;
  padding: 8px 0 8px 18px;
  font-size: 13px;
  color: #c2d0de;
  line-height: 1.7;
  border-bottom: 1px dashed rgba(255, 255, 255, .05);
}
.notes li:last-child { border-bottom: 0; }
.notes li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 17px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(99, 207, 224, .55);
}
.notes li time {
  display: block;
  font-family: var(--mono);
  font-size: 10.5px;
  color: #5a6d82;
  margin-bottom: 1px;
}
.notes li p { margin: 0; }

.chats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.chats li {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .018);
}
.chats .ch-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: #5a6d82;
  margin-bottom: 6px;
}
.chats .ch-top a { color: #4f6579; text-decoration: none; }
.chats .ch-top a:hover { color: var(--sea); }
.chats .her { font-size: 13px; color: #dbe6f2; line-height: 1.75; }
.chats .them {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed rgba(255, 255, 255, .06);
  font-size: 12px;
  color: #708499;
  line-height: 1.65;
}
.chats .them b { color: #8497ab; font-weight: 400; }

.blank-note {
  font-size: 12.5px;
  color: #5c6f84;
  font-style: italic;
  padding: 6px 0;
}

footer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 60px;
  color: #4f6176;
  font-size: 11.5px;
  line-height: 1.9;
}
footer code {
  font-family: var(--mono);
  font-size: 11px;
  color: #6b7f95;
  background: rgba(255, 255, 255, .035);
  padding: 1px 5px;
  border-radius: 4px;
}
footer p { margin: 0; max-width: 74ch; }

@media (max-width: 720px) {
  .masthead { padding-top: 30px; }
  .mast-meta { align-items: flex-start; }
  .figures > div { padding-right: 18px; margin-right: 18px; }
  .figures dd { font-size: 21px; }
  .toolbar { gap: 8px; }
  .search { max-width: none; flex-basis: 100%; }
  .sort { margin-left: 0; }
  .grid { grid-template-columns: 1fr; }
  .drawer-inner { padding: 20px 18px 50px; }
  .d-stats { grid-template-columns: repeat(2, 1fr); }
  .ev { grid-template-columns: 44px 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
