:root {
  --ink: #1f1b16;
  --muted: #837767;
  --paper: #f6f0e6;
  --paper-2: #ede4d6;
  --card: rgba(255, 252, 246, 0.92);
  --line: rgba(112, 88, 57, 0.16);
  --gold: #9f7437;
  --gold-2: #c2a06c;
  --dark: #1e2421;
  --red: #c94b38;
  --green: #2f7461;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.8), transparent 28%),
    linear-gradient(90deg, rgba(230, 220, 204, 0.56), rgba(255, 252, 247, 0.92), rgba(232, 221, 205, 0.58)),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.38;
  background-image:
    linear-gradient(110deg, transparent 0 46%, rgba(129, 101, 64, 0.08) 47%, transparent 48%),
    radial-gradient(circle at 12% 92%, rgba(76, 91, 84, 0.14), transparent 20%);
}

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

button {
  border: 0;
  cursor: pointer;
}

input,
textarea,
select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
}

.prototype-stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(250px, 360px) minmax(360px, 430px);
  justify-content: center;
  align-items: center;
  gap: clamp(24px, 5vw, 72px);
  padding: 32px;
}

.brand-panel {
  position: relative;
  min-height: 720px;
  border-radius: 0 0 8px 8px;
  padding: 120px 42px 40px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(250, 247, 238, 0.78), rgba(246, 239, 226, 0.9)),
    url("https://images.unsplash.com/photo-1488085061387-422e29b40080?auto=format&fit=crop&w=900&q=80") center bottom/cover;
  box-shadow: 0 22px 70px rgba(78, 62, 43, 0.18);
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 40%;
  background: linear-gradient(180deg, transparent, rgba(238, 232, 219, 0.88));
}

.brand-panel > * {
  position: relative;
  z-index: 1;
}

.brand-panel h1,
.login-card h2 {
  margin: 0;
  font-size: 50px;
  line-height: 1;
  font-family: "Songti SC", "STSong", serif;
  font-weight: 800;
}

.seal {
  position: absolute;
  top: 102px;
  left: 216px;
  width: 26px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--red);
  color: white;
  font-size: 12px;
  writing-mode: vertical-rl;
}

.brand-panel p,
.login-card p {
  margin: 22px 0 8px;
  color: #6f6256;
  font-size: 17px;
}

.brand-panel span {
  display: block;
  color: #a29483;
  font-size: 14px;
  letter-spacing: 6px;
}

.brand-panel ul {
  display: grid;
  gap: 22px;
  margin: 116px 0 0;
  padding: 0;
  list-style: none;
  color: #655744;
  font-size: 17px;
}

.brand-panel li::before {
  content: "◇";
  margin-right: 12px;
  color: var(--gold);
}

.phone-frame {
  width: min(390px, calc(100vw - 32px));
  height: 760px;
  border-radius: 28px;
  padding: 1px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 26px 64px rgba(69, 52, 32, 0.16);
}

.phone-screen {
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.66);
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.96), rgba(246, 239, 226, 0.96)),
    var(--paper);
}

.status-bar {
  height: 34px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 0 20px 5px;
  font-size: 12px;
  font-weight: 700;
}

.mobile-view {
  display: none;
  height: calc(100% - 94px);
  overflow: auto;
  padding: 10px 18px 22px;
  scrollbar-width: none;
}

.mobile-view::-webkit-scrollbar {
  display: none;
}

.mobile-view.active {
  display: block;
}

.mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 38px;
}

.mobile-header strong {
  font-size: 23px;
  font-weight: 800;
}

.home-head strong {
  display: block;
  font-family: "Songti SC", "STSong", serif;
  font-size: 30px;
}

.mobile-header small {
  color: #9d907f;
  font-size: 11px;
}

.ghost-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
}

.search-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  margin: 10px 0 14px;
  padding: 0 14px;
  border-radius: 18px;
  background: rgba(231, 222, 208, 0.72);
  color: #9c8d79;
}

.search-pill input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
}

.city-hero {
  position: relative;
  height: 210px;
  overflow: hidden;
  border-radius: 0 0 24px 24px;
  box-shadow: 0 16px 30px rgba(74, 53, 33, 0.12);
}

.city-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.86) contrast(0.95);
}

.city-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(26, 22, 18, 0.76));
}

.city-hero div {
  position: absolute;
  z-index: 1;
  left: 22px;
  bottom: 22px;
  color: white;
}

.city-hero h2 {
  margin: 0;
  font-size: 30px;
}

.city-hero p {
  margin: 4px 0 12px;
  font-size: 15px;
}

.city-hero button {
  border-radius: 16px;
  padding: 7px 14px;
  background: rgba(255, 255, 255, 0.18);
  color: white;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 8px;
  margin: -22px 10px 22px;
  padding: 22px 12px 16px;
  border-radius: 18px;
  position: relative;
  z-index: 1;
  background: rgba(255, 252, 246, 0.94);
  box-shadow: 0 16px 34px rgba(75, 55, 34, 0.14);
}

.feature-item,
.channel-item {
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #554839;
  font-size: 12px;
}

.feature-icon,
.channel-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(160, 116, 55, 0.12);
  color: var(--gold);
  border: 1px solid rgba(159, 116, 55, 0.18);
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 12px;
}

.section-row strong {
  font-size: 16px;
}

.section-row button {
  background: transparent;
  color: #a19280;
  font-size: 12px;
}

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

.read-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 12px;
  min-height: 92px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
}

.read-card img {
  width: 100%;
  height: 88px;
  border-radius: 10px;
  object-fit: cover;
}

.read-card strong,
.topic-card strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.read-card p,
.topic-card p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

footer,
small {
  color: #9b8d7b;
  font-size: 11px;
}

.ink-banner {
  height: 122px;
  margin: 4px -18px 0;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.16), rgba(255, 252, 246, 0.96)),
    url("https://images.unsplash.com/photo-1534528741775-53994a69daeb?auto=format&fit=crop&w=900&q=80") center 44%/cover;
}

.forum-search {
  margin-top: -24px;
  position: relative;
  z-index: 1;
}

.round-channel {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.channel-icon {
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
}

.forum-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.forum-tabs button {
  position: relative;
  height: 42px;
  background: transparent;
  color: #756858;
  font-weight: 700;
}

.forum-tabs button.active {
  color: var(--ink);
}

.forum-tabs button.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 22px;
  height: 3px;
  border-radius: 3px;
  background: var(--gold);
  transform: translateX(-50%);
}

.topic-list {
  display: grid;
  gap: 8px;
  padding-bottom: 20px;
}

.topic-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.topic-card .avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: url("https://images.unsplash.com/photo-1502685104226-ee32379fefbe?auto=format&fit=crop&w=120&q=80") center/cover;
}

.topic-card button {
  margin-top: 26px;
  background: transparent;
  color: #9a8b78;
  font-size: 12px;
}

.float-compose {
  position: absolute;
  right: 24px;
  bottom: 86px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b28a4b, #8d622b);
  color: white;
  box-shadow: 0 12px 28px rgba(116, 78, 31, 0.35);
}

.login-card {
  display: grid;
  gap: 14px;
  min-height: 470px;
  margin-top: 56px;
  padding: 58px 26px 28px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.84), rgba(248, 240, 226, 0.92)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=700&q=80") center bottom/cover;
}

.login-card h2 {
  font-size: 42px;
}

.login-card input {
  height: 48px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.66);
}

.login-card button,
.composer-card button[type="submit"] {
  height: 46px;
  border-radius: 18px;
  background: linear-gradient(135deg, #b2894d, #8d622b);
  color: white;
}

.profile-page {
  display: grid;
  gap: 16px;
}

.profile-hero {
  margin: 2px -18px 0;
  padding: 30px 18px 24px;
  color: white;
  background:
    linear-gradient(180deg, rgba(25, 29, 26, 0.72), rgba(25, 29, 26, 0.96)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=700&q=80") center/cover;
}

.profile-id {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
  align-items: center;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.68);
  background: url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=180&q=80") center/cover;
}

.profile-id h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-top: 22px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
}

.profile-stats div {
  padding: 14px 8px;
  text-align: center;
  background: rgba(31, 27, 22, 0.54);
}

.profile-stats strong {
  display: block;
  font-size: 18px;
  color: #f3d99d;
}

.profile-menu {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px 8px;
  padding: 18px 2px;
}

.profile-menu button {
  display: grid;
  gap: 8px;
  justify-items: center;
  background: transparent;
  color: #44392d;
  font-size: 12px;
}

.profile-menu i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-style: normal;
}

.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 4px 18px 9px;
  border-top: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.94);
}

.bottom-nav button {
  display: grid;
  gap: 3px;
  justify-items: center;
  align-content: center;
  background: transparent;
  color: #7f705d;
  font-size: 18px;
}

.bottom-nav span {
  font-size: 11px;
}

.bottom-nav button.active {
  color: var(--gold);
  font-weight: 800;
}

.composer-sheet {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: end center;
  padding: 24px;
  background: rgba(31, 27, 22, 0.28);
}

.composer-card {
  width: min(390px, calc(100vw - 32px));
  display: grid;
  gap: 14px;
  padding: 14px 16px 18px;
  border-radius: 22px;
  background: rgba(255, 252, 246, 0.98);
  box-shadow: 0 22px 68px rgba(31, 27, 22, 0.28);
}

.sheet-head {
  display: grid;
  grid-template-columns: 68px 1fr 68px;
  align-items: center;
  text-align: center;
}

.sheet-head button {
  background: transparent;
  color: var(--gold);
}

.composer-card label {
  display: grid;
  gap: 8px;
  color: #6a5a46;
  font-size: 13px;
}

.composer-card select,
.composer-card input {
  height: 44px;
  padding: 0 12px;
}

.composer-card textarea {
  min-height: 150px;
  padding: 12px;
}

.hidden {
  display: none !important;
}

/* Admin */
.admin-body {
  min-height: 100vh;
  background: #f7f3ec;
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 232px 1fr;
}

.admin-side {
  padding: 28px 18px;
  background: linear-gradient(180deg, #1c2320, #111614);
  color: white;
}

.admin-logo {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 32px;
}

.admin-logo strong {
  font-family: "Songti SC", "STSong", serif;
  font-size: 22px;
}

.seal-mini {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font-size: 12px;
}

.admin-side nav {
  display: grid;
  gap: 8px;
}

.admin-side button,
.side-link {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  text-decoration: none;
}

.admin-side button.active,
.side-link:hover {
  background: rgba(168, 128, 69, 0.28);
  color: white;
}

.admin-main {
  padding: 24px;
}

.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-top h1 {
  margin: 0;
  font-size: 22px;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6f6255;
}

.admin-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=120&q=80") center/cover;
}

.admin-login-panel {
  width: min(420px, calc(100vw - 36px));
  display: grid;
  gap: 14px;
  margin: 12vh auto;
  padding: 28px;
  border-radius: 12px;
  background: white;
  box-shadow: 0 22px 60px rgba(74, 54, 31, 0.12);
}

.admin-login-panel input {
  height: 46px;
  padding: 0 12px;
}

.admin-login-panel button {
  height: 46px;
  border-radius: 8px;
  background: var(--gold);
  color: white;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric,
.chart-card,
.table-wrap {
  border: 1px solid rgba(123, 94, 54, 0.1);
  border-radius: 8px;
  background: white;
  box-shadow: 0 12px 34px rgba(74, 54, 31, 0.06);
}

.metric {
  padding: 18px;
}

.metric strong {
  display: block;
  margin-bottom: 5px;
  font-size: 28px;
}

.metric span {
  color: #7e7162;
  font-size: 13px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 330px;
  gap: 16px;
}

.chart-card {
  min-height: 300px;
  padding: 18px;
}

.chart-card h2 {
  margin: 0 0 18px;
  font-size: 16px;
}

.fake-chart {
  height: 210px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(to top, rgba(159, 116, 55, 0.08) 1px, transparent 1px) 0 0/100% 52px;
  clip-path: polygon(0 64%, 16% 56%, 30% 68%, 43% 42%, 58% 35%, 72% 46%, 86% 28%, 100% 12%, 100% 100%, 0 100%);
  background-color: rgba(47, 116, 97, 0.14);
}

.table-wrap {
  max-height: 300px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

caption {
  padding: 14px 16px;
  text-align: left;
  font-weight: 800;
}

th,
td {
  padding: 11px 12px;
  border-top: 1px solid rgba(123, 94, 54, 0.1);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  color: #857665;
  font-weight: 700;
}

@media (max-width: 960px) {
  .prototype-stage {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    display: none;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-side {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px;
  }

  .admin-side nav {
    display: flex;
    overflow-x: auto;
  }

  .admin-side button,
  .side-link {
    white-space: nowrap;
  }

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

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

@media (max-width: 480px) {
  .prototype-stage {
    padding: 0;
  }

  .phone-frame {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    padding: 0;
  }

  .phone-screen {
    border-radius: 0;
    border: 0;
  }

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