@import url("https://cdn-font.hyperos.mi.com/font/css?family=MiSans:400,500,600,700:Chinese_Simplify,Latin&display=swap");

:root {
  --bg: #f4f0e8;
  --panel: rgba(255, 252, 247, 0.88);
  --panel-strong: #fffdf8;
  --line: rgba(113, 93, 68, 0.16);
  --text: #2e251c;
  --muted: #74624f;
  --accent: #8f5d2d;
  --accent-soft: rgba(143, 93, 45, 0.12);
  --shadow: 0 24px 60px rgba(76, 56, 34, 0.12);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "MiSans", sans-serif;
  color: var(--text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(circle at top left, rgba(214, 185, 149, 0.3), transparent 28%),
    radial-gradient(circle at top right, rgba(196, 219, 204, 0.28), transparent 24%),
    linear-gradient(180deg, #f8f5ef 0%, var(--bg) 100%);
}

body {
  padding: 24px;
}

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

img {
  max-width: 100%;
  display: block;
}

.app-shell {
  width: min(780px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.04em;
}

.brand-text {
  font-size: 0.98rem;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c48848 0%, #8f5d2d 100%);
  box-shadow: 0 0 0 6px rgba(143, 93, 45, 0.1);
}

.topnav {
  display: inline-flex;
  gap: 18px;
  color: var(--muted);
  font-size: 0.96rem;
}

.topnav a {
  transition: color 0.2s ease;
}

.topnav a:hover,
.topnav a:focus-visible {
  color: var(--text);
}

.feed-shell,
.detail-shell,
.comment-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
}

.comment-head h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
}

.topbar-search {
  width: min(320px, 100%);
}

.button,
.search-input {
  height: 46px;
  border-radius: 999px;
  font: inherit;
}

.button {
  padding: 0 20px;
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, #9b6734 0%, #7f4f21 100%);
  color: #fffaf4;
}

.button-secondary {
  background: rgba(255, 252, 247, 0.95);
  color: var(--text);
  border: 1px solid var(--line);
}

.search-input {
  width: 100%;
  min-width: 180px;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: rgba(143, 93, 45, 0.32);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 4px rgba(143, 93, 45, 0.08);
}

.feed-shell {
  margin-top: 22px;
  padding: 24px 24px 26px;
}

.feed-meta {
  margin: 4px 4px 20px;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.memo-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.memo-card {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 28px 30px;
  border: 1px solid rgba(113, 93, 68, 0.1);
  border-radius: 22px;
  background: var(--panel-strong);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.memo-card:hover {
  transform: translateY(-1px);
  border-color: rgba(143, 93, 45, 0.18);
  box-shadow: 0 14px 32px rgba(76, 56, 34, 0.08);
}

.memo-card-head {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: center;
}

.memo-date {
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.memo-title {
  margin: 0;
  font-size: clamp(1.18rem, 2vw, 1.34rem);
  line-height: 1.7;
  letter-spacing: 0.01em;
  font-weight: 600;
}

.memo-excerpt {
  margin: 0;
  color: var(--muted);
  line-height: 1.95;
  font-size: 1rem;
  letter-spacing: 0.01em;
  max-width: 62ch;
}

.memo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.memo-tag {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(143, 93, 45, 0.08);
  color: var(--accent);
  font-size: 0.8rem;
}

.memo-card-foot {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 0.2rem;
}

.memo-link {
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.load-more-row {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.detail-shell {
  padding: 30px 34px 36px;
}

.back-link {
  margin-bottom: 18px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  letter-spacing: 0.02em;
}

.detail-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}

.detail-title {
  margin: 0;
  font-size: clamp(1.92rem, 3vw, 2.9rem);
  line-height: 1.32;
  letter-spacing: 0.01em;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: var(--muted);
  font-size: 0.95rem;
  padding-bottom: 0.25rem;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-body {
  color: var(--text);
  font-size: clamp(1.04rem, 1vw + 0.88rem, 1.12rem);
  line-height: 2.02;
  letter-spacing: 0.012em;
  word-break: break-word;
  max-width: 46rem;
  margin: 0 auto;
}

.detail-body > :first-child {
  margin-top: 0;
}

.detail-body > :last-child {
  margin-bottom: 0;
}

.detail-body h1,
.detail-body h2,
.detail-body h3 {
  margin: 2rem 0 1rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.detail-body p,
.detail-body li {
  margin: 0 0 1.15rem;
}

.detail-body ul,
.detail-body ol {
  margin: 0 0 1.3rem;
  padding-left: 1.35rem;
}

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

.detail-body img {
  margin: 1.8rem auto;
  border-radius: 18px;
  box-shadow: 0 16px 38px rgba(45, 31, 15, 0.14);
}

.detail-body pre {
  overflow: auto;
  padding: 18px 20px;
  border-radius: 16px;
  background: #2e251c;
  color: #f9f3ea;
  line-height: 1.7;
}

.detail-body blockquote {
  margin: 1.6rem 0;
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: rgba(143, 93, 45, 0.06);
  color: var(--muted);
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 46rem;
  margin: 2.6rem auto 0;
}

.post-nav-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 124px;
  padding: 18px 20px;
  border: 1px solid rgba(113, 93, 68, 0.12);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.78);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.post-nav-card:hover {
  transform: translateY(-1px);
  border-color: rgba(143, 93, 45, 0.2);
  box-shadow: 0 12px 26px rgba(76, 56, 34, 0.08);
}

.post-nav-card-next {
  text-align: right;
}

.post-nav-card.is-empty {
  justify-content: center;
  background: rgba(255, 252, 247, 0.5);
  box-shadow: none;
}

.post-nav-card.is-empty:hover {
  transform: none;
  border-color: rgba(113, 93, 68, 0.12);
}

.post-nav-label {
  color: var(--accent);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.post-nav-title {
  font-size: 1rem;
  line-height: 1.75;
  font-weight: 600;
  color: var(--text);
}

.post-nav-date,
.post-nav-empty {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

.comment-shell {
  margin-top: 24px;
  padding: 28px 32px;
}

.comment-head,
#artalk-root {
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}

.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 252, 247, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.footer-copy,
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: center;
}

.footer-copy strong {
  font-size: 0.98rem;
  letter-spacing: 0.04em;
}

.footer-copy span,
.footer-meta span {
  color: var(--muted);
  font-size: 0.92rem;
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 28px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(113, 93, 68, 0.2);
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.94);
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1;
  box-shadow: 0 16px 36px rgba(76, 56, 34, 0.14);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 50;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.empty-state,
.error-state,
.loading-state {
  padding: 42px 20px;
  text-align: center;
  color: var(--muted);
}

::selection {
  background: rgba(143, 93, 45, 0.18);
}

@media (max-width: 900px) {
  body {
    padding: 14px;
  }

  .app-shell {
    width: min(100%, 740px);
  }
}

@media (max-width: 640px) {
  .topbar,
  .feed-shell,
  .detail-shell,
  .comment-shell,
  .site-footer {
    border-radius: 20px;
  }

  .topbar,
  .detail-shell,
  .comment-shell,
  .site-footer {
    padding: 18px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
    border-radius: 22px;
  }

  .topnav {
    width: 100%;
    justify-content: center;
  }

  .topbar-search {
    width: 100%;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .back-to-top {
    display: none;
  }

  .memo-card {
    padding: 22px 20px;
  }

  .detail-shell,
  .comment-shell {
    padding: 22px 20px 24px;
  }

  .detail-head,
  .detail-body,
  .post-nav,
  .comment-head,
  #artalk-root {
    max-width: 100%;
  }

  .post-nav {
    grid-template-columns: 1fr;
    margin-top: 2.2rem;
  }

  .post-nav-card-next {
    text-align: left;
  }

  .detail-body {
    font-size: 1rem;
    line-height: 1.92;
  }
}
