:root {
  color-scheme: light;
  --page: #f3ede3;
  --page-alt: #ebe2d3;
  --surface: #fffdf9;
  --surface-muted: #f8f2e8;
  --surface-strong: #ffffff;
  --line: #dccfbd;
  --line-strong: #c9b59d;
  --text: #1f2937;
  --text-soft: #6b7280;
  --heading: #172033;
  --accent: #b56a2b;
  --accent-strong: #965216;
  --accent-soft: #f3e1cf;
  --success-bg: #e7f4ea;
  --success-text: #276749;
  --danger-bg: #fae7e4;
  --danger-text: #9b3d2b;
  --reading-bg: #f9f4ec;
  --shadow: 0 12px 30px rgba(91, 65, 31, 0.06);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(245, 236, 224, 0.94) 0, rgba(245, 236, 224, 0.94) 220px, transparent 220px),
    linear-gradient(180deg, var(--page) 0%, #f7f2ea 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 210px;
  background:
    radial-gradient(circle at top left, rgba(181, 106, 43, 0.14), transparent 32%),
    radial-gradient(circle at top right, rgba(23, 32, 51, 0.08), transparent 30%);
  pointer-events: none;
}

body.member-mode {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

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

button {
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #fffaf4;
  font-weight: 700;
  cursor: pointer;
  padding: 11px 18px;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(181, 106, 43, 0.12);
}

label {
  display: block;
  margin: 12px 0 8px;
  color: var(--text-soft);
  font-size: 14px;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1360px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.guest-shell {
  width: min(760px, calc(100vw - 28px));
  padding-top: 42px;
  display: grid;
  gap: 18px;
}

.guest-portal {
  display: grid;
  gap: 18px;
}

.guest-intro {
  display: grid;
  gap: 14px;
  padding: 8px 4px 0;
}

.guest-intro h1 {
  margin: 0;
  color: var(--heading);
  font-size: clamp(34px, 7vw, 54px);
  line-height: 1.04;
}

.guest-copy {
  margin: 0;
  max-width: 680px;
  color: var(--text-soft);
  line-height: 1.8;
  font-size: 15px;
}

.guest-pill-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.guest-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid rgba(201, 181, 157, 0.75);
  color: var(--heading);
  font-size: 13px;
  font-weight: 700;
}

.guest-login-card,
.guest-admin-panel {
  display: grid;
  gap: 10px;
}

.guest-form-head {
  display: grid;
  gap: 4px;
}

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

.guest-note {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(220, 207, 189, 0.88);
  background: rgba(255, 253, 249, 0.72);
  box-shadow: var(--shadow);
}

.guest-note strong {
  color: var(--heading);
  font-size: 15px;
}

.guest-note span {
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 14px;
}

.guest-admin-form {
  display: grid;
}

.guest-admin-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.guest-login-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-card,
.card {
  background: var(--surface);
  border: 1px solid rgba(201, 181, 157, 0.75);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 36px 40px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: 28px;
  top: 26px;
  width: 120px;
  height: 120px;
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(181, 106, 43, 0.18), rgba(181, 106, 43, 0.04)),
    #f6ebdd;
}

.hero-card h1,
.topbar h1 {
  margin: 10px 0 10px;
  color: var(--heading);
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.1;
}

.hero-copy {
  margin: 0;
  max-width: 720px;
  color: var(--text-soft);
  line-height: 1.8;
  font-size: 15px;
}

.eyebrow {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.tip-strip {
  display: inline-flex;
  gap: 10px;
  margin-top: 20px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--heading);
  border: 1px solid rgba(181, 106, 43, 0.18);
}

.login-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: 1.05fr 0.95fr;
}

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

.admin-shell {
  display: grid;
  gap: 22px;
}

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

.admin-nav-btn {
  padding: 16px 18px;
  border-radius: 24px;
  text-align: left;
  display: grid;
  gap: 6px;
  border-color: rgba(201, 181, 157, 0.86);
  background: rgba(255, 253, 249, 0.9);
  color: var(--heading);
  box-shadow: var(--shadow);
}

.admin-nav-btn:hover {
  background: #f5ebdf;
  color: var(--heading);
}

.admin-nav-btn.active {
  background: linear-gradient(135deg, #b56a2b, #8d4f16);
  border-color: rgba(181, 106, 43, 0.92);
  color: #fffaf4;
}

.admin-nav-btn.active:hover {
  background: linear-gradient(135deg, #a55d22, #7e4512);
}

.admin-nav-label {
  font-size: 16px;
  font-weight: 800;
}

.admin-nav-note {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
}

.admin-nav-btn.active .admin-nav-note {
  color: rgba(255, 250, 244, 0.78);
}

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

.summary-card {
  padding: 20px 22px;
  display: grid;
  gap: 8px;
}

.summary-label {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-value {
  color: var(--heading);
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  line-height: 1;
}

.summary-note {
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 14px;
}

.admin-workspace {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
}

.admin-workspace-vertical {
  grid-template-columns: minmax(0, 1fr);
}

.admin-notice-stack {
  gap: 18px;
  align-content: start;
}

.notice-editor-card,
.notice-list-card {
  width: 100%;
}

.notice-list-card .admin-card-head {
  margin-bottom: 18px;
}

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

.admin-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

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

.member-list-head-actions {
  align-items: flex-start;
}

.member-search-field {
  width: min(100%, 320px);
}

.member-search-field input {
  min-width: 220px;
}

.admin-checklist {
  display: grid;
  gap: 12px;
}

.admin-check-item {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(220, 207, 189, 0.9);
  background: var(--surface-muted);
}

.admin-check-item strong {
  color: var(--heading);
  font-size: 15px;
}

.admin-check-item span {
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 14px;
}

.lower-grid {
  margin-top: 22px;
}

.admin-hint-card {
  margin-bottom: 22px;
}

.panel,
.form-card,
.card {
  padding: 26px;
}

.admin-secondary-card {
  align-content: start;
}

.card-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: 8px;
}

.field-tip,
.muted {
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 14px;
}

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

.tier-check-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 8px;
}

.tier-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-muted);
  color: var(--text);
}

.tier-check input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.target-range-helper {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #efe5d8;
  border-radius: 18px;
  background: rgba(255, 250, 244, 0.86);
}

.target-range-helper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--heading);
  font-size: 14px;
  font-weight: 800;
}

.target-range-helper-tip {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}

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

.target-range-row {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid rgba(220, 207, 189, 0.9);
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.82);
}

.target-range-label {
  color: var(--heading);
  font-size: 14px;
  font-weight: 800;
}

.target-range-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.target-range-actions .mini-btn {
  width: 100%;
}

.target-range-clear-btn {
  flex-shrink: 0;
}

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

.topbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-easter-egg {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 94px;
  height: 94px;
  padding: 0;
  border: 0;
  background: transparent;
  z-index: 35;
  overflow: visible;
}

.site-easter-egg:hover {
  background: transparent;
}

.site-easter-egg img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

body.black-myth-arrival::before,
body.black-myth-arrival::after {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 90;
}

body.black-myth-arrival::before {
  content: "";
  inset: 0;
  left: auto;
  top: auto;
  transform: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(224, 43, 43, 0.18), rgba(0, 0, 0, 0.72) 60%),
    linear-gradient(180deg, rgba(20, 10, 10, 0.08), rgba(0, 0, 0, 0.76));
  animation: black-myth-backdrop 1.5s ease forwards;
}

body.black-myth-arrival::after {
  content: "黑神降临";
  color: #fff5ea;
  font-size: clamp(30px, 5vw, 58px);
  font-weight: 900;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.48), 0 0 22px rgba(255, 83, 83, 0.35);
  animation: black-myth-text 1.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes black-myth-backdrop {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes black-myth-text {
  0% {
    opacity: 0;
    transform: translate(-50%, -30%) scale(0.74);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -52%) scale(1.04);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60%) scale(1.08);
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid rgba(181, 106, 43, 0.18);
  background: var(--surface-muted);
  color: var(--heading);
}

.ghost-btn {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--heading);
}

.ghost-btn:hover {
  background: #f2e7d7;
  color: var(--heading);
  border-color: var(--accent);
}

.table-wrap {
  overflow-x: auto;
}

.table-scroll,
.scroll-region {
  scrollbar-width: thin;
  scrollbar-color: rgba(181, 106, 43, 0.62) rgba(243, 225, 207, 0.52);
}

.table-scroll::-webkit-scrollbar,
.scroll-region::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-scroll::-webkit-scrollbar-thumb,
.scroll-region::-webkit-scrollbar-thumb {
  background: rgba(181, 106, 43, 0.56);
  border-radius: 999px;
  border: 2px solid rgba(255, 253, 249, 0.9);
}

.table-scroll::-webkit-scrollbar-track,
.scroll-region::-webkit-scrollbar-track {
  background: rgba(243, 225, 207, 0.4);
  border-radius: 999px;
}

.table-scroll {
  max-height: 430px;
  overflow: auto;
  border: 1px solid #efe5d8;
  border-radius: 20px;
  background: rgba(255, 253, 249, 0.72);
}

.table-scroll-tall {
  max-height: 560px;
}

.member-table-scroll {
  max-height: 680px;
}

.notice-table-scroll {
  max-height: 720px;
}

.scroll-region {
  max-height: 430px;
  overflow: auto;
  padding-right: 6px;
}

.trace-results-scroll {
  max-height: 360px;
}

.preview-scroll {
  max-height: 620px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 10px;
  border-bottom: 1px solid #efe5d8;
  vertical-align: top;
}

th {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-scroll th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fffaf4;
  box-shadow: inset 0 -1px 0 #efe5d8;
}

tbody tr:hover {
  background: rgba(243, 225, 207, 0.42);
}

.table-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-soft);
  line-height: 1.7;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #ece7df;
  color: var(--heading);
}

.status-pill.active,
.status-pill.available,
.status-pill.reading,
.status-pill.finished {
  background: var(--success-bg);
  color: var(--success-text);
}

.status-pill.unused {
  background: rgba(181, 106, 43, 0.12);
  color: var(--accent-strong);
}

.status-pill.used {
  background: rgba(46, 94, 177, 0.12);
  color: #1f4c9a;
}

.status-pill.expired,
.status-pill.disabled {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.member-list-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.member-count-badge {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(181, 106, 43, 0.16);
  background: rgba(243, 225, 207, 0.52);
  color: var(--heading);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

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

.member-notice-card,
.member-notice-empty {
  border: 1px solid rgba(220, 207, 189, 0.92);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
  padding: 16px 18px;
}

.member-notice-card {
  display: grid;
  gap: 12px;
  box-shadow: 0 12px 26px rgba(91, 65, 31, 0.04);
}

.member-notice-card.reading {
  border-color: rgba(39, 103, 73, 0.22);
  background: rgba(231, 244, 234, 0.76);
}

.member-notice-card.finished {
  border-color: rgba(39, 103, 73, 0.18);
}

.member-notice-card.expired {
  border-color: rgba(184, 91, 72, 0.22);
  background: rgba(250, 231, 228, 0.72);
}

.member-notice-meta {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.member-notice-title {
  color: var(--heading);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.5;
}

.member-notice-kicker {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.member-notice-submeta {
  display: flex;
  gap: 10px 14px;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 13px;
}

.member-notice-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.member-notice-empty {
  color: var(--text-soft);
  text-align: center;
  line-height: 1.8;
}

.mini-btn {
  min-width: 82px;
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 999px;
}

.member-layout {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(340px, 0.92fr) minmax(520px, 1.08fr);
  align-items: start;
}

.member-shell {
  max-width: 1100px;
}

.member-header {
  margin-bottom: 22px;
  display: grid;
  gap: 14px;
}

.member-header-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.member-header-copy {
  display: grid;
  gap: 8px;
}

.member-header-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.member-header h1 {
  margin: 0;
  color: var(--heading);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.08;
}

.member-header-note {
  margin: 0;
  max-width: 720px;
  color: var(--text-soft);
  line-height: 1.75;
  font-size: 14px;
}

.member-logout-btn {
  min-width: 112px;
  flex-shrink: 0;
}

.member-identity-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.member-identity-item {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 15px 16px;
  border-radius: 20px;
  border: 1px solid rgba(201, 181, 157, 0.72);
  background: rgba(255, 253, 249, 0.78);
  box-shadow: 0 10px 24px rgba(91, 65, 31, 0.05);
}

.member-identity-label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.member-identity-value {
  color: var(--heading);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.member-panel {
  border-color: rgba(201, 181, 157, 0.68);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(248, 242, 233, 0.96));
  box-shadow: 0 18px 42px rgba(91, 65, 31, 0.08);
}

.viewer-card {
  min-height: 600px;
  display: grid;
  align-content: start;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.viewer-card-mobile-top {
  scroll-margin-top: 12px;
}

.viewer-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(181, 106, 43, 0.8), rgba(23, 32, 51, 0.26));
}

.viewer-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.viewer-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.viewer-current-title {
  margin-top: 6px;
  color: var(--heading);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  line-height: 1.2;
}

.viewer-summary {
  max-width: 280px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
  text-align: right;
}

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

.viewer-meta-item {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 13px 14px;
  border-radius: 18px;
  border: 1px solid rgba(220, 207, 189, 0.86);
  background: rgba(255, 255, 255, 0.58);
}

.viewer-meta-label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.viewer-meta-value {
  color: var(--heading);
  font-weight: 800;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.viewer-stage-shell {
  padding: 10px;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(23, 32, 51, 0.06), rgba(23, 32, 51, 0.02));
  border: 1px solid rgba(23, 32, 51, 0.06);
}

.viewer-stage {
  min-height: 400px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: radial-gradient(circle at top, #24314d 0%, #151d30 68%, #101624 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.viewer-stage img {
  width: min(100%, 980px);
  filter: drop-shadow(0 24px 36px rgba(7, 12, 25, 0.34));
  display: block;
  pointer-events: none;
}

.viewer-placeholder {
  padding: 24px;
  display: grid;
  gap: 8px;
  text-align: center;
  color: rgba(226, 232, 240, 0.82);
  line-height: 1.8;
}

.viewer-placeholder strong {
  font-size: 18px;
  color: #f8fafc;
}

.viewer-placeholder span {
  font-size: 14px;
}

.viewer-status {
  margin-top: 0;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(220, 207, 189, 0.78);
  background: rgba(255, 255, 255, 0.56);
  color: var(--text-soft);
}

.member-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  padding: 0;
  background: rgba(10, 16, 30, 0.74);
  backdrop-filter: blur(10px);
}

.member-viewer-dialog {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: max(18px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)) 16px;
  background:
    linear-gradient(180deg, rgba(10, 16, 30, 0.98), rgba(19, 35, 66, 0.98)),
    #0b1220;
}

.member-viewer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.member-viewer-title-wrap {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.member-viewer-title {
  color: #f8fafc;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.4;
}

.member-viewer-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: rgba(226, 232, 240, 0.78);
  font-size: 13px;
}

.member-viewer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.member-viewer-close {
  border-color: rgba(226, 232, 240, 0.22);
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.06);
}

.member-viewer-close:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.member-viewer-stage {
  min-height: 0;
  border-radius: 28px;
  border: 1px solid rgba(226, 232, 240, 0.14);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.member-viewer-stage img {
  width: min(100%, 980px);
  max-height: 100%;
  display: block;
  pointer-events: none;
}

.member-viewer-stage .viewer-placeholder {
  color: rgba(226, 232, 240, 0.78);
}

.member-viewer-status {
  margin-top: 0;
  color: rgba(226, 232, 240, 0.82);
  text-align: center;
}

.trace-results {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.preview-placeholder,
.preview-shell {
  display: grid;
  gap: 14px;
}

.preview-placeholder {
  min-height: 220px;
  place-items: center;
  text-align: center;
  color: var(--text-soft);
  border-radius: 20px;
  border: 1px dashed var(--line-strong);
  background: var(--surface-muted);
  padding: 24px;
}

.preview-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.preview-notice-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--heading);
}

.preview-image-grid {
  display: grid;
  gap: 14px;
}

.preview-image-card {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f5ede1;
}

.preview-image-card img {
  width: 100%;
  display: block;
  pointer-events: none;
}

.variant-preview-section {
  display: grid;
  gap: 14px;
}

.variant-preview-grid {
  display: grid;
  gap: 14px;
}

.variant-preview-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 250, 244, 0.88);
  padding: 16px 18px;
  display: grid;
  gap: 12px;
}

.variant-preview-head {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.variant-preview-content {
  white-space: pre-wrap;
  line-height: 1.8;
  color: var(--heading);
}

.variant-preview-assignment {
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 14px;
}

.variant-preview-assignment strong {
  color: var(--heading);
}

.trace-summary {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(181, 106, 43, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 250, 244, 0.98), rgba(248, 242, 232, 0.96));
  padding: 18px 20px;
  box-shadow: 0 16px 34px rgba(91, 65, 31, 0.08);
}

.trace-summary.fallback {
  border-color: rgba(46, 94, 177, 0.2);
  background: linear-gradient(180deg, rgba(246, 249, 255, 0.98), rgba(239, 245, 255, 0.96));
}

.trace-summary-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trace-summary.fallback .trace-summary-kicker {
  color: #1f4c9a;
}

.trace-summary-title {
  color: var(--heading);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.trace-summary-range-panel {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(181, 106, 43, 0.2);
  background: rgba(255, 255, 255, 0.72);
}

.trace-summary.fallback .trace-summary-range-panel {
  border-color: rgba(46, 94, 177, 0.22);
  background: rgba(255, 255, 255, 0.8);
}

.trace-summary-range-label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trace-summary-range-value {
  color: var(--heading);
  font-size: clamp(28px, 4.4vw, 40px);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1.05;
  word-break: break-word;
}

.trace-summary-range-meta,
.trace-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.trace-summary-range-meta {
  color: var(--heading);
  font-weight: 700;
}

.trace-summary-actions button {
  box-shadow: 0 10px 24px rgba(181, 106, 43, 0.18);
}

.trace-summary-action-tip {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}

.trace-summary-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.trace-empty,
.trace-item {
  border: 1px solid var(--line);
  background: var(--surface-muted);
  border-radius: 20px;
  padding: 15px 16px;
}

.trace-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
}

.trace-rank {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.trace-main {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  line-height: 1.6;
}

.toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 18px);
  left: 50%;
  width: min(460px, calc(100vw - 28px));
  padding: 15px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(16, 23, 37, 0.96);
  color: #f8fafc;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.28);
  transform: translate(-50%, -12px);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 2400;
  text-align: center;
  line-height: 1.6;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

.dialog-open {
  overflow: hidden;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(38, 28, 16, 0.36);
  backdrop-filter: blur(4px);
}

.confirm-dialog {
  width: min(100%, 460px);
  border-radius: 26px;
  border: 1px solid rgba(201, 181, 157, 0.9);
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(248, 242, 232, 0.98));
  box-shadow: 0 28px 60px rgba(63, 43, 17, 0.18);
  padding: 26px 24px 22px;
}

.input-dialog {
  width: min(100%, 520px);
}

.publish-overlay {
  z-index: 1250;
}

.publish-dialog {
  width: min(100%, 520px);
}

.publish-dialog-error {
  border-color: rgba(184, 91, 72, 0.34);
}

.publish-inline-warning {
  margin: 14px 0 6px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(184, 91, 72, 0.24);
  background: rgba(250, 231, 228, 0.92);
  color: #7a3125;
  line-height: 1.7;
  font-size: 14px;
}

.publish-inline-warning code {
  font-family: Consolas, "SFMono-Regular", Menlo, monospace;
  font-size: 13px;
}

.publish-progress-shell {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

.publish-progress-track {
  position: relative;
  overflow: hidden;
  height: 14px;
  border-radius: 999px;
  background: rgba(181, 106, 43, 0.14);
  border: 1px solid rgba(181, 106, 43, 0.18);
}

.publish-progress-bar {
  position: relative;
  height: 100%;
  min-width: 18px;
  border-radius: 999px;
  background: linear-gradient(90deg, #b56a2b, #d08a4b);
  box-shadow: 0 8px 18px rgba(181, 106, 43, 0.22);
  transition: width 0.24s ease;
}

.publish-progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.45) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: publish-shimmer 1.4s linear infinite;
}

.publish-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-soft);
  font-size: 14px;
}

.publish-progress-text {
  color: var(--heading);
  font-weight: 700;
}

.publish-progress-value {
  font-variant-numeric: tabular-nums;
}

.publish-error-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
}

.confirm-eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.confirm-title {
  margin-top: 10px;
  color: var(--heading);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
}

.confirm-message {
  margin-top: 14px;
  display: grid;
  gap: 8px;
  color: var(--text-soft);
  line-height: 1.7;
}

.confirm-message span {
  display: block;
}

.input-dialog-description {
  margin-bottom: 18px;
}

.input-dialog-form {
  display: grid;
  gap: 18px;
}

.input-dialog-fields {
  display: grid;
  gap: 14px;
}

.input-dialog-field {
  display: grid;
  gap: 6px;
}

.input-dialog-field label {
  margin: 0;
}

.input-dialog-hint {
  margin-top: 0;
}

.confirm-actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.confirm-secondary {
  min-width: 92px;
}

.confirm-primary {
  min-width: 112px;
}

.confirm-primary.danger {
  background: #b85b48;
  border-color: #b85b48;
}

.confirm-primary.danger:hover {
  background: #9f4736;
  border-color: #9f4736;
}

@keyframes publish-shimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(160%);
  }
}

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

  .tier-check-grid,
  .target-range-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

@media (max-width: 980px) {
  .guest-note-strip,
  .login-grid,
  .admin-grid,
  .admin-nav,
  .admin-summary-grid,
  .admin-workspace,
  .inline-grid {
    grid-template-columns: 1fr;
  }

  .tier-check-grid,
  .target-range-grid,
  .target-range-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .target-range-helper-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar,
  .admin-card-head,
  .member-list-head,
  .member-notice-meta,
  .member-viewer-head {
    flex-direction: column;
  }

  .member-header-main,
  .viewer-card-head {
    flex-direction: column;
  }

  .shell {
    width: min(100vw - 20px, 1360px);
  }

  .guest-shell {
    width: min(100vw - 20px, 760px);
    padding-top: 26px;
  }

  .hero-card {
    padding: 28px 24px;
  }

  .confirm-dialog {
    padding: 22px 18px 18px;
    border-radius: 22px;
  }

  .confirm-title {
    font-size: 21px;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 16px, 1360px);
    padding: 18px 0 28px;
  }

  .guest-shell {
    width: min(100vw - 16px, 760px);
    gap: 14px;
    padding-top: 18px;
  }

  .card,
  .panel,
  .form-card {
    padding: 18px;
    border-radius: 20px;
  }

  .guest-intro {
    gap: 12px;
    padding: 2px 2px 0;
  }

  .guest-intro h1 {
    font-size: clamp(30px, 10vw, 40px);
  }

  .guest-copy,
  .field-tip,
  .muted,
  .summary-note,
  .admin-check-item span,
  .guest-note span,
  .viewer-status,
  .publish-progress-meta {
    font-size: 13px;
  }

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

  .tier-check-grid,
  .target-range-grid,
  .target-range-actions {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    width: 100%;
    gap: 8px;
  }

  .site-easter-egg {
    right: 12px;
    bottom: 12px;
    width: 74px;
    height: 74px;
  }

  .member-viewer-dialog {
    gap: 12px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .member-viewer-title {
    font-size: 20px;
  }

  .member-viewer-close {
    width: 100%;
    justify-content: center;
  }

  .topbar-actions .badge,
  .topbar-actions button {
    width: 100%;
    justify-content: center;
  }

  .badge {
    min-height: 38px;
    padding: 0 13px;
  }

  th,
  td {
    padding: 12px 8px;
  }

  .row-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .mini-btn {
    width: 100%;
  }

  .member-layout {
    gap: 16px;
  }

  .member-header {
    margin-bottom: 16px;
    gap: 12px;
  }

  .member-header h1 {
    font-size: clamp(28px, 9vw, 38px);
  }

  .member-header-note {
    font-size: 13px;
    line-height: 1.65;
  }

  .member-logout-btn {
    width: 100%;
    justify-content: center;
  }

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

  .member-identity-item {
    padding: 12px 13px;
    border-radius: 18px;
  }

  .member-identity-value {
    font-size: 16px;
  }

  .member-panel,
  .viewer-card {
    padding: 16px;
    border-radius: 22px;
  }

  .member-list-head {
    margin-bottom: 12px;
  }

  .member-count-badge {
    align-self: flex-start;
  }

  .member-notice-card,
  .member-notice-empty {
    padding: 14px;
    border-radius: 18px;
  }

  .member-notice-title {
    font-size: 16px;
  }

  .viewer-card {
    min-height: auto;
  }

  .viewer-current-title {
    font-size: 24px;
  }

  .viewer-summary {
    max-width: none;
    text-align: left;
  }

  .viewer-meta-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .viewer-stage-shell {
    padding: 8px;
    border-radius: 20px;
  }

  .viewer-stage {
    min-height: 240px;
    border-radius: 18px;
  }

  .viewer-placeholder {
    padding: 18px;
  }

  .guest-admin-actions,
  .member-notice-actions,
  .confirm-actions,
  .publish-error-actions {
    flex-direction: column-reverse;
  }

  .trace-summary {
    padding: 16px;
    border-radius: 18px;
  }

  .trace-summary-title {
    font-size: 21px;
  }

  .trace-summary-range-panel {
    padding: 15px 16px;
    border-radius: 16px;
  }

  .trace-summary-range-value {
    font-size: 26px;
  }

  .trace-summary-range-meta,
  .trace-summary-actions,
  .trace-summary-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .trace-summary-actions button {
    width: 100%;
  }

  .member-notice-actions {
    align-items: stretch;
  }

  .guest-admin-actions button,
  .member-notice-actions button,
  .confirm-actions button,
  .publish-error-actions button {
    width: 100%;
  }

  .toast {
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    width: calc(100vw - 24px);
    padding: 14px 16px;
  }
}
