:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --panel: #fffdf9;
  --ink: #221a14;
  --muted: #7a6d62;
  --line: #e8ddcf;
  --accent: #db3a34;
  --accent-dark: #b72d28;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fbf5ea 0%, #efe7da 45%, #e6ddcf 100%);
}

a {
  color: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  padding: 28px 20px;
  background: rgba(34, 26, 20, 0.95);
  color: #f8f2ea;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  font-size: 24px;
  font-weight: 700;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav a {
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
}

.logout-form {
  margin-top: auto;
}

.content {
  padding: 28px;
}

.content-full {
  grid-column: 1 / -1;
}

.page-header {
  margin-bottom: 24px;
}

.customer-header-meta {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.customer-header-meta h1,
.customer-header-meta p {
  margin: 0;
}

.split-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.panel {
  background: rgba(255, 253, 249, 0.92);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 18px 48px rgba(64, 46, 25, 0.08);
}

.grid {
  display: grid;
  gap: 24px;
}

.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.uneven {
  grid-template-columns: 1.15fr 0.85fr;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label,
.stack-form > div {
  display: grid;
  gap: 8px;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
}

textarea {
  resize: vertical;
}

.primary-button,
.danger-button,
.ghost-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  padding: 12px 18px;
  text-decoration: none;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-dark);
}

.ghost-button,
.link-button {
  background: #f0e7dc;
  color: var(--ink);
}

.danger-button {
  background: #2c2018;
  color: #fff;
  margin-top: 16px;
}

.alert,
.notice {
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.alert {
  background: #fff0ef;
  color: #9e2c27;
}

.notice {
  background: #eef7eb;
  color: #356638;
}

.field-error {
  color: #b7312c;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  background: rgba(255, 253, 249, 0.95);
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 28px 60px rgba(64, 46, 25, 0.14);
}

.narrow-form {
  max-width: 720px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
}

.inline-link {
  color: var(--accent);
  text-decoration: none;
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.checkbox-row input {
  width: auto;
}

.avatar-preview,
.qr-image {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--line);
}

.qr-panel {
  margin-top: 20px;
}

.customer-side-actions {
  margin-top: 20px;
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.customer-side-actions .qr-panel {
  margin-top: 0;
}

.customer-side-actions form {
  margin: 0;
}

.list-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.empty-state-box {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 24px;
  display: grid;
  gap: 14px;
  background: #fffaf4;
}

.post-admin-table td {
  vertical-align: top;
}

.post-cover-thumb {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #f7efe4;
}

.post-cover-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.post-title-cell {
  display: grid;
  gap: 8px;
  min-width: 220px;
}

.tag-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f6ede2;
  color: #6d5848;
  font-size: 12px;
}

.post-metrics-grid {
  display: grid;
  gap: 6px;
  min-width: 72px;
  font-size: 13px;
}

.status-stack {
  display: grid;
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  width: fit-content;
}

.status-live {
  background: #eaf7ea;
  color: #2d6b36;
}

.status-draft {
  background: #f4ede3;
  color: #7b6352;
}

.status-featured {
  background: #fff3d8;
  color: #9a6b00;
}

.action-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.action-link-row form {
  margin: 0;
}

.inline-button {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
}

.danger-inline {
  color: #b7312c;
}

.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-fields {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.image-grid {
  margin-top: 18px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 190px));
  justify-content: start;
  align-items: start;
}

.image-card {
  display: grid;
  gap: 10px;
}

.image-card img {
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #fffaf4;
}

.pending-image-preview {
  margin-top: 18px;
}

.image-card-pending {
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: #fffaf4;
}

.image-card-meta {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  word-break: break-all;
}

.comment-list {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.comment-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: #fff;
}

.comment-card-header,
.public-comment {
  display: flex;
  gap: 12px;
}

.comment-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
}

.public-body {
  background: linear-gradient(180deg, #faf6ef 0%, #f3ece1 100%);
}

.public-page {
  width: min(430px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 0 1px #eee, 0 20px 60px rgba(40, 30, 20, 0.12);
}

.phone-topbar,
.note-header,
.note-body,
.comments-panel,
.other-posts,
.public-footer {
  padding: 16px;
}

.phone-topbar,
.note-header,
.public-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.public-avatar {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 50%;
}

.follow-button {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
}

.gallery {
  display: grid;
  gap: 8px;
}

.gallery-image {
  width: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.rich-text p {
  margin: 0 0 12px;
  line-height: 1.7;
}

.tag-row,
.post-switch-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag,
.post-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: #f6efe5;
  text-decoration: none;
}

.post-chip.active {
  background: #2d2119;
  color: #fff;
}

.meta-line {
  margin-top: 16px;
  color: var(--muted);
}

.empty-public-state {
  margin: 16px;
  padding: 28px 20px;
  border-radius: 24px;
  background: #fff7f0;
  color: #5f4534;
  box-shadow: inset 0 0 0 1px #f0dcc8;
}

.empty-public-state h2 {
  margin: 0 0 12px;
}

.empty-public-state p {
  margin: 0;
  line-height: 1.7;
}

.draft-notice {
  margin: 16px;
  padding: 12px 16px;
  border-radius: 16px;
  background: #fff4d8;
  color: #7b5a13;
}

.portal-body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f8f1e8 0%, #efe3d6 100%);
  font-family: "Microsoft YaHei UI", "PingFang SC", sans-serif;
}

.portal-shell {
  width: min(430px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: linear-gradient(180deg, #fffaf6 0%, #fff 32%, #fdf7f0 100%);
  box-shadow: 0 0 0 1px #eee, 0 20px 60px rgba(40, 30, 20, 0.12);
}

.portal-brand-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.portal-brand-lockup {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.portal-brand-logo {
  display: inline-block;
  color: #ff8a2a;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-shadow: 0 0 18px rgba(255, 150, 55, 0.28), 0 6px 18px rgba(255, 122, 31, 0.16);
  animation: portalBrandGlow 3.6s ease-in-out infinite;
}

.portal-brand-subtitle {
  color: #c77632;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.9;
}

.portal-topbar {
  padding: 12px 18px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.portal-nav {
  padding: 8px 18px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-back {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #f4ebdf;
  color: #2c2018;
  font-size: 18px;
}

.portal-nav-title {
  font-size: 16px;
  font-weight: 700;
}

.portal-content {
  min-height: calc(100vh - 54px);
  padding: 42px 18px 36px;
  display: grid;
  gap: 18px;
  align-content: center;
}

.portal-slogan-stage {
  position: relative;
  min-height: 220px;
  display: grid;
  align-items: center;
}

.portal-slogan-card {
  position: relative;
  overflow: hidden;
  padding: 28px 24px;
  border-radius: 30px;
  background: linear-gradient(145deg, #fff6ec 0%, #fff 48%, #fff2df 100%);
  border: 1px solid rgba(255, 183, 118, 0.45);
  box-shadow: 0 18px 50px rgba(135, 92, 49, 0.13);
  text-align: center;
  animation: portalFloat 4.8s ease-in-out infinite;
}

.portal-slogan-card::before {
  content: "";
  position: absolute;
  inset: -30% auto auto -10%;
  width: 52%;
  height: 180%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.72) 50%, rgba(255, 255, 255, 0) 100%);
  transform: rotate(18deg);
  animation: portalShine 5.5s linear infinite;
}

.portal-slogan-kicker {
  position: relative;
  margin: 0 0 12px;
  color: #cf7b2d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.portal-slogan-title {
  position: relative;
  margin: 0;
  display: grid;
  gap: 6px;
  font-size: 34px;
  line-height: 1.08;
  color: #2f2017;
}

.portal-slogan-title span:last-child {
  font-size: 24px;
  color: #d96c24;
}

.portal-slogan-subtitle {
  position: relative;
  margin: 16px auto 0;
  max-width: 270px;
  color: #7a624d;
  line-height: 1.7;
  font-size: 13px;
}

.portal-slogan-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(6px);
  opacity: 0.9;
  animation: portalOrb 6s ease-in-out infinite;
}

.portal-slogan-orb-left {
  width: 64px;
  height: 64px;
  top: 16px;
  left: 22px;
  background: radial-gradient(circle, rgba(255, 179, 94, 0.85) 0%, rgba(255, 179, 94, 0) 70%);
}

.portal-slogan-orb-right {
  width: 88px;
  height: 88px;
  right: 14px;
  bottom: 18px;
  background: radial-gradient(circle, rgba(255, 125, 61, 0.55) 0%, rgba(255, 125, 61, 0) 72%);
  animation-delay: -2.2s;
}

.portal-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #f0e5d8;
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 14px 34px rgba(86, 63, 43, 0.08);
}

.portal-hero {
  display: grid;
  gap: 14px;
  text-align: center;
}

.portal-profile {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.portal-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  background: #f1e7d9;
}

.portal-eyebrow {
  margin: 0;
  color: #9a8877;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.portal-title {
  margin: 6px 0 0;
  font-size: 26px;
  line-height: 1.25;
}

.portal-copy {
  margin: 0;
  color: #5b4a3d;
  line-height: 1.8;
}

.portal-actions {
  display: grid;
  gap: 12px;
}

.portal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.portal-button-primary {
  background: var(--accent);
  color: #fff;
}

.portal-button-secondary {
  background: #f4ebdf;
  color: #2c2018;
}

.portal-tip {
  margin: 0;
  padding: 14px 16px;
  border-radius: 18px;
  background: #fff4e8;
  color: #80522e;
  line-height: 1.7;
}

.portal-richtext {
  color: #32271f;
  line-height: 1.8;
}

.portal-richtext p,
.portal-richtext ul,
.portal-richtext ol {
  margin-top: 0;
  margin-bottom: 14px;
}

.portal-empty {
  margin: 0;
  color: #7a6d62;
  line-height: 1.8;
}

@keyframes portalFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

@keyframes portalShine {
  0% {
    transform: translateX(-120%) rotate(18deg);
  }

  100% {
    transform: translateX(240%) rotate(18deg);
  }
}

@keyframes portalOrb {
  0%,
  100% {
    transform: scale(1) translateY(0);
  }

  50% {
    transform: scale(1.08) translateY(-8px);
  }
}

@keyframes portalBrandGlow {
  0%,
  100% {
    transform: translateY(0);
    text-shadow: 0 0 18px rgba(255, 150, 55, 0.24), 0 6px 18px rgba(255, 122, 31, 0.12);
  }

  50% {
    transform: translateY(-2px);
    text-shadow: 0 0 24px rgba(255, 150, 55, 0.38), 0 10px 24px rgba(255, 122, 31, 0.2);
  }
}

@media (max-width: 900px) {
  .shell,
  .two-columns,
  .uneven {
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 16px;
  }

  .customer-header-meta,
  .customer-side-actions {
    align-items: flex-start;
  }

  .inline-fields {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 18px;
  }
}