:root {
  --paper: #f3eee6;
  --sheet: #fffdf9;
  --ink: #241c18;
  --muted: #6b5e55;
  --line: #e3d6c8;
  --accent: #8d3b32;
  --accent-dark: #6f2c25;
  --moss: #234237;
  --radius: 0.75rem;
  --shadow-sm: 0 1px 2px rgba(36, 28, 24, 0.05);
  --shadow-md: 0 10px 24px rgba(36, 28, 24, 0.12);
  color-scheme: light;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-bottom: calc(8.75rem + env(safe-area-inset-bottom));
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: calc(4.25rem + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at top left, rgba(141, 59, 50, 0.08), transparent 28rem),
    var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

body[data-page="account"] {
  padding-bottom: env(safe-area-inset-bottom);
}

body[data-page="account"] .tabbar {
  display: none;
}

body[data-page="admin"] {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: #efe8de;
}

body[data-page="admin"].is-login {
  background:
    radial-gradient(circle at top left, rgba(141, 59, 50, 0.08), transparent 28rem),
    var(--paper);
}

.admin-gate {
  width: min(28rem, calc(100% - 2rem));
  margin: 10vh auto 2rem;
}

.admin-gate .brand { margin-bottom: 1.4rem; }

.dash {
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  min-height: 100vh;
}

.dash-side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 1.15rem 0.8rem 0.9rem;
  border-right: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.96);
}

.dash-side .brand { margin: 0.15rem 0.45rem 1rem; }

.dash-nav {
  flex: 1;
  overflow: auto;
}

.dash-label {
  margin: 0.85rem 0.7rem 0.25rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

.dash-group:first-child .dash-label { margin-top: 0.2rem; }

.dash-nav a {
  display: block;
  margin: 0.08rem 0;
  padding: 0.42rem 0.7rem;
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.dash-nav a:hover { background: rgba(36, 28, 24, 0.04); }

.dash-nav a.is-current {
  background: rgba(141, 59, 50, 0.1);
  color: var(--accent-dark);
}

.dash-exit {
  margin-top: 0.6rem;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.dash-exit:hover { color: var(--accent-dark); }

.dash-backdrop,
.dash-toggle { display: none; }

.dash-top {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1.35rem 0.7rem;
  background: rgba(239, 232, 222, 0.92);
  backdrop-filter: saturate(160%) blur(8px);
}

.dash-top h1 {
  margin: 0;
  font-size: 1.35rem;
}

.dash-body {
  width: min(68rem, 100%);
  padding: 0.35rem 1.35rem 2rem;
}

.dash-section { margin-bottom: 1.15rem; }

.dash-section h2 {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

@media (max-width: 800px) {
  .dash { display: block; }

  .dash-side {
    position: fixed;
    z-index: 40;
    width: min(16.5rem, 86vw);
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    box-shadow: var(--shadow-md);
  }

  .dash.is-open .dash-side { transform: none; }

  .dash.is-open .dash-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    border: 0;
    background: rgba(36, 28, 24, 0.28);
  }

  .dash-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0 0.7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--sheet);
    color: var(--ink);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
  }

  .dash-body { padding-right: 1rem; padding-left: 1rem; }
}

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

.stat-card {
  padding: 0.75rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.92);
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.stat-card b {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

@media (min-width: 960px) {
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.admin-create h2 { margin-bottom: 0.35rem; font-size: 1.15rem; }

.admin-create-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.7rem;
  margin: 0.7rem 0;
}

.admin-created {
  margin: 0.8rem 0;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--sheet);
}

.admin-created pre {
  margin: 0.45rem 0 0.7rem;
  white-space: pre-wrap;
  font-family: Consolas, "Songti SC", monospace;
  font-size: 0.95rem;
}

.admin-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.admin-card h2 {
  margin-bottom: 0.25rem;
  font-size: 1.15rem;
}

.admin-card p { margin: 0.2rem 0; }

.admin-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.admin-edit {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.admin-edit label {
  display: grid;
  gap: 0.25rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

textarea.admin-text {
  width: 100%;
  min-height: 4.6rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 16px;
  line-height: 1.55;
  resize: vertical;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.admin-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-pager {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.filter-bar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.filter-bar .field {
  min-width: 13rem;
  margin-bottom: 0;
}

.filter-bar .admin-btn {
  min-height: 2.75rem;
}

.filter-bar-note {
  margin: 0 0 0.9rem;
}

.dash-table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sheet);
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.dash-table th,
.dash-table td {
  padding: 0.55rem 0.8rem;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.dash-table th {
  background: #faf6ef;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.dash-table thead th:last-child { text-align: right; }

.dash-table tbody tr:last-child td { border-bottom: 0; }
.dash-table tbody tr:hover { background: #faf6ef; }

.dash-table .cell-main { font-weight: 600; }
.dash-table .cell-sub { color: var(--muted); font-size: 0.8rem; }
.dash-table td.cell-wrap { white-space: normal; min-width: 16rem; max-width: 26rem; }

.dash-edit-row td {
  background: #faf6ef;
}

.dash-edit-row .admin-edit {
  max-width: 34rem;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.7rem;
}

.row-action {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-dark);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.row-action:hover { text-decoration: underline; }
.row-action.danger { color: var(--muted); }
.row-action:disabled { color: var(--line); cursor: default; text-decoration: none; }

.admin-switch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.92);
  cursor: pointer;
}

.admin-switch-copy { min-width: 0; }

.admin-switch b { display: block; }

.admin-switch .note { display: block; margin: 0.2rem 0 0; }

.admin-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.admin-switch:has(input:checked) {
  border-color: var(--accent);
  background: #f8ebe8;
}

.admin-switch:has(input:checked) .switch-track { background: var(--accent); }

.admin-switch:has(input:checked) .switch-track::after { transform: translateX(1.15rem); }

.admin-switch:has(input:focus-visible) .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.admin-card .admin-switch {
  margin-top: 0.7rem;
  padding: 0.7rem 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.admin-card .admin-switch:has(input:checked) {
  border-color: var(--line);
  background: transparent;
}

.admin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.admin-btn:hover { border-color: var(--accent); color: var(--accent-dark); }

.admin-btn.is-current {
  border-color: var(--accent);
  background: rgba(141, 59, 50, 0.1);
  color: var(--accent-dark);
}

.admin-btn:disabled { opacity: 0.55; cursor: default; }

.metric-series { display: grid; gap: 0.4rem; }

.metric-row {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.82rem;
}

.metric-bar {
  display: block;
  height: 0.45rem;
  border-radius: 999px;
  background: rgba(141, 59, 50, 0.12);
  overflow: hidden;
}

.metric-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.metric-scroll { overflow-x: auto; }

.metric-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.metric-table th,
.metric-table td {
  padding: 0.45rem 0.4rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.metric-table th { color: var(--muted); font-weight: 600; }

.admin-subhead {
  margin: 1rem 0 0;
  font-size: 1.05rem;
}

#admin-root > .text-edit {
  margin: -0.2rem 0 0.8rem;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.7rem;
  font-weight: 600;
}

.check-line input {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  accent-color: var(--accent);
}

body[data-page="form"] {
  padding-bottom: calc(8rem + env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 70% 36% at 0% 0%, rgba(141, 59, 50, 0.12), transparent 50%),
    var(--paper);
}

body[data-page="form"] .panel {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0.2rem 0 0;
}

body[data-page="form"] h1 {
  font-size: clamp(1.9rem, 8vw, 2.4rem);
}

a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr min(34rem, calc(100% - 1.75rem)) 1fr;
  align-items: center;
  padding: calc(0.65rem + env(safe-area-inset-top)) 0 0.7rem;
  background: rgba(255, 253, 249, 0.94);
  backdrop-filter: saturate(160%) blur(6px);
}

.site-header .brand,
.site-header .account-line {
  grid-row: 1;
}

.site-header .brand {
  grid-column: 2;
  justify-self: start;
}

.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, rgba(141, 59, 50, 0.15) 45%, transparent 70%);
}

.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.brand:active { transform: scale(0.97); }

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 0.4rem;
  background: var(--accent);
  color: #fffaf7;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 0;
  transform: rotate(-6deg);
  box-shadow: var(--shadow-sm);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-size: 0.92rem;
  text-decoration: none;
}

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

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 249, 0.96);
}

.tabbar a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 3.1rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.tabbar a[aria-current="page"] {
  color: var(--accent-dark);
  font-weight: 700;
}

.tabbar a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: 0.3rem;
  left: 50%;
  transform: translateX(-50%);
  width: 1.1rem;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.action-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(3.1rem + env(safe-area-inset-bottom));
  z-index: 25;
  padding: 0.65rem 1rem 0.3rem;
  background: linear-gradient(transparent, var(--paper) 30%);
}

.saved-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  margin-left: 0.2rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--moss);
  color: #f7f4ee;
  font-size: 0.75rem;
}

.saved-count[hidden] { display: none; }

.wrap {
  width: min(34rem, calc(100% - 1.75rem));
  margin: 0 auto;
  padding: 1.1rem 0 1rem;
}

h1, h2, p { margin-top: 0; }

h1 {
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: clamp(1.7rem, 7vw, 2.4rem);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: 0.02em;
}

.lede {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 36rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.1rem;
}

.actions .button,
.empty-state > .button { width: 100%; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fffaf7;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  touch-action: manipulation;
  transition: background 0.15s ease, transform 0.1s ease;
}

.button:active { transform: scale(0.98); }
.button-block { width: 100%; }
.button:hover { background: var(--accent-dark); }

.button-secondary {
  background: transparent;
  color: var(--accent-dark);
}

.button-secondary:hover {
  background: rgba(141, 59, 50, 0.08);
}

.points {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}

.points li {
  padding: 0.9rem 1rem;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.points strong { display: block; }
.points span { color: var(--muted); }

.panel, .detail, .empty-state {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 1.1rem;
  box-shadow: var(--shadow-sm);
}

form {
  display: grid;
  gap: 0.9rem;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

legend, label {
  font-weight: 600;
}

fieldset legend { grid-column: 1 / -1; margin-bottom: 0.1rem; }

fieldset[hidden],
.wx-reveal[hidden],
.sheet-reveal[hidden],
.sheet-block[hidden] {
  display: none !important;
}

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

fieldset.style-mode {
  grid-template-columns: repeat(4, 1fr);
}

fieldset.sound-mode {
  grid-template-columns: repeat(3, 1fr);
}

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

.five-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

fieldset.wx-target {
  grid-template-columns: repeat(5, 1fr);
}

fieldset.wx-mode {
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
}

fieldset.wx-pos {
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
}

fieldset.mom-mode {
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.field {
  display: grid;
  gap: 0.35rem;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
  font-size: 16px;
  color: inherit;
}

.birth-combo {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
}

.birth-combo input[type="date"],
.birth-combo input[type="time"] {
  width: auto;
  min-width: 0;
  min-height: 2.75rem;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.birth-combo input[type="date"] {
  flex: 1.35 1 0;
}

.birth-combo input[type="time"] {
  flex: 1 1 0;
  border-left: 1px solid var(--line);
}

.choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-weight: 600;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.choice:has(input:checked) {
  border-color: var(--accent);
  background: #f8ebe8;
  color: var(--accent-dark);
}

.choice:has(input:disabled) {
  color: #b3a69c;
  background: #f6f1ea;
}

.hint, .note, .wuxing {
  color: var(--muted);
  font-size: 0.92rem;
}

.with-help {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
}

.help-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
}

.help-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  opacity: 0.42;
  font-family: "Songti SC", "SimSun", Georgia, serif;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  cursor: pointer;
}

.help-mark::before {
  content: "";
  position: absolute;
  inset: -0.55rem;
}

.help-mark:hover,
.help-wrap.is-open .help-mark {
  opacity: 1;
  color: var(--accent);
  border-color: var(--accent);
}

.help-pop {
  position: fixed;
  z-index: 80;
  padding: 0.72rem 0.88rem 0.78rem;
  border: 0;
  border-radius: 0.85rem;
  background: #241c18;
  color: #f4ece4;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.03em;
  text-align: left;
  box-shadow: 0 16px 36px rgba(36, 28, 24, 0.28);
  animation: help-in 0.16s ease;
}

.bazi-stage .help-pop {
  background: #fffdf9;
  color: var(--ink);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
}

.help-pop.is-above {
  animation-name: help-in-up;
}

.help-pop[hidden] { display: none; }

@keyframes help-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

@keyframes help-in-up {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: none; }
}

h2 .with-help,
.eyebrow .with-help,
.sheet-kicker .with-help {
  align-items: baseline;
}

.sheet-kicker .help-mark,
.eyebrow .help-mark,
.wuge-name .help-mark {
  letter-spacing: 0;
}

h2 .help-mark {
  transform: translateY(-0.12em);
}

.wuge-name .with-help {
  letter-spacing: 0.22em;
}

.wuge-name .help-mark {
  letter-spacing: 0;
  transform: translateY(-0.08em);
}

.wuxing .with-help {
  color: var(--muted);
}

.bazi-stage .help-mark {
  color: #e8c4b8;
  opacity: 0.72;
}

.bazi-stage .help-mark:hover,
.bazi-stage .help-wrap.is-open .help-mark {
  opacity: 1;
  color: #f3d3c8;
  border-color: currentColor;
}

.error {
  margin: 0;
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius);
  background: #f8e8e4;
  color: var(--accent-dark);
}

.error[hidden] { display: none; }

.similar-panel { margin-bottom: 1rem; }

.similar-panel p {
  margin: 0 0 0.8rem;
  color: var(--muted);
}

.page-intro { margin-bottom: 1rem; }

.page-intro-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.page-intro-row h1 { margin-bottom: 0; }

.direction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.direction-row .chip-button {
  min-height: 2rem;
  padding: 0 0.75rem;
  font-size: 0.84rem;
}

.profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.profile-head h1 { margin-bottom: 0; }

body[data-page="profile"] {
  background:
    radial-gradient(ellipse 80% 40% at 100% 0%, rgba(141, 59, 50, 0.14), transparent 50%),
    radial-gradient(ellipse 60% 30% at 0% 20%, rgba(35, 66, 55, 0.08), transparent 45%),
    var(--paper);
}

.profile-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.2rem;
}

.profile-seal {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5.4rem;
  height: 5.4rem;
  border: 2px solid var(--accent);
  color: var(--accent);
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: 2.7rem;
  line-height: 1;
  letter-spacing: 0;
  transform: rotate(-7deg);
  box-shadow: 6px 7px 0 rgba(141, 59, 50, 0.12);
}

.profile-seal.is-compound {
  font-size: 1.55rem;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
}

.profile-seal.is-empty {
  opacity: 0.35;
  box-shadow: none;
}

.tier-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  height: 1.05rem;
  margin-top: 0.06rem;
  padding: 0 0.22rem 0.02rem;
  border: 1px solid rgba(141, 59, 50, 0.28);
  border-radius: 2px;
  background: rgba(141, 59, 50, 0.08);
  color: var(--accent-dark);
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: 0.62rem;
  line-height: 1;
  letter-spacing: 0.02em;
}

.tier-seal.is-high {
  border-color: rgba(141, 59, 50, 0.55);
  background: rgba(141, 59, 50, 0.12);
}

.profile-hero-copy h1 {
  margin-bottom: 0.25rem;
  font-size: clamp(1.85rem, 8vw, 2.35rem);
}

.dash-table select {
  min-height: 2rem;
  padding: 0 0.4rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
}

.profile-hero-copy .lede {
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
}

.text-edit {
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

button.text-edit {
  background: none;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.site-header .account-line {
  display: flex;
  align-items: center;
  align-self: center;
  grid-column: 2;
  justify-self: end;
  gap: 0.35rem;
  min-width: 0;
  margin: 0;
  line-height: 1;
}

.account-who {
  overflow: hidden;
  color: var(--ink);
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-header .account-line .text-edit {
  flex: none;
  margin-left: 0.1rem;
  padding-left: 0.5rem;
  border-left: 1px solid var(--line);
  border-bottom-color: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.meta-tile {
  padding: 0.75rem 0.8rem 0.7rem;
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.86);
  border: 1px solid var(--line);
  grid-column: 1 / -1;
}

.meta-label {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

.meta-value {
  font-weight: 650;
  font-size: 0.98rem;
}

.meta-tile.is-empty .meta-value {
  color: #b3a69c;
  font-weight: 400;
}

.bazi-stage {
  padding: 1rem 0.95rem 1.05rem;
  border-radius: 1.25rem;
  background: #1c1714;
  color: #f6efe7;
  box-shadow: var(--shadow-md);
}

.bazi-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.95rem;
}

.bazi-stage .eyebrow {
  color: #d7b2a8;
  margin-bottom: 0.2rem;
}

.bazi-day {
  margin: 0;
  font-size: 0.95rem;
  color: #e8ddd3;
}

.xiyong-seal {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 4.1rem;
  height: 4.1rem;
  border: 1.5px solid #e8c4b8;
  color: #f3d3c8;
  text-align: center;
}

.xiyong-kicker {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
}

.xiyong-char {
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: 1.7rem;
  line-height: 1;
}

.pillar-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}

.pillar {
  display: grid;
  justify-items: center;
  gap: 0.12rem;
  padding: 0.55rem 0.2rem 0.6rem;
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.06);
}

.pillar-label {
  color: #c4b4a8;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
}

.pillar-gan,
.pillar-zhi {
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: 1.35rem;
  line-height: 1.1;
}

.pillar-wx {
  color: #c9b8ac;
  font-size: 0.68rem;
}

.pillar.is-empty {
  opacity: 0.45;
}

.bazi-reason {
  margin: 0.85rem 0 0.35rem;
  color: #eadfd6;
  font-size: 0.88rem;
}

.bazi-stage .hint {
  margin: 0;
  color: #b7a79b;
}

.eyebrow {
  margin-bottom: 0.3rem;
  color: var(--moss);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
}

.summary div {
  display: flex;
  gap: 0.3rem;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: #f6f0e8;
  font-size: 0.9rem;
}

.summary dt { color: var(--muted); }
.summary dd { margin: 0; }

.wuge-list {
  display: grid;
  gap: 0.45rem;
  margin: 0.15rem 0 1.1rem;
  padding: 0;
  list-style: none;
}

.wuge-item {
  padding: 0.75rem 0.9rem 0.8rem;
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.86);
  border: 1px solid var(--line);
}

.wuge-item.is-focus {
  background: #f8ebe8;
  border-color: transparent;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.wuge-item-head {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
}

.wuge-name {
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: 1.05rem;
  letter-spacing: 0.22em;
}

.wuge-tag {
  margin-left: auto;
  color: var(--accent-dark);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.wuge-score {
  margin-left: auto;
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: 1.2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.wuge-item-head:has(.wuge-tag) .wuge-score {
  margin-left: 0.35rem;
}

.wuge-score small {
  margin-left: 0.32rem;
  color: var(--accent-dark);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.wuge-how {
  margin: 0.22rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}

.char-list {
  display: grid;
  gap: 0.8rem;
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
}

.char-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.85rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.glyph, .name-display {
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
}

.name-display {
  margin-bottom: 0.2rem;
  font-size: clamp(1.9rem, 9vw, 2.6rem);
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.glyph {
  grid-row: span 3;
  font-size: 2.2rem;
  line-height: 1;
}

.pinyin { color: var(--muted); }
.pinyin-large { font-size: 1.1rem; }

.detail-hero {
  margin: 0 0 1.15rem;
  padding: 1.5rem 1.2rem 1.2rem;
  border-radius: var(--radius);
  background: #1c1714;
  color: #f6efe7;
  box-shadow: var(--shadow-md);
}

.detail-hero .pinyin { color: #cfc2b4; }
.detail-hero .style-tag { margin-bottom: 0; color: #d7b2a8; }

.refs-list {
  display: grid;
  gap: 0.7rem;
  margin: 0 0 1.1rem;
  padding: 0;
  list-style: none;
}

.refs-list li {
  padding-left: 0;
}

.ref-tag {
  display: inline-flex;
  align-items: center;
  margin-right: 0.5rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--moss);
  color: #f7f4ee;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.site-footer {
  width: min(34rem, calc(100% - 1.75rem));
  /* 文末紧凑：贴近上方内容，与固定 tabbar 之间保留安全间距 */
  margin: 0 auto 0.6rem;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

/* 备案号行：挂在页脚内，工信部核查要求可点击跳转。
   整体贴近页脚文案排布，不单独占一行视觉重心；图标与文字同色系、紧凑间距。 */
.icp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.1rem 0.3rem;
  margin-top: 0.1rem;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}

.icp-row a {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 1.7rem;
  padding: 0 0.1rem;
  color: var(--muted);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.icp-row a .icp-badge {
  flex: none;
  display: block;
}

.icp-row a:active {
  color: var(--accent-dark);
}

.icp-row a:active .icp-badge {
  opacity: 0.75;
}

@media (hover: hover) {
  .icp-row a:hover {
    color: var(--accent-dark);
    text-decoration: underline;
    text-underline-offset: 0.2em;
  }
}

:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 2px;
}

/* Surname, actions, and the applied filters stay together under the header. */
.results-sticky {
  position: sticky;
  top: calc(3.45rem + env(safe-area-inset-top));
  z-index: 18;
  margin-bottom: 0.85rem;
  padding: 0.4rem 0.4rem 0.42rem;
  border: 1px solid var(--line);
  border-radius: 1.15rem;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: var(--shadow-sm);
  backdrop-filter: saturate(160%) blur(8px);
}

.results-sticky:not(:has(.filter-pills)) {
  border-radius: 999px;
}

.info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.05rem 0 0.05rem 0.45rem;
}

.info-bar .chip-button {
  min-height: 2rem;
  padding: 0 0.62rem;
  font-size: 0.82rem;
}

.info-bar-core {
  font-weight: 700;
  font-size: 1.02rem;
  white-space: nowrap;
}

.info-bar-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.results-more {
  margin-top: 1rem;
}

.results-more-count {
  margin: 0 0 0.45rem;
  text-align: center;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.38rem;
  padding: 0.38rem 0.15rem 0.08rem 0.45rem;
  border-top: 1px solid var(--line);
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  padding: 0.05rem 0.48rem;
  border-radius: 999px;
  background: #f3ece3;
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.55;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.filter-pill:active {
  background: #e7dccd;
}

.filter-pill-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-right: -0.22rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.filter-pill-x:hover { color: var(--accent-dark); }

.chip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fffaf7;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
}

.chip-button-ghost {
  background: transparent;
  color: var(--accent-dark);
}

.chip-button-ghost:hover { background: rgba(141, 59, 50, 0.08); }

/* Dense name grid: used on the naming list and the favorites list. */
.tile-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 5.6rem;
  padding: 0.8rem 0.75rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sheet);
}

.tile-skeleton span {
  display: block;
  border-radius: 0.3rem;
  background: #ece4d8;
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}

.skel-name { width: 55%; height: 1.15rem; }
.skel-pinyin { width: 35%; height: 0.7rem; }
.skel-meaning { width: 85%; height: 0.6rem; }

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.detail-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 1.4rem 0 0.6rem;
}

.detail-skeleton span {
  display: block;
  border-radius: 0.3rem;
  background: #ece4d8;
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}

.skel-detail-name { width: 45%; height: 2rem; }
.skel-detail-py { width: 28%; height: 1rem; }
.skel-detail-line { width: 100%; height: 0.85rem; }
.skel-detail-line.short { width: 70%; }

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.25rem, 1fr));
  gap: 0.6rem;
}

.name-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.8rem 0.75rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sheet);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.name-tile:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tile-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.tile-hit:focus-visible {
  outline: 2px solid var(--moss);
  outline-offset: 2px;
}

.tile-fav {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.85);
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
}

.tile-fav svg { width: 1.05rem; height: 1.05rem; display: block; }
.tile-fav.is-saved { color: var(--accent); }
.tile-fav.is-saved svg {
  transform-origin: center;
  animation: fav-pop 0.18s ease;
}

@keyframes fav-pop {
  0% { transform: scale(0.65); }
  55% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.tile-hide {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
}

.tile-hide:hover { color: var(--accent-dark); }
.tile-hide svg { width: 0.85rem; height: 0.85rem; display: block; }

.name-tile.is-collapsing {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.19s ease, transform 0.19s ease;
}

.undo-bar {
  position: fixed;
  left: 50%;
  bottom: calc(3.1rem + 0.8rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  max-width: calc(100% - 2rem);
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: var(--ink);
  color: #f7f4ee;
  box-shadow: var(--shadow-md);
  font-size: 0.88rem;
  animation: undo-in 0.18s ease;
}

.undo-bar .text-edit { color: #f0c9b8; font-size: 0.88rem; }

@keyframes undo-in {
  from { opacity: 0; transform: translateX(-50%) translateY(0.4rem); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.tile-styles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.45rem;
}

.tile-style {
  align-self: flex-start;
  color: var(--moss);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.tile-pinyin {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.tile-meaning {
  color: var(--ink-soft, var(--muted));
  font-size: 0.78rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-name {
  padding-right: 1.6rem;
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: clamp(1.3rem, 6vw, 1.6rem);
  line-height: 1.25;
  letter-spacing: 0.02em;
}

.profile-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1rem;
  margin: 0 0 1.1rem;
}

.bazi-panel { margin-top: 0.85rem; }
.bazi-title {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}
.profile-facts dt { color: var(--muted); }
.profile-facts dd { margin: 0; font-weight: 600; }
.profile-facts dd.is-empty {
  color: #b3a69c;
  font-weight: 400;
  font-style: italic;
}

.fact-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.fact-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: #f8ebe8;
  color: var(--accent-dark);
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-weight: 700;
  font-size: 0.9rem;
}

.style-tag {
  display: inline-block;
  margin: 0 0 0.3rem;
  color: var(--moss);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.sheet[hidden] { display: none; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(28, 23, 20, 0.52);
}

.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(3.1rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  max-height: min(82vh, 42rem);
  overflow: hidden;
  border-radius: 1.4rem 1.4rem 0 0;
  background:
    radial-gradient(ellipse 80% 40% at 100% 0%, rgba(141, 59, 50, 0.12), transparent 52%),
    var(--sheet);
  box-shadow: 0 -18px 40px rgba(36, 28, 24, 0.2);
}

.sheet-handle {
  width: 2.4rem;
  height: 0.28rem;
  margin: 0.55rem auto 0.15rem;
  border-radius: 999px;
  background: #d8cbbf;
}

.sheet-head {
  padding: 0.15rem 1.15rem 0.55rem;
}

.sheet-head h2 {
  margin: 0;
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: 1.7rem;
  letter-spacing: 0.12em;
}

.sheet-panel form {
  flex: 1;
  overflow: auto;
  padding: 0 1.15rem 0.4rem;
  gap: 0.85rem;
}

.sheet-panel legend,
.sheet-panel .field > label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.sheet-panel .choice {
  min-height: 2.45rem;
  border-radius: 0.85rem;
  background: rgba(255, 253, 249, 0.7);
}

.sheet-kicker {
  display: flex;
  align-items: center;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
}

.sheet-block-head,
.sheet-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.sheet-toggle-lead {
  margin: 0.12rem 0 0;
  color: #b3a69c;
  font-size: 0.78rem;
}

.sheet-block,
.sheet-wx {
  display: grid;
  gap: 0.7rem;
  padding: 0.85rem 0.9rem;
  border-radius: 1.1rem;
  background: rgba(255, 253, 249, 0.55);
  border: 1px solid var(--line);
}

.sheet-reveal,
.wx-reveal {
  display: grid;
  gap: 0.7rem;
}

.sheet-toggle-copy {
  min-width: 0;
  flex: 1;
}

.sheet-switch {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  margin: 0;
  padding: 0.82rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgba(255, 253, 249, 0.55);
  cursor: pointer;
  font-weight: 600;
}

.sheet-switch-copy {
  display: grid;
  gap: 0.16rem;
  min-width: 0;
}

.sheet-switch-lead {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.sheet-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.switch-track {
  position: relative;
  flex: none;
  width: 2.7rem;
  height: 1.55rem;
  border-radius: 999px;
  background: #d5c6b6;
  box-shadow: inset 0 0 0 1px rgba(36, 28, 24, 0.05);
  transition: background 0.18s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 0.15rem;
  left: 0.15rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(36, 28, 24, 0.16);
  transition: transform 0.18s ease;
}

.sheet-switch:has(input:checked) {
  border-color: var(--accent);
  background: #f8ebe8;
}

.sheet-switch:has(input:checked) .sheet-kicker {
  color: var(--accent-dark);
}

.sheet-switch:has(input:checked) .switch-track {
  background: var(--accent);
}

.sheet-switch:has(input:checked) .switch-track::after {
  transform: translateX(1.15rem);
}

.sheet-switch:has(input:focus-visible) .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.sheet-fix-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.sheet-fix-slot {
  display: grid;
  justify-items: start;
  gap: 0.3rem;
}

.sheet-fix-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.sheet-char,
.sheet-panel input.sheet-char {
  flex: none;
  width: 3.1rem;
  min-width: 3.1rem;
  max-width: 3.1rem;
  height: 3.1rem;
  min-height: 3.1rem;
  padding: 0;
  border-radius: 0.85rem;
  text-align: center;
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: 1.35rem;
  font-weight: 700;
}

.wx-seal {
  min-height: 2.7rem;
  border-radius: var(--radius);
  font-family: "Songti SC", "SimSun", "Noto Serif SC", serif;
  font-size: 1.15rem;
  font-weight: 700;
}

.sheet-dock {
  flex-shrink: 0;
  padding: 0.7rem 1.15rem 0.95rem;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0), var(--sheet) 28%);
}

body.sheet-open { overflow: hidden; }

/* 意见反馈 */
fieldset.feedback-type {
  grid-template-columns: repeat(auto-fit, minmax(4.6rem, 1fr));
}

.feedback-text {
  width: 100%;
  min-height: 7.5rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
  font: inherit;
  font-size: 16px;
  line-height: 1.55;
  resize: vertical;
}

.feedback-count {
  margin: 0;
  text-align: right;
}

.feedback-count.is-short {
  color: var(--accent-dark);
  font-weight: 600;
}

.flip-prompt {
  margin: 0 0 1rem;
}

.flip-prompt p {
  margin: 0;
  line-height: 1.7;
}

/* 资料页入口 */
a.entry-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin: 1rem 0 0;
  text-decoration: none;
  color: inherit;
}

.entry-main {
  display: grid;
  gap: 0.15rem;
}

.entry-sub {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
}

.entry-arrow {
  color: var(--muted);
  font-size: 1.2rem;
}
