:root {
  --orange: #d98218;
  --orange-deep: #a9570d;
  --orange-soft: #f5dfc3;
  --cream: #fbf6ee;
  --paper: #fffdfa;
  --ink: #302318;
  --muted: #75695f;
  --line: #e4d2bd;
  --shadow: 0 14px 38px rgba(91, 55, 21, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 88% 4%, rgba(224, 142, 36, .14), transparent 30rem),
    linear-gradient(180deg, #fffdfa 0, var(--cream) 38rem, #f8f0e5 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}
a { color: inherit; }

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  max-width: 1180px;
  margin: auto;
  padding: 0 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 250, .82);
}
.brand {
  text-decoration: none;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -1.5px;
}
.brand strong { color: var(--orange); }
.site-head nav { display: flex; gap: 18px; }
.site-head nav a {
  color: #6e4b2e;
  text-decoration: none;
  font-weight: 700;
}
.site-head nav a:hover,
.site-head nav a:focus-visible { color: var(--orange-deep); }

.shell {
  max-width: 1100px;
  margin: auto;
  padding: 42px 24px 70px;
}
.hero-card {
  display: grid;
  grid-template-columns: 1.5fr .7fr;
  gap: 30px;
  align-items: center;
  margin-bottom: 24px;
  padding: 34px;
  border: 1px solid #dfc29f;
  border-radius: 24px;
  background: linear-gradient(145deg, #fffefa, #f8e8d2);
  box-shadow: 0 22px 60px rgba(112, 67, 25, .12);
}
h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 10px;
  color: #2c1f15;
  font-size: clamp(36px, 6vw, 58px);
  line-height: 1;
}
.hero-card > div > p:last-child {
  margin: 0;
  color: #685b50;
  font-size: 17px;
}
.eyebrow {
  margin-bottom: 8px;
  color: var(--orange-deep);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .15em;
}
.privacy-note {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 18px;
  border-left: 3px solid var(--orange);
  border-radius: 0 12px 12px 0;
  background: rgba(224, 142, 36, .11);
}
.privacy-note span { color: #736559; font-size: 13px; }

.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 250, .97);
  box-shadow: var(--shadow);
}
.alert {
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: 12px;
}
.alert.error {
  border: 1px solid #d8958e;
  background: #fff0ed;
  color: #7f2d25;
}
.alert.success {
  border: 1px solid #9cbe92;
  background: #f0f8ed;
  color: #315f28;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.category-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  text-decoration: none;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.category-card:hover,
.category-card:focus-visible {
  transform: translateY(-2px);
  border-color: #dc9a49;
  box-shadow: 0 16px 38px rgba(112, 67, 25, .15);
  outline: none;
}
.category-icon {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  height: 44px;
  border-radius: 13px;
  background: #f9e5ca;
  color: var(--orange-deep);
  font-size: 25px;
}
.category-card strong,
.category-card small { display: block; }
.category-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.topic-index,
.compose,
.topic-head,
.admin-login {
  padding: 26px;
  margin-bottom: 24px;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}
.section-title h1,
.section-title h2 { margin: 0; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid #d6974a;
  border-radius: 999px;
  background: #fffaf3;
  color: #81420d;
  font: 700 14px Arial, sans-serif;
  text-decoration: none;
  cursor: pointer;
}
.button:hover,
.button:focus-visible {
  background: #f8e4c8;
  outline: 2px solid rgba(169, 87, 13, .24);
  outline-offset: 2px;
}
.button.primary {
  border-color: #bf6814;
  background: linear-gradient(115deg, #f2ae4b, #d97f17);
  color: #2b1808;
  box-shadow: 0 7px 16px rgba(169, 87, 13, .18);
}
.button.danger {
  border-color: #c97a72;
  background: #fff5f3;
  color: #9a362e;
}

.topic-rows { border-top: 1px solid var(--line); }
.topic-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px 145px;
  gap: 16px;
  align-items: center;
  padding: 16px 4px;
  border-bottom: 1px solid #eee1d2;
  text-decoration: none;
}
.topic-row:hover .topic-main strong,
.topic-row:focus-visible .topic-main strong { color: var(--orange-deep); }
.topic-main strong,
.topic-main small,
.topic-meta strong,
.topic-meta small { display: block; }
.topic-main small,
.topic-meta small,
.topic-row time {
  color: var(--muted);
  font-size: 12px;
}
.topic-meta { text-align: center; }
.topic-row time { text-align: right; }
.empty { color: var(--muted); }

.compose label {
  display: block;
  margin: 16px 0 7px;
  font-weight: 700;
}
.compose label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.compose input,
.compose textarea,
.compose select {
  display: block;
  width: 100%;
  margin-top: 7px;
  padding: 12px 13px;
  border: 1px solid #d8bd9c;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  box-shadow: inset 0 1px 2px rgba(88, 52, 20, .05);
}
.compose textarea { resize: vertical; }
.compose input:focus,
.compose textarea:focus,
.compose select:focus {
  border-color: var(--orange);
  outline: 3px solid rgba(217, 130, 24, .18);
  outline-offset: 1px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.human-check { max-width: 340px; }
.trap {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
.form-note { color: var(--muted); font-size: 12px; }
.breadcrumb {
  display: flex;
  gap: 10px;
  margin: 0 0 14px;
  color: #75583d;
  font-size: 13px;
}
.breadcrumb a { color: var(--orange-deep); }
.topic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topic-head h2 { margin: 0; }
.locked {
  padding: 8px 12px;
  border-radius: 999px;
  background: #f8e4c8;
  color: #80420e;
  font-size: 12px;
  font-weight: 700;
}

.post-list {
  display: grid;
  gap: 13px;
  margin-bottom: 24px;
}
.post { padding: 0; overflow: hidden; }
.post header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid #eadccc;
  background: #fbf1e4;
}
.post header time { color: var(--muted); font-size: 12px; }
.post-body {
  padding: 20px 18px;
  color: #37291d;
  overflow-wrap: anywhere;
}
.report-form { padding: 0 18px 12px; text-align: right; }
.text-button {
  border: 0;
  background: none;
  color: #81746a;
  font-size: 11px;
  cursor: pointer;
}
.text-button:hover { color: var(--orange-deep); }
.moderation-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid #eadccc;
}
.moderation-item p { margin: 5px 0 0; color: var(--muted); }
.moderation-actions { display: flex; gap: 7px; }
.moderation-actions form { margin: 0; }
code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #f5e6d4;
  color: #7e3d08;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  max-width: 1100px;
  margin: auto;
  padding: 25px 24px 38px;
  border-top: 1px solid var(--line);
  color: #7a6e64;
  font-size: 13px;
}
footer a { color: #99500e; }

@media (max-width: 760px) {
  .site-head { min-height: 66px; padding: 0 16px; }
  .site-head nav a:first-child { display: none; }
  .shell { padding: 24px 13px 50px; }
  .hero-card { grid-template-columns: 1fr; padding: 25px; }
  .category-grid { grid-template-columns: 1fr; }
  .topic-row { grid-template-columns: minmax(0, 1fr) 62px; }
  .topic-row time { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .moderation-item { display: block; }
  .moderation-actions { margin-top: 12px; flex-wrap: wrap; }
}

@media (max-width: 480px) {
  .brand { font-size: 27px; }
  .site-head nav a { font-size: 13px; }
  .section-title,
  .topic-head,
  .post header { align-items: flex-start; flex-direction: column; }
  .topic-meta { display: none; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
