:root {
  --bg: #f3f4f6;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --text: #111827;
  --text-soft: #6b7280;
  --text-faint: #9ca3af;
  --primary: #2563eb;
  --primary-soft: #e0ecff;
  --dark: #111827;
  --dark-soft: #1f2937;
  --shadow: 0 10px 24px rgba(17, 24, 39, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 13px;
}

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

a {
  color: inherit;
}

#app {
  height: 100vh;
  overflow: hidden;
}

.fa-shell {
  position: relative;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fa-watermark {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  opacity: 0.1;
  display: block;
  color: #0f172a;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.8px;
  transform: rotate(-18deg);
  transform-origin: center;
  text-align: center;
  padding-top: 38vh;
  white-space: nowrap;
  user-select: none;
}

.fa-watermark.is-hidden {
  display: none;
}

.fa-header,
.fa-body {
  position: relative;
  z-index: 2;
}

.fa-header {
  height: 62px;
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.fa-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fa-logo,
.fa-rail-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1d4ed8, #60a5fa);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.8px;
}

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

.fa-brand-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-soft);
}

.fa-header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fa-top-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.fa-top-chip.active {
  background: var(--primary);
  color: #fff;
}

.fa-top-chip-icon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
}

.fa-header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fa-header-tools .btn {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.fa-search {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel-soft);
  color: var(--text-soft);
}

.fa-search-text {
  min-width: 30px;
  font-size: 12px;
}

.fa-kbd {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  display: inline-grid;
  place-items: center;
  background: #fff;
  font-size: 12px;
}

.fa-tool-dot {
  font-size: 15px;
  color: #374151;
}

.fa-user-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 2px;
  font-weight: 600;
  font-size: 12px;
}

.fa-user-inline-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 700;
}

.fa-body {
  flex: 1;
  display: grid;
  grid-template-columns: 92px 220px minmax(0, 1fr);
  min-height: calc(100vh - 62px);
  height: calc(100vh - 62px);
  overflow: hidden;
}

.fa-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  background: var(--panel);
  border-right: 1px solid var(--line);
}

.fa-rail-item {
  width: 100%;
  border-radius: 12px;
  padding: 8px 6px;
  text-align: center;
  color: #374151;
  cursor: pointer;
  text-decoration: none;
}

.fa-rail-item.active {
  background: #111827;
  color: #fff;
}

.fa-rail-icon {
  width: 28px;
  height: 28px;
  margin: 0 auto 4px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(37, 99, 235, 0.10);
  font-size: 12px;
  font-weight: 700;
}

.fa-rail-item.active .fa-rail-icon {
  background: rgba(255, 255, 255, 0.12);
}

.fa-rail-label {
  font-size: 11px;
  line-height: 1.3;
}

.fa-rail-bottom {
  margin-top: auto;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  font-size: 15px;
  cursor: pointer;
}

.fa-rail-hover-menu {
  position: fixed;
  z-index: 55;
  width: 216px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
  padding: 10px;
}

.fa-rail-hover-menu[hidden] {
  display: none !important;
}

.fa-rail-hover-title {
  padding: 2px 4px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
}

.fa-rail-hover-list {
  display: grid;
  gap: 6px;
}

.fa-rail-hover-link {
  display: block;
  border-radius: 8px;
  padding: 8px 10px;
  text-decoration: none;
  color: #334155;
  font-size: 13px;
}

.fa-rail-hover-link:hover {
  background: #f8fafc;
}

.fa-rail-hover-link.active {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.fa-sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.fa-sidebar-title {
  padding: 8px 10px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: var(--panel-soft);
  font-size: 14px;
  font-weight: 700;
}

.sidebar-role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 20px 10px;
}

.sidebar-role-row .tip {
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
}

.sidebar-role-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid #bfd6ff;
  border-radius: 999px;
  background: #f7fbff;
  color: #2456b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.sidebar-role-switch-icon {
  font-size: 12px;
  line-height: 1;
}

.fa-side-group {
  margin-bottom: 12px;
}

.fa-sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: none;
}

.fa-sidebar-scroll::-webkit-scrollbar {
  display: none;
}

.fa-side-group-title {
  margin: 0 0 6px;
  padding: 0 4px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
}

.fa-sidebar-list {
  display: grid;
  gap: 6px;
}

.fa-side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: #374151;
  font-size: 13px;
}

.fa-side-link:hover {
  background: var(--panel-soft);
}

.fa-side-link.active {
  background: var(--primary-soft);
  color: #1d4ed8;
  font-weight: 700;
}

.fa-side-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--dark);
  color: #fff;
  font-size: 11px;
}

.fa-main {
  min-width: 0;
  height: calc(100vh - 62px);
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fa-main-sticky {
  flex: none;
}

.fa-main-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.fa-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 12px;
  margin-bottom: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.fa-breadcrumb-star {
  font-size: 16px;
  line-height: 1;
  color: #374151;
}

.fa-breadcrumb-item {
  position: relative;
  font-size: 13px;
  color: var(--text-soft);
}

.fa-breadcrumb-item + .fa-breadcrumb-item {
  padding-left: 12px;
}

.fa-breadcrumb-item + .fa-breadcrumb-item::before {
  content: "/";
  position: absolute;
  left: 0;
  color: var(--text-faint);
}

.fa-breadcrumb-item.current {
  color: var(--text);
  font-weight: 700;
}

.fa-breadcrumb-hint {
  margin-left: 8px;
  color: var(--text-soft);
  font-size: 12px;
  white-space: nowrap;
}

.top-tab-strip {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 6px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.top-tab-strip.compact {
  grid-template-columns: minmax(0, 1fr);
}

.top-tab-shift {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: #374151;
}

.top-tab-shift:disabled {
  opacity: 0.45;
  cursor: default;
}

.top-tab-viewport {
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.top-tab-viewport::-webkit-scrollbar {
  display: none;
}

.top-tab-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  width: max-content;
}

.top-tab-item {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 6px 0 12px;
  border-radius: 4px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #374151;
  font-size: 12px;
  white-space: nowrap;
}

.top-tab-item.active {
  border-color: #60a5fa;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

.top-tab-link {
  display: inline-flex;
  align-items: center;
  height: 100%;
  text-decoration: none;
}

.top-tab-close {
  width: 20px;
  height: 20px;
  margin-left: 6px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font-size: 14px;
  line-height: 1;
}

.top-tab-close:hover {
  background: rgba(17, 24, 39, 0.08);
}

.fa-hero {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.fa-topbar-kicker {
  margin-bottom: 6px;
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.fa-topbar-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.fa-topbar-desc {
  margin-top: 8px;
  max-width: 760px;
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 13px;
}

.panel-shell {
  padding: 4px 0 0;
  background: transparent;
}

.fa-shell.page-withdraws .fa-breadcrumb {
  margin-bottom: 6px;
}

.fa-shell.page-withdraws .panel-shell {
  padding-top: 4px;
}

.fa-shell.page-withdraws .withdraw-filter-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.fa-shell.page-withdraws .withdraw-filter-keyword {
  flex: 0 1 360px;
  min-width: 220px;
  max-width: 360px;
}

.fa-shell.page-withdraws .withdraw-filter-select {
  flex: 0 0 auto;
}

.fa-shell.page-withdraws .withdraw-filter-row input,
.fa-shell.page-withdraws .withdraw-filter-row select {
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
}

.fa-shell.page-withdraws .withdraw-filter-row select {
  width: auto;
  min-width: 0;
  padding-right: 30px;
}

.fa-shell.page-withdraws .withdraw-filter-row .toolbar-actions {
  margin-left: 0;
  align-self: flex-end;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.stat-card {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stat-label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.stat-value {
  margin-top: 6px;
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}

.stat-desc {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.toolbar-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}

.toolbar-main {
  flex: 1;
  min-width: 0;
}

.toolbar-card > .toolbar-main > h2,
.toolbar-card > .toolbar-main > h3 {
  display: none;
}

.toolbar-card > .toolbar-main > .tip {
  display: none;
}

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

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 0 !important;
}

.toolbar-card .filter-row label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 600;
}

.toolbar-card .filter-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.toolbar-card .filter-row > div {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  max-width: 320px;
}

.toolbar-card .filter-row > div:first-child {
  flex: 0 1 360px;
  min-width: 220px;
  max-width: 360px;
}

.toolbar-card .filter-row input,
.toolbar-card .filter-row select {
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
}

.toolbar-card .filter-row textarea {
  min-height: 72px;
  border-radius: 10px;
}

.toolbar-card .filter-row .toolbar-actions {
  margin-left: 0;
  align-self: flex-end !important;
  flex-direction: row;
  min-width: auto;
  max-width: none;
}

.toolbar-actions-secondary {
  justify-content: flex-end;
  margin-top: 10px;
}

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

.config-form-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.config-form-block > label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 600;
}

.config-form-block input,
.config-form-block textarea,
.config-form-block select {
  width: 100%;
}

.config-form-span-3 {
  grid-column: 1 / -1;
}

.invite-toggle-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.invite-toggle-option {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.invite-toggle-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.invite-toggle-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  transition: all 120ms ease-out;
}

.invite-toggle-option.is-active span {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #2563eb;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.invite-toggle-option:hover span {
  border-color: #93c5fd;
}

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

@media (max-width: 760px) {
  .config-form-grid {
    grid-template-columns: 1fr;
  }
}

.filter-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  min-height: 30px;
  border: 1px solid #bfd6ff;
  border-radius: 999px;
  background: #f7fbff;
  color: #2456b8;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 120ms ease-out;
}

.filter-chip:hover {
  border-color: #6ea8ff;
  background: #edf5ff;
}

.filter-chip.active {
  border-color: #3b82f6;
  background: #3b82f6;
  color: #fff;
}

.filter-chip[data-status="pending"].active,
.filter-chip[data-dashboard-refunds="pending"].active {
  border-color: #f59e0b;
  background: #f59e0b;
  color: #fff;
}

.filter-chip[data-status="approved"].active,
.filter-chip[data-status="active"].active {
  border-color: #10b981;
  background: #10b981;
  color: #fff;
}

.filter-chip[data-status="rejected"].active,
.filter-chip[data-status="inactive"].active,
.filter-chip[data-dashboard-orders="risk"].active {
  border-color: #ef4444;
  background: #ef4444;
  color: #fff;
}

.filter-chip[data-risk="refund"].active,
.filter-chip[data-risk="reconcile"].active {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
  gap: 14px;
}

.panel-box {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.panel-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-box-title {
  font-size: 16px;
  font-weight: 700;
}

.panel-box-body {
  padding: 14px 16px;
}

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

.detail-item {
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}

.detail-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.detail-k {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.detail-v {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.6;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.table-clickable tbody tr {
  cursor: pointer;
}

.table-clickable tbody tr.is-selected {
  background: #eef4ff;
}

.tree-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: calc(var(--tree-indent, 0) * 18px);
}

.tree-toggle {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 4px;
  padding: 0;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

.tree-toggle.ghost {
  visibility: hidden;
}

.text-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.text-link:hover {
  text-decoration: underline;
}

.thumb-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.thumb-image {
  width: 72px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: var(--panel-soft);
}

.hint-box {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.card h2,
.card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

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

.table th,
.table td {
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.table thead th {
  background: var(--panel-soft);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.actions:not(td) {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table td.actions {
  display: table-cell;
  white-space: nowrap;
}

.table td.actions .btn {
  margin-right: 8px;
}

.table td.actions .btn:last-child {
  margin-right: 0;
}

.actions-nowrap {
  flex-wrap: nowrap;
  align-items: center;
}

.state {
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
}

.state-loading {
  background: #eff6ff;
  color: #1d4ed8;
}

.state-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 88px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  background: #fbfcfe;
  color: var(--text-soft);
}

.state-error {
  background: #fef2f2;
  color: #dc2626;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #374151;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

textarea {
  min-height: 88px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.25);
}

.btn {
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 13px;
  cursor: pointer;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
  transition: all 120ms ease-out;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-muted {
  background: #eef5ff;
  color: #1d4ed8;
  border: 1px solid #bfd6ff;
}

.btn-muted:hover {
  background: #e2eeff;
  border-color: #93c5fd;
}

.btn-text {
  background: transparent;
  color: var(--text-soft);
  border-color: transparent;
}

.btn-text:hover {
  background: #f8fafc;
  border-color: #e5e7eb;
  color: var(--text);
}

.image-field-actions {
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.image-field-preview {
  width: 100%;
}

.image-field-preview-link {
  display: block;
}

.image-field-preview-image {
  object-fit: cover;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.segmented {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.segmented-btn {
  min-height: 32px;
  border: 1px solid #bfd6ff;
  border-radius: 10px;
  background: #f7fbff;
  color: #2456b8;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.segmented-btn:hover {
  background: #edf5ff;
  border-color: #93c5fd;
}

.segmented-btn.is-active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}

.pager {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pager-meta {
  color: var(--text-soft);
  font-size: 12px;
}

.pager-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pager-size-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
}

.pager-size-label select {
  width: auto;
  min-width: 70px;
  padding: 5px 8px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge-neutral {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #e5e7eb;
}

.badge-info {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.badge-success {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.badge-warn {
  background: #fffbeb;
  color: #b45309;
  border-color: #fcd34d;
}

.badge-danger {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.badge-status-pending {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fdba74;
}

.badge-status-approved,
.badge-status-paid,
.badge-status-completed,
.badge-status-success,
.badge-status-succeeded,
.badge-status-refunded {
  background: #ecfdf3;
  color: #047857;
  border-color: #86efac;
}

.badge-status-rejected,
.badge-status-reject,
.badge-status-failed,
.badge-status-cancelled,
.badge-status-abnormal,
.badge-status-inactive {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.badge-status-in_progress,
.badge-status-processing,
.badge-status-refunding {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.badge-status-none,
.badge-status-draft {
  background: #f3f4f6;
  color: #4b5563;
  border-color: #d1d5db;
}

.state-empty-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  font-weight: 700;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
}

.timeline li {
  position: relative;
  margin-left: 10px;
  padding: 0 0 12px 16px;
  border-left: 2px solid #dbeafe;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--primary);
}

.tip {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.7;
}

.error-tip {
  color: #dc2626;
  margin: 0 0 12px;
  font-size: 13px;
}

.error-tip:empty {
  display: none;
}

.success-tip {
  color: #047857;
  margin: 0 0 12px;
  font-size: 13px;
}

.success-tip:empty {
  display: none;
}

.dialog-mask {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(4px);
}

.dialog-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.coach-editor-mask {
  padding: 14px;
}

.coach-editor-dialog {
  width: min(1260px, 100%);
  max-height: calc(100vh - 28px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.coach-editor-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-top: 10px;
}

.coach-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 14px;
  min-height: 520px;
}

.coach-editor-form,
.coach-editor-preview-pane {
  min-height: 420px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.coach-editor-rich-host {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.coach-editor-rich-host textarea {
  width: 100%;
}

.coach-editor-preview {
  min-height: 240px;
}

.coach-preview-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.coach-preview-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.coach-preview-avatar {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #f3f4f6;
}

.coach-preview-avatar-empty {
  display: grid;
  place-items: center;
  color: var(--text-faint);
  font-size: 12px;
}

.coach-preview-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.coach-preview-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.coach-preview-sub {
  color: var(--text-soft);
  font-size: 13px;
}

.coach-preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.coach-preview-section {
  display: grid;
  gap: 6px;
}

.coach-preview-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.coach-preview-content {
  color: var(--text);
  line-height: 1.7;
  font-size: 13px;
}

.dialog-head {
  padding: 18px 20px 0;
  flex: 0 0 auto;
}

.dialog-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.dialog-body {
  padding: 14px 20px;
  overflow: auto;
  min-height: 0;
  flex: 1 1 auto;
}

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

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

.dialog-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dialog-radio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dialog-radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
}

.dialog-radio-grid.is-locked .dialog-radio {
  opacity: 0.72;
}

.dialog-radio input {
  width: auto;
  margin: 0;
}

.tab-context-menu {
  position: fixed;
  z-index: 1001;
  min-width: 0;
  width: max-content;
  display: inline-grid;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
}

.tab-context-menu[hidden] {
  display: none !important;
}

.tab-context-action {
  width: auto;
  border: 0;
  border-radius: 6px;
  padding: 7px 10px;
  text-align: left;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.tab-context-action:hover {
  background: var(--panel-soft);
}

.tab-context-action:disabled {
  color: var(--text-faint);
  background: #fff;
  cursor: not-allowed;
}

.tab-context-action:disabled:hover {
  background: #fff;
}

.drawer-shell {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(15, 23, 42, 0.3);
  animation: drawer-fade-in 0.18s ease-out;
}

.drawer-panel {
  width: min(720px, 56vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -16px 0 40px rgba(15, 23, 42, 0.18);
  animation: drawer-slide-in 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes drawer-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes drawer-slide-in {
  from {
    opacity: 0.88;
    transform: translateX(36px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-title {
  font-size: 18px;
  font-weight: 700;
}

.drawer-desc {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
}

.drawer-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  color: #4b5563;
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 16px 20px;
}

.drawer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.drawer-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-search {
  max-width: 300px;
}

.drawer-linkage {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.drawer-linkage input {
  width: auto;
  margin: 0;
}

.drawer-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 20px;
  border-top: 1px solid var(--line);
}

.drawer-tree {
  display: grid;
  gap: 6px;
}

.drawer-node {
  padding-left: calc(var(--tree-depth, 0) * 18px);
}

.drawer-node-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.drawer-node-toggle {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 4px;
  padding: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.drawer-node-toggle.ghost {
  visibility: hidden;
}

.drawer-node-group {
  padding: 10px 12px 6px 0;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 700;
}

.drawer-node-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel-soft);
  font-size: 13px;
  cursor: pointer;
}

.drawer-node-label:hover {
  background: #eef4ff;
}

.drawer-node-label-page {
  background: #f8fafc;
}

.drawer-node-label-button {
  background: #fefce8;
}

.drawer-node-label-api {
  background: #f8fbff;
}

.drawer-node-label input {
  width: auto;
  margin: 0;
}

.drawer-node-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.drawer-node-tag.api {
  background: #dbeafe;
  color: #1d4ed8;
}

.drawer-node-tag.page {
  background: #e5e7eb;
  color: #374151;
}

.drawer-node-tag.button {
  background: #fef3c7;
  color: #92400e;
}

.drawer-node-hint {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 11px;
}

.drawer-node-children {
  margin-top: 4px;
  display: grid;
  gap: 4px;
}

.drawer-node-children.is-collapsed {
  display: none;
}

.dialog-display-input {
  background: var(--panel-soft);
  color: var(--text-soft);
  cursor: default;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
  background: #fff;
  flex: 0 0 auto;
}

.form-help {
  display: block;
  margin-top: 6px;
  color: var(--text-faint);
  font-size: 12px;
  line-height: 1.5;
}

.menu-parent-picker {
  display: grid;
  gap: 8px;
}

.menu-parent-search input {
  width: 100%;
}

.menu-parent-static {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--text-soft);
  font-size: 12px;
}

.menu-parent-empty {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--text-soft);
  font-size: 12px;
}

.menu-parent-radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.menu-parent-radio-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.menu-parent-radio-card:hover {
  background: var(--panel-soft);
}

.menu-parent-radio-card.is-selected {
  background: #eef4ff;
  border-color: #bfdbfe;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.08);
}

.menu-parent-radio-card input {
  margin: 0;
}

.menu-parent-tree {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.menu-parent-node {
  display: grid;
  gap: 4px;
}

.menu-parent-choice {
  display: grid;
  gap: 2px;
  padding: 8px 10px 8px calc(10px + var(--tree-indent, 0) * 18px);
  border-radius: 8px;
}

.menu-parent-choice.is-selectable {
  grid-template-columns: auto auto minmax(0, auto) 1fr;
  align-items: center;
  cursor: pointer;
  border: 1px solid transparent;
}

.menu-parent-choice.is-selectable:hover {
  background: var(--panel-soft);
}

.menu-parent-choice.is-selectable.is-selected {
  background: #eef4ff;
  border-color: #bfdbfe;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.08);
}

.menu-parent-choice.is-branch {
  grid-template-columns: auto minmax(0, auto) 1fr;
  align-items: center;
  background: #f8fafc;
}

.menu-parent-choice input {
  margin: 0;
}

.menu-parent-toggle {
  width: 18px;
  height: 18px;
  border: 0;
  padding: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}

.menu-parent-toggle.ghost {
  visibility: hidden;
  cursor: default;
}

.menu-parent-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.menu-parent-label mark,
.menu-parent-hint mark {
  background: #fef3c7;
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

.menu-parent-hint {
  color: var(--text-faint);
  font-size: 11px;
}

.menu-parent-children {
  display: grid;
  gap: 4px;
}

.menu-parent-children.is-collapsed {
  display: none;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-shell {
  width: min(1100px, 100%);
  min-height: min(720px, calc(100vh - 40px));
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(360px, 460px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.login-side {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #60a5fa 100%);
}

.login-side-mark {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 22px;
  font-weight: 800;
}

.login-side-kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.8);
}

.login-side-title {
  margin: 10px 0 14px;
  font-size: 38px;
  line-height: 1.1;
}

.login-side-desc {
  max-width: 480px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
}

.login-side-points {
  margin-top: 24px;
  display: grid;
  gap: 10px;
}

.login-point {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.login-point-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #fff;
}

.login-card {
  margin: 0;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding: 36px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card-head h2 {
  margin: 0;
  font-size: 28px;
}

.login-form-block {
  margin-top: 18px;
}

.login-field + .login-field {
  margin-top: 14px;
}

.login-form-block .actions {
  margin-top: 14px;
}

.login-divider {
  position: relative;
  margin: 24px 0 6px;
  text-align: center;
}

.login-divider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--line);
}

.login-divider span {
  position: relative;
  z-index: 1;
  padding: 0 12px;
  background: var(--panel);
  color: var(--text-faint);
  font-size: 12px;
}

@media (max-width: 1100px) {
  .fa-header {
    grid-template-columns: 1fr;
    height: auto;
    padding: 14px;
  }

  .fa-body {
    grid-template-columns: 92px 1fr;
  }

  .fa-sidebar {
    display: none;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .fa-body {
    grid-template-columns: 1fr;
  }

  .fa-rail,
  .fa-sidebar {
    display: none;
  }

  .fa-main,
  .panel-shell,
  .login-side,
  .login-card {
    padding: 14px;
  }

  .fa-hero {
    flex-direction: column;
  }

  .fa-header-tools,
  .fa-header-nav {
    flex-wrap: wrap;
  }

  .fa-breadcrumb-hint {
    display: none;
  }

  .split-layout {
    grid-template-columns: 1fr;
  }

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

.fa-tool-btn,
.fa-user-btn,
.fa-search-btn {
  cursor: pointer;
}

.fa-tool-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: #374151;
}

.fa-tool-btn:hover,
.fa-search-btn:hover,
.fa-user-btn:hover {
  border-color: var(--line-strong);
  background: #fff;
}

.fa-notice-btn {
  position: relative;
}

.fa-notice-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  line-height: 1;
}

.fa-notice-badge:empty {
  display: none;
}

.fa-user-btn {
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  padding: 5px 8px 5px 4px;
}

.ui-hide-tabs .top-tab-strip {
  display: none;
}

.ui-hide-sidebar .fa-body {
  grid-template-columns: 92px minmax(0, 1fr);
}

.ui-hide-sidebar .fa-sidebar {
  display: none;
}

.ui-hide-logo .fa-logo,
.ui-hide-logo .fa-rail-logo {
  display: none;
}

.header-overlay,
.header-popover,
.header-side-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.header-overlay[hidden],
.header-popover[hidden],
.header-side-drawer[hidden] {
  display: none;
}

.header-overlay-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
}

.header-search-panel {
  position: relative;
  width: min(760px, calc(100vw - 32px));
  margin: 84px auto 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
}

.header-search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.header-search-input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
}

.header-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.header-search-clear {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.header-search-list {
  margin-top: 16px;
  max-height: 340px;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.header-search-item,
.header-notice-item {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-soft);
  text-align: left;
  cursor: pointer;
}

.header-search-item:hover,
.header-search-item.active,
.header-notice-item:hover {
  border-color: var(--primary);
  background: #fff;
}

.header-search-item-title,
.header-notice-item-title {
  font-size: 13px;
  font-weight: 700;
}

.header-search-item-meta,
.header-notice-item-desc {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 12px;
}

.header-search-foot {
  margin-top: 14px;
  color: var(--text-faint);
  font-size: 12px;
}

.header-popover {
  pointer-events: none;
}

.header-popover-card {
  position: absolute;
  top: 74px;
  right: 14px;
  width: 320px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.14);
  pointer-events: auto;
}

.header-notice-card {
  top: 64px;
}

.header-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-popover-title {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 800;
}

.header-popover-head .header-popover-title {
  margin-bottom: 0;
}

.header-popover-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
}

.header-popover-empty {
  padding: 18px 8px;
  text-align: center;
  color: var(--text-faint);
}

.header-empty-action {
  display: block;
  margin: 10px auto 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
}

.header-user-card {
  width: 230px;
}

.header-notice-item.is-read {
  opacity: 0.68;
  background: #fff;
}

.header-notice-item-head {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  align-items: center;
  gap: 8px;
}

.header-notice-item-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

.header-notice-item-title {
  display: block;
}

.header-notice-item-time {
  color: var(--text-faint);
  font-size: 11px;
}

.header-user-action {
  width: 100%;
  padding: 12px 10px;
  border: 0;
  border-radius: 10px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.header-user-action:hover {
  background: var(--panel-soft);
}

.header-side-card {
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 100vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -18px 0 36px rgba(15, 23, 42, 0.14);
  animation: drawer-slide-in 180ms ease-out;
}

.header-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.header-side-title {
  font-size: 16px;
  font-weight: 800;
}

.header-side-body {
  padding: 14px 18px 24px;
  overflow: auto;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
}

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

.settings-switch input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.settings-switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.18s ease;
}

.settings-switch-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  transition: transform 0.18s ease;
}

.settings-switch input:checked + .settings-switch-slider {
  background: var(--primary);
}

.settings-switch input:checked + .settings-switch-slider::after {
  transform: translateX(18px);
}

.settings-switch input:focus-visible + .settings-switch-slider {
  outline: 2px solid rgba(37, 99, 235, 0.3);
  outline-offset: 2px;
}

@keyframes drawer-slide-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
