:root {
  --bg: #f3f6f2;
  --ink: #173025;
  --panel: #ffffff;
  --edge: #d2dacc;
  --accent: #1f7a45;
  --warn: #b53a2f;
  --muted: #5b6b62;
  --shadow: 0 18px 50px rgba(27, 40, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Noto Sans SC', system-ui, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: radial-gradient(circle at top left, #dff1db 0%, transparent 35%),
    radial-gradient(circle at top right, #fde2bf 0%, transparent 30%), var(--bg);
}

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

.hidden {
  display: none !important;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
}

.brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-links a {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--muted);
}

.nav-links a.active,
.nav-links a:hover {
  border-color: var(--edge);
  color: var(--ink);
  background: #fff;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.hero-block {
  border-radius: 20px;
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 18px;
}

.hero-kicker {
  margin: 0;
  color: var(--muted);
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.hero-block h1 {
  margin: 8px 0 10px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.hero-block p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.7;
}

.panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--edge);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}

.panel-head {
  margin-bottom: 12px;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
}

.panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.feed-list {
  display: grid;
  gap: 12px;
}

.feed-item {
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
}

.feed-item img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--edge);
}

.feed-item h3,
.feed-item h4,
.feed-item h1 {
  margin: 0 0 4px;
}

.feed-item p {
  margin: 0 0 8px;
  color: var(--muted);
}

.story-snippet {
  color: #2e4f40 !important;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.badge {
  border-radius: 999px;
  padding: 3px 10px;
  background: #e8f4ea;
  color: #155a32;
}

.badge.warn {
  background: #fbe8d8;
  color: #945216;
}

.badge.danger {
  background: #f8ddda;
  color: var(--warn);
}

.inline-link {
  color: #1a5f39;
  font-weight: 700;
}

.inline-link:hover {
  text-decoration: underline;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgba(31, 122, 69, 0.22);
  border-color: var(--accent);
}

button {
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.ghost {
  background: #eef3ec;
  color: var(--ink);
}

/* Anchor buttons (used for auth links) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.btn.ghost {
  background: #eef3ec;
  color: var(--ink);
}

.upload-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.upload-dropzone {
  border: 1px dashed #9fb2a6;
  border-radius: 12px;
  padding: 12px;
  background: #f9fcf8;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.upload-dropzone p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.upload-dropzone.active {
  border-color: var(--accent);
  background: #edf8ef;
}

.avatar-preview {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border: 1px solid var(--edge);
  border-radius: 14px;
}

.upload-status {
  font-size: 0.82rem;
}

.upload-status.danger {
  color: var(--warn);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(20, 32, 27, 0.45);
  display: grid;
  place-items: center;
  padding: 14px;
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--edge);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.auth-modal-card {
  width: min(860px, 100%);
}

.modal-form {
  margin-top: 10px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.card {
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-card {
  display: grid;
  gap: 14px;
}

.detail-head {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
}

.detail-head img {
  width: 110px;
  height: 110px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--edge);
}

.story-block {
  border-left: 3px solid #b8d5bf;
  padding-left: 10px;
}

.story-block h3,
.story-block h5 {
  margin: 0 0 8px;
}

.story-block p {
  margin: 0;
  color: #2e4f40;
  line-height: 1.7;
}

.story-block.large {
  padding-top: 4px;
}

.comments-list {
  display: grid;
  gap: 8px;
}

.comment-item {
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: #fdfefd;
  padding: 9px 10px;
}

.comment-meta {
  margin: 0 0 6px;
  font-size: 0.78rem;
  color: #6b7f73;
}

.comment-content {
  margin: 0;
  color: var(--ink);
}

.comment-form {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.comment-login-tip {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-block {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
}

.avatar-shell {
  width: 84px;
  height: 84px;
  border-radius: 14px;
  border: 1px solid var(--edge);
  background: #eef3ec;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 1.2rem;
  font-weight: 700;
  color: #2a5d41;
}

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

.empty {
  border: 1px dashed var(--edge);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 14px;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  background: #163228;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  box-shadow: var(--shadow);
}

@media (max-width: 860px) {
  .site-header {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .auth-actions {
    margin-left: auto;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .detail-head {
    grid-template-columns: 72px 1fr;
  }

  .detail-head img {
    width: 72px;
    height: 72px;
  }

  .profile-block {
    grid-template-columns: 64px 1fr;
  }

  .avatar-shell {
    width: 64px;
    height: 64px;
  }

  .feed-item {
    grid-template-columns: 58px 1fr;
  }

  .feed-item img {
    width: 58px;
    height: 58px;
  }
}
