:root {
  --bg: #0a0a0b;
  --surface: #141416;
  --elevated: #1a1a1c;
  --accent: #ff6363;
  --accent-glow: rgba(255, 99, 99, 0.3);
  --border-accent: rgba(255, 99, 99, 0.15);
  --fg: #ffffff;
  --muted: #a1a1aa;
  --glass: rgba(255, 255, 255, 0.03);
  --avatar: #3a3a40;
  --r: 6px;
  --hair: 1px;
  --focus: 0 0 0 1px #ff6363, 0 0 0 4px rgba(255, 99, 99, 0.16);
  --font: Inter, "SF Pro Display", "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", ui-sans-serif, system-ui, sans-serif;
}

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

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--fg);
  background: var(--bg);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

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

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 40;
  padding: 8px 12px;
  background: var(--surface);
  border: var(--hair) solid var(--border-accent);
  border-radius: var(--r);
  font-size: 13px;
}

.skip:focus {
  top: 12px;
}

.fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(640px 360px at 12% -8%, var(--accent-glow), transparent 62%);
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 240px minmax(0, 640px) minmax(180px, 1fr);
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
}

.rail-left {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 14px 18px 10px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r);
  color: var(--muted);
  font-size: 16px;
  font-weight: 500;
  transition: background 140ms ease, color 140ms ease;
}

.nav a svg {
  flex-shrink: 0;
}

.nav a:hover {
  background: var(--glass);
  color: var(--fg);
}

.nav a[aria-current="page"] {
  color: var(--accent);
}

.id {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r);
  border: var(--hair) solid var(--border-accent);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: -6px -8px 22px rgba(255, 99, 99, 0.08);
}

.id-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
}

.id-chev {
  color: var(--muted);
  flex-shrink: 0;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--avatar);
  display: grid;
  place-items: center;
  color: var(--muted);
  flex-shrink: 0;
}

.avatar svg {
  display: block;
}

.feed {
  min-width: 0;
  padding: 28px 20px 40px;
}

.feed-head {
  margin: 0 0 22px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.post {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 0 12px;
  padding: 4px 4px 8px;
  border-radius: var(--r);
  color: inherit;
  transition: background 160ms ease;
}

.post:hover,
.post:focus-visible {
  background: rgba(255, 99, 99, 0.04);
}

.post > .avatar {
  width: 40px;
  height: 40px;
  margin-top: 2px;
}

.post-main {
  min-width: 0;
}

.post-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  margin: 0 0 12px;
  line-height: 1.25;
}

.post-line .name {
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -0.015em;
}

.post-line time {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.post-text {
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--fg);
  line-height: 1.7;
}

.embed {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  border-radius: 12px;
  border: var(--hair) solid var(--accent);
  background: rgba(20, 20, 22, 0.78);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow:
    0 0 0 1px rgba(255, 99, 99, 0.28),
    0 0 18px rgba(255, 99, 99, 0.22),
    0 0 42px rgba(255, 99, 99, 0.12);
  transition: box-shadow 160ms ease;
}

.post:hover .embed,
.post:focus-visible .embed {
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 22px rgba(255, 99, 99, 0.32),
    0 0 48px rgba(255, 99, 99, 0.16);
}

.embed-media {
  position: relative;
  display: block;
  min-height: 156px;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 78% 82%, rgba(255, 99, 99, 0.28), transparent 58%),
    radial-gradient(80% 70% at 18% 18%, rgba(255, 99, 99, 0.1), transparent 52%),
    var(--elevated);
}

.embed-media .thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.embed-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  padding: 16px 18px 14px;
  min-width: 0;
  background: rgba(16, 16, 18, 0.35);
}

.embed-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  border: var(--hair) solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 11, 0.72);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.embed-copy strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.35;
}

.embed-desc {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.embed-url {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  margin-top: auto;
  padding-top: 12px;
  border-top: var(--hair) solid rgba(255, 99, 99, 0.16);
  color: var(--muted);
  font-size: 12px;
}

.embed-url svg {
  flex-shrink: 0;
  color: #8a8a93;
}

.rail-right {
  min-width: 0;
}

.feed-foot {
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.lost {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 48px 24px;
  text-align: center;
}

.lost h1 {
  margin: 8px 0 10px;
  font-size: 22px;
  font-weight: 600;
}

.lost p {
  color: var(--muted);
  margin: 0 0 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: var(--r);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.btn:hover {
  filter: brightness(1.06);
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 72px minmax(0, 1fr);
    max-width: none;
  }
  .rail-right {
    display: none;
  }
  .nav a span,
  .id-name,
  .id-chev {
    display: none;
  }
  .nav a {
    justify-content: center;
    padding: 12px;
  }
  .id {
    justify-content: center;
    padding: 8px 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }
}

@media (max-width: 720px) {
  .embed {
    grid-template-columns: 1fr;
  }
  .embed-media {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }
  .embed-copy {
    padding: 14px 16px 14px;
  }
}

@media (max-width: 640px) {
  .layout {
    grid-template-columns: 1fr;
    padding-bottom: 64px;
  }
  .rail-left {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    z-index: 20;
    flex-direction: row;
    align-items: center;
    padding: 0 8px;
    border-top: var(--hair) solid var(--border-accent);
    background: rgba(10, 10, 11, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }
  .nav {
    flex: 1;
    flex-direction: row;
    justify-content: space-around;
  }
  .id {
    display: none;
  }
  .feed {
    padding: 20px 14px 32px;
  }
}
