:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #f4f1eb;
  color: #252525;
  --ink: #202826;
  --paper: #fffdf8;
  --line: #ded6c8;
  --accent: #7a4f2b;
  --flame: #d88b45;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.72), rgba(244, 241, 235, 0) 260px),
    #f4f1eb;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px 28px;
  background: rgba(32, 40, 38, 0.96);
  color: #fff;
  box-shadow: 0 10px 28px rgba(32, 40, 38, 0.18);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

nav {
  align-items: center;
  display: flex;
  gap: 18px;
  font-size: 14px;
}

nav a {
  color: rgba(255, 255, 255, 0.82);
}

nav a:hover {
  color: #fff;
}

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  min-height: 160px;
  padding: 28px 0;
  border-bottom: 1px solid #d8d1c3;
  margin-bottom: 22px;
}

.hero h1 {
  margin: 6px 0;
  font-size: 34px;
  line-height: 1.15;
}

.hero-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  background: #fffdf8;
  border: 1px solid #ded6c8;
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(42, 35, 26, 0.08);
}

.hero-mark img {
  width: 68px;
  height: 68px;
}

.eyebrow {
  margin: 0;
  color: #7a4f2b;
  font-size: 13px;
  font-weight: 700;
}

.muted {
  color: #6f6a61;
}

.panel {
  background: #fffdf8;
  border: 1px solid #ded6c8;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 12px 30px rgba(42, 35, 26, 0.045);
}

.panel h2 {
  margin-top: 0;
  font-size: 20px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.status-strip div {
  min-height: 86px;
  padding: 16px;
  background: #202826;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(32, 40, 38, 0.14);
}

.status-strip span {
  display: block;
  margin-bottom: 8px;
  color: #d7cdbf;
  font-size: 13px;
}

.status-strip strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.15;
}

.status-strip small {
  display: block;
  margin-top: 6px;
  color: #d7cdbf;
  font-size: 13px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
}

.text-link {
  color: #7a4f2b;
  font-size: 14px;
  font-weight: 700;
}

.text-link:hover {
  text-decoration: underline;
}

.narrow-panel {
  max-width: 460px;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  color: #7a4f2b;
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cfc5b7;
  border-radius: 8px;
  font: inherit;
}

.login-form button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #202826;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.join-hero {
  align-items: center;
}

.join-badge {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border: 1px solid #ded6c8;
  border-radius: 18px;
  background: #202826;
  color: #fff;
  box-shadow: 0 18px 42px rgba(32, 40, 38, 0.18);
}

.join-badge span {
  color: #d7cdbf;
  font-size: 13px;
}

.join-badge strong {
  font-size: 34px;
  line-height: 1;
}

.join-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.coming-soon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eee6d8;
  color: #7a4f2b;
  font-size: 13px;
  font-weight: 700;
}

.join-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.join-field-grid label {
  display: grid;
  gap: 8px;
  color: #7a4f2b;
  font-weight: 700;
}

.join-field-grid input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cfc5b7;
  border-radius: 8px;
  background: #f4f1eb;
  color: #4d4740;
  font: inherit;
}

.disabled-action {
  width: 100%;
  min-height: 46px;
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  background: #202826;
  color: #d7cdbf;
  font: inherit;
  font-weight: 700;
  cursor: not-allowed;
}

.join-note ul {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  padding-left: 20px;
  color: #3c3934;
  line-height: 1.7;
}

.error {
  margin: 0;
  color: #9a2f2f;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stats-strip div {
  min-height: 82px;
  padding: 16px;
  background: #202826;
  color: #fff;
  border-radius: 8px;
}

.stats-strip span {
  display: block;
  margin-bottom: 8px;
  color: #d7cdbf;
  font-size: 13px;
}

.stats-strip strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 22px;
  line-height: 1.15;
}

.active-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.active-card {
  display: grid;
  gap: 14px;
  min-height: 138px;
  padding: 16px;
  background: linear-gradient(180deg, #fffdf8, #faf4eb);
  border: 1px solid #ded6c8;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(42, 35, 26, 0.04);
}

.active-card:hover {
  border-color: #987351;
  transform: translateY(-1px);
}

.active-card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid #ebe4d8;
}

.active-card-foot span {
  color: #7a4f2b;
  font-size: 14px;
  font-weight: 700;
}

.active-card-foot small {
  color: #635e55;
  text-align: right;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.agent-grid.wide {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.agent-card {
  display: flex;
  min-height: 204px;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
  padding: 18px;
  background: #fffdf8;
  border: 1px solid #ded6c8;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(42, 35, 26, 0.04);
}

.agent-card:hover {
  border-color: #987351;
  transform: translateY(-1px);
}

.agent-card.compact {
  min-height: 112px;
}

.agent-card-head {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
}

.portrait-svg {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(42, 35, 26, 0.08);
}

.profile-hero {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 18px;
  align-items: center;
}

.profile-avatar .portrait-svg {
  width: 84px;
  height: 84px;
  border-radius: 14px;
}

.avatar {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--avatar-bg, #202826);
  color: #202826;
  border-radius: 8px;
  font-weight: 700;
}

.portrait-hair,
.portrait-face,
.portrait-body {
  position: absolute;
  display: block;
}

.portrait-hair {
  top: 8px;
  width: 24px;
  height: 18px;
  background: var(--avatar-accent, #202826);
  border-radius: 12px 12px 8px 8px;
  z-index: 1;
}

.portrait-face {
  top: 15px;
  width: 21px;
  height: 20px;
  background: var(--avatar-skin, #e8b88f);
  border-radius: 50%;
  z-index: 2;
}

.portrait-face::before,
.portrait-face::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 3px;
  height: 3px;
  background: #302a25;
  border-radius: 50%;
}

.portrait-face::before {
  left: 5px;
}

.portrait-face::after {
  right: 5px;
}

.portrait-body {
  bottom: -8px;
  width: 34px;
  height: 20px;
  background: var(--avatar-accent, #202826);
  border-radius: 14px 14px 0 0;
}

.agent-card strong {
  display: block;
  font-size: 18px;
}

.agent-card span,
.agent-card small {
  color: #635e55;
}

.occupation-line {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-card p {
  margin: 0;
  color: #3d3a34;
  line-height: 1.5;
  min-height: 48px;
}

.agent-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  min-height: 62px;
}

.agent-meta span {
  display: block;
  min-width: 0;
  padding: 5px 8px;
  background: #eee6d8;
  color: #5b4938;
  border-radius: 6px;
  font-size: 12px;
  line-height: 18px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-meta .primary {
  grid-column: 1 / -1;
  text-align: center;
  white-space: normal;
}

.fire-number {
  padding-top: 10px;
  border-top: 1px solid #ebe4d8;
  color: #7a4f2b;
  font-size: 13px;
  font-weight: 700;
}

.relation-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #ebe4d8;
  border-radius: 8px;
  background: #fffaf1;
  margin-bottom: 10px;
}

.relation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.relation-row strong {
  font-size: 16px;
}

.relation-row small,
.relation-row span {
  color: #635e55;
}

.relation-badge {
  padding: 4px 8px;
  border-radius: 6px;
  background: #e8dfd1;
  color: #6f4728;
  font-size: 12px;
  font-weight: 700;
}

.relation-meter {
  height: 8px;
  overflow: hidden;
  background: #ece5d9;
  border-radius: 999px;
}

.relation-meter span {
  display: block;
  height: 100%;
  background: #7a4f2b;
  border-radius: inherit;
}

.relation-trust .relation-meter span {
  background: #3d6f5a;
}

.relation-follow .relation-meter span {
  background: #6b6f3d;
}

.relation-dislike .relation-meter span {
  background: #8b3f47;
}

.timeline {
  display: grid;
  gap: 12px;
}

.macro-list {
  display: grid;
  gap: 10px;
}

.macro-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: #fff6ea;
  border: 1px solid #ead3b9;
  border-left: 4px solid #d88b45;
  border-radius: 8px;
}

.macro-item div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.macro-item strong {
  color: #7a4f2b;
}

.macro-item span {
  color: #6f6a61;
  font-size: 13px;
}

.macro-item p {
  margin: 0;
  line-height: 1.6;
}

.forum-list {
  display: grid;
  gap: 12px;
}

.forum-post-link {
  display: block;
}

.forum-post-link:hover .forum-post {
  border-color: #987351;
  transform: translateY(-1px);
}

.forum-post {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #fffdf8;
  border: 1px solid #ded6c8;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(42, 35, 26, 0.04);
}

.forum-post-detail {
  margin-bottom: 18px;
}

.forum-post-head {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: start;
}

.forum-post-head h2 {
  margin: 4px 0 0;
  font-size: 20px;
  line-height: 1.35;
}

.forum-post-head > div:only-child {
  grid-column: 1 / -1;
}

.forum-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #6f6a61;
  font-size: 13px;
}

.forum-meta strong {
  color: #252525;
}

.forum-body {
  white-space: pre-wrap;
  margin: 0;
  color: #3d3a34;
  line-height: 1.7;
}

.tone-long {
  border-left: 4px solid #3d6f5a;
}

.tone-risk {
  border-left: 4px solid #8b3f47;
}

.tone-wait,
.tone-observe {
  border-left: 4px solid #7a4f2b;
}

.reply-list {
  display: grid;
  gap: 8px;
  padding: 12px 0 0 64px;
  border-top: 1px solid #ebe4d8;
}

.detail-replies {
  padding-left: 0;
  border-top: 0;
}

.reply {
  padding: 10px 12px;
  background: #f6f0e6;
  border-radius: 8px;
}

.reply strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.reply p {
  margin: 0;
  color: #3d3a34;
  line-height: 1.6;
}

.topic-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  padding: 18px;
  background: #fffdf8;
  border: 1px solid #ded6c8;
  border-radius: 8px;
}

.topic-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.topic-card p {
  margin: 0 0 10px;
  color: #3d3a34;
  line-height: 1.6;
}

.topic-card small {
  color: #6f6a61;
}

.topic-tag {
  align-self: start;
  padding: 6px 8px;
  background: #e8dfd1;
  color: #6f4728;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.event {
  padding: 14px 0;
  border-top: 1px solid #ebe4d8;
}

.event:first-child {
  border-top: 0;
}

.event time {
  display: block;
  margin-bottom: 6px;
  color: #7a4f2b;
  font-size: 12px;
  font-weight: 700;
}

.event p {
  margin: 0;
  line-height: 1.65;
}

.report {
  white-space: pre-wrap;
  margin: 0;
  font-family: inherit;
  line-height: 1.65;
}

.archive-list {
  display: grid;
  gap: 18px;
}

.archive-item {
  padding-bottom: 18px;
  border-bottom: 1px solid #ebe4d8;
}

.archive-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.archive-meta {
  margin-bottom: 10px;
  color: #7a4f2b;
  font-size: 13px;
  font-weight: 700;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
}

.pager a,
.pager span,
.pager strong {
  min-width: 72px;
  padding: 8px 12px;
  background: #fffdf8;
  border: 1px solid #ded6c8;
  border-radius: 8px;
  color: #5b4938;
  font-size: 14px;
  text-align: center;
}

.pager span {
  color: #a0988d;
}

.pager strong {
  background: #202826;
  border-color: #202826;
  color: #fff;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 18px;
}

dl {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 10px 14px;
}

dt {
  color: #7a4f2b;
  font-weight: 700;
}

dd {
  margin: 0;
}

@media (max-width: 720px) {
  .topbar,
  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    gap: 12px;
    padding: 12px 16px;
  }

  nav {
    flex-wrap: wrap;
    gap: 10px 14px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .hero-mark {
    width: 72px;
    height: 72px;
  }

  .hero-mark img {
    width: 52px;
    height: 52px;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-hero {
    grid-template-columns: 64px 1fr;
  }

  .profile-avatar .portrait-svg {
    width: 64px;
    height: 64px;
  }

  .two-column {
    grid-template-columns: 1fr;
  }

  .join-layout,
  .join-field-grid {
    grid-template-columns: 1fr;
  }

  .topic-card {
    grid-template-columns: 1fr;
  }

  .forum-post-head {
    grid-template-columns: 44px 1fr;
  }

  .reply-list {
    padding-left: 0;
  }

  .topic-tag {
    width: fit-content;
  }

  dl {
    grid-template-columns: 1fr;
  }
}
