/* 围炉小站 · 样式
   纸感底色 + 松绿点缀，窄栏排版，阅读优先。 */

:root {
  --bg: #faf7f2;
  --bg-soft: #f3ede2;
  --ink: #24211d;
  --ink-soft: #4b453d;
  --muted: #6f665a;
  --line: #e4dccd;
  --line-strong: #d3c8b5;
  --accent: #2f5d50;
  --accent-ink: #faf7f2;
  --accent-soft: rgba(47, 93, 80, 0.08);
  --danger: #a8412f;
  --alert-bg: #fbeee9;
  --radius: 8px;
  --font-serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", "SimSun", "Noto Serif SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171614;
    --bg-soft: #1f1d1a;
    --ink: #e9e3d8;
    --ink-soft: #c8c0b3;
    --muted: #948b7d;
    --line: #302c26;
    --line-strong: #443e35;
    --accent: #8fb9a8;
    --accent-ink: #171614;
    --accent-soft: rgba(143, 185, 168, 0.1);
    --danger: #e08a76;
    --alert-bg: #2a1d19;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(80rem 40rem at 50% -20%, var(--bg-soft), transparent 70%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 3px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 14px;
  border-radius: var(--radius);
  z-index: 10;
}

.skip-link:focus {
  left: 8px;
}

/* ------------------------------ 页头 ------------------------------ */

.site-header {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand:hover {
  color: inherit;
}

.brand-seal {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: 0.14em;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}

.nav-link:hover {
  color: var(--ink);
}

.nav-cta {
  padding: 5px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.nav-cta:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.nav-user {
  color: var(--ink-soft);
}

.inline-form {
  display: inline;
  margin: 0;
}

.linklike {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.linklike:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

.linklike.danger:hover {
  color: var(--danger);
}

/* ------------------------------ 主体 ------------------------------ */

main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 24px 56px;
}

.masthead {
  padding: 26px 0 34px;
  border-bottom: 1px solid var(--line);
}

.masthead h1 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(30px, 5vw, 40px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.masthead p {
  margin: 0;
  max-width: 34em;
  color: var(--muted);
}

.feed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 30px 0 6px;
}

.feed-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.feed {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.feed-item {
  padding: 18px 0 16px;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s ease;
}

.feed-item:hover {
  background: linear-gradient(90deg, var(--accent-soft), transparent 70%);
}

.feed-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.feed-title:hover {
  color: var(--accent);
}

.feed-meta,
.meta,
.reply-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.feed-author {
  color: var(--ink-soft);
}

.dot {
  opacity: 0.55;
}

/* ------------------------------ 帖子 ------------------------------ */

.thread {
  padding: 30px 0 8px;
}

.thread-head h1 {
  margin: 0 0 10px;
  font-family: var(--font-serif);
  font-size: clamp(26px, 4.2vw, 34px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}

.prose {
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 16.5px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.thread-actions {
  margin-top: 22px;
  text-align: right;
}

.replies {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding-top: 26px;
}

.replies-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.replies-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
}

.reply-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.reply {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.reply .prose {
  margin: 6px 0 0;
  font-size: 15.5px;
}

.no-replies {
  margin: 18px 0 0;
  color: var(--muted);
}

.login-hint {
  margin: 26px 0 0;
  color: var(--muted);
}

.login-hint a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------ 表单 ------------------------------ */

.reply-form {
  margin-top: 28px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > span {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

input,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.75;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.form-foot {
  display: flex;
  align-items: center;
  gap: 18px;
}

.btn {
  display: inline-block;
  padding: 9px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.btn:hover {
  opacity: 0.9;
  color: var(--accent-ink);
}

.btn:active {
  transform: translateY(1px);
}

.field-note {
  margin: -6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}

.alert {
  margin: 20px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--danger);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--alert-bg);
  color: var(--danger);
  font-size: 14px;
}

/* ------------------------------ 认证 / 发帖页 ------------------------------ */

.auth,
.compose {
  max-width: 440px;
  margin: 40px auto 0;
}

.compose {
  max-width: 620px;
}

.auth h1,
.compose h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 600;
}

.auth-sub {
  margin: 8px 0 0;
  color: var(--muted);
}

.auth-alt {
  margin-top: 24px;
  color: var(--muted);
  font-size: 14px;
}

.auth-alt a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------ 空状态 / 404 ------------------------------ */

.empty {
  padding: 54px 0;
  text-align: center;
}

.empty-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 21px;
}

.empty-text {
  margin: 8px 0 22px;
  color: var(--muted);
}

.notfound {
  padding: 64px 0;
  text-align: center;
}

.notfound-code {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 56px;
  color: var(--line-strong);
}

.notfound h1 {
  margin: 4px 0 8px;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 600;
}

.notfound p {
  margin: 0 0 24px;
  color: var(--muted);
}

/* ------------------------------ 分页 / 页脚 ------------------------------ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  font-size: 14px;
}

.page-link {
  color: var(--ink-soft);
}

.page-link:hover {
  color: var(--accent);
}

.page-link.disabled {
  color: var(--muted);
  opacity: 0.5;
}

.page-link.current {
  color: var(--muted);
}

.page-status {
  color: var(--muted);
  font-size: 13px;
}

.site-footer {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 24px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 560px) {
  .site-header {
    padding: 20px 18px 14px;
  }

  main {
    padding: 4px 18px 40px;
  }

  .site-footer {
    padding: 20px 18px 32px;
  }

  .masthead {
    padding: 18px 0 26px;
  }

  .feed-item {
    padding: 15px 0 13px;
  }

  .nav {
    gap: 12px;
  }
}

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