:root {
  color-scheme: light;
  --paper: #f6f0df;
  --paper-2: #efe3c6;
  --ink: #17211e;
  --muted: #69736f;
  --line: #d7c59e;
  --sky: #1e6f8a;
  --jade: #18876f;
  --moss: #566b2f;
  --amber: #b5751a;
  --coral: #bd4d35;
  --night: #102529;
  --panel: rgba(255, 252, 243, 0.84);
  --shadow: 0 18px 50px rgba(39, 53, 43, 0.14);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  font-family: "Palatino Linotype", "Book Antiqua", "Noto Serif SC", SimSun, serif;
  background:
    linear-gradient(90deg, rgba(30, 111, 138, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(86, 107, 47, 0.07) 1px, transparent 1px),
    radial-gradient(circle at 18% 8%, rgba(30, 111, 138, 0.18), transparent 28%),
    radial-gradient(circle at 85% 16%, rgba(181, 117, 26, 0.18), transparent 28%),
    linear-gradient(140deg, #fbf6e7 0%, #ead7ad 52%, #d7e3d0 100%);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(120deg, rgba(255, 255, 255, 0.38), transparent 28%, rgba(16, 37, 41, 0.08)),
    repeating-linear-gradient(0deg, rgba(23, 33, 30, 0.025), rgba(23, 33, 30, 0.025) 1px, transparent 1px, transparent 5px);
  mix-blend-mode: multiply;
}

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

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

button {
  min-height: 38px;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(30, 111, 138, 0.28);
  outline-offset: 3px;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 56px;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  min-height: 72px;
  padding: 14px 0 18px;
  border-bottom: 1px solid rgba(23, 33, 30, 0.16);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  color: #fffaf0;
  background: conic-gradient(from 40deg, var(--sky), var(--jade), var(--amber), var(--coral), var(--sky));
  border: 2px solid rgba(23, 33, 30, 0.72);
  box-shadow: 4px 4px 0 rgba(23, 33, 30, 0.18);
}

.brand-title {
  display: block;
  font-size: clamp(25px, 4vw, 36px);
  line-height: 1;
}

.brand-subtitle {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-family: Georgia, serif;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.nav a,
.user-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(23, 33, 30, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 252, 243, 0.62);
  color: var(--night);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nav a:hover,
.user-link:hover {
  transform: translateY(-1px);
  border-color: rgba(30, 111, 138, 0.48);
  background: rgba(255, 252, 243, 0.92);
}

.nav a.active {
  color: #fffaf0;
  background: var(--night);
  border-color: var(--night);
}

.user-box {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.user-pill {
  padding: 8px 10px;
  border: 1px solid rgba(23, 33, 30, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 252, 243, 0.62);
  text-align: right;
}

.user-pill strong,
.user-pill span {
  display: block;
}

.user-pill span {
  color: var(--amber);
  font-size: 12px;
}

.page {
  padding-top: 26px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.95fr);
  gap: 24px;
  align-items: stretch;
  min-height: 430px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(14px, 4vw, 28px) 0;
}

.eyebrow {
  display: inline-flex;
  width: max-content;
  gap: 8px;
  align-items: center;
  color: var(--coral);
  font-size: 13px;
  font-weight: 800;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: currentColor;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(46px, 10vw, 96px);
  line-height: 0.92;
  letter-spacing: 0;
}

.lead {
  max-width: 650px;
  color: #31433d;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.72;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 22px;
}

.btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid rgba(23, 33, 30, 0.18);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 252, 243, 0.76);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 rgba(23, 33, 30, 0.12);
}

.btn.primary {
  color: #fffaf0;
  background: var(--night);
  border-color: var(--night);
}

.btn.jade {
  color: #fffaf0;
  background: var(--jade);
  border-color: var(--jade);
}

.btn.coral {
  color: #fffaf0;
  background: var(--coral);
  border-color: var(--coral);
}

.btn.ghost {
  background: transparent;
}

.btn:disabled,
.icon-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.panel {
  border: 1px solid rgba(23, 33, 30, 0.18);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel.pad {
  padding: clamp(16px, 3vw, 24px);
}

.sky-board {
  position: relative;
  overflow: hidden;
  min-height: 430px;
  color: #f8f3e4;
  background:
    linear-gradient(180deg, rgba(16, 37, 41, 0.96), rgba(22, 63, 59, 0.88)),
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.2), transparent 18%);
}

.sky-board svg {
  width: 100%;
  height: 100%;
  min-height: 430px;
  display: block;
}

.sky-note {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: rgba(255, 252, 243, 0.82);
  font-size: 13px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin: 32px 0 14px;
}

.section-head h2 {
  margin-bottom: 3px;
  font-size: clamp(25px, 3vw, 34px);
}

.section-head p {
  color: var(--muted);
  margin: 0;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.post-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(23, 33, 30, 0.14);
  border-left: 5px solid var(--jade);
  border-radius: var(--radius);
  background: rgba(255, 252, 243, 0.74);
  transition: transform 160ms ease, background 160ms ease;
}

.post-row:hover {
  transform: translateY(-1px);
  background: rgba(255, 252, 243, 0.96);
}

.post-row h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.post-row p {
  margin-bottom: 12px;
  color: #40504b;
  line-height: 1.62;
}

.meta,
.tags,
.stat-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.tag,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid rgba(23, 33, 30, 0.14);
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.7);
  color: var(--night);
  font-size: 12px;
}

.badge.private {
  color: #fffaf0;
  border-color: var(--coral);
  background: var(--coral);
}

.temperature {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(23, 33, 30, 0.16);
  border-radius: 50%;
  color: #fffaf0;
  background: conic-gradient(var(--coral) var(--value, 20%), rgba(255, 255, 255, 0.22) 0), var(--night);
  font-weight: 900;
}

.filterbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.form {
  display: grid;
  gap: 12px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(23, 33, 30, 0.18);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--ink);
  background: rgba(255, 252, 243, 0.86);
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.58;
}

.empty {
  padding: 28px;
  border: 1px dashed rgba(23, 33, 30, 0.26);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  background: rgba(255, 252, 243, 0.44);
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100% - 32px));
  padding: 13px 15px;
  border: 1px solid rgba(23, 33, 30, 0.22);
  border-radius: var(--radius);
  color: #fffaf0;
  background: var(--night);
  box-shadow: var(--shadow);
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 460px);
  gap: 24px;
  align-items: stretch;
  min-height: 560px;
}

.talisman {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  color: #fffaf0;
  background:
    linear-gradient(155deg, rgba(16, 37, 41, 0.94), rgba(30, 111, 138, 0.82)),
    repeating-linear-gradient(90deg, transparent, transparent 18px, rgba(255, 255, 255, 0.08) 19px);
}

.talisman::after {
  content: "天地";
  position: absolute;
  right: -8px;
  bottom: -28px;
  color: rgba(255, 252, 243, 0.1);
  font-size: 180px;
  font-weight: 900;
  line-height: 1;
}

.post-body {
  white-space: pre-wrap;
  color: #2b3c36;
  font-size: 18px;
  line-height: 1.84;
}

.append-item,
.comment-item,
.task-item,
.message {
  padding: 14px;
  border: 1px solid rgba(23, 33, 30, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 252, 243, 0.7);
}

.comment-item {
  display: grid;
  gap: 6px;
}

.chat-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 680px;
  overflow: hidden;
}

.group-list {
  border-right: 1px solid rgba(23, 33, 30, 0.14);
  background: rgba(255, 252, 243, 0.42);
}

.group-list button {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid rgba(23, 33, 30, 0.12);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.group-list button.active {
  color: #fffaf0;
  background: var(--night);
}

.message-pane {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 680px;
}

.messages {
  overflow: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.message {
  width: min(74%, 620px);
}

.message.mine {
  align-self: flex-end;
  border-color: rgba(24, 135, 111, 0.38);
  background: rgba(220, 241, 231, 0.76);
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.admin-tabs button.active {
  color: #fffaf0;
  background: var(--night);
}

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(255, 252, 243, 0.68);
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid rgba(23, 33, 30, 0.12);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--night);
  background: rgba(214, 197, 158, 0.42);
}

.compact {
  font-size: 13px;
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .topbar,
  .hero,
  .auth-layout,
  .chat-layout {
    grid-template-columns: 1fr;
  }

  .nav {
    justify-content: start;
  }

  .user-box {
    justify-content: start;
  }

  .filterbar,
  .form-row,
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .message,
  .post-row {
    width: 100%;
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: clamp(44px, 17vw, 72px);
  }
}
