:root {
  --bg-body: #f5f3f0;
  --bg-card: #ffffff;
  --bg-nav: rgba(255, 255, 255, 0.82);
  --text-primary: #1a1a1a;
  --text-secondary: #65676b;
  --text-muted: #8a8d91;
  --accent: #e84057;
  --accent-2: #ff8a3d;
  --accent-3: #00b4ab;
  --border: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.04);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.nav {
  width: min(680px, calc(100% - 24px));
  margin: 12px auto 0;
  background: var(--bg-nav);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  padding: 6px 8px;
  position: sticky;
  top: 12px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.nav-right {
  justify-content: flex-end;
  margin-left: auto;
}

.nav .nav-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 74px;
  width: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  text-decoration: none;
  box-shadow: none;
  pointer-events: auto;
}

.nav .nav-logo:hover {
  background: transparent;
  transform: translate(-50%, -50%);
  color: inherit;
}

.nav .nav-logo img {
  width: auto;
  height: 100%;
  max-width: none;
  object-fit: contain;
  display: block;
  background: transparent;
  border-radius: 0;
}

.nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  letter-spacing: -0.01em;
  padding: 8px 18px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav a:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.nav a.active {
  color: #ffffff;
  background: var(--text-primary);
}

.nav .feed-toggle,
.nav .log-link,
.nav .faq-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav .feed-toggle {
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 16px;
}

.nav .feed-toggle:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

.nav .log-link,
.nav .faq-link {
  width: 36px;
  height: 36px;
  background: transparent;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

.nav .log-link:hover,
.nav .faq-link:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
}

.container {
  max-width: 680px;
  margin: 20px auto 48px;
  padding: 0 16px 24px;
}

.post {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.post:hover {
  box-shadow: var(--shadow-md);
}

.post::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
  border-radius: 0 2px 2px 0;
}

.post-log-link {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.post:hover .post-log-link {
  opacity: 1;
}

.post-log-link:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}

.reply-log-link {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.reply:hover .reply-log-link {
  opacity: 1;
}

.reply-log-link:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}

.author {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0;
}

.author a {
  text-decoration: none;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

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

.author a::before {
  content: none;
  display: none;
}

.author a img {
  width: 59px !important;
  height: 59px !important;
  margin-right: 0 !important;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 2px solid rgba(0, 0, 0, 0.06);
}

.text {
  order: 2;
  margin: 12px 0 0;
  font-size: 15px;
  color: var(--text-primary);
  white-space: pre-wrap;
  line-height: 1.55;
}

.text p { margin: 0; }

.post-image {
  order: 1;
  margin-top: 12px;
  margin-bottom: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.post-image img {
  width: 100%;
  display: block;
}

.time {
  order: 3;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0;
}

.post-replies {
  order: 4;
}

.reply {
  position: relative;
  margin-top: 10px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-left: 24px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  box-shadow: none;
}

.post-replies:empty { display: none; }

@media (max-width: 640px) {
  .nav {
    width: calc(100% - 16px);
    gap: 4px;
    padding: 4px 6px;
  }

  .nav-left,
  .nav-right {
    gap: 2px;
  }

  .nav .nav-logo {
    height: 74px;
  }

  .nav a {
    padding: 7px 14px;
    font-size: 13px;
  }

  .nav .feed-toggle {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .nav .log-link,
  .nav .faq-link {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .container {
    margin-top: 16px;
    padding-inline: 10px;
  }

  .post {
    padding: 16px;
    border-radius: 18px;
  }

  .post-log-link {
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .reply-log-link {
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    font-size: 14px;
  }

  .reply {
    margin-left: 12px;
    padding: 12px;
  }

  .author a img {
  width: 52px !important;
  height: 52px !important;
  }
}

.log-root .character > :not(summary),
.log-root .category > :not(summary),
.log-root .memory-thread > :not(summary) {
  padding: 0 0 4px 14px !important;
}

.log-root .category > :not(summary) {
  padding: 0 0 2px 14px !important;
}

.log-root .memory-thread > :not(summary) {
  padding: 0 0 0 14px !important;
}

.log-root .log-links {
  display: flex !important;
  flex-wrap: wrap;
  gap: 4px 6px;
  align-items: center;
  margin: 0 8px 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.log-root .log-links > span {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.log-root .log-chip {
  display: inline-flex !important;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 11px;
  line-height: 1.4;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.log-root .log-chip:hover {
  color: var(--accent);
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.12);
}

@media (max-width: 640px) {
  .log-root .character > :not(summary),
  .log-root .category > :not(summary),
  .log-root .memory-thread > :not(summary) {
    padding: 0 0 4px 10px !important;
  }

  .log-root .category > :not(summary) {
    padding: 0 0 2px 10px !important;
  }

  .log-root .memory-thread > :not(summary) {
    padding: 0 0 0 10px !important;
  }

  .log-root .log-links {
    margin-left: 4px;
    margin-right: 4px;
  }
}
