/* =========================================================
   回声意见箱 · 站长后台与登录页
   ========================================================= */

/* ---------------- 登录页 ---------------- */

.admin-auth-page {
  background: var(--paper);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(480px, 1.1fr);
  min-height: 100vh;
}

.auth-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 38px 48px 34px;
  background:
    radial-gradient(circle at 82% 12%, rgba(176, 138, 79, 0.18), transparent 28%),
    radial-gradient(circle at 12% 92%, rgba(181, 55, 44, 0.16), transparent 30%),
    var(--sidebar);
  color: #f7f0e4;
  overflow: hidden;
}

.auth-brand-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-inverse {
  color: #f7f0e4;
}

.brand-inverse .brand-mark,
.brand-inverse .brand-svg {
  color: var(--red);
}

.brand-inverse .brand-type small {
  color: rgba(247, 240, 228, 0.45);
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: rgba(247, 240, 228, 0.55);
  font-size: 11px;
  transition: color 0.2s;
}

.auth-back:hover {
  color: #fff;
}

.auth-back .icon {
  width: 13px;
  height: 13px;
}

.auth-quote {
  position: relative;
  z-index: 2;
  margin: auto 0;
  max-width: 460px;
  padding-block: 40px;
}

.auth-seal {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 22px;
  border: 1px solid rgba(247, 240, 228, 0.22);
  border-radius: 8px;
  background: var(--red);
  color: #fff8ec;
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  box-shadow: inset 0 0 0 3px rgba(255, 248, 236, 0.16);
}

.auth-quote .eyebrow {
  color: rgba(247, 240, 228, 0.42);
}

.auth-quote h1 {
  margin-top: 18px;
  font-family: var(--serif);
  font-size: clamp(40px, 4.2vw, 58px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.auth-quote > p:not(.eyebrow) {
  max-width: 380px;
  margin-top: 22px;
  color: rgba(247, 240, 228, 0.56);
  font-size: 12px;
  line-height: 1.9;
}

.auth-meta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding-top: 22px;
  border-top: 1px solid rgba(247, 240, 228, 0.1);
  color: rgba(247, 240, 228, 0.42);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.auth-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.auth-meta .icon {
  width: 13px;
  height: 13px;
  color: var(--gold);
}

.auth-pattern {
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 380px;
  height: 380px;
  border: 1px solid rgba(247, 240, 228, 0.07);
  border-radius: 50%;
}

.auth-pattern::before,
.auth-pattern::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(247, 240, 228, 0.06);
  border-radius: 50%;
}

.auth-pattern::before {
  inset: 34px;
}

.auth-pattern::after {
  inset: 78px;
}

.auth-form-panel {
  display: grid;
  place-items: center;
  padding: 42px;
  background:
    radial-gradient(circle at 80% 15%, rgba(176, 138, 79, 0.11), transparent 30%),
    var(--paper);
}

.auth-form-inner {
  width: min(400px, 100%);
}

.auth-form-inner .eyebrow {
  margin-bottom: 16px;
}

.auth-form-inner h2 {
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.auth-sub {
  margin-top: 8px;
  margin-bottom: 30px;
  color: var(--muted);
  font-size: 12px;
}

.auth-form .field-group {
  margin-bottom: 20px;
}

.input-with-icon {
  position: relative;
  display: block;
}

.input-with-icon > .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  color: var(--muted-light);
  transform: translateY(-50%);
  pointer-events: none;
}

.input-with-icon .text-input {
  padding-left: 40px;
}

.auth-form .btn-block {
  min-height: 50px;
  margin-top: 8px;
  font-size: 13px;
}

.auth-footnote {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 22px;
  color: var(--muted-light);
  font-size: 10px;
  line-height: 1.6;
}

.auth-footnote .icon {
  width: 13px;
  height: 13px;
  margin-top: 1px;
  color: var(--gold);
}

/* ---------------- 后台整体框架 ---------------- */

.admin-page {
  background: #f1ece2;
}

.admin-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  width: 264px;
  padding: 23px 15px 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(176, 138, 79, 0.13), transparent 32%),
    var(--sidebar);
  color: #f6efe3;
  border-right: 1px solid rgba(0, 0, 0, 0.16);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 7px 24px;
}

.sidebar-head .brand {
  gap: 9px;
}

.sidebar-head .brand-mark {
  width: 36px;
  height: 36px;
}

.sidebar-head .brand-type strong {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.sidebar-head .brand-type small {
  font-size: 7px;
  letter-spacing: 0.16em;
}

.sidebar-close {
  display: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--sidebar-line);
  border-radius: 8px;
  background: transparent;
  color: rgba(246, 239, 227, 0.6);
}

.sidebar-close .icon {
  width: 15px;
  height: 15px;
  margin: auto;
}

.sidebar-section-label {
  padding: 0 12px;
  margin-bottom: 9px;
  color: rgba(246, 239, 227, 0.32);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 0 11px;
  border-radius: 9px;
  color: rgba(246, 239, 227, 0.62);
  font-size: 12px;
  transition:
    background 0.18s,
    color 0.18s;
}

.admin-nav-item .icon {
  width: 16px;
  height: 16px;
  opacity: 0.72;
}

.admin-nav-item span {
  flex: 1;
}

.admin-nav-item em {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(246, 239, 227, 0.1);
  color: rgba(246, 239, 227, 0.66);
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  text-align: center;
}

.admin-nav-item em.is-alert {
  background: var(--red);
  color: #fff8ec;
}

.admin-nav-item:hover {
  background: rgba(246, 239, 227, 0.06);
  color: #fff8ec;
}

.admin-nav-item.is-active {
  background: rgba(246, 239, 227, 0.1);
  color: #fff8ec;
}

.admin-nav-item.is-active .icon {
  color: #d6b47d;
  opacity: 1;
}

.sidebar-note {
  display: flex;
  gap: 9px;
  margin: 24px 5px 0;
  padding: 12px;
  border: 1px solid var(--sidebar-line);
  border-radius: 10px;
  background: rgba(246, 239, 227, 0.035);
}

.sidebar-note-icon {
  color: var(--gold);
}

.sidebar-note-icon .icon {
  width: 14px;
  height: 14px;
}

.sidebar-note strong {
  display: block;
  font-size: 10px;
  letter-spacing: 0.03em;
}

.sidebar-note p {
  margin-top: 2px;
  color: rgba(246, 239, 227, 0.38);
  font-size: 9px;
  line-height: 1.6;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--sidebar-line);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 8px;
  border-radius: 9px;
  transition: background 0.18s;
}

.sidebar-user:hover {
  background: rgba(246, 239, 227, 0.06);
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(176, 138, 79, 0.2);
  color: #e1c18c;
  font-family: var(--serif);
  font-size: 14px;
  flex: none;
}

.sidebar-user > span:nth-child(2) {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.sidebar-user strong {
  font-size: 11px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user small {
  color: rgba(246, 239, 227, 0.35);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.sidebar-user > .icon {
  width: 13px;
  height: 13px;
  color: rgba(246, 239, 227, 0.32);
}

.logout-form {
  margin-top: 3px;
}

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(246, 239, 227, 0.42);
  font-size: 10px;
  text-align: left;
  transition:
    background 0.18s,
    color 0.18s;
}

.sidebar-logout:hover {
  background: rgba(181, 55, 44, 0.14);
  color: #f3b5ab;
}

.sidebar-logout .icon {
  width: 14px;
  height: 14px;
}

.admin-main {
  min-height: 100vh;
  margin-left: 264px;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 88px;
  padding: 13px 32px;
  border-bottom: 1px solid rgba(211, 196, 173, 0.55);
  background: rgba(241, 236, 226, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--ink-soft);
}

.menu-toggle .icon {
  width: 18px;
  height: 18px;
  margin: auto;
}

.topbar-title {
  min-width: 0;
}

.topbar-title p {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
}

.topbar-title h1 {
  margin-top: 1px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
}

.admin-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 300px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.75);
  transition:
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}

.admin-search:focus-within {
  background: #fff;
  border-color: rgba(181, 55, 44, 0.38);
  box-shadow: 0 0 0 3px rgba(181, 55, 44, 0.06);
}

.admin-search > .icon {
  width: 15px;
  height: 15px;
  color: var(--muted-light);
  flex: none;
}

.admin-search input {
  width: 100%;
  height: 100%;
  padding: 0 20px 0 8px;
  border: 0;
  background: transparent;
  font-size: 12px;
  outline: none;
}

.search-clear {
  position: absolute;
  right: 9px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--paper-deep);
  color: var(--muted);
}

.search-clear .icon {
  width: 11px;
  height: 11px;
}

.topbar-site {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.55);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  transition:
    color 0.18s,
    border-color 0.18s,
    background 0.18s;
}

.topbar-site:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--card);
}

.topbar-site .icon {
  width: 13px;
  height: 13px;
}

.admin-content {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 26px 32px 52px;
}

/* ---------------- Flash ---------------- */

.flash {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  padding: 11px 15px;
  border: 1px solid rgba(63, 102, 80, 0.2);
  border-radius: 10px;
  background: var(--green-soft);
  color: #2f513e;
  font-size: 11px;
  animation: rise 0.28s ease both;
}

.flash .icon {
  width: 15px;
  height: 15px;
}

.flash.is-hiding {
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity 0.3s,
    transform 0.3s;
}

.btn.is-loading {
  opacity: 0.62;
  pointer-events: none;
}

/* ---------------- 数据卡片 ---------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  position: relative;
  padding: 19px 20px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -42px;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.055;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.stat-top i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--paper-light);
  color: currentColor;
  font-style: normal;
}

.stat-top .icon {
  width: 15px;
  height: 15px;
}

.stat-card > strong {
  display: block;
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 36px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.stat-card > p {
  margin-top: 2px;
  color: var(--muted-light);
  font-size: 9px;
}

.stat-ink {
  color: var(--ink);
}

.stat-red {
  color: var(--red);
}

.stat-gold {
  color: var(--gold);
}

.stat-green {
  color: var(--green);
}

.stat-red .stat-top i {
  background: var(--red-soft);
}

.stat-gold .stat-top i {
  background: var(--gold-soft);
}

.stat-green .stat-top i {
  background: var(--green-soft);
}

/* ---------------- 留言列表 ---------------- */

.message-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 59px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tabs a {
  position: relative;
  padding: 7px 11px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  transition:
    color 0.18s,
    background 0.18s;
}

.filter-tabs a:hover {
  color: var(--ink);
  background: var(--paper-light);
}

.filter-tabs a.is-active {
  color: var(--ink);
  background: var(--paper-light);
  font-weight: 600;
}

.filter-tabs a.is-active::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 2px;
  height: 1px;
  background: var(--red);
}

.toolbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.inline-action {
  display: inline-flex;
  margin: 0;
}

.btn:disabled {
  opacity: 0.36;
  cursor: not-allowed;
  pointer-events: none;
}

.result-count {
  color: var(--muted-light);
  font-size: 9px;
  white-space: nowrap;
}

.result-count b {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-weight: 500;
}

.search-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-light);
  color: var(--muted);
  font-size: 10px;
}

.search-summary .icon {
  width: 12px;
  height: 12px;
}

.search-summary b {
  color: var(--ink);
  font-weight: 600;
}

.message-row {
  position: relative;
  display: grid;
  grid-template-columns: 3px 34px minmax(0, 1fr) 42px;
  align-items: stretch;
  min-height: 116px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  transition: background 0.18s;
}

.message-row:last-child {
  border-bottom: 0;
}

.message-row:hover {
  background: #fffdf9;
}

.message-row.is-unread {
  background: #fffdf7;
}

.message-row.is-unread:hover {
  background: #fffaf0;
}

.row-status-strip {
  align-self: stretch;
  background: transparent;
}

.row-status-pending {
  background: linear-gradient(180deg, var(--red), rgba(181, 55, 44, 0.18));
}

.row-status-handled {
  background: linear-gradient(180deg, var(--green), rgba(63, 102, 80, 0.12));
}

.row-star {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 21px;
}

.star-form {
  margin: 0;
}

.star-button {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #c9bda9;
  transition:
    color 0.18s,
    background 0.18s;
}

.star-button .icon {
  width: 15px;
  height: 15px;
}

.star-button:hover {
  color: var(--gold);
  background: var(--gold-soft);
}

.star-button.is-starred {
  color: var(--gold);
}

.star-button.is-starred .icon {
  fill: currentColor;
}

.row-body {
  display: block;
  min-width: 0;
  padding: 17px 10px 16px 2px;
}

.row-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.row-top time {
  margin-left: auto;
  color: var(--muted-light);
  font-size: 9px;
  white-space: nowrap;
}

.unread-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(181, 55, 44, 0.1);
  flex: none;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.status-pending {
  background: var(--red-soft);
  color: var(--red-dark);
}

.status-handled {
  background: var(--green-soft);
  color: var(--green);
}

.category-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  white-space: nowrap;
}

.category-gold {
  background: var(--gold-soft);
  color: #85652f;
}

.category-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.category-orange {
  background: var(--orange-soft);
  color: var(--orange);
}

.category-red {
  background: var(--red-soft);
  color: var(--red-dark);
}

.category-gray {
  background: #eeeae2;
  color: var(--muted);
}

.contact-inline {
  font-size: 9px;
  color: var(--muted-light);
}

.contact-inline b {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--ink-soft);
}

.row-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.65;
}

.message-row.is-unread .row-text {
  color: var(--ink);
  font-weight: 600;
}

.row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
  color: var(--muted-light);
  font-size: 10px;
}

.row-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.row-meta .icon {
  width: 11px;
  height: 11px;
  color: var(--gold);
}

.row-meta .mono {
  color: var(--muted);
  font-size: 9.5px;
}

.row-name {
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-open {
  display: grid;
  place-items: center;
  align-self: center;
  width: 29px;
  height: 29px;
  margin-right: 11px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted-light);
  transition:
    color 0.2s,
    border-color 0.2s,
    background 0.2s,
    transform 0.2s;
}

.row-open .icon {
  width: 14px;
  height: 14px;
}

.message-row:hover .row-open {
  color: var(--red);
  border-color: rgba(181, 55, 44, 0.3);
  background: var(--red-soft);
  transform: translateX(2px);
}

/* ---------------- 空状态 ---------------- */

.empty-state {
  padding: 64px 24px 68px;
  text-align: center;
}

.empty-illustration {
  position: relative;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: var(--paper-light);
  color: var(--gold);
}

.empty-illustration .icon {
  width: 32px;
  height: 32px;
}

.empty-spark {
  position: absolute;
  top: 12px;
  right: 11px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
}

.empty-state h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}

.empty-state p {
  max-width: 340px;
  margin: 8px auto 18px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

/* ---------------- 分页 ---------------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: #fffefa;
}

.page-prev,
.page-next {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.page-prev .icon {
  transform: rotate(180deg);
}

.page-prev .icon,
.page-next .icon {
  width: 13px;
  height: 13px;
}

.page-prev:hover,
.page-next:hover {
  color: var(--ink);
}

.page-prev.is-disabled,
.page-next.is-disabled {
  opacity: 0.32;
  pointer-events: none;
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 3px;
}

.page-link {
  display: grid;
  place-items: center;
  min-width: 27px;
  height: 27px;
  padding: 0 6px;
  border-radius: 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.page-link:hover {
  background: var(--paper-light);
  color: var(--ink);
}

.page-link.is-current {
  background: var(--ink);
  color: #fff8ec;
}

.page-gap {
  padding: 0 2px;
  color: var(--muted-light);
  font-size: 9px;
}

/* ---------------- 留言详情 ---------------- */

.detail-page {
  max-width: 1230px;
  margin: 0 auto;
}

.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 15px;
  color: var(--muted-light);
  font-size: 10px;
}

.detail-breadcrumb a:hover {
  color: var(--red);
}

.detail-breadcrumb .icon {
  width: 11px;
  height: 11px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.detail-head > div:first-child {
  min-width: 0;
}

.detail-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 8px;
}

.star-badge,
.unread-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
}

.star-badge {
  background: var(--gold-soft);
  color: #85652f;
}

.star-badge .icon {
  width: 10px;
  height: 10px;
  fill: currentColor;
}

.unread-badge {
  background: var(--red-soft);
  color: var(--red-dark);
}

.detail-head h2 {
  max-width: 720px;
  font-family: var(--serif);
  font-size: clamp(25px, 2.8vw, 35px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.detail-sub {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 5px;
  flex: none;
}

.detail-actions form {
  margin: 0;
}

.detail-actions .star-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--card);
}

.detail-actions .star-button .icon {
  width: 16px;
  height: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(330px, 0.68fr);
  gap: 18px;
  align-items: start;
}

.letter-card {
  position: relative;
  min-height: 520px;
  padding: 32px 36px 26px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 35%),
    var(--card);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.letter-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--green));
  opacity: 0.55;
}

.letter-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 22px;
  border-bottom: 1px dashed var(--line);
}

.letter-stamp {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--red);
}

.letter-stamp .icon {
  width: 27px;
  height: 27px;
}

.letter-stamp span {
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.letter-lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 4px;
}

.letter-lines i {
  display: block;
  width: 54px;
  height: 2px;
  background: var(--line);
}

.letter-lines i:nth-child(2) {
  width: 38px;
}

.letter-lines i:nth-child(3) {
  width: 46px;
}

.letter-content {
  padding: 30px 2px 38px;
  color: #2e2a24;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 2.05;
  letter-spacing: 0.01em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.letter-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-top: 19px;
  border-top: 1px solid var(--line);
}

.letter-footer > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.letter-footer span {
  color: var(--muted-light);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.letter-footer strong {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
}

.letter-signature {
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.detail-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-card {
  padding: 18px 19px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding-bottom: 13px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.heading-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 8px;
  background: var(--paper-light);
  color: var(--gold);
  flex: none;
}

.heading-icon .icon {
  width: 15px;
  height: 15px;
}

.card-heading h2 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.card-heading p {
  margin-top: 1px;
  color: var(--muted-light);
  font-size: 9px;
}

.contact-block {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 9px;
  background: var(--paper-light);
}

.contact-badge {
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  flex: none;
}

.contact-qq .contact-badge {
  background: #e5eef9;
  color: #2b6ca8;
}

.contact-wechat .contact-badge {
  background: var(--green-soft);
  color: var(--green);
}

.copy-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  flex: 1;
}

.contact-block .icon-button {
  width: 27px;
  height: 27px;
  background: #fff;
}

.meta-list {
  margin-top: 12px;
}

.meta-list > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(227, 216, 198, 0.7);
}

.meta-list > div:last-child {
  border-bottom: 0;
}

.meta-list dt {
  color: var(--muted-light);
  font-size: 9px;
  flex: none;
}

.meta-list dd {
  color: var(--ink-soft);
  font-size: 10px;
  text-align: right;
  overflow-wrap: anywhere;
}

.detail-card > .btn,
.detail-card > form > .btn {
  margin-top: 10px;
}

.geo-highlight {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, var(--paper-light), #fffdf8);
}

.geo-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--muted-light);
  font-size: 9px;
}

.geo-label .icon {
  width: 11px;
  height: 11px;
  color: var(--gold);
}

.geo-highlight strong {
  font-size: 11px;
  font-weight: 600;
}

.geo-status {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--muted);
  font-size: 8px;
}

.geo-ok {
  background: var(--green-soft);
  color: var(--green);
}

.geo-failed {
  background: var(--red-soft);
  color: var(--red-dark);
}

.geo-pending {
  background: var(--gold-soft);
  color: #85652f;
}

.geo-private {
  background: #eeeae2;
  color: var(--muted);
}

.meta-details {
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.meta-details summary {
  color: var(--muted);
  font-size: 9px;
  cursor: pointer;
}

.meta-details summary:hover {
  color: var(--ink);
}

.meta-details p {
  margin-top: 7px;
  color: var(--muted-light);
  font-size: 9px;
}

.meta-details p strong {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-weight: 500;
}

.meta-details code {
  display: block;
  padding: 6px 7px;
  border-radius: 5px;
  background: var(--paper-light);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.note-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.note-form .field-group {
  margin-bottom: 9px;
}

.text-area-small {
  min-height: 92px;
  padding-bottom: 12px;
  font-size: 11px;
}

.status-form {
  margin-top: 10px;
}

.privacy-warning {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 2px 4px;
  color: var(--muted-light);
  font-size: 9px;
  line-height: 1.6;
}

.privacy-warning .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;
  color: var(--red);
}

/* ---------------- 设置页 ---------------- */

.settings-page {
  max-width: 1080px;
  margin: 0 auto;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.settings-main,
.settings-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-card {
  padding: 22px 23px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.settings-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.settings-form .field-group {
  width: 100%;
  margin-bottom: 0;
}

.settings-form .field-row {
  width: 100%;
}

.about-card .brand-stacked {
  gap: 12px;
  margin-bottom: 14px;
}

.brand-stacked .brand-mark {
  width: 40px;
  height: 40px;
}

.brand-stacked strong {
  font-family: var(--serif);
  font-size: 17px;
}

.brand-stacked p {
  color: var(--muted-light);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.about-copy {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.about-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 14px 0 0;
  border-top: 1px dashed var(--line);
}

.about-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  color: var(--muted);
  font-size: 10px;
}

.about-list .icon {
  width: 12px;
  height: 12px;
  color: var(--green);
}

.privacy-card .heading-icon {
  margin-bottom: 12px;
}

.privacy-card h2 {
  font-family: var(--serif);
  font-size: 17px;
}

.privacy-card p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.75;
}

/* ---------------- 后台错误页 ---------------- */

.admin-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  text-align: center;
}

.admin-error-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: var(--card);
  color: var(--gold);
}

.admin-error-icon .icon {
  width: 26px;
  height: 26px;
}

.admin-error h2 {
  margin-top: 5px;
  font-family: var(--serif);
  font-size: 30px;
}

.admin-error > p:not(.eyebrow) {
  margin: 8px 0 18px;
  color: var(--muted);
  font-size: 11px;
}

/* ---------------- 响应式 ---------------- */

/* ---------------- 站长回复 ---------------- */

.reply-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
}

.reply-admin-card {
  border-color: rgba(63, 102, 80, 0.3);
  background:
    linear-gradient(135deg, rgba(228, 237, 229, 0.5), transparent 45%),
    var(--card);
}

.reply-existing {
  margin-bottom: 13px;
  padding: 12px 13px;
  border: 1px solid rgba(63, 102, 80, 0.2);
  border-radius: 10px;
  background: var(--green-soft);
}

.reply-existing p {
  margin-top: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.75;
}

.reply-existing time {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 8px;
}

.reply-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
  font-size: 9px;
  font-weight: 600;
}

.reply-state .icon {
  width: 11px;
  height: 11px;
}

.reply-empty-hint {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.reply-form .field-group {
  margin-bottom: 9px;
}

.reply-form .text-area {
  background: #fffefa;
}

@media (max-width: 1180px) {
  .admin-search {
    width: 250px;
  }

  .topbar-title h1 {
    font-size: 22px;
  }

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

@media (max-width: 1020px) {
  .auth-brand-panel {
    padding-inline: 34px;
  }

  .auth-form-panel {
    padding-inline: 30px;
  }

  .detail-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .detail-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }

  .privacy-warning {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand-panel {
    display: none;
  }

  .auth-form-panel {
    min-height: 100vh;
  }

  .admin-search {
    width: 220px;
  }

  .topbar-site span {
    display: none;
  }

  .topbar-site {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .topbar-site .icon {
    width: 15px;
    height: 15px;
  }
}

@media (max-width: 840px) {
  .sidebar {
    width: 270px;
    transform: translateX(-102%);
    transition: transform 0.26s ease;
    box-shadow: var(--shadow-lg);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close {
    display: inline-grid;
  }

  .admin-main {
    margin-left: 0;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .admin-topbar {
    min-height: 76px;
    padding: 10px 20px;
  }

  .admin-content {
    padding: 20px 20px 44px;
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(18, 15, 11, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s;
  }

  .sidebar-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 720px) {
  .admin-topbar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .topbar-title {
    flex: 1;
  }

  .topbar-title h1 {
    font-size: 20px;
  }

  .topbar-actions {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .admin-search {
    width: 100%;
  }

  .topbar-site {
    margin-left: auto;
  }

  .stats-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 15px 16px 13px;
  }

  .stat-card > strong {
    font-size: 30px;
  }

  .list-toolbar {
    align-items: flex-start;
    padding: 10px 13px;
  }

  .toolbar-right {
    width: 100%;
    justify-content: flex-start;
  }

  .message-row {
    grid-template-columns: 3px 30px minmax(0, 1fr);
  }

  .row-open {
    display: none;
  }

  .row-body {
    padding-right: 14px;
  }

  .row-top time {
    margin-left: 0;
  }

  .row-meta {
    gap: 5px 12px;
  }

  .detail-head {
    flex-direction: column;
    gap: 14px;
  }

  .detail-actions {
    width: 100%;
  }

  .letter-card {
    padding: 24px 22px 22px;
  }

  .letter-content {
    padding: 24px 0 30px;
    font-size: 15px;
  }

  .detail-side {
    grid-template-columns: 1fr;
  }

  .pagination {
    padding-inline: 12px;
  }

  .page-numbers {
    display: none;
  }

  .settings-card {
    padding: 18px;
  }

  .settings-form .field-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .admin-topbar {
    padding-inline: 14px;
  }

  .admin-content {
    padding: 16px 14px 38px;
  }

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

  .stat-top i {
    width: 26px;
    height: 26px;
  }

  .stat-card > strong {
    font-size: 27px;
  }

  .filter-tabs {
    width: 100%;
  }

  .filter-tabs a {
    padding-inline: 9px;
  }

  .row-star {
    padding-top: 18px;
  }

  .message-row {
    grid-template-columns: 3px 27px minmax(0, 1fr);
  }

  .row-text {
    font-size: 12px;
  }

  .row-meta .row-name {
    display: none;
  }

  .detail-head h2 {
    font-size: 24px;
  }

  .detail-actions .btn {
    flex: 1;
  }

  .detail-actions .star-button {
    flex: none;
  }
}
