:root {
  --bg: #f5ede2;
  --paper: #fbf7f1;
  --paper-strong: #fffdf9;
  --ink: #1f1a17;
  --muted: #6c6157;
  --line: rgba(31, 26, 23, 0.12);
  --accent: #c4572d;
  --accent-strong: #8d2f14;
  --forest: #1f5c4c;
  --gold: #d5a541;
  --error: #b42318;
  --shadow: 0 24px 60px rgba(63, 35, 18, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --overview-stat-size: 36px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: 'Manrope', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(212, 165, 65, 0.16), transparent 22%),
    radial-gradient(circle at right 20%, rgba(196, 87, 45, 0.18), transparent 20%),
    linear-gradient(180deg, #efe3d2 0%, #f6efe6 45%, #f8f3eb 100%);
}

html {
  scrollbar-width: thin;
  scrollbar-color: rgba(196, 87, 45, 0.42) rgba(255, 255, 255, 0.4);
}

body::-webkit-scrollbar,
.sidebar::-webkit-scrollbar,
.content::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
.modal__panel::-webkit-scrollbar,
textarea::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

body::-webkit-scrollbar-track,
.sidebar::-webkit-scrollbar-track,
.content::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
.modal__panel::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.44);
  border-radius: 999px;
}

body::-webkit-scrollbar-thumb,
.sidebar::-webkit-scrollbar-thumb,
.content::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
.modal__panel::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(213, 165, 65, 0.78), rgba(196, 87, 45, 0.58));
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.72);
}

body::-webkit-scrollbar-thumb:hover,
.sidebar::-webkit-scrollbar-thumb:hover,
.content::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
.modal__panel::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(213, 165, 65, 0.96), rgba(196, 87, 45, 0.8));
}

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

.hidden {
  display: none !important;
}

[hidden] {
  display: none !important;
}

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

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

.login-panel {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  padding: 36px;
  min-height: 100vh;
}

.login-panel__hero,
.login-card,
.sidebar,
.content,
.modal__panel {
  background: rgba(255, 253, 249, 0.78);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
}

.login-panel__hero {
  padding: 48px;
  border-radius: var(--radius-xl);
  position: relative;
  overflow: hidden;
}

.login-panel__hero::after {
  content: '';
  position: absolute;
  inset: auto -40px -70px auto;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(31, 92, 76, 0.22), transparent 70%);
  transform: rotate(8deg);
}

.login-panel__hero h1 {
  margin: 0;
  max-width: 620px;
  line-height: 1.05;
  font-size: clamp(42px, 6vw, 78px);
  font-family: 'Noto Serif SC', serif;
}

.hero-copy {
  max-width: 560px;
  margin: 26px 0 32px;
  color: var(--muted);
  line-height: 1.8;
  font-size: 17px;
}

.hero-tags,
.placeholder-tags,
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-tags span,
.admin-profile__roles,
.status-chip,
.pill,
.placeholder-tags span,
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(31, 26, 23, 0.08);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.filter-pill {
  cursor: pointer;
  transition: 0.2s ease;
}

.filter-pill.active {
  background: rgba(196, 87, 45, 0.14);
  color: var(--accent-strong);
  border-color: rgba(196, 87, 45, 0.2);
}

.login-card {
  align-self: center;
  padding: 34px;
  border-radius: var(--radius-xl);
}

.login-card__header h2 {
  margin: 0 0 8px;
  font-size: 34px;
  font-family: 'Noto Serif SC', serif;
}

.login-card__header p:last-child {
  color: var(--muted);
  line-height: 1.7;
}

.login-form {
  margin-top: 26px;
}

.field {
  display: block;
  margin-bottom: 18px;
}

.field span {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.field input,
.toolbar-input,
.modal__field input,
.modal__field select,
.modal__field textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  border-radius: 14px;
  padding: 14px 16px;
  outline: none;
  transition: 0.2s ease;
}

.toolbar-input:is(select),
.modal__field select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 58px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18' fill='none'%3E%3Cpath d='M4.5 6.75L9 11.25L13.5 6.75' stroke='%231F1A17' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 18px 18px;
}

.toolbar-input--multiselect {
  min-height: 132px;
  padding: 10px 12px;
}

.custom-select {
  position: relative;
}

.custom-select__native {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  width: 0;
  height: 0;
}

.custom-select__trigger {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(250, 243, 234, 0.92));
  border-radius: 18px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.custom-select__trigger.is-active {
  border-color: rgba(196, 87, 45, 0.28);
  background: linear-gradient(135deg, rgba(255, 245, 235, 0.98), rgba(250, 234, 215, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.7),
    0 8px 18px rgba(196, 87, 45, 0.08);
}

.custom-select__trigger.is-active .custom-select__label {
  color: var(--accent-strong);
}

.custom-select__trigger.is-active .custom-select__chevron {
  border-color: var(--accent-strong);
}

.custom-select__label {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-select__chevron {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.18s ease;
  margin-right: 4px;
}

.custom-select.is-open .custom-select__chevron {
  transform: rotate(225deg) translateY(-1px);
}

.custom-select__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.98);
  border: 1px solid rgba(31, 26, 23, 0.08);
  box-shadow: 0 24px 48px rgba(63, 35, 18, 0.16);
  backdrop-filter: blur(18px);
  display: grid;
  gap: 4px;
  transform-origin: top center;
  animation: customSelectPanelIn 0.18s ease;
}

.custom-select__option {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--ink);
  background: transparent;
  border: none;
  font-size: 15px;
  font-weight: 700;
}

.custom-select__option:hover,
.custom-select__option:focus-visible {
  outline: none;
  background: rgba(213, 165, 65, 0.12);
  color: var(--accent-strong);
}

.custom-select__option.is-selected {
  background: linear-gradient(135deg, rgba(196, 87, 45, 0.16), rgba(213, 165, 65, 0.14));
  color: var(--accent-strong);
}

@keyframes customSelectPanelIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.field input:focus,
.toolbar-input:focus,
.modal__field input:focus,
.modal__field select:focus,
.modal__field textarea:focus {
  border-color: rgba(196, 87, 45, 0.55);
  box-shadow: 0 0 0 4px rgba(196, 87, 45, 0.12);
}

.field input.has-error,
.toolbar-input.has-error {
  border-color: rgba(180, 35, 24, 0.65);
  box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.15);
  background: rgba(180, 35, 24, 0.03);
}

.primary-btn,
.ghost-btn,
.nav-item,
.nav-group__summary,
.action-link {
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.table-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.table-sort-btn::after {
  content: '↕';
  font-size: 12px;
  color: var(--muted);
}

.table-sort-btn.is-active::after {
  content: '↓';
  color: var(--accent-strong);
}

.table-sort-btn.is-active.is-asc::after {
  content: '↑';
}

.primary-btn:hover,
.ghost-btn:hover,
.nav-item:hover,
.nav-group__summary:hover,
.action-link:hover {
  transform: translateY(-1px);
}

.primary-btn {
  width: 100%;
  padding: 16px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: white;
  font-weight: 800;
  box-shadow: 0 18px 34px rgba(141, 47, 20, 0.28);
}

.primary-btn--inline {
  width: auto;
  min-width: 128px;
}

.primary-btn[disabled] {
  opacity: 0.75;
  cursor: wait;
}

.ghost-btn {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  font-weight: 700;
}

.ghost-btn--danger {
  color: var(--accent-strong);
  flex: 0 0 auto;
}

.action-link {
  background: transparent;
  color: var(--accent-strong);
  padding: 0;
  font-weight: 800;
}

.action-link--danger {
  color: var(--error);
}

.table-row--muted {
  opacity: 0.48;
}

.table-row--muted td {
  background: rgba(31, 26, 23, 0.035);
}

.table-row--redeem-unused td {
  background: linear-gradient(180deg, rgba(243, 251, 247, 0.52), rgba(255, 255, 255, 0.92));
}

.checkbox-cell {
  width: 56px;
  text-align: center;
}

.table-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid rgba(141, 47, 20, 0.28);
  background: rgba(255, 253, 249, 0.98);
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.table-checkbox::before {
  content: '';
  width: 10px;
  height: 10px;
  transform: scale(0);
  transition: transform 0.15s ease;
  background: var(--accent-strong);
  clip-path: polygon(14% 44%, 0 59%, 42% 100%, 100% 20%, 84% 6%, 39% 66%);
}

.table-checkbox:checked {
  border-color: rgba(141, 47, 20, 0.68);
  background: rgba(255, 244, 237, 0.98);
}

.table-checkbox:checked::before {
  transform: scale(1);
}

.table-checkbox:disabled {
  opacity: 0.42;
  cursor: default;
}

.code-text {
  font-family: 'Manrope', monospace;
  letter-spacing: 0.08em;
}

.code-text--unused {
  color: #176a55;
}

.hint,
.error-text {
  margin: 14px 0 0;
  font-size: 13px;
}

.hint {
  color: var(--muted);
}

.error-text {
  color: var(--error);
  min-height: 20px;
}

.dashboard {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  min-height: 100vh;
  padding: 24px;
}

.sidebar {
  border-radius: var(--radius-xl);
  padding: 22px;
  position: sticky;
  top: 24px;
  height: calc(100vh - 48px);
  overflow: hidden;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
}

.brand h2 {
  margin: 0;
  font-size: 30px;
  font-family: 'Noto Serif SC', serif;
}

.sidebar__brand {
  flex: 0 0 auto;
}

.sidebar__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  margin-top: 24px;
  padding-right: 6px;
}

.nav {
  margin-top: 0;
}

.nav-groups {
  display: grid;
  gap: 14px;
}

.nav-group {
  border-radius: 18px;
  border: 1px solid rgba(31, 26, 23, 0.08);
  background: rgba(255, 255, 255, 0.54);
  overflow: hidden;
}

.nav-group__summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-weight: 800;
}

.nav-group__summary::-webkit-details-marker {
  display: none;
}

.nav-group__arrow {
  transition: transform 0.2s ease;
}

.nav-group[open] .nav-group__arrow {
  transform: rotate(0deg);
}

.nav-group:not([open]) .nav-group__arrow {
  transform: rotate(-90deg);
}

.nav-group__items {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.nav-item {
  text-align: left;
  padding: 13px 14px;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(196, 87, 45, 0.14), rgba(213, 165, 65, 0.22));
  color: var(--accent-strong);
}

.sidebar-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 18px;
  border-top: 1px solid rgba(31, 26, 23, 0.08);
  background: linear-gradient(180deg, rgba(251, 247, 241, 0), rgba(251, 247, 241, 0.92) 20%, rgba(251, 247, 241, 0.98));
}

.sidebar-account {
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.sidebar-account__roles {
  display: inline-flex;
  align-items: center;
  max-width: 168px;
  min-width: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(31, 26, 23, 0.08);
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content {
  border-radius: var(--radius-xl);
  padding: 26px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.content-header h1 {
  margin: 0;
  font-size: clamp(42px, 3.8vw, 58px);
  line-height: 1.02;
  font-family: 'Noto Serif SC', serif;
}

.page-description {
  margin: 10px 0 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

.content-status {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.section-actions--overview-range {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-actions--overview-range-compact {
  justify-content: flex-end;
}

.overview-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.94);
  border: 1px solid rgba(31, 26, 23, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.68);
}

.overview-mode-chip {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.overview-mode-chip:hover {
  transform: translateY(-1px);
}

.overview-mode-chip.active {
  background: linear-gradient(135deg, rgba(255,241,214,0.96), rgba(247,230,190,0.96));
  color: var(--accent);
  box-shadow: 0 10px 18px rgba(212, 165, 65, 0.14);
}

.section-actions--overview-range .toolbar-input {
  min-width: 168px;
}

.status-chip {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(31, 92, 76, 0.08);
  border: 1px solid rgba(31, 92, 76, 0.12);
  color: rgba(31, 92, 76, 0.9);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.status-chip:hover {
  transform: translateY(-1px);
  background: rgba(31, 92, 76, 0.12);
  border-color: rgba(31, 92, 76, 0.18);
}

.page-error {
  margin-top: 0;
  min-height: 18px;
  max-width: 260px;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.84;
}

.metrics-grid,
.cards-grid,
.placeholder-grid {
  display: grid;
  gap: 16px;
}

.metrics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 18px;
}

.metrics-grid--compact {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

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

.recommend-preview-card {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(249,240,228,0.96));
  border: 1px solid rgba(31, 26, 23, 0.08);
}

.recommend-preview-card__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
}

.recommend-preview-card__meta {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.6;
}

.recommend-preview-list {
  display: grid;
  gap: 10px;
}

.recommend-preview-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.8);
}

.recommend-preview-item img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  flex: 0 0 auto;
}

.recommend-preview-item__copy {
  min-width: 0;
}

.recommend-preview-item__copy strong,
.recommend-preview-item__copy small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recommend-preview-item__copy small {
  margin-top: 4px;
  color: var(--muted);
}

.recommend-preview-item__reason {
  color: var(--accent-strong);
  opacity: 0.92;
}

.metric-card,
.placeholder-card {
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(249,240,228,0.96));
  border: 1px solid rgba(31, 26, 23, 0.08);
}

.metric-card__label {
  color: var(--muted);
  font-size: 13px;
}

.metric-card__value {
  margin-top: 12px;
  font-size: var(--overview-stat-size);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

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

.overview-analytics-grid--secondary {
  margin-top: 20px;
}

.overview-panel {
  padding: 20px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.88), rgba(249,240,228,0.96));
  border: 1px solid rgba(31, 26, 23, 0.08);
}

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

.overview-panel--trend {
  grid-column: 1 / -1;
}

.section-head--trend-toolbar {
  margin-top: 0;
  margin-bottom: 18px;
  align-items: flex-start;
}

.section-head--trend-toolbar .section-actions {
  margin-left: auto;
}

.section-head--trend-toolbar .toolbar-input {
  min-width: 148px;
}

.overview-today-card {
  padding: 16px 18px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,246,233,0.96));
  border: 1px solid rgba(31, 26, 23, 0.06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.overview-today-card__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overview-today-card__value {
  margin-top: 10px;
  font-size: var(--overview-stat-size);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
}

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

.overview-behavior-card {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.88);
  border: 1px solid rgba(31, 26, 23, 0.06);
}

.overview-behavior-card__eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.overview-behavior-card__value {
  margin-top: 8px;
  font-size: var(--overview-stat-size);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.overview-behavior-card__meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-behavior-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(212, 165, 65, 0.12);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overview-trend-chart {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.overview-trend-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.overview-trend-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.88);
  border: 1px solid rgba(31, 26, 23, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.overview-trend-summary-chip:hover {
  transform: translateY(-1px);
}

.overview-trend-summary-chip.is-muted {
  opacity: 0.46;
  background: rgba(249, 244, 236, 0.72);
}

.overview-trend-summary-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.overview-trend-canvas {
  position: relative;
  padding: 16px 16px 14px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,248,238,0.92)),
    repeating-linear-gradient(
      to top,
      transparent 0,
      transparent 48px,
      rgba(31, 26, 23, 0.05) 48px,
      rgba(31, 26, 23, 0.05) 49px
    );
  border: 1px solid rgba(31, 26, 23, 0.06);
}

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

.overview-trend-axis {
  stroke: rgba(31, 26, 23, 0.14);
  stroke-width: 1;
}

.overview-trend-grid-line {
  stroke: rgba(31, 26, 23, 0.08);
  stroke-width: 1;
  stroke-dasharray: 4 6;
}

.overview-trend-line {
  fill: none;
  stroke-width: 4.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 5px 10px rgba(31, 26, 23, 0.08));
}

.overview-trend-area {
  opacity: 0.12;
}

.overview-trend-point {
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 2;
}

.overview-trend-label {
  fill: rgba(108, 97, 87, 0.94);
  font-size: 11px;
  font-weight: 700;
}

.overview-trend-xlabel {
  fill: rgba(108, 97, 87, 0.78);
  font-size: 11px;
  font-weight: 700;
}

.overview-trend-hotspots {
  position: absolute;
  inset: 16px 16px 14px;
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  pointer-events: none;
}

.overview-trend-hotspot {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: crosshair;
  pointer-events: auto;
}

.overview-trend-hotspot:focus-visible {
  outline: 2px solid rgba(196, 87, 45, 0.42);
  outline-offset: -2px;
  border-radius: 12px;
}

.overview-trend-hotspot.is-active {
  background: linear-gradient(180deg, rgba(212, 165, 65, 0.08), rgba(212, 165, 65, 0.02));
}

.overview-trend-hoverline {
  position: absolute;
  top: 18px;
  bottom: 16px;
  width: 1px;
  background: linear-gradient(180deg, rgba(145, 95, 45, 0.08), rgba(145, 95, 45, 0.36), rgba(145, 95, 45, 0.08));
  pointer-events: none;
  transform: translateX(-0.5px);
}

.overview-trend-tooltip {
  position: absolute;
  z-index: 3;
  width: 188px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(31, 26, 23, 0.92);
  color: rgba(255, 249, 242, 0.96);
  box-shadow: 0 18px 40px rgba(31, 26, 23, 0.18);
  pointer-events: none;
}

.overview-trend-tooltip__date {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 236, 202, 0.88);
}

.overview-trend-tooltip__rows {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overview-trend-tooltip__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.overview-trend-tooltip__key {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 249, 242, 0.88);
}

.overview-trend-tooltip__dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  flex-shrink: 0;
}

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

.overview-trend-peak {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.88);
  border: 1px solid rgba(31, 26, 23, 0.06);
}

.overview-trend-peak__label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overview-trend-peak__value {
  margin-top: 8px;
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
}

.overview-trend-peak__meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overview-bars,
.overview-funnel,
.overview-retention {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.overview-trend-item,
.overview-retention-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.84);
}

.overview-trend-date,
.overview-retention-title {
  font-weight: 800;
}

.overview-trend-values {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.overview-bar-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overview-module-detail-block {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.78);
  border: 1px solid rgba(31, 26, 23, 0.05);
}

.overview-module-detail-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.overview-module-detail-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-module-detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(212, 165, 65, 0.1);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.overview-module-detail-chip strong {
  color: var(--text);
  font-weight: 800;
}

.overview-bar-head,
.overview-funnel-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.overview-bar-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(212, 165, 65, 0.12);
  overflow: hidden;
}

.overview-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(196, 87, 45, 0.84), rgba(213, 165, 65, 0.86));
}

.overview-funnel-label {
  width: 88px;
  flex-shrink: 0;
  color: var(--muted);
  font-weight: 700;
}

.overview-funnel-shape {
  min-width: 120px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(196, 87, 45, 0.14), rgba(213, 165, 65, 0.18));
  color: var(--accent-strong);
  text-align: center;
}

.overview-retention-item span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.section-head {
  margin-bottom: 10px;
}

.section-head--sub {
  margin-top: 24px;
 }

.section-head--actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.section-head--hero-action {
  margin-top: -34px;
  margin-bottom: 28px;
  justify-content: flex-end;
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.section-head h3,
.placeholder-card h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.section-head:has(> div:empty) {
  margin-bottom: 14px;
}

.section-head p,
.placeholder-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.section-head p {
  display: none;
}

.quick-filters {
  margin-bottom: 16px;
}

.toolbar-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

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

.primary-btn--compact,
.ghost-btn--compact {
  min-height: 48px;
  padding: 0 18px;
  font-size: 16px;
}

.card-item__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.card-item__title {
  font-size: 22px;
  font-weight: 800;
}

.card-item__subtitle {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.7;
}

.card-item__meta {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.card-item__actions {
  margin-top: 16px;
}

.inline-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.inline-pills--compact {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.pill--muted {
  background: rgba(31, 26, 23, 0.06);
  color: var(--muted);
}

.pill--accent {
  background: rgba(196, 87, 45, 0.14);
  color: var(--accent-strong);
}

.pill--ok {
  background: rgba(31, 92, 76, 0.12);
  color: var(--forest);
}

.pill--warn {
  background: rgba(211, 165, 65, 0.18);
  color: #9a5726;
}

.pill--redeem-unused {
  background: linear-gradient(180deg, rgba(225, 246, 236, 0.96), rgba(205, 238, 223, 0.92));
  border: 1px solid rgba(31, 92, 76, 0.18);
  color: #176a55;
}

.pill--redeem-used {
  background: rgba(31, 26, 23, 0.05);
  border: 1px solid rgba(31, 26, 23, 0.08);
  color: rgba(108, 97, 87, 0.88);
}

.cell-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cell-actions--single {
  flex-wrap: nowrap;
}

.icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(31, 26, 23, 0.08);
  font-size: 16px;
}

.table-wrap {
  overflow: auto;
  border-radius: 20px;
  border: 1px solid rgba(31, 26, 23, 0.08);
  background: rgba(255,255,255,0.72);
  -webkit-overflow-scrolling: touch;
  position: relative;
  max-height: min(68vh, 980px);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1180px;
}

th,
td {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(31, 26, 23, 0.08);
  text-align: left;
  vertical-align: top;
}

th:last-child,
td:last-child {
  min-width: 92px;
}

th {
  position: sticky;
  top: 0;
  background: #f8efe3;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 3;
  box-shadow: inset 0 -1px 0 rgba(31, 26, 23, 0.08);
  white-space: nowrap;
}

td strong {
  display: block;
  margin-bottom: 6px;
}

/* 启蒙阅读表格操作列固定在右侧 */
[data-panel='reading'] .table-wrap th:last-child,
[data-panel='reading'] .table-wrap td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: linear-gradient(270deg, rgba(255, 253, 249, 0.99), rgba(251, 247, 241, 0.96));
  box-shadow: -8px 0 14px rgba(63, 35, 18, 0.035);
}

[data-panel='reading'] .table-wrap th:last-child {
  background: #f8efe3;
  z-index: 4;
}

/* 资源表格操作列固定在右侧 */
[data-panel='resources'] .table-wrap th:last-child,
[data-panel='resources'] .table-wrap td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: linear-gradient(270deg, rgba(255, 253, 249, 0.99), rgba(251, 247, 241, 0.96));
  box-shadow: -8px 0 14px rgba(63, 35, 18, 0.035);
}

[data-panel='resources'] .table-wrap th:last-child {
  background: #f8efe3;
  z-index: 4;
}

/* 启蒙乐园/学习卡片表格操作列固定在右侧 */
[data-panel='learning-cards'] .table-wrap th:last-child,
[data-panel='learning-cards'] .table-wrap td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: linear-gradient(270deg, rgba(255, 253, 249, 0.99), rgba(251, 247, 241, 0.96));
  box-shadow: -8px 0 14px rgba(63, 35, 18, 0.035);
}

[data-panel='learning-cards'] .table-wrap th:last-child {
  background: #f8efe3;
  z-index: 4;
}

[data-panel='users'] .table-wrap td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: linear-gradient(270deg, rgba(255, 253, 249, 0.99), rgba(251, 247, 241, 0.96));
  box-shadow: -8px 0 14px rgba(63, 35, 18, 0.035);
}

[data-panel='users'] .table-wrap th:last-child {
  right: 0;
  z-index: 5;
  background: #f8efe3;
  box-shadow: -8px 0 14px rgba(63, 35, 18, 0.035);
}

/* 启蒙阅读场景弹窗：宽屏变体 */
/* 场景弹窗专用变体：用 .modal__panel.modal__panel--reading-scenes 提升 specificity 到 0,2,0
   避免被文件后面的 .modal__panel { display:flex; width:920px; ... } 覆盖。
   关键: 必须给 panel 显式 height 才能让内部 flex:1 1 auto 撑开。 */
.modal__panel.modal__panel--reading-scenes {
  width: min(1100px, calc(100vw - 24px));
  height: calc(100vh - 12px);
  max-height: calc(100vh - 12px);
  margin: 6px auto;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal__panel--reading-scenes > .modal__header {
  flex-shrink: 0;
  padding: 20px 28px 14px;
  border-bottom: 1px solid rgba(31, 26, 23, 0.06);
}

.modal__panel--reading-scenes .modal__form {
  margin-top: 0;
  padding: 12px 28px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.scenes-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* 包裹 scenes-toolbar + scenes-list 的匿名 div:
   必须是 flex column 容器,否则内部 scenes-list 的 flex:1 1 0 不生效,
   列表会塌陷到自然内容高度(被 panel overflow:hidden 切掉)。 */
.scenes-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 10px;
}

.scenes-toolbar__title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text, #2a1f17);
  font-family: 'Noto Serif SC', serif;
  line-height: 1.2;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.scenes-toolbar__meta {
  color: var(--muted, #8c7a64);
  font-size: 12px;
  font-weight: 500;
}

.scenes-toolbar__actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.scenes-list {
  flex: 1 1 0;
  min-height: 0;
  /* 显式 height: 0 + flex-basis: 0 是 flexbox 子项收缩的可靠配方 */
  height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: 18px;
  border: 1px solid rgba(31, 26, 23, 0.08);
  background: rgba(255, 255, 255, 0.78);
  -webkit-overflow-scrolling: touch;
  /* 阻止 wheel 事件冒泡到背景页 */
  overscroll-behavior: contain;
}

.scenes-list table {
  min-width: 0;
  width: 100%;
  border-collapse: collapse;
}

.scenes-list thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f8efe3;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted, #8c7a64);
  box-shadow: inset 0 -1px 0 rgba(31, 26, 23, 0.08);
  white-space: nowrap;
  padding: 8px 18px;
  text-align: left;
}

.scenes-list tbody td {
  padding: 9px 18px;
  border-bottom: 1px solid rgba(31, 26, 23, 0.05);
  vertical-align: middle;
  font-size: 14px;
}

.scenes-list thead th:last-child,
.scenes-list tbody td:last-child {
  padding-right: 22px;
  padding-left: 14px;
}

.scenes-list tbody tr:last-child td {
  border-bottom: 0;
}

.scenes-list tbody tr:hover {
  background: rgba(247, 236, 220, 0.42);
}

.scene-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: rgba(31, 26, 23, 0.04);
  display: block;
  position: relative;
  background-color: #f3ecdb;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  flex-shrink: 0;
}

.scene-thumb__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: rgba(140, 122, 100, 0.7);
  font-weight: 600;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.scene-thumb--loaded .scene-thumb__placeholder {
  opacity: 0;
}

.scene-thumb--error {
  background: #f8eee0;
}
.scene-thumb--error::after {
  content: '加载失败';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #b07050;
}

.scene-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #8c7a64);
  font-size: 11px;
  border: 1px dashed rgba(31, 26, 23, 0.18);
}

.scene-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.scene-cell__title {
  font-weight: 700;
  color: var(--text, #2a1f17);
  font-size: 15px;
  line-height: 1.3;
}

.scene-cell__sub {
  font-size: 12px;
  color: var(--muted, #8c7a64);
}

.scene-cell__story {
  font-size: 12px;
  color: #5c4d3c;
  line-height: 1.5;
  max-width: 360px;
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scene-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.scenes-list thead th:last-child,
.scenes-list tbody td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: linear-gradient(270deg, rgba(255, 253, 249, 0.99), rgba(251, 247, 241, 0.96));
  box-shadow: -4px 0 8px rgba(63, 35, 18, 0.025);
}

.scenes-list thead th:last-child {
  background: #f8efe3;
  z-index: 4;
}

.scenes-list tbody tr:hover td:last-child {
  background: linear-gradient(270deg, rgba(251, 247, 241, 0.99), rgba(247, 236, 220, 0.96));
}

td small {
  color: var(--muted, #999);
  display: block;
  font-size: 11px;
  line-height: 1.4;
  word-break: break-word;
  opacity: 0.8;
}

.cell-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cell-text--nowrap strong,
.cell-text--nowrap small {
  white-space: nowrap;
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inline-pills--compact {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.table-card {
  display: grid;
  grid-template-columns: 26px 82px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 240px;
}

.table-card--user {
  grid-template-columns: 82px minmax(0, 1fr);
  min-width: 0;
}

.table-card--resource {
  grid-template-columns: 26px 82px minmax(0, 1fr);
  min-width: 0;
}

.table-drag-handle {
  width: 26px;
  min-width: 26px;
  height: 54px;
  border: 0;
  border-radius: 12px;
  background: rgba(244, 226, 196, 0.78);
  color: var(--accent-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 1px;
  box-shadow: inset 0 0 0 1px rgba(196, 87, 45, 0.08);
}

.table-drag-handle:active {
  cursor: grabbing;
}

.table-card__cover {
  width: 82px;
  height: 82px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(31, 26, 23, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-card__cover--preview,
.creation-record-preview--clickable {
  cursor: zoom-in;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.table-card__cover--preview:hover,
.creation-record-preview--clickable:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(63, 35, 18, 0.12);
  border-color: rgba(196, 87, 45, 0.18);
}

.table-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.table-card__cover-btn {
  all: unset;
  cursor: zoom-in;
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.table-card__cover-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(63, 35, 18, 0.12);
}

.table-card__cover-empty {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pill--vip {
  background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
  color: #8d2f14;
  font-weight: 600;
}

.pill--points {
  background: #e8f5e9;
  color: #2e7d32;
  font-weight: 600;
.table-card__cover-empty {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cell-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  cursor: pointer;
}

.switch__slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e0e0e0;
  border: none;
  transition: .3s;
  border-radius: 22px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.switch__slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.switch input:checked + .switch__slider {
  background-color: var(--accent, #4caf50);
}

.switch input:checked + .switch__slider:before {
  transform: translateX(24px);
}

.switch--sm {
  width: 36px;
  height: 20px;
}

.switch--sm .switch__slider:before {
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
}

.switch--sm input:checked + .switch__slider:before {
  transform: translateX(16px);
}

.status-text {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 10px;
  background: #f0f0f0;
  color: #666;
}

.badge--vip {
  background: #fff8e1;
  color: #f57f17;
}

.badge--points {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge--info {
  background: #e3f2fd;
  color: #1565c0;
}

.badge--weak {
  opacity: 0.6;
  font-size: 10px !important;
  padding: 1px 6px;
}

.status-text {
  font-size: 12px;
  color: var(--muted);
} line-height: 1.4;
}

.table-card--static {
  grid-template-columns: 96px minmax(0, 1fr);
}

.creation-record-preview {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247, 236, 220, 0.92));
  border: 1px solid rgba(31, 26, 23, 0.08);
  display: grid;
  place-items: center;
}

.creation-record-preview__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.creation-record-preview__empty {
  padding: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.creation-record-preview__single {
  all: unset;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
  display: block;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.creation-record-preview__single:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(63, 35, 18, 0.12);
}

.creation-record-preview__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  width: 100%;
  height: 100%;
  padding: 4px;
}

.creation-record-preview__item {
  all: unset;
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
  background: rgba(255,255,255,0.88);
  border: 1px solid rgba(31, 26, 23, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.creation-record-preview__item:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(63, 35, 18, 0.1);
  border-color: rgba(196, 87, 45, 0.18);
}

.creation-record-preview__item--more {
  overflow: hidden;
}

.creation-record-preview__more-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 13, 10, 0.52);
  color: white;
  font-size: 14px;
  font-weight: 800;
  backdrop-filter: blur(4px);
}

.creation-record-modal {
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247, 236, 220, 0.94));
  border: 1px solid rgba(31, 26, 23, 0.08);
}

.creation-record-modal__image {
  width: 100%;
  max-height: 640px;
  object-fit: contain;
  display: block;
  background: rgba(255, 253, 249, 0.88);
}

.creation-record-modal__image--source {
  max-height: 420px;
}

.creation-record-modal__image-wrapper {
  margin-bottom: 12px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(31, 26, 23, 0.08);
  background: rgba(255,255,255,0.88);
}

.creation-record-modal__image-wrapper:last-child {
  margin-bottom: 0;
}

.creation-record-modal__image-button {
  all: unset;
  width: 100%;
  cursor: zoom-in;
  display: block;
  position: relative;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.creation-record-modal__image-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(63, 35, 18, 0.12);
}

.creation-record-modal__image-label {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(18, 13, 10, 0.56);
  color: white;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.resource-rule-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 136px;
}

.resource-rule-stack .pill {
  width: fit-content;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(18, 13, 10, 0.56);
  backdrop-filter: blur(10px);
}

.image-lightbox.hidden {
  display: none;
}

.image-lightbox__dialog {
  width: min(960px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.98), rgba(247, 236, 220, 0.95));
  box-shadow: 0 28px 80px rgba(20, 12, 9, 0.22);
  position: relative;
}

.image-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(63, 35, 18, 0.12);
}

.image-lightbox__image {
  width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(31, 26, 23, 0.08);
}

.image-lightbox__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.image-lightbox__meta strong {
  font-size: 20px;
  color: var(--text);
}

.image-lightbox__meta small {
  color: var(--muted);
  font-size: 14px;
}

#creationRecordsTableBody .cell-actions {
  align-items: flex-start;
}

#creationRecordsTableBody .creation-record-meta {
  min-width: 0;
}

#creationRecordsTableBody .creation-record-meta strong,
#creationRecordsTableBody .creation-record-meta small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#creationRecordsTableBody .creation-record-meta {
  gap: 4px;
}

#creationRecordsTableBody .creation-record-meta small {
  font-size: 12px;
}

[data-panel='creation-records'] .table-wrap table {
  min-width: 1340px;
}

[data-panel='creation-records'] .table-wrap th:nth-child(1),
[data-panel='creation-records'] .table-wrap td:nth-child(1) {
  width: 56px;
  min-width: 56px;
  position: sticky;
  left: 0;
  z-index: 2;
  background: linear-gradient(90deg, rgba(255, 253, 249, 0.99), rgba(251, 247, 241, 0.96));
  box-shadow: 8px 0 14px rgba(63, 35, 18, 0.035);
}

[data-panel='creation-records'] .table-wrap th:nth-child(2),
[data-panel='creation-records'] .table-wrap td:nth-child(2) {
  min-width: 320px;
}

[data-panel='creation-records'] .table-wrap th:nth-child(3),
[data-panel='creation-records'] .table-wrap td:nth-child(3) {
  min-width: 160px;
}

[data-panel='creation-records'] .table-wrap th:nth-child(4),
[data-panel='creation-records'] .table-wrap td:nth-child(4) {
  min-width: 180px;
}

[data-panel='creation-records'] .table-wrap th:nth-child(5),
[data-panel='creation-records'] .table-wrap td:nth-child(5) {
  min-width: 200px;
}

[data-panel='creation-records'] .table-wrap th:nth-child(6),
[data-panel='creation-records'] .table-wrap td:nth-child(6) {
  min-width: 180px;
}

[data-panel='creation-records'] .table-wrap th:nth-child(7),
[data-panel='creation-records'] .table-wrap td:nth-child(7) {
  min-width: 180px;
}

[data-panel='creation-records'] .table-wrap th:nth-child(8),
[data-panel='creation-records'] .table-wrap td:nth-child(8) {
  min-width: 120px;
}

[data-panel='creation-records'] .table-wrap thead th:nth-child(1) {
  z-index: 4;
  background: #f8efe3;
}

.table-card__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}

.table-card__content strong,
.table-card__content small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-inline: 4px;
}

.pager-text {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.table-wrap th:nth-last-child(2),
.table-wrap td:nth-last-child(2) {
  min-width: 108px;
}

.table-wrap th:nth-child(2),
.table-wrap td:nth-child(2) {
  min-width: 148px;
}

.table-wrap th:nth-child(7),
.table-wrap td:nth-child(7),
.table-wrap th:nth-child(8),
.table-wrap td:nth-child(8) {
  min-width: 124px;
}

.table-wrap th:nth-child(8),
.table-wrap td:nth-child(8) {
  position: sticky;
  right: 0;
  z-index: 2;
  background: linear-gradient(90deg, rgba(251, 247, 241, 0.76), rgba(255, 253, 249, 0.98) 26%);
  box-shadow: -8px 0 14px rgba(63, 35, 18, 0.035);
}

.table-wrap thead th:nth-child(8) {
  z-index: 4;
  background: linear-gradient(90deg, rgba(248, 239, 227, 0.92), #f8efe3 24%);
}

.table-wrap tbody tr[draggable='true'] {
  cursor: grab;
}

.table-wrap tbody tr[draggable='true']:active {
  cursor: grabbing;
}

.table-wrap tbody tr.is-dragging td {
  opacity: 0.56;
}

.table-wrap tbody tr.is-drag-over td {
  background: rgba(244, 226, 196, 0.46);
}

.drag-handle-cell {
  width: 32px;
  min-width: 32px;
  text-align: center;
  cursor: grab;
}

.drag-handle {
  font-size: 18px;
  color: var(--muted);
  user-select: none;
  cursor: grab;
  padding: 4px;
}

.drag-handle:active {
  cursor: grabbing;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  /* 弹窗全屏容器：禁止任何溢出触发背景页滚动 */
  overflow: hidden;
  /* 滚轮触底时不要把背景页一起滚 */
  overscroll-behavior: contain;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 19, 14, 0.42);
}

.modal__panel {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  overflow: auto;
  margin: 18px auto;
  border-radius: 24px;
  padding: 24px;
  /* 阻止 wheel 事件冒泡到背景页 */
  overscroll-behavior: contain;
}

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

.modal__header h3 {
  margin: 0;
  font-size: 30px;
  font-family: 'Noto Serif SC', serif;
}

.modal__close {
  border: none;
  background: transparent;
  font-size: 30px;
  cursor: pointer;
}

.modal__form {
  margin-top: 20px;
  display: grid;
  gap: 14px;
  min-height: 0;
}

.modal__form > .scenes-list,
.modal__form > [data-panel] {
  min-height: 0;
}

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

.modal__field--full {
  grid-column: 1 / -1;
}

.modal__field label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.modal__field textarea {
  min-height: 110px;
  resize: vertical;
}

.modal__field input:disabled,
.modal__field select:disabled,
.modal__field textarea:disabled,
.modal__field .is-disabled {
  background: rgba(239, 232, 220, 0.92);
  color: rgba(90, 76, 61, 0.72);
  cursor: not-allowed;
}

.field-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.modal__summary-block {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 26, 23, 0.08);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 88px;
}

.password-field__toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--accent-strong);
  font-weight: 700;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 10px;
}

.password-field__toggle:hover {
  background: rgba(196, 87, 45, 0.08);
}

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

.settings-tabs__button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(31, 26, 23, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.settings-tabs__button:hover {
  border-color: rgba(196, 87, 45, 0.28);
  transform: translateY(-1px);
}

.settings-tabs__button.is-active {
  border-color: rgba(196, 87, 45, 0.34);
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(249, 240, 227, 0.86));
  box-shadow: 0 12px 24px rgba(141, 47, 20, 0.08);
}

.settings-tabs__label {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-strong);
}

.settings-tabs__description {
  color: var(--muted);
  line-height: 1.55;
}

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

.summary-kpi,
.summary-row {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(248, 239, 227, 0.56);
}

.summary-kpi strong,
.summary-row strong {
  display: block;
  margin-bottom: 6px;
}

.summary-kpi small,
.summary-row small,
.summary-empty {
  color: var(--muted);
  line-height: 1.6;
}

.summary-row--status {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 239, 228, 0.72));
}

.status-note {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.status-note--muted {
  color: #6e5d52;
  background: rgba(110, 93, 82, 0.1);
}

.status-note--success {
  color: #295f4b;
  background: rgba(86, 126, 112, 0.14);
}

.status-note--warning {
  color: #9a5726;
  background: rgba(211, 165, 65, 0.18);
}

.image-field {
  display: grid;
  gap: 12px;
}

.image-field__actions {
  display: grid;
  gap: 10px;
}

.image-field__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.image-upload-btn {
  position: relative;
  overflow: hidden;
}

.image-field__preview-wrap {
  border-radius: 18px;
  border: 1px solid rgba(31, 26, 23, 0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.78), rgba(247,239,229,0.78));
  padding: 12px;
}

.image-field__preview-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  align-items: center;
}

.image-field__preview {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(31, 26, 23, 0.08);
  background: rgba(255,255,255,0.82);
}

.image-field__meta {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.image-field__meta span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.image-field__meta code {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.image-field__empty {
  padding: 18px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,0.68);
  color: var(--muted);
  text-align: center;
}

.image-field__status {
  min-height: 18px;
  margin: 0;
}

.modal__info {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(213, 165, 65, 0.12);
  color: var(--accent-strong);
  line-height: 1.7;
  font-size: 14px;
}

.file-field {
  display: grid;
  gap: 12px;
}

.file-field__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.file-field__list {
  display: grid;
  gap: 10px;
}

.file-item {
  display: grid;
  grid-template-columns: 28px 108px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(31, 26, 23, 0.08);
  background: rgba(255,255,255,0.72);
}

.file-item.is-dragging {
  opacity: 0.68;
}

.file-item.is-drag-over {
  border-color: rgba(196, 87, 45, 0.32);
  box-shadow: 0 10px 22px rgba(196, 87, 45, 0.1);
}

.file-item__drag {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 8px 0 0;
  cursor: grab;
}

.file-item__drag:active {
  cursor: grabbing;
}

.file-item__thumb {
  width: 108px;
  height: 108px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(244, 235, 220, 0.88);
  border: 1px solid rgba(31, 26, 23, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.file-item__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.file-item__meta {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.file-item__actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.file-item__actions--stack {
  align-content: start;
}

.file-item--template-asset {
  grid-template-columns: 28px 108px minmax(0, 1fr) auto;
}

.file-item__meta strong,
.file-item__meta small,
.file-item__meta code {
  overflow-wrap: anywhere;
}

.success-text {
  color: var(--forest);
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 13px;
}

.modal__footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.modal__footer > #modalDeleteBtn {
  margin-right: auto;
}

.modal__error {
  margin-top: 14px;
}

.modal__panel--compact {
  max-width: 720px;
}

code {
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(31, 26, 23, 0.08);
}

@media (max-width: 1280px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .login-panel,
  .dashboard {
    grid-template-columns: 1fr;
  }

  .metrics-grid,
  .metrics-grid--compact,
  .cards-grid,
  .placeholder-grid,
  .overview-analytics-grid,
  .overview-behavior-grid,
  .overview-trend-peaks,
  .toolbar-grid,
  .modal__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }

  .sidebar__scroll {
    overflow: visible;
    padding-right: 0;
  }

  .section-head--trend-toolbar {
    align-items: stretch;
  }

  .section-head--trend-toolbar .section-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .login-panel,
  .dashboard {
    padding: 14px;
  }

  .login-panel__hero,
  .login-card,
  .sidebar,
  .content,
  .modal__panel {
    padding: 20px;
  }

  .metrics-grid,
  .metrics-grid--compact,
  .cards-grid,
  .placeholder-grid,
  .overview-analytics-grid,
  .overview-behavior-grid,
  .overview-trend-peaks,
  .toolbar-grid,
  .modal__grid,
  .settings-tabs {
    grid-template-columns: 1fr;
  }

  .content-header,
  .section-head--actions,
  .modal__footer {
    flex-direction: column;
  }

  .section-actions--overview-range-compact {
    justify-content: flex-start;
  }

  .section-head--trend-toolbar .toolbar-input {
    min-width: 100%;
  }

  .section-head--hero-action {
    margin-top: 0;
    margin-bottom: 16px;
    justify-content: flex-start;
  }

  .content-status {
    text-align: left;
    align-items: flex-start;
  }

  .image-field__preview-card {
    grid-template-columns: 1fr;
  }

  .image-field__preview {
    width: 100%;
    height: 180px;
  }

  .file-item {
    grid-template-columns: 1fr;
  }

  .file-item__actions {
    justify-items: start;
    grid-auto-flow: column;
    justify-content: flex-start;
  }

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

  table {
    min-width: 1080px;
  }

  .inline-pills--compact {
    max-width: 220px;
  }

  .table-pager {
    justify-content: space-between;
    flex-wrap: wrap;
  }

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

  .sidebar-account {
    justify-content: space-between;
  }
}
