:root {
  --bg: #0c0c0e;
  --card: #16161a;
  --text: #f4f2ec;
  --muted: #9a968c;
  --line: rgba(255,255,255,0.08);
  --gold: #e8c872;
  --gold-dim: rgba(232,200,114,0.16);
  --site: #7eb8ff;
  --app: #b8a0ff;
  --game: #7ed9b0;
  --bar-h: 96px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "SF Pro Text", "PingFang SC", "Noto Sans SC", "Helvetica Neue", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-top: calc(var(--bar-h) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(28px + var(--safe-bottom));
  min-height: 100dvh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  margin-top: calc(-1 * (var(--bar-h) + env(safe-area-inset-top, 0px)));
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 12px;
  background: rgba(12,12,14,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.brand-mark { color: var(--gold); font-size: 14px; }
.brand-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  min-height: 40px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.chip.is-active {
  background: var(--gold-dim);
  border-color: rgba(232,200,114,0.35);
  color: var(--gold);
}

.feed {
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 14px 0;
}
.day {
  margin-bottom: 8px;
}
.day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 18px 2px 10px;
  position: sticky;
  top: calc(var(--bar-h) + env(safe-area-inset-top, 0px) - 4px);
  z-index: 5;
  background: linear-gradient(180deg, var(--bg) 70%, transparent);
}
.day-date {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.day-count {
  font-size: 12px;
  color: var(--muted);
}

.card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.card:active { transform: scale(0.985); }
.card.is-hi {
  border-color: rgba(232,200,114,0.32);
  background: linear-gradient(165deg, #242018 0%, #1a1812 100%);
  box-shadow: 0 12px 36px rgba(0,0,0,0.35);
}
.card-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center top;
  background: #111;
}
.card-body { padding: 14px 14px 16px; }
.card-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.tag {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
}
.tag[data-type="网站"] { color: var(--site); }
.tag[data-type="App UI"] { color: var(--app); }
.tag[data-type="小游戏"] { color: var(--game); }
.hi-badge {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--gold);
  background: var(--gold-dim);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}
.card-title {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  line-height: 1.25;
}
.card-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.45;
}

.sentinel { height: 1px; }
.status {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 16px;
}

/* Sheet */
.sheet[hidden] { display: none !important; }
.sheet {
  position: fixed;
  inset: 0;
  z-index: 100;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
}
.sheet-panel {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: min(92dvh, 920px);
  background: #121214;
  border-radius: 22px 22px 0 0;
  border: 1px solid var(--line);
  border-bottom: none;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bottom);
  animation: sheetUp 0.28s ease;
}
@keyframes sheetUp {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet-handle {
  width: 40px; height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  margin: 10px auto 0;
}
.sheet-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
}
.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 18px 28px;
  font-size: 16px;
}
.sheet-hero {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 14px;
  margin: 12px 0 14px;
  background: #111;
}
.sheet-kicker {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.1em;
  font-weight: 700;
  margin-bottom: 6px;
}
.sheet-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.sheet-desc {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 16px;
}
.btn-open {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  background: var(--gold);
  color: #1a1508;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  margin: 8px 0 20px;
}
.teardown h1, .teardown h2, .teardown h3 {
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 1.1em 0 0.45em;
}
.teardown h1 { font-size: 20px; }
.teardown h2 { font-size: 17px; color: var(--gold); }
.teardown h3 { font-size: 15px; color: #d8d2c4; }
.teardown p, .teardown li {
  color: #c9c4b6;
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 0.65em;
}
.teardown ul, .teardown ol { padding-left: 1.2em; margin-bottom: 0.8em; }
.teardown code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: rgba(255,255,255,0.06);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}
.teardown pre.md-code {
  background: #0a0a0c;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 0.8em 0 1em;
  font-size: 13px;
  line-height: 1.45;
  color: #d8d2c4;
}
.teardown .md-kv {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0.8em 0 1.1em;
}
.teardown .md-kv > div {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}
.teardown .md-kv strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
}
.teardown .md-kv span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.teardown a { color: var(--site); }

body.sheet-open { overflow: hidden; }

@media (min-width: 560px) {
  .feed { padding-left: 20px; padding-right: 20px; }
}

/* ---- GitHub Pages additions (permalinks, day pages, share) ---- */
a.day-link { text-decoration: none; display: inline-flex; align-items: baseline; gap: 8px; }
.day-go { font-size: 12px; letter-spacing: 0.02em; color: var(--muted); font-weight: 500; }
.btn-ghost {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px;
  border-radius: 14px; border: 1px solid var(--line); color: var(--text); text-decoration: none;
  font-size: 15px; margin: -8px 0 20px;
}
.days-index { max-width: 520px; margin: 8px auto 0; padding: 8px 16px 24px; }
.days-index h2 { font-size: 13px; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin: 8px 2px 10px; }
.days-index ul { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.days-index a {
  display: block; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); text-decoration: none; font-size: 14px; font-variant-numeric: tabular-nums;
}
.days-index a small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Day page */
body.dp-body { padding-top: 0; }
.dp-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: rgba(12,12,14,0.9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.dp-home { color: var(--text); text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: 0.04em; }
.dp-home span { color: var(--gold); margin-right: 6px; font-size: 13px; }
.dp-share-mini {
  border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 14px;
  padding: 7px 14px; min-height: 36px; border-radius: 999px; cursor: pointer;
}
.dp { max-width: 560px; margin: 0 auto; padding: 18px 18px 8px; }
.dp-kicker { color: var(--gold); font-size: 13px; letter-spacing: 0.08em; font-weight: 700; font-variant-numeric: tabular-nums; }
.dp-title { font-size: 30px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 750; margin: 6px 0 8px; }
.dp-lede { color: #cfcabd; font-size: 16.5px; line-height: 1.55; }
.dp-hero-link { display: block; margin: 16px 0 12px; }
.dp-hero { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: center top;
  border-radius: 16px; background: #111; border: 1px solid var(--line); }
.dp .btn-open { margin: 4px 0 8px; }
.dp-plain { margin: 22px 0 6px; padding: 16px 16px 6px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.dp-h2 { font-size: 13px; letter-spacing: 0.08em; color: var(--gold); font-weight: 700; margin-bottom: 10px; }
.dp-plain p { font-size: 16px; line-height: 1.65; color: #e6e2d8; margin-bottom: 10px; }
.dp-plain p b { color: var(--text); }
.dp-plain ol { padding-left: 1.25em; margin: 4px 0 12px; }
.dp-plain li { font-size: 15.5px; line-height: 1.6; color: #cfcabd; margin-bottom: 6px; }
.dp-full { margin: 10px 0 0; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; }
.dp-full summary { cursor: pointer; padding: 13px 0; color: var(--muted); font-size: 14px; list-style: none; }
.dp-full summary::-webkit-details-marker { display: none; }
.dp-full summary::after { content: " ›"; }
.dp-full[open] summary::after { content: " ⌄"; }
.dp-full .teardown { padding-bottom: 12px; overflow-wrap: anywhere; }
.dp-sec { font-size: 13px; letter-spacing: 0.08em; color: var(--muted); font-weight: 600; margin: 28px 2px 10px; }
.mini {
  display: flex; gap: 12px; align-items: flex-start; padding: 10px; margin-bottom: 10px; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; -webkit-tap-highlight-color: transparent;
}
.mini:active { transform: scale(0.99); }
.mini img { flex: 0 0 112px; width: 112px; height: 70px; object-fit: cover; object-position: center top; border-radius: 9px; background: #111; }
.mini-body { min-width: 0; flex: 1; }
.mini-row { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.mini .tag { font-size: 11px; padding: 2px 8px; }
.mini-title { font-size: 16px; font-weight: 650; line-height: 1.25; letter-spacing: -0.01em; }
.mini-desc { font-size: 13.5px; color: var(--muted); line-height: 1.45; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-go { color: var(--muted); font-size: 16px; align-self: center; }
.dp-share {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; margin: 22px 0 10px;
  border-radius: 14px; border: 1px solid rgba(232,200,114,0.4); background: var(--gold-dim); color: var(--gold);
  font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.dp-nav { display: flex; justify-content: space-between; gap: 8px; margin: 6px 0 24px; }
.dp-nav a, .dp-nav span { flex: 1; text-align: center; padding: 11px 6px; border-radius: 12px; border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-size: 14px; font-variant-numeric: tabular-nums; }
.dp-nav span { color: rgba(255,255,255,0.2); }
.dp-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 4px 0 20px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: #f4f2ec; color: #111; font-size: 14px; font-weight: 600; padding: 10px 16px; border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4); z-index: 200; opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.toast.show { opacity: 1; }
/* width/height attrs are hints only; keep the 16:10 crop */
.card-thumb, .dp-hero, .sheet-hero { height: auto; }

/* ---- 小白课 + 知识地图 ---- */
.brand-link { margin-left: auto; color: var(--gold); text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 6px 12px; border: 1px solid rgba(232,200,114,0.3); border-radius: 999px; }
.dp-top-r { display: flex; align-items: center; gap: 8px; }
.dp-maplink { color: var(--gold); text-decoration: none; font-size: 14px; padding: 7px 12px; min-height: 36px;
  display: inline-flex; align-items: center; border-radius: 999px; border: 1px solid rgba(232,200,114,0.3); }
.dp-top-t { color: var(--muted); font-size: 14px; }

.xb { margin: 30px 0 6px; padding-top: 22px; border-top: 1px solid var(--line); }
.xb-head { margin-bottom: 6px; }
.xb-badge { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; color: #1a1508;
  background: var(--gold); padding: 5px 12px; border-radius: 999px; }
.xb-sub { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin-top: 10px; }
.xb-h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em;
  margin: 28px 0 10px; color: var(--text); }
.xb-h2 span { flex: 0 0 26px; height: 26px; border-radius: 999px; border: 1px solid rgba(232,200,114,0.45); color: var(--gold);
  font-size: 13px; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.xb-note { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: -2px 0 12px; }
.xb-tech { border-left: 2px solid rgba(232,200,114,0.35); padding: 2px 0 2px 14px; margin: 0 0 14px; }
.xb-tech summary { list-style: none; cursor: pointer; }
.xb-tech summary::-webkit-details-marker { display: none; }
.xb-tech-name { display: block; font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.xb-tech-name::after { content: " ›"; color: var(--muted); font-weight: 400; }
.xb-tech[open] .xb-tech-name::after { content: " ⌄"; }
.xb-tech-meta { display: block; font-size: 15px; line-height: 1.65; color: #cfcabd; }
.xb-tech-body { margin-top: 8px; }
.xb-tech-body p { font-size: 15px; line-height: 1.65; color: #cfcabd; margin-bottom: 8px; }
.xb-k { display: block; font-size: 12px; letter-spacing: 0.06em; color: var(--gold); font-weight: 700; margin-bottom: 1px; }
.xb-lesson { margin-top: 4px; }
.xb-crumb { font-size: 13px; color: var(--gold); letter-spacing: 0.04em; font-weight: 600; }
.xb-title { font-size: 23px; line-height: 1.3; letter-spacing: -0.02em; font-weight: 750; margin: 4px 0 12px; }
.xb-prose p, .xb-prose li { font-size: 16px; line-height: 1.8; color: #e3dfd4; }
.xb-prose p { margin-bottom: 14px; }
.xb-prose b { color: #fff; font-weight: 700; background: linear-gradient(transparent 62%, rgba(232,200,114,0.22) 0); }
.xb-prose ul { padding-left: 1.2em; margin: -4px 0 14px; }
.xb-prose li { margin-bottom: 6px; }
.xb-h4 { font-size: 15px; font-weight: 700; color: var(--gold); margin: 22px 0 8px; letter-spacing: 0.02em; }
.xb-refs { list-style: none; }
.xb-refs li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.xb-refs li:last-child { border-bottom: 0; }
.xb-refs b { display: block; font-size: 15px; color: var(--text); margin-bottom: 3px; }
.xb-refs a { color: var(--site); text-decoration: none; }
.xb-refs span { font-size: 14.5px; line-height: 1.6; color: var(--muted); }
.xb-callout { margin: 20px 0 6px; padding: 14px 16px 6px; border-radius: 14px; background: rgba(126,217,176,0.07);
  border: 1px solid rgba(126,217,176,0.22); }
.xb-callout-t { font-size: 14px; font-weight: 700; color: var(--game); margin-bottom: 8px; }
.xb-callout ol { padding-left: 1.2em; }
.xb-callout li { font-size: 15px; line-height: 1.7; color: #d9e8e0; margin-bottom: 10px; }
.xb-gloss > div { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.xb-gloss > div:last-child { border-bottom: 0; }
.xb-gloss dt { font-size: 15px; font-weight: 700; color: var(--text); }
.xb-gloss dd { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin-top: 2px; }
.xb-prog, .mp-total { padding: 14px 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.xb-prog-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 15px; }
.xb-prog-row b { font-weight: 700; }
.xb-prog-row span { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.xb-prog-row.small { margin-top: 6px; }
.bar { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.07); overflow: hidden; margin-top: 8px; }
.bar.big { height: 8px; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.xb-next { display: block; margin-top: 14px; padding: 12px 14px; border-radius: 12px; text-decoration: none;
  background: var(--gold-dim); border: 1px solid rgba(232,200,114,0.3); }
.xb-next span { display: block; font-size: 12px; color: var(--gold); letter-spacing: 0.04em; margin-bottom: 2px; }
.xb-next b { font-size: 15px; color: var(--text); font-weight: 650; line-height: 1.45; }
.xb-maplink { display: block; text-align: center; margin-top: 12px; color: var(--text); text-decoration: none; font-size: 14.5px;
  padding: 10px; border-radius: 12px; border: 1px solid var(--line); }

.mp .dp-title { font-size: 28px; }
.mp-total { margin: 18px 0 8px; }
.mp-ovs { margin-top: 12px; display: grid; gap: 8px; }
.mp-ov { display: grid; grid-template-columns: 7.5em 1fr 3em; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-size: 14px; }
.mp-ov .bar { margin-top: 0; height: 5px; }
.mp-ov em { font-style: normal; color: var(--muted); font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
.mp-track { margin-top: 34px; scroll-margin-top: 70px; }
.mp-th { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.mp-th h2 { font-size: 21px; font-weight: 750; letter-spacing: -0.01em; }
.mp-th span { color: var(--gold); font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 600; }
.mp-intro { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 10px 0 6px; }
.mp-list { list-style: none; }
.mp-l { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid rgba(255,255,255,0.05); scroll-margin-top: 70px; }
.mp-l:target { background: rgba(232,200,114,0.06); border-radius: 10px; }
.mp-n { flex: 0 0 28px; height: 28px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 13px;
  display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; margin-top: 1px; }
.mp-l.done .mp-n { background: var(--gold); border-color: var(--gold); color: #1a1508; font-weight: 700; }
.mp-b { min-width: 0; flex: 1; }
.mp-t { font-size: 16px; font-weight: 650; line-height: 1.4; color: #d9d5ca; }
.mp-l.done .mp-t { color: var(--text); }
.mp-s { font-size: 14px; line-height: 1.55; color: var(--muted); margin-top: 3px; }
.mp-pre { font-size: 12.5px; color: rgba(154,150,140,0.75); margin-top: 4px; }
.mp-status { display: inline-block; margin-top: 7px; font-size: 12.5px; color: rgba(154,150,140,0.8); padding: 3px 10px;
  border-radius: 999px; border: 1px solid var(--line); text-decoration: none; }
.mp-status.is-done { color: var(--gold); border-color: rgba(232,200,114,0.35); background: var(--gold-dim); font-weight: 600; }
.mp-status.is-next { color: var(--game); border-color: rgba(126,217,176,0.35); }
