:root {
  --bg: #1a1a18;
  --panel: #20201d;
  --panel-2: #23231f;
  --panel-3: #262a28;
  --panel-4: #2a2422;
  --ink: #e9e6dd;
  --ink-soft: #c8c3b7;
  --muted: #8b877e;
  --line: #34332d;
  --line-strong: #403f38;
  --accent: #cc785c;

  --font-sans: "Inter Tight", "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: "Source Serif 4", Georgia, "Noto Serif SC", "Songti SC",
    "SimSun", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas,
    "Courier New", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 3px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* ---------- frame ---------- */

.app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 32px 44px 0;
  overflow: hidden;
}

.main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* ---------- floating bar ---------- */

.floatbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 44px;
  background: rgba(26, 26, 24, 0.86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.floatbar.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.float-id {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 2px;
}

.float-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
}

.float-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.float-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.float-links a,
.float-search {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 8px 16px;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.float-links a:hover,
.float-search:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.search-panel {
  position: fixed;
  top: 74px;
  right: 44px;
  z-index: 59;
  width: min(320px, calc(100vw - 88px));
  padding: 10px 42px 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.search-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease;
}

.search-close:hover {
  color: var(--accent);
}

.search-panel input {
  width: 100%;
  background: none;
  border: 0;
  outline: none;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 4px 0;
}

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

/* ---------- home ---------- */

.home {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 56px;
  padding: 32px 0 28px;
}

.feed {
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  padding-right: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.feed::-webkit-scrollbar {
  width: 5px;
}

.feed::-webkit-scrollbar-thumb {
  background: var(--line-strong);
}

.feed-grid {
  columns: 3;
  column-gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  break-inside: avoid;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  opacity: 0;
  animation: card-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: border-color 0.18s ease;
}

.card:hover {
  border-color: var(--accent);
}

.card-cover {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--panel-2);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(233, 230, 221, 0.022) 0 1px,
    transparent 1px 9px
  );
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.feed-grid .card:nth-child(3n + 2) .card-cover {
  aspect-ratio: 1 / 1;
  background-color: var(--panel-3);
}

.feed-grid .card:nth-child(3n) .card-cover {
  aspect-ratio: 5 / 4;
  background-color: var(--panel-4);
}

.cover-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cover-top .mono {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.cover-arrow {
  font-size: 13px;
  color: var(--muted);
  transition: transform 0.18s ease, color 0.18s ease;
}

.card:hover .cover-arrow {
  transform: translate(2px, -2px);
  color: var(--accent);
}

.cover-quote {
  margin-top: auto;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cover-num {
  margin-top: 14px;
  align-self: flex-end;
  font-size: 30px;
  line-height: 1;
  color: rgba(233, 230, 221, 0.18);
  letter-spacing: 0.02em;
}

.card-cover.has-img {
  padding: 0;
}

.cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.65) brightness(0.76);
  transition: transform 0.45s ease, filter 0.3s ease;
}

.card:hover .cover-img {
  transform: scale(1.02);
  filter: saturate(0.75) brightness(0.86);
}

.card-cover.has-img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.5) 0%,
    rgba(0, 0, 0, 0) 42%
  );
  pointer-events: none;
}

.card-cover.has-img .cover-top {
  position: relative;
  z-index: 2;
  padding: 14px 16px;
}

.card-cover.has-img .cover-top .mono {
  color: #efece3;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.card-cover.has-img .cover-arrow {
  color: #efece3;
}

.card-body {
  padding: 15px 16px 14px;
  border-top: 1px solid var(--line);
}

.card-title {
  font-size: 17px;
  line-height: 1.5;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  font-size: 10px;
}

.card-meta .read {
  color: var(--muted);
  transition: color 0.15s ease;
}

.card:hover .read {
  color: var(--accent);
}

/* link cards */

.card-link .card-cover {
  aspect-ratio: 4 / 3;
  background-image: none;
}

.cover-link {
  justify-content: space-between;
}

.cover-link .mono {
  color: var(--muted);
}

.link-word {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.02em;
  align-self: flex-start;
  line-height: 1.15;
}

.card-link:nth-child(5) .card-cover {
  background-color: var(--panel-2);
}

.card-link:nth-child(6) .card-cover {
  background-color: var(--panel-3);
}

.card-link:nth-child(7) .card-cover {
  background-color: var(--panel-4);
}

/* ---------- profile ---------- */

.profile {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  border-left: 1px solid var(--line);
  padding: 28px 0 6px 44px;
  animation: slide-left 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
}

.avatar {
  width: 84px;
  height: 84px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--panel-2);
  overflow: hidden;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.name {
  margin-top: 22px;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.handle {
  margin-top: 8px;
  font-size: 11px;
}

.bio {
  margin-top: 18px;
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.contact {
  margin-top: 26px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.contact a,
.contact button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.contact a:hover,
.contact button:hover {
  color: var(--accent);
}

.contact svg {
  width: 18px;
  height: 18px;
}

.side-nav {
  margin-top: 46px;
  display: flex;
  flex-direction: column;
}

.side-nav a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid transparent;
  font-size: 14px;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.side-nav a:hover {
  color: var(--accent);
}

.side-nav a .mono {
  font-size: 10px;
}

.side-nav a .count {
  margin-left: auto;
  font-size: 10px;
}

.side-nav a .lock {
  margin-left: auto;
  font-size: 11px;
  opacity: 0.7;
}

.profile-foot {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 10px;
}

/* ---------- listing ---------- */

.listing {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  grid-template-rows: minmax(0, 1fr);
  gap: 48px;
  padding: 28px 0;
  overflow: hidden;
}

.listing-feed {
  height: 100%;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  padding-right: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.listing-feed::-webkit-scrollbar {
  width: 5px;
}

.listing-feed::-webkit-scrollbar-thumb {
  background: var(--line-strong);
}

.listing-head {
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.back-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.back-box {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1;
  transition: border-color 0.15s ease;
}

.back-home:hover {
  color: var(--accent);
}

.back-home:hover .back-box {
  border-color: var(--accent);
}

.back-text {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.listing-title {
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.listing-count {
  margin-top: 10px;
  font-size: 10px;
}

.filters {
  min-height: 0;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  padding-left: 34px;
  display: flex;
  flex-direction: column;
  gap: 36px;
}

.filter-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}

.filter-list {
  display: flex;
  flex-direction: column;
}

.filter-list a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-size: 14px;
  color: var(--ink-soft);
  transition: color 0.15s ease;
}

.filter-list a:hover,
.filter-list a.is-active {
  color: var(--accent);
}

.filter-list .mono {
  font-size: 10px;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 6px 10px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tag-chip:hover,
.tag-chip.is-active {
  color: var(--accent);
  border-color: var(--accent);
}

.tag-chip .mono {
  font-size: 9px;
}

.filters-foot {
  margin-top: auto;
  font-size: 9px;
}

/* ---------- article / page ---------- */

.post,
.page {
  max-width: 700px;
  margin: 0 auto;
  padding: 60px 0 88px;
}

.post-head {
  margin-bottom: 40px;
}

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 18px;
}

.post .post-title,
.page-title {
  font-size: clamp(30px, 3.2vw, 40px);
  line-height: 1.22;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.post-body {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.post-body > * + * {
  margin-top: 1.1em;
}

.post-body h2,
.post-body h3 {
  font-family: var(--font-sans);
  color: var(--ink);
  letter-spacing: -0.015em;
  margin-top: 1.9em;
}

.post-body h2 {
  font-size: 24px;
}

.post-body h3 {
  font-size: 20px;
}

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--panel-2);
  padding: 0.14em 0.36em;
  border: 1px solid var(--line);
}

.post-body pre {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 18px 20px;
  overflow-x: auto;
}

.post-body pre code {
  background: none;
  border: 0;
  padding: 0;
}

/* ---------- motion ---------- */

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slide-left {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

/* ---------- responsive ---------- */

@media (max-width: 1280px) {
  .feed-grid {
    columns: 2;
  }
}

@media (max-width: 1060px) {
  .app {
    padding: 32px 28px 0;
  }

  .home {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 36px;
  }

  .profile {
    padding-left: 28px;
  }

  .listing {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 32px;
  }

  .filters {
    padding-left: 24px;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .app {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    padding: 20px 20px 0;
  }

  .main {
    overflow: visible;
  }

  .floatbar {
    top: 0;
    left: 0;
    right: 0;
    padding: 0 20px;
  }

  .search-panel {
    top: 68px;
    right: 20px;
    width: min(320px, calc(100vw - 40px));
  }

  .home {
    height: auto;
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 24px 0 40px;
  }

  .profile {
    order: -1;
    border-left: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 28px;
  }

  .profile .avatar {
    width: 68px;
    height: 68px;
  }

  .name {
    font-size: 26px;
    margin-top: 16px;
  }

  .side-nav {
    margin-top: 24px;
  }

  .profile-foot {
    display: none;
  }

  .feed {
    overflow: visible;
    padding-right: 0;
  }

  .feed-grid {
    columns: 2;
    column-gap: 12px;
  }

  .card {
    margin-bottom: 12px;
  }

  .card-cover {
    aspect-ratio: 1 / 1;
  }

  .cover-num {
    font-size: 30px;
  }

  .card-body {
    padding: 12px 12px 11px;
  }

  .card-title {
    font-size: 14px;
  }

  .listing {
    height: auto;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 20px 0 32px;
  }

  .listing-feed {
    overflow: visible;
    padding-right: 0;
  }

  .filters {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 24px 0 0;
    overflow: visible;
    gap: 24px;
  }

  .filters-foot {
    display: none;
  }

  .post,
  .page {
    padding: 40px 4px 64px;
  }

  .post-body {
    font-size: 17px;
  }
}

@media (max-width: 620px) {
  .float-links a:nth-child(3),
  .float-links a:nth-child(4),
  .float-links a:nth-child(5) {
    display: none;
  }
}

@media (max-width: 460px) {
  .feed-grid {
    columns: 1;
  }

  .card-cover {
    aspect-ratio: 4 / 3;
  }
}
