:root {
  --bg: #fbf7f4;
  --surface: #ffffff;
  --surface-soft: #fffaf7;
  --ink: #332a27;
  --muted: #7b6c66;
  --muted-soft: #a19089;
  --line: #ecdfd9;
  --line-strong: #dfcec6;
  --accent: #b75b70;
  --accent-dark: #984559;
  --accent-soft: #faebef;
  --success: #4f765f;
  --success-soft: #edf5ef;
  --warn: #96603b;
  --warn-soft: #fbf0e7;
  --radius: 18px;
  --radius-small: 12px;
  --shadow: 0 12px 34px rgba(73, 45, 37, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Page transitions */
@view-transition {
  navigation: auto;
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes page-leave {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-5px);
  }
}

::view-transition-old(root) {
  animation: page-leave 140ms ease-in both;
}

::view-transition-new(root) {
  animation: page-enter 220ms cubic-bezier(0.22, 0.8, 0.3, 1) both;
}

@supports not (view-transition-name: root) {
  .page-shell,
  .login-shell {
    animation: page-enter 240ms cubic-bezier(0.22, 0.8, 0.3, 1) both;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -20%, rgba(250, 228, 232, 0.75), transparent 42%),
    var(--bg);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

:focus-visible {
  outline: 3px solid rgba(183, 91, 112, 0.25);
  outline-offset: 2px;
}

.app-body {
  min-height: 100vh;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(223, 206, 198, 0.7);
  background: rgba(255, 253, 251, 0.9);
  backdrop-filter: blur(16px);
}

.nav-shell {
  width: min(1080px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand,
.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #efcbd3;
  border-radius: 50%;
  color: var(--accent-dark);
  background: linear-gradient(145deg, #fff7f8, #fbe9ed);
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
}

.brand-title {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}

.main-nav::-webkit-scrollbar {
  display: none;
}

.main-nav a {
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease;
}

.main-nav a:hover {
  color: var(--ink);
  background: #f7efeb;
}

.main-nav a.active {
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-weight: 600;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 13px;
}

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

.user-box form {
  margin: 0;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: none;
  font-size: 13px;
}

.text-button:hover {
  color: var(--accent-dark);
}

/* Page layout */
.page-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 64px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 10px 0 24px;
}

.page-heading h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.page-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.balance-pill {
  flex-shrink: 0;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.balance-pill strong {
  margin: 0 3px;
  color: var(--accent-dark);
  font-size: 17px;
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.meter-card {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.meter-card.meter-accent {
  border-color: #e8c7cf;
  background:
    radial-gradient(circle at 92% 8%, rgba(250, 228, 232, 0.72), transparent 46%),
    var(--surface);
}

.meter-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.meter-value {
  display: block;
  margin: 7px 0 4px;
  overflow: hidden;
  color: var(--ink);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter-value small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
}

.meter-note {
  display: block;
  overflow: hidden;
  color: var(--muted-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 16px;
  margin-bottom: 18px;
}

.dashboard-charts .panel {
  min-width: 0;
  padding: 18px 20px 16px;
  margin-bottom: 0;
}

.dashboard-charts .panel-heading {
  margin-bottom: 10px;
}

.chart-heading {
  align-items: flex-start;
  margin-bottom: 10px;
}

.chart-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted-soft);
  font-size: 12px;
}

.calendar-legend {
  display: flex;
  gap: 9px;
  flex-shrink: 0;
  padding-top: 2px;
  font-size: 11px;
}

.legend-income {
  color: var(--success);
}

.legend-expense {
  color: var(--accent-dark);
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-weekdays {
  margin-bottom: 4px;
}

.calendar-weekdays span {
  color: var(--muted-soft);
  font-size: 11px;
  text-align: center;
}

.calendar-cell {
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 2px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--surface-soft);
  text-align: center;
}

.calendar-cell.is-empty {
  background: transparent;
}

.calendar-cell.is-future {
  color: var(--muted-soft);
  background: #fdfbfa;
}

.calendar-cell.has-activity:not(.is-today) {
  background: #fff8f5;
}

.calendar-cell.is-today {
  border-color: #dca7b4;
  background: #fff5f7;
  box-shadow: inset 0 0 0 1px rgba(183, 91, 112, 0.08);
}

.calendar-day {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}

.calendar-lines {
  display: grid;
  gap: 1px;
  margin-top: 2px;
  font-size: 9px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.calendar-plus {
  color: var(--success);
}

.calendar-minus {
  color: var(--accent-dark);
}

.calendar-lines .is-zero {
  color: #c9bab4;
}

.trend-panel {
  display: flex;
  flex-direction: column;
}

.trend-change {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.trend-change.is-up {
  color: var(--success);
  background: var(--success-soft);
}

.trend-change.is-down {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.trend-chart {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 0;
  padding: 0;
}

.trend-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.trend-grid-line {
  stroke: #efe5e1;
  stroke-width: 1;
}

.trend-axis-label {
  fill: var(--muted-soft);
  font-family: inherit;
  font-size: 11px;
}

.trend-area {
  fill: url(#trend-fill);
}

.trend-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-dot {
  fill: #fff;
  stroke: var(--accent);
  stroke-width: 2;
}

.trend-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.trend-summary strong {
  margin: 0 2px;
  color: var(--ink);
  font-size: 14px;
}

/* Cards and sections */
.panel {
  margin-bottom: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.panel-heading h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
}

.text-link {
  color: var(--accent-dark);
  font-size: 13px;
  white-space: nowrap;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.content-grid .panel {
  min-width: 0;
}

.home-showcase {
  padding: 20px;
}

.home-showcase .panel-heading {
  margin-bottom: 12px;
}

.home-showcase .notice-board {
  padding: 16px;
}

.home-showcase .notice-list {
  gap: 14px;
}

.home-showcase .shop-grid {
  margin-bottom: 0;
}

.badge-grid.home-badge-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.empty-note {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-small);
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
  font-size: 13px;
}

/* Tasks */
.task-list {
  display: grid;
  gap: 12px;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.task-card.compact {
  padding: 15px 16px;
}

.task-card.is-done {
  background: #fcfaf8;
}

.task-body {
  min-width: 0;
}

.task-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.task-title-row h2,
.task-title-row h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
}

.task-title-row h2 {
  font-size: 18px;
}

.task-body > p,
.shop-card-body > p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.reward {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.task-state {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 2px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: #f3eeeb;
  font-size: 12px;
  white-space: nowrap;
}

.pill-success {
  color: var(--success);
  background: var(--success-soft);
}

.pill-pending {
  color: var(--warn);
  background: var(--warn-soft);
}

.pill-warn {
  color: #9d4e4e;
  background: #fceded;
}

.task-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 13px;
}

.task-result span {
  color: var(--muted-soft);
  font-size: 12px;
}

.task-result.success {
  color: var(--success);
  background: var(--success-soft);
}

.task-result.pending {
  color: var(--warn);
  background: var(--warn-soft);
}

.task-result.warn {
  color: #9d4e4e;
  background: #fceded;
}

.task-note {
  margin: 10px 0 0;
  padding-left: 10px;
  border-left: 2px solid var(--line-strong);
  color: var(--muted);
  font-size: 13px;
}

/* Notice board */
.notice-board {
  padding: 22px;
  border: 1px solid #e4d4cc;
  border-radius: 16px;
  background:
    radial-gradient(circle, rgba(183, 91, 112, 0.1) 1px, transparent 1.5px) 0 0 / 17px 17px,
    linear-gradient(145deg, #f8f0ea, #f4e9e3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.notice-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.notice-list .task-card {
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 210 / 297;
  gap: 8px;
  padding: 24px 16px 15px;
  overflow: hidden;
  border: 1px solid #eadfd9;
  border-radius: 2px;
  background: #fffdfb;
  box-shadow: 0 12px 24px rgba(73, 45, 37, 0.1);
}

.notice-list .task-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 54px;
  height: 6px;
  background: rgba(183, 91, 112, 0.2);
  transform: translateX(-50%);
}

.notice-list .task-card.is-done {
  background: #fbfaf8;
}

.notice-list .task-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.notice-list .task-title-row {
  display: block;
}

.notice-list .task-title-row h2 {
  margin-bottom: 7px;
  font-size: 18px;
  line-height: 1.35;
}

.notice-list .task-body > p {
  display: block;
  flex: 1 1 auto;
  min-height: 3.2em;
  overflow-y: auto;
  padding-right: 4px;
  font-size: 12.5px;
  line-height: 1.6;
  scrollbar-color: rgba(183, 91, 112, 0.35) transparent;
  scrollbar-width: thin;
}

.notice-list .task-body > p::-webkit-scrollbar {
  width: 5px;
}

.notice-list .task-body > p::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(183, 91, 112, 0.35);
}

.notice-list .submit-form {
  flex-shrink: 0;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: auto;
}

.notice-list textarea {
  min-height: 68px;
  padding: 8px 9px;
  border-radius: 3px;
  font-size: 12px;
  overflow-y: auto;
  resize: none;
}

.notice-list .button {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 3px;
  font-size: 13px;
}

.notice-list .task-result {
  margin-top: auto;
  padding: 7px 8px;
  border-radius: 3px;
  font-size: 12px;
}

.notice-list .task-result span {
  font-size: 10px;
}

.notice-list .task-note {
  margin-top: 6px;
  max-height: 90px;
  overflow-y: auto;
  padding-right: 4px;
  font-size: 12px;
  scrollbar-width: thin;
}

.notice-list .task-state {
  justify-content: flex-start;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.submit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

textarea,
input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input {
  min-height: 42px;
  padding: 9px 12px;
}

textarea {
  min-height: 84px;
  padding: 10px 12px;
  resize: vertical;
}

textarea::placeholder,
input::placeholder {
  color: #b4a49d;
}

textarea:focus,
input:focus {
  border-color: #c48a98;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(183, 91, 112, 0.1);
}

/* Buttons */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  transition: transform 120ms ease, background 160ms ease, border-color 160ms ease;
}

.button:not(:disabled):active {
  transform: translateY(1px);
}

.button-primary {
  color: #fff;
  background: var(--accent);
}

.button-primary:hover {
  background: var(--accent-dark);
}

.button-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: #fff;
}

.button-ghost:hover {
  border-color: #c9b4ac;
  background: var(--surface-soft);
}

.button-small {
  min-height: 33px;
  padding: 5px 12px;
  font-size: 13px;
}

.button-wide {
  width: 100%;
}

.button-disabled,
.button:disabled {
  border-color: transparent;
  color: var(--muted-soft);
  background: #f2ece9;
}

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

.shop-card {
  min-width: 0;
  display: flex;
  aspect-ratio: 1 / 1;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.shop-card-body {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

.shop-card .task-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.shop-card .task-title-row h2 {
  font-size: 16px;
  line-height: 1.35;
}

.shop-card-body > p {
  display: -webkit-box;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.shop-card .button {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 13px;
}

.price-tag {
  flex-shrink: 0;
  min-width: 34px;
  padding: 2px 8px;
  border: 1px solid #edcdd4;
  border-radius: 999px;
  color: var(--accent-dark);
  background: #fff7f8;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
}

.shop-meta {
  margin: 8px 0;
  color: var(--muted-soft);
  font-size: 11px;
}

.shop-card form {
  margin-top: auto;
}

.shop-card-action {
  margin-top: auto;
}

.redemption-state {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Mini lists */
.mini-shop-list,
.badge-strip {
  display: grid;
  gap: 4px;
}

.mini-shop-item,
.badge-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.mini-shop-item:last-child,
.badge-mini:last-child {
  border-bottom: 0;
}

.mini-shop-item > span:first-child,
.badge-mini > span:last-child {
  min-width: 0;
}

.mini-shop-item strong,
.mini-shop-item small,
.badge-mini strong,
.badge-mini small {
  display: block;
}

.mini-shop-item strong,
.badge-mini strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-shop-item small,
.badge-mini small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-shop-item:hover strong {
  color: var(--accent-dark);
}

.badge-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid #edcdd4;
  border-radius: 50%;
  color: var(--accent-dark);
  background: #fff7f8;
  font-size: 11px;
  font-weight: 700;
}

.badge-mini .badge-icon {
  margin-right: 2px;
}

.badge-mini > span:last-child {
  flex: 1;
}

/* Ledger */
.ledger-list {
  display: grid;
}

.ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

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

.ledger-row strong,
.ledger-row small {
  display: block;
}

.ledger-row strong {
  font-size: 14px;
}

.ledger-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.ledger-copy {
  min-width: 0;
}

.amount-plus,
.amount-minus {
  flex-shrink: 0;
  font-size: 16px;
  font-weight: 700;
}

.amount-plus {
  color: var(--success);
}

.amount-minus {
  color: var(--accent-dark);
}

/* Badges */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 14px;
}

.badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  gap: 5px;
  padding: 18px 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.badge-card.earned {
  border-color: #e7c7cf;
  background: linear-gradient(145deg, #fff, #fff8f9);
}

.badge-card.locked {
  color: var(--muted);
  background: #fdfbfa;
  box-shadow: none;
}

.badge-icon.big {
  width: 48px;
  height: 48px;
  margin-bottom: 3px;
  font-size: 13px;
}

.badge-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.badge-state {
  color: var(--muted-soft);
  font-size: 11px;
}

.badge-copy h2 {
  margin: 2px 0 3px;
  font-size: 16px;
  line-height: 1.35;
}

.badge-copy p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.badge-copy small {
  display: block;
  width: 100%;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-wrap {
  display: grid;
  gap: 3px;
  width: 100%;
  margin-top: 7px;
}

.progress-wrap progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #f2eae6;
  appearance: none;
}

.progress-wrap progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #f2eae6;
}

.progress-wrap progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--accent);
}

.progress-wrap progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--accent);
}

.progress-wrap small {
  margin: 0;
  text-align: center;
}

/* Admin */
.admin-grid {
  align-items: start;
}

.count-pill {
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 12px;
  text-align: center;
}

.review-card {
  margin-top: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.review-card:first-of-type {
  margin-top: 0;
}

.review-meta {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.review-card form {
  margin-top: 12px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.form-actions.center {
  justify-content: center;
  margin-top: 22px;
}

.form-actions form {
  margin: 0;
}

.stack-form {
  display: grid;
  gap: 13px;
}

.stack-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

.member-list {
  display: grid;
  gap: 4px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

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

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-weight: 700;
}

.member-row > div {
  min-width: 0;
  flex: 1;
}

.member-row strong,
.member-row small {
  display: block;
}

.member-row strong {
  font-size: 14px;
}

.member-row small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.balance-small {
  flex-shrink: 0;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 600;
}

/* Flash */
.flash {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 13px;
}

.flash-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--muted);
}

.flash-success {
  border-color: #cfe3d6;
  color: var(--success);
  background: var(--success-soft);
}

.flash-success .flash-dot {
  background: var(--success);
}

.flash-error {
  border-color: #edd0d0;
  color: #9d4e4e;
  background: #fceded;
}

.flash-error .flash-dot {
  background: #b85b5b;
}

.flash-info {
  border-color: #eedcc8;
  color: var(--warn);
  background: var(--warn-soft);
}

.flash-info .flash-dot {
  background: var(--warn);
}

/* Profile */
.content-grid.single {
  grid-template-columns: 1fr;
}

.user-name:hover {
  color: var(--accent-dark);
}

.badge-note {
  display: block;
  margin-top: 6px;
  color: var(--muted-soft);
  font-size: 11px;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: stretch;
  gap: 20px;
}

.profile-card {
  min-width: 0;
}

.profile-summary-card {
  display: flex;
  flex-direction: column;
}

.profile-summary-card .profile-facts {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
}

.profile-summary-card .profile-facts > div {
  flex: 0 0 auto;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 2px 0 18px;
  border-bottom: 1px solid var(--line);
}

.profile-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border: 1px solid #efcbd3;
  border-radius: 50%;
  color: var(--accent-dark);
  background: linear-gradient(145deg, #fff7f8, #fbe9ed);
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 24px;
  font-weight: 700;
}

.profile-identity strong {
  display: block;
  font-size: 21px;
  line-height: 1.3;
}

.profile-identity small {
  color: var(--muted);
  font-size: 13px;
}

.profile-facts {
  display: grid;
  gap: 0;
  margin: 0 0 18px;
  padding: 0;
}

.profile-facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}

.profile-facts > div:last-child {
  border-bottom: 0;
}

.profile-facts dt {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-facts dd {
  min-width: 0;
  margin: 0;
  font-weight: 600;
  text-align: right;
  overflow-wrap: anywhere;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.profile-stat-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.profile-stat-grid strong {
  display: block;
  color: var(--accent-dark);
  font-size: 23px;
  line-height: 1.2;
}

.profile-stat-grid span {
  color: var(--muted);
  font-size: 12px;
}

.profile-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.profile-ledger {
  margin-top: 14px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.profile-ledger .ledger-row {
  padding: 9px 0;
}

.profile-edit-panel {
  margin-top: 20px;
}

.profile-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 16px;
}

.profile-form-block {
  align-content: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.profile-form-block h3,
.profile-password-form h3 {
  margin: 0;
  font-size: 16px;
}

.profile-password-form {
  max-width: none;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
}

/* Login */
.login-body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% 8%, rgba(183, 91, 112, 0.11), transparent 38%),
    linear-gradient(rgba(51, 42, 39, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 42, 39, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 36px 36px, 36px 36px;
}

.login-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  overflow: hidden;
}

.login-shell::before {
  content: "";
  position: absolute;
  top: -260px;
  left: -180px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(183, 91, 112, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.login-shell::after {
  content: "";
  position: absolute;
  right: -8%;
  bottom: 10%;
  width: 44%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(183, 91, 112, 0.34), transparent);
  transform: rotate(-16deg);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  padding: 34px;
  border: 1px solid #d8c7c1;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    10px 10px 0 rgba(183, 91, 112, 0.08),
    0 24px 60px rgba(80, 50, 40, 0.08);
  backdrop-filter: blur(8px);
}

.login-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 76px;
  height: 3px;
  background: var(--accent);
}

.login-card::after {
  content: "";
  position: absolute;
  right: 13px;
  bottom: 13px;
  width: 18px;
  height: 18px;
  border-right: 1px solid rgba(51, 42, 39, 0.18);
  border-bottom: 1px solid rgba(51, 42, 39, 0.18);
  pointer-events: none;
}

.login-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 34px;
}

.login-brand {
  margin-bottom: 0;
}

.login-brand .brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  color: #fff;
  background: var(--ink);
  box-shadow: 3px 3px 0 rgba(183, 91, 112, 0.38);
  font-size: 19px;
}

.login-brand .brand-title {
  font-size: 17px;
  letter-spacing: 0.04em;
}

.login-pulse {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(183, 91, 112, 0.1);
  animation: login-signal 2.4s ease-in-out infinite;
}

.login-heading {
  padding: 2px 0 24px;
  border-bottom: 1px solid var(--line);
}

.login-heading h1,
.error-card h1 {
  margin: 0;
  color: var(--ink);
  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.login-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.field input {
  min-height: 50px;
  border-color: #d8c7c1;
  border-radius: 2px;
  background: #fffdfb;
}

.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(183, 91, 112, 0.11);
}

.login-form .button {
  min-height: 50px;
  justify-content: space-between;
  margin-top: 4px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  color: #fff;
  background: var(--ink);
  font-size: 15px;
  letter-spacing: 0.16em;
}

.login-form .button::after {
  content: "↗";
  color: #ffb3c2;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0;
}

.login-form .button:hover {
  border-color: var(--accent);
  background: var(--accent);
}

.login-form .button:hover::after {
  color: #fff;
}

.login-card .button-ghost {
  border-color: #d8c7c1;
  color: var(--ink);
  background: #fffdfb;
}

.login-card .button-ghost:hover {
  border-color: var(--ink);
  background: #fff7f8;
}

.error-card {
  text-align: center;
}

.error-code {
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

@keyframes login-signal {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.guest-actions {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.reward-extra {
  display: block;
  margin-top: 2px;
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.35;
}

.info-date {
  display: block;
  color: var(--muted-soft);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.info-preview-panel {
  display: flex;
  flex-direction: column;
}

.info-preview-card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}

.info-preview-image {
  width: 116px;
  height: 92px;
  display: block;
  border-radius: 9px;
  object-fit: cover;
}

.info-preview-copy {
  min-width: 0;
}

.info-preview-copy h3 {
  margin: 4px 0 4px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 20px;
  line-height: 1.3;
}

.info-preview-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.info-list {
  display: grid;
  gap: 18px;
}

.info-post {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 26px;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.info-post-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  border-radius: 13px;
  object-fit: cover;
}

.info-post-copy {
  min-width: 0;
}

.info-post-copy h2 {
  margin: 6px 0 8px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 25px;
  line-height: 1.3;
}

.info-summary {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.7;
}

.info-body {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-line;
}

/* Login info module */
.login-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  grid-template-columns: minmax(0, 1.38fr) minmax(340px, 420px);
  align-items: center;
  justify-items: stretch;
  gap: clamp(28px, 4vw, 54px);
  padding: 40px 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  justify-self: end;
}

.login-info {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  aspect-ratio: 297 / 210;
  padding: 24px 26px;
  overflow: hidden;
  border: 1px solid rgba(216, 199, 193, 0.85);
  border-radius: 4px;
  background: rgba(255, 253, 251, 0.76);
  box-shadow: 8px 8px 0 rgba(183, 91, 112, 0.06);
  backdrop-filter: blur(8px);
}

.login-info-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.login-info-label {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.login-info-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
  flex: 1;
  gap: clamp(18px, 2.6vw, 30px);
  min-height: 0;
  padding: 0;
  border-bottom: 0;
}

.login-info-media {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 13px;
  background: var(--surface-soft);
}

.login-info-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.login-info-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.login-info-copy h2 {
  margin: 8px 0 10px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(24px, 2.3vw, 34px);
  line-height: 1.25;
}

.login-info-copy p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(13px, 1.15vw, 15px);
  line-height: 1.8;
}

.login-info-more {
  margin-top: 16px;
  color: var(--accent-dark);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.login-info-empty {
  margin: 18px 0;
  color: var(--muted);
  font-size: 14px;
}

/* Responsive */
@media (max-width: 860px) {
  .nav-shell {
    min-height: auto;
    padding: 12px 0 10px;
    flex-wrap: wrap;
    gap: 8px 18px;
  }

  .main-nav {
    order: 3;
    flex-basis: 100%;
    margin: 0 -4px;
  }

  .dashboard-charts {
    grid-template-columns: 1fr;
  }

  .info-post {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .login-shell {
    width: min(560px, 100%);
    grid-template-columns: 1fr;
    padding: 24px 16px 40px;
  }

  .login-card {
    order: 1;
    max-width: none;
    justify-self: stretch;
  }

  .login-info {
    order: 2;
  }

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

  .profile-edit-grid {
    grid-template-columns: 1fr;
  }

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

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

  .badge-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

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

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

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .nav-shell,
  .page-shell {
    width: calc(100% - 24px);
  }

  .brand {
    gap: 8px;
  }

  .brand-title {
    font-size: 15px;
  }

  .user-name {
    max-width: 72px;
  }

  .page-shell {
    padding-top: 20px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
  }

  .page-heading h1 {
    font-size: 28px;
  }

  .panel {
    padding: 20px;
  }

  .info-preview-card {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 11px;
  }

  .info-preview-image {
    width: 88px;
    height: 74px;
  }

  .info-preview-copy h3 {
    font-size: 17px;
  }

  .info-preview-copy p {
    font-size: 11px;
  }

  .info-post {
    padding: 18px;
  }

  .info-post-copy h2 {
    font-size: 21px;
  }

  .login-info {
    aspect-ratio: auto;
    padding: 20px;
  }

  .login-info-feature {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .login-info-media {
    aspect-ratio: 16 / 9;
  }

  .login-info-copy h2 {
    font-size: 23px;
  }

  .dashboard-grid {
    gap: 8px;
    margin-bottom: 16px;
  }

  .meter-card {
    padding: 14px 10px;
  }

  .meter-label {
    font-size: 11px;
  }

  .meter-value {
    margin-top: 5px;
    font-size: clamp(15px, 5vw, 22px);
  }

  .dashboard-grid .meter-card:first-child .meter-value {
    font-size: clamp(14px, 4.6vw, 22px);
  }

  .meter-value small {
    margin-left: 2px;
    font-size: 10px;
  }

  .meter-note {
    font-size: 10px;
    line-height: 1.4;
    overflow: visible;
    white-space: normal;
  }

  .dashboard-charts {
    gap: 14px;
    margin-bottom: 16px;
  }

  .dashboard-charts .panel {
    padding: 16px 14px 12px;
  }

  .calendar-legend {
    gap: 6px;
    font-size: 10px;
  }

  .calendar-weekdays,
  .calendar-grid {
    gap: 3px;
  }

  .calendar-cell {
    min-height: 46px;
    padding: 3px 2px;
    border-radius: 7px;
  }

  .calendar-day {
    font-size: 10px;
  }

  .calendar-lines {
    font-size: 8px;
  }

  .trend-chart {
    min-height: 0;
  }

  .task-card {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .task-state {
    justify-content: flex-start;
  }

  .submit-form,
  .two-fields {
    grid-template-columns: 1fr;
  }

  .shop-card-body {
    min-height: 0;
  }

  .shop-grid {
    gap: 10px;
  }

  .shop-card {
    padding: 12px;
    border-radius: 13px;
  }

  .shop-card .task-title-row h2 {
    font-size: 14px;
  }

  .shop-card-body > p {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }

  .shop-card .button {
    min-height: 32px;
    font-size: 12px;
  }

  .badge-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

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

  .badge-card {
    padding: 12px 9px;
    border-radius: 13px;
  }

  .badge-icon.big {
    width: 40px;
    height: 40px;
    font-size: 11px;
  }

  .badge-copy h2 {
    font-size: 14px;
  }

  .badge-copy p {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }

  .badge-copy small,
  .badge-state {
    font-size: 9px;
  }

  .notice-board {
    padding: 12px;
  }

  .home-showcase {
    padding: 16px;
  }

  .home-showcase .notice-board {
    padding: 12px;
  }

  .notice-list {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .login-card {
    padding: 26px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  ::view-transition-old(root),
  ::view-transition-new(root),
  .page-shell,
  .login-shell {
    animation: none !important;
  }
}

/* Admin console */
.admin-shell {
  width: min(1180px, calc(100% - 32px));
}

.admin-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin: 6px 0 18px;
  padding: 34px 38px;
  overflow: hidden;
  border-radius: 24px;
  color: #fff8f6;
  background:
    radial-gradient(circle at 84% 12%, rgba(255, 220, 205, 0.22), transparent 34%),
    linear-gradient(125deg, #35272c 0%, #653a47 58%, #925666 100%);
  box-shadow: 0 20px 44px rgba(66, 38, 45, 0.16);
}

.admin-hero::after {
  content: "";
  position: absolute;
  right: -52px;
  bottom: -88px;
  width: 250px;
  height: 250px;
  border: 1px solid rgba(255, 238, 230, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 30px rgba(255, 238, 230, 0.04), 0 0 0 62px rgba(255, 238, 230, 0.025);
}

.admin-hero-copy {
  position: relative;
  z-index: 1;
  flex: 1 1 420px;
  max-width: 640px;
}

.admin-eyebrow,
.admin-panel-kicker {
  display: block;
  color: #e8b4be;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  line-height: 1.4;
}

.admin-hero h1 {
  margin: 8px 0 6px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.admin-hero p {
  margin: 0;
  color: rgba(255, 247, 244, 0.76);
  font-size: 14px;
}

.admin-hero p strong {
  color: #fff5ef;
}

.admin-status-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  min-width: 190px;
  padding: 13px 16px;
  border: 1px solid rgba(255, 240, 235, 0.2);
  border-radius: 15px;
  background: rgba(255, 250, 248, 0.08);
  backdrop-filter: blur(8px);
}

.admin-status-light {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #a8d2b7;
  box-shadow: 0 0 0 5px rgba(168, 210, 183, 0.12), 0 0 16px rgba(168, 210, 183, 0.75);
  animation: admin-pulse 2.4s ease-in-out infinite;
}

@keyframes admin-pulse {
  0%, 100% { opacity: 0.65; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1); }
}

.admin-status-card strong,
.admin-status-card small {
  display: block;
}

.admin-status-card strong {
  font-size: 13px;
}

.admin-status-card small {
  margin-top: 2px;
  color: rgba(255, 247, 244, 0.62);
  font-size: 10px;
}

.admin-tabs {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 22px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 6px 22px rgba(73, 45, 37, 0.035);
  scrollbar-width: none;
}

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

.admin-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.admin-tabs a span {
  color: var(--muted-soft);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.admin-tabs a b {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 10px;
  text-align: center;
}

.admin-tabs a:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.admin-tabs a.active {
  color: #fff;
  background: var(--ink);
  box-shadow: 0 5px 14px rgba(51, 42, 39, 0.18);
}

.admin-tabs a.active span {
  color: rgba(255, 255, 255, 0.55);
}

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

.admin-kpi {
  min-width: 0;
  padding: 19px 20px 16px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-kpi.admin-kpi-balance {
  border-color: #e3c5cc;
  background:
    radial-gradient(circle at 92% 0%, rgba(250, 228, 232, 0.9), transparent 45%),
    linear-gradient(145deg, #fffdfb, #fff6f7);
}

.admin-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.admin-kpi-top i {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.admin-kpi > strong {
  display: block;
  margin: 10px 0 7px;
  overflow: hidden;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(25px, 2.8vw, 34px);
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-kpi > strong small {
  margin-left: 4px;
  color: var(--muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
}

.admin-kpi footer {
  color: var(--muted-soft);
  font-size: 11px;
  line-height: 1.45;
}

.admin-kpi footer em {
  font-style: normal;
  font-weight: 600;
}

.positive {
  color: var(--success) !important;
}

.negative {
  color: var(--accent-dark) !important;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 18px;
  margin-bottom: 18px;
}

.admin-overview-grid > .panel {
  margin-bottom: 0;
}

.admin-overview-grid.admin-overview-lower {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr);
}

.admin-panel-kicker {
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 9px;
}

.admin-chart-panel {
  padding-bottom: 18px;
}

.admin-chart-totals {
  display: flex;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
}

.admin-trend-chart {
  min-height: 230px;
  display: grid;
  align-items: center;
}

.admin-trend-chart svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.admin-chart-grid {
  stroke: #efe5e1;
  stroke-width: 1;
  stroke-dasharray: 3 4;
}

.admin-chart-axis {
  fill: #a19089;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 9px;
}

.admin-chart-area {
  fill: url(#admin-trend-fill);
}

.admin-chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-chart-dot {
  fill: #fff;
  stroke: var(--accent);
  stroke-width: 1.7;
}

.admin-chart-dot.is-last {
  fill: var(--accent);
  stroke: #fff;
  stroke-width: 2.4;
}

.admin-chart-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.admin-chart-legend strong {
  color: var(--ink);
}

.legend-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 5px;
  border-radius: 50%;
}

.legend-income {
  background: var(--success);
}

.legend-expense {
  background: var(--accent);
}

.admin-quick-panel {
  align-self: start;
}

.admin-entry-form {
  gap: 11px;
}

.admin-entry-form label > span,
.admin-filter-bar label > span {
  color: var(--muted);
  font-size: 11px;
}

select {
  width: 100%;
  min-height: 42px;
  padding: 9px 34px 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

select:focus {
  border-color: #c48a98;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(183, 91, 112, 0.1);
}

.admin-direction {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.admin-direction label {
  position: relative;
  display: block;
  cursor: pointer;
}

.admin-direction input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.admin-direction span {
  display: block;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  transition: color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.admin-direction input:checked + span {
  color: var(--accent-dark);
  background: #fff;
  box-shadow: 0 2px 8px rgba(73, 45, 37, 0.08);
}

.admin-direction input:focus-visible + span {
  outline: 3px solid rgba(183, 91, 112, 0.22);
}

.admin-amount-input {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
}

.admin-amount-input b {
  padding-left: 12px;
  color: var(--accent-dark);
  font-size: 16px;
}

.admin-amount-input input {
  border: 0;
  box-shadow: none;
  background: transparent;
}

.admin-amount-input:focus-within {
  border-color: #c48a98;
  box-shadow: 0 0 0 3px rgba(183, 91, 112, 0.1);
}

.admin-amount-input input:focus {
  box-shadow: none;
}

.admin-form-note {
  color: var(--muted-soft);
  font-size: 10px;
  text-align: center;
}

.admin-activity-list {
  display: grid;
}

.admin-activity-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.admin-activity-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.admin-activity-mark.is-plus {
  color: var(--success);
  background: var(--success-soft);
}

.admin-activity-mark.is-minus {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.admin-activity-row > div {
  min-width: 0;
}

.admin-activity-row strong,
.admin-activity-row small {
  display: block;
}

.admin-activity-row strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-activity-row small {
  color: var(--muted-soft);
  font-size: 10px;
}

.admin-activity-row em {
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.admin-todo-list {
  display: grid;
  gap: 8px;
}

.admin-todo-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  transition: border-color 150ms ease, transform 150ms ease;
}

.admin-todo-item:hover {
  border-color: #d9bfc5;
  transform: translateY(-1px);
}

.admin-todo-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 10px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-family: "Songti SC", "STSong", serif;
  font-size: 13px;
  font-weight: 700;
}

.admin-todo-item > div {
  min-width: 0;
  flex: 1;
}

.admin-todo-item strong,
.admin-todo-item small {
  display: block;
}

.admin-todo-item strong {
  font-size: 12px;
}

.admin-todo-item small {
  color: var(--muted-soft);
  font-size: 10px;
}

.admin-todo-item > b {
  color: var(--accent-dark);
  font-size: 18px;
}

.admin-member-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.admin-member-strip > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
}

.admin-member-strip i {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-style: normal;
  font-weight: 700;
}

.admin-member-strip b {
  color: var(--ink);
  font-size: 10px;
}

.admin-shop-panel {
  margin-top: 18px;
}

.admin-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin: 10px 0 20px;
}

.admin-section-heading h2 {
  margin: 3px 0 4px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 27px;
  line-height: 1.25;
}

.admin-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.admin-balance-chip {
  flex-shrink: 0;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
}

.admin-balance-chip strong {
  margin: 0 3px;
  color: var(--accent-dark);
  font-size: 16px;
}

.admin-filter-panel {
  padding: 16px 18px;
}

.admin-filter-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1.5fr auto;
  align-items: end;
  gap: 10px;
}

.admin-filter-bar label {
  display: grid;
  gap: 5px;
}

.admin-filter-actions {
  display: flex;
  gap: 6px;
}

.admin-table-panel {
  padding-bottom: 16px;
}

.admin-table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  scrollbar-width: thin;
}

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 12px;
}

.admin-table th,
.admin-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: var(--muted-soft);
  background: #fcf8f6;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr:hover {
  background: #fffbf9;
}

.admin-table .is-number {
  text-align: right;
  white-space: nowrap;
}

.admin-table .is-action {
  width: 58px;
  text-align: right;
}

.admin-table td form {
  margin: 0;
}

.admin-nowrap {
  white-space: nowrap;
}

.admin-member-name {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #f6f0ed;
  font-size: 10px;
}

.admin-memo {
  font-weight: 600;
}

.admin-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 9px;
  font-style: normal;
}

.admin-type-tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: #f5efec;
  font-size: 9px;
  white-space: nowrap;
}

.admin-type-tag.type-adjustment {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.admin-type-tag.type-task,
.admin-type-tag.type-badge {
  color: var(--success);
  background: var(--success-soft);
}

.admin-type-tag.type-daily {
  color: var(--warn);
  background: var(--warn-soft);
}

.admin-balance-cell {
  color: var(--muted);
}

.admin-inline-button,
.admin-danger-link {
  padding: 0;
  border: 0;
  background: none;
  font-size: 11px;
  font-weight: 600;
}

.admin-inline-button {
  color: var(--accent-dark);
}

.admin-inline-button:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.admin-danger-link {
  color: #a64d4d;
}

.admin-danger-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.admin-table-note {
  margin: 10px 2px 0;
  color: var(--muted-soft);
  font-size: 10px;
}

.admin-row-note {
  display: block;
  max-width: 280px;
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted-soft);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.admin-review-list .review-card {
  margin: 0;
}

.admin-form-panel {
  margin-top: 18px;
}

.admin-task-form {
  grid-template-columns: minmax(0, 1.5fr) minmax(130px, 0.5fr) minmax(110px, 0.4fr);
  align-items: end;
}

.admin-task-form .admin-form-wide {
  grid-column: 1 / -1;
}

.admin-task-form textarea {
  min-height: 72px;
}

.admin-form-actions {
  display: flex;
  justify-content: flex-end;
}

.admin-badge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-badge-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-badge-card.is-earned {
  border-color: #e5c9cf;
  background:
    radial-gradient(circle at 94% 0%, rgba(250, 228, 232, 0.65), transparent 42%),
    var(--surface);
}

.admin-badge-head {
  display: grid;
  grid-template-columns: 43px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.admin-badge-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid #ebcfd5;
  border-radius: 50%;
  color: var(--accent-dark);
  background: linear-gradient(145deg, #fffaf9, #fbedf0);
  font-family: "Songti SC", "STSong", serif;
  font-size: 14px;
  font-weight: 700;
}

.admin-badge-head h3 {
  margin: 1px 0 0;
  font-size: 16px;
  line-height: 1.3;
}

.admin-badge-head > b {
  color: var(--accent-dark);
  font-family: "Songti SC", "STSong", serif;
  font-size: 22px;
  line-height: 1;
}

.admin-badge-card > p {
  min-height: 38px;
  margin: 12px 0 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.admin-badge-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 10px;
}

.admin-badge-rule strong {
  color: var(--ink);
}

.admin-recipients {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 42px;
  margin: 10px 0;
}

.admin-recipient,
.admin-recipient-empty {
  height: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
}

.admin-recipient {
  color: var(--success);
  background: var(--success-soft);
}

.admin-recipient-empty {
  color: var(--muted-soft);
  background: #f6f1ee;
}

.admin-badge-grant {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin-top: auto;
}

.admin-badge-grant select {
  min-height: 34px;
  padding-top: 5px;
  padding-bottom: 5px;
  font-size: 11px;
}

.admin-badge-auto {
  margin-top: auto;
  padding: 8px 10px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--muted-soft);
  font-size: 9px;
  text-align: center;
}

@media (max-width: 980px) {
  .admin-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .admin-quick-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 0 26px;
  }

  .admin-quick-panel .panel-heading {
    grid-column: 1 / -1;
  }

  .admin-entry-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  .admin-entry-form .admin-direction,
  .admin-entry-form label:nth-of-type(2),
  .admin-entry-form label:nth-of-type(4),
  .admin-entry-form .button,
  .admin-entry-form .admin-form-note {
    grid-column: span 1;
  }

  .admin-entry-form .button,
  .admin-entry-form .admin-form-note {
    grid-column: 1 / -1;
  }

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

  .admin-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

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

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

  .admin-task-form .admin-form-wide {
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .admin-shell {
    width: calc(100% - 24px);
  }

  .admin-hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    padding: 26px 22px;
    border-radius: 20px;
  }

  .admin-status-card {
    width: 100%;
    min-width: 0;
  }

  .admin-tabs {
    margin-bottom: 17px;
  }

  .admin-tabs a {
    padding: 7px 12px;
  }

  .admin-kpi-grid {
    gap: 9px;
  }

  .admin-kpi {
    padding: 15px 13px 13px;
    border-radius: 14px;
  }

  .admin-kpi-top {
    font-size: 10px;
  }

  .admin-kpi-top i {
    width: 23px;
    height: 23px;
    font-size: 10px;
  }

  .admin-kpi > strong {
    font-size: clamp(21px, 6.2vw, 28px);
  }

  .admin-kpi > strong small {
    display: block;
    margin: 2px 0 0;
    font-size: 9px;
  }

  .admin-kpi footer {
    font-size: 9px;
  }

  .admin-chart-panel {
    padding: 16px 12px 13px;
  }

  .admin-trend-chart {
    min-height: 0;
  }

  .admin-chart-legend {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .admin-quick-panel {
    display: block;
  }

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

  .admin-entry-form .admin-direction,
  .admin-entry-form label:nth-of-type(2),
  .admin-entry-form label:nth-of-type(4),
  .admin-entry-form .button,
  .admin-entry-form .admin-form-note {
    grid-column: auto;
  }

  .admin-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .admin-section-heading h2 {
    font-size: 24px;
  }

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

  .admin-filter-actions {
    grid-column: auto;
    justify-content: stretch;
  }

  .admin-filter-actions .button {
    flex: 1;
  }

  .admin-review-list,
  .admin-badge-grid {
    grid-template-columns: 1fr;
  }

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

  .admin-task-form .admin-form-wide {
    grid-column: auto;
  }

  .admin-form-actions {
    justify-content: stretch;
  }

  .admin-form-actions .button {
    width: 100%;
  }
}

/* Sites */
.sites-heading {
  align-items: center;
}

.site-count {
  flex-shrink: 0;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
}

.site-count strong {
  margin: 0 3px;
  color: var(--accent-dark);
  font-size: 17px;
}

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

.site-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.site-card:hover {
  border-color: #e2c3ca;
  box-shadow: 0 18px 40px rgba(73, 45, 37, 0.09);
  transform: translateY(-3px);
}

.site-card:focus-visible {
  outline: 3px solid rgba(183, 91, 112, 0.28);
  outline-offset: 3px;
}

.site-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, #cf7f92, var(--accent-dark));
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(183, 91, 112, 0.2);
}

.site-card:nth-child(2n) .site-icon {
  background: linear-gradient(145deg, #4b4441, #241f1d);
  box-shadow: 0 8px 18px rgba(36, 31, 29, 0.2);
}

.site-card-copy {
  flex: 1;
  min-width: 0;
}

.site-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.site-title-row h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 21px;
  line-height: 1.3;
}

.site-open {
  color: var(--muted-soft);
  font-size: 17px;
  transition: color 160ms ease, transform 160ms ease;
}

.site-card:hover .site-open {
  color: var(--accent-dark);
  transform: translate(1px, -1px);
}

.site-description {
  margin: 7px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.site-domain {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 9px;
  overflow: hidden;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-footnote {
  margin: 16px 4px 0;
  color: var(--muted-soft);
  font-size: 11px;
}

.admin-table .is-actions {
  width: 150px;
  text-align: right;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.admin-row-actions form {
  margin: 0;
}

.admin-row-actions a {
  text-decoration: none;
}

.admin-site-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.admin-site-name i {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.admin-site-name strong {
  font-size: 13px;
}

.admin-site-form {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.6fr) 88px 82px;
  align-items: end;
}

.admin-site-form .admin-form-wide {
  grid-column: 1 / -1;
}

.admin-site-form textarea {
  min-height: 68px;
}

@media (max-width: 980px) {
  .admin-site-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .site-grid {
    grid-template-columns: 1fr;
  }

  .site-card {
    padding: 18px;
  }

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

  .admin-site-form .admin-form-wide {
    grid-column: auto;
  }
}

/* Blog + Markdown + preview (2026-11-15) */
.preview-banner {
  border-bottom: 1px solid #efd3d9;
  background: linear-gradient(90deg, #fff6f2, #fdf0f3 55%, #fff8f0);
}

.preview-banner-inner {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  padding: 8px 0;
  color: var(--muted);
  font-size: 11px;
}

.preview-banner p {
  flex: 1;
  min-width: 220px;
  margin: 0;
}

.preview-badge {
  padding: 2px 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.preview-switch {
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-switch select {
  width: auto;
  min-height: 30px;
  padding: 3px 26px 3px 9px;
  border-radius: 8px;
  font-size: 11px;
}

.preview-switch .button {
  min-height: 30px;
  padding: 4px 10px;
  font-size: 11px;
}

.preview-manage-link {
  font-size: 11px;
}

.blog-heading {
  align-items: flex-end;
}

.blog-count {
  flex-shrink: 0;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
}

.blog-count strong {
  margin-right: 3px;
  color: var(--accent-dark);
  font-size: 17px;
}

.blog-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.blog-feature:hover,
.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(73, 45, 37, 0.1);
}

.blog-feature-media {
  min-height: 330px;
  overflow: hidden;
  background: var(--surface-soft);
}

.blog-feature-media img,
.blog-card-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.blog-cover-fallback {
  width: 100%;
  min-height: 210px;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(152, 69, 89, 0.42);
  background:
    radial-gradient(circle at 70% 20%, rgba(250, 228, 232, 0.9), transparent 55%),
    linear-gradient(145deg, #fffaf7, #f7e9e6);
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 70px;
}

.blog-feature-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: clamp(24px, 4vw, 42px);
}

.blog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted-soft);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.blog-feature h2,
.blog-card h2 {
  margin: 2px 0 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  line-height: 1.3;
}

.blog-feature h2 {
  font-size: clamp(26px, 3.4vw, 36px);
}

.blog-feature p,
.blog-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.blog-feature p {
  font-size: 14px;
}

.blog-more {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
}

.blog-more i {
  font-style: normal;
  transition: transform 160ms ease;
}

.blog-feature:hover .blog-more i,
.blog-card:hover .blog-more i {
  transform: translateX(3px);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.blog-card-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-soft);
}

.blog-card-media .blog-cover-fallback {
  min-height: 0;
  font-size: 46px;
}

.blog-card-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: 18px 20px 20px;
}

.blog-card h2 {
  font-size: 22px;
}

.blog-card p {
  font-size: 12px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.blog-empty {
  padding: 34px;
}

.post-shell {
  width: min(860px, calc(100% - 32px));
}

.post-back {
  display: inline-block;
  margin: 2px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.post-back:hover {
  color: var(--accent-dark);
}

.post-admin-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-bottom: 12px;
  padding: 11px 15px;
  border: 1px solid #efcfb4;
  border-radius: 12px;
  color: #7b533b;
  background: #fff8ef;
  font-size: 12px;
}

.post-admin-preview strong {
  padding: 1px 8px;
  border-radius: 999px;
  color: #fff;
  background: #b7794f;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.post-admin-preview .text-link {
  margin-left: auto;
}

.post-article {
  padding: clamp(22px, 4.4vw, 46px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.post-header .blog-meta {
  margin-bottom: 8px;
}

.post-header h1 {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(30px, 4.8vw, 46px);
  line-height: 1.22;
}

.post-summary {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.post-cover {
  margin: 26px 0 6px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.post-cover img {
  width: 100%;
  max-height: 430px;
  display: block;
  object-fit: cover;
}

.post-link-row {
  margin: 26px 0 0;
}

.post-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted-soft);
  font-size: 11px;
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.post-nav-item {
  display: grid;
  gap: 4px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.post-nav-item:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.post-nav-item.is-next {
  text-align: right;
}

.post-nav-item span {
  color: var(--muted-soft);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.post-nav-item strong {
  font-size: 13px;
  font-weight: 600;
}

.markdown-body {
  margin-top: 26px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 1.7em 0 0.6em;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  line-height: 1.35;
}

.markdown-body h1 {
  font-size: 32px;
}

.markdown-body h2 {
  font-size: 27px;
}

.markdown-body h3 {
  font-size: 21px;
}

.markdown-body h4 {
  font-size: 17px;
}

.markdown-body p {
  margin: 0 0 1.1em;
}

.markdown-body a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.markdown-body strong {
  color: #2f2522;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 1.1em;
  padding-left: 1.5em;
}

.markdown-body li {
  margin: 0.28em 0;
}

.markdown-body blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  color: var(--muted);
  background: var(--accent-soft);
}

.markdown-body blockquote p:last-child {
  margin-bottom: 0;
}

.markdown-body code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #f4ece8;
  font-size: 0.9em;
}

.markdown-body pre {
  margin: 18px 0;
  padding: 15px 17px;
  overflow-x: auto;
  border-radius: 13px;
  color: #f9efe9;
  background: #322829;
  line-height: 1.65;
}

.markdown-body pre code {
  padding: 0;
  color: inherit;
  background: none;
  font-size: 12px;
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.markdown-body hr {
  margin: 28px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.markdown-body table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
  font-size: 13px;
}

.markdown-body th,
.markdown-body td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
}

.markdown-body th {
  background: var(--surface-soft);
}

.admin-preview-card {
  align-items: flex-start;
  min-width: 250px;
  max-width: 330px;
  padding: 14px 16px;
}

.admin-preview-card .admin-status-light {
  margin-top: 4px;
}

.admin-status-light.is-preview {
  background: #f1c78d;
  box-shadow: 0 0 0 5px rgba(241, 199, 141, 0.12), 0 0 16px rgba(241, 199, 141, 0.7);
}

.admin-preview-card small b {
  color: #fff5ef;
}

.admin-preview-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.admin-preview-switch select {
  width: 118px;
  min-height: 30px;
  padding: 3px 24px 3px 8px;
  border-color: rgba(255, 240, 235, 0.24);
  border-radius: 8px;
  color: #fff8f6;
  background: rgba(255, 255, 255, 0.1);
  font-size: 11px;
}

.admin-preview-switch select option {
  color: var(--ink);
}

.admin-preview-switch .button {
  min-height: 30px;
  padding: 4px 9px;
  border-color: rgba(255, 240, 235, 0.28);
  color: #fff5ef;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
}

.admin-preview-open {
  display: inline-block;
  margin-top: 7px;
  color: #f2c9bc;
  font-size: 10px;
}

.admin-info-title-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.admin-info-thumb {
  width: 58px;
  height: 44px;
  display: grid;
  flex-shrink: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface-soft);
  color: var(--accent-dark);
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 18px;
}

.admin-slug {
  padding: 2px 7px;
  border-radius: 5px;
  color: var(--muted);
  background: #f6f0ed;
  font-size: 10px;
  white-space: nowrap;
}

.admin-info-form {
  margin-top: 4px;
}

.admin-info-editor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 22px;
  align-items: start;
}

.admin-info-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.admin-info-main label,
.admin-info-side label {
  display: grid;
  gap: 5px;
}

.admin-info-main label > span,
.admin-info-side label > span {
  color: var(--muted);
  font-size: 11px;
}

.admin-info-two {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
}

.admin-md-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.admin-md-heading small {
  color: var(--muted-soft);
  font-size: 10px;
}

.admin-md-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.admin-md-toolbar button,
.admin-md-upload {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fff;
  font-size: 10px;
  line-height: 1.6;
}

.admin-md-toolbar button:hover,
.admin-md-upload:hover {
  border-color: #d9bec4;
  color: var(--accent-dark);
}

.admin-md-upload {
  cursor: pointer;
}

.admin-md-upload input,
.admin-upload-button input {
  display: none;
}

.admin-markdown-input {
  min-height: 330px;
  font-family: "SFMono-Regular", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
}

.admin-md-preview {
  max-height: 430px;
  margin-top: 2px;
  padding: 16px 18px;
  overflow-y: auto;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #fffdfb;
  font-size: 13px;
  line-height: 1.75;
}

.admin-md-preview h1 {
  font-size: 24px;
}

.admin-md-preview h2 {
  font-size: 21px;
}

.admin-md-preview h3 {
  font-size: 17px;
}

.admin-info-side {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.admin-info-side-block {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fffdfb;
}

.admin-info-side-block h3 {
  margin: -2px 0 1px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 16px;
}

.admin-upload-button {
  justify-self: start;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--accent-dark);
  background: #fff;
  font-size: 11px;
  cursor: pointer;
}

.admin-cover-preview {
  position: relative;
  display: grid;
  min-height: 130px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-soft);
}

.admin-cover-preview img {
  width: 100%;
  height: 100%;
  max-height: 180px;
  display: block;
  object-fit: cover;
}

.admin-cover-preview img[hidden] {
  display: none;
}

.admin-cover-empty {
  padding: 24px;
  color: var(--muted-soft);
  font-size: 10px;
}

.admin-checkbox {
  display: flex !important;
  align-items: center;
  gap: 8px !important;
  color: var(--muted);
  font-size: 12px;
}

.admin-checkbox input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

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

@media (max-width: 1080px) {
  .admin-hero {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .admin-hero-copy {
    flex: 1 1 420px;
  }

  .admin-preview-card {
    flex: 1 1 100%;
    max-width: none;
  }
}

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

  .blog-feature-media {
    min-height: 230px;
    aspect-ratio: 16 / 9;
  }

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

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

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

  .admin-info-side-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .preview-banner-inner {
    align-items: flex-start;
  }

  .preview-banner p {
    flex-basis: 100%;
    order: 3;
  }

  .preview-switch {
    order: 2;
  }

  .preview-manage-link {
    margin-left: auto;
  }

  .blog-feature-copy {
    padding: 22px;
  }

  .blog-feature h2 {
    font-size: 26px;
  }

  .post-article {
    border-radius: 18px;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-item.is-next {
    text-align: left;
  }

  .admin-info-two,
  .admin-info-side,
  .admin-info-side-actions {
    grid-template-columns: 1fr;
  }

  .admin-preview-switch {
    width: 100%;
  }

  .admin-preview-switch select {
    flex: 1;
    width: auto;
  }
}
/* ===== 站点页脚与备案信息 =====
   工信部备案号链接工信部备案系统；公安备案号前放图标，并链接公安备案查询页。 */
.site-footer {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 18px;
}

.site-footer-copy {
  color: var(--muted-soft);
}

.site-footer-filing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.site-footer-filing a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
}

.site-footer-filing a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer-filing img {
  display: block;
  width: 20px;
  height: 22px;
}

.filing-divider {
  color: var(--line-strong);
}

/* 登录/错误页：页脚贴底，首屏仍保持居中布局。 */
.login-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.login-body .login-shell {
  flex: 1 1 auto;
  min-height: 0;
}

.login-body .site-footer {
  flex: 0 0 auto;
}