:root {
  --bg: #08111d;
  --line: rgba(108, 202, 255, 0.16);
  --text: #f5fbff;
  --muted: #a8bfd1;
  --cyan: #6fd9ff;
  --teal: #59f4cf;
  --gold: #ffd36c;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
}

html {
  min-height: 100%;
  background: #050c15;
  overscroll-behavior-y: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(56, 143, 255, 0.14), transparent 30%),
    radial-gradient(circle at 80% 18%, rgba(255, 211, 108, 0.12), transparent 24%),
    linear-gradient(180deg, #05101b 0%, #08111d 52%, #050c15 100%);
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-overflow-scrolling: touch;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -4;
  background:
    linear-gradient(180deg, rgba(111, 217, 255, 0.04), transparent 32%),
    linear-gradient(120deg, rgba(255,255,255,0.02), transparent 32%, rgba(255,255,255,0.01) 52%, transparent 76%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.014) 0, rgba(255,255,255,0.014) 1px, transparent 1px, transparent 120px);
  transform: translateZ(0);
}

.bg-orb,
.scan-beam {
  position: fixed;
  pointer-events: none;
  z-index: -3;
}

.bg-orb {
  border-radius: 999px;
  filter: blur(8px);
  opacity: 0.55;
  animation: floatOrb 18s ease-in-out infinite;
}

.orb-a {
  top: 8%;
  left: -6%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(111, 217, 255, 0.18), transparent 68%);
}

.orb-b {
  top: 26%;
  right: -4%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(89, 244, 207, 0.16), transparent 68%);
  animation-delay: -6s;
}

.orb-c {
  bottom: 6%;
  left: 24%;
  width: 360px;
  height: 240px;
  background: radial-gradient(circle, rgba(255, 211, 108, 0.12), transparent 70%);
  animation-delay: -11s;
}

.scan-beam {
  inset: -20% auto 0 -18%;
  width: 42%;
  transform: rotate(10deg);
  background: linear-gradient(90deg, transparent 0%, rgba(111, 217, 255, 0.03) 40%, rgba(111, 217, 255, 0.14) 50%, rgba(111, 217, 255, 0.03) 60%, transparent 100%);
  mix-blend-mode: screen;
  animation: scanMove 10s linear infinite;
}

.page-shell {
  position: relative;
  z-index: 1;
  max-width: 1460px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  isolation: isolate;
}

body[data-page-mode="fullscreen"] .page-shell {
  max-width: 100%;
  padding: 18px 18px 32px;
}

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

.fullscreen-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 12px;
  min-height: 24px;
}

.fullscreen-hidden-controls {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.hero,
.toolbar-row,
.filter-row,
.action-row,
.meta-row,
.board-grid,
.dual-grid,
.metrics-grid {
  display: grid;
  gap: 12px;
}

.hero {
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.compact-hero {
  position: relative;
}

.hero-copy-block {
  padding-top: 4px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 12px;
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.02;
}

.hero-copy {
  margin: 0;
  max-width: 560px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.hero-panel,
.panel,
.metric-card,
.floating-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(14, 29, 47, 0.94), rgba(8, 20, 34, 0.88)),
    rgba(8, 20, 34, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 30px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(14px);
}

.hero-panel,
.panel,
.floating-panel {
  padding: 12px;
}

.toolbar-row {
  grid-template-columns: 1fr 42px;
  align-items: end;
}

.toolbar-row-wide {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.filter-stack {
  display: grid;
  gap: 12px;
}

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

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

body[data-page-mode="fullscreen"] .toolbar-actions {
  justify-content: flex-start;
}

.quick-range-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

label span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

input[type="date"],
input[type="time"],
select {
  width: 100%;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid rgba(111, 217, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

option {
  color: #08111d;
}

.compact-action-row {
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  align-items: end;
}

.action-btn-group {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(140px, 0.8fr);
  gap: 12px;
}

.action-main-btn,
.action-sub-btn {
  width: 100%;
}

.compare-mode-field {
  display: block;
}

.month-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.month-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(111, 217, 255, 0.08);
  border: 1px solid rgba(111, 217, 255, 0.16);
  color: var(--text);
  font-size: 12px;
}

.tall-table-wrap {
  max-height: 420px;
  overflow: auto;
}

.comparison-custom {
  margin-bottom: 16px;
}

.comparison-custom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: end;
}

button {
  cursor: pointer;
  padding: 12px 15px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
}

.primary-btn {
  background: linear-gradient(90deg, #57d9ff, #5af0cf);
  color: #041019;
}

.ghost-btn,
.icon-btn {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(111, 217, 255, 0.18);
}

.ghost-btn:hover,
.page-dot:hover,
.quick-range-btn:hover,
.fullscreen-link-btn:hover {
  border-color: rgba(111, 217, 255, 0.42);
  background: rgba(111, 217, 255, 0.08);
}

.icon-btn {
  padding: 0;
  width: 42px;
  height: 42px;
  font-size: 18px;
}

.fullscreen-link-btn,
.quick-range-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.toolbar-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 16px;
  border: 1px solid rgba(111, 217, 255, 0.3);
  text-decoration: none;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease, filter 0.16s ease;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  position: relative;
  overflow: hidden;
}

.toolbar-link-btn:hover {
  transform: translateY(-2px) scale(1.01);
  filter: saturate(1.08);
}

.toolbar-link-btn:before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 15px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02));
  opacity: 0.55;
  pointer-events: none;
}

.toolbar-link-btn-icon,
.toolbar-link-btn-text {
  position: relative;
  z-index: 1;
}

.toolbar-link-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.toolbar-link-btn-primary {
  color: #041019;
  background: linear-gradient(135deg, #7ce7ff, #5af0cf 58%, #b2ffdf);
  border-color: transparent;
  box-shadow: 0 16px 34px rgba(87, 217, 255, 0.3);
}

.toolbar-link-btn-primary .toolbar-link-btn-icon {
  background: rgba(4, 16, 25, 0.12);
}

.toolbar-link-btn-secondary {
  color: var(--text);
  background: linear-gradient(135deg, rgba(111, 217, 255, 0.22), rgba(89, 244, 207, 0.14));
  border-color: rgba(111, 217, 255, 0.46);
  box-shadow: 0 14px 30px rgba(27, 89, 120, 0.26);
}

.toolbar-link-btn-secondary .toolbar-link-btn-icon {
  background: rgba(111, 217, 255, 0.18);
}

.toolbar-link-btn-secondary:hover,
.toolbar-link-btn-primary:hover {
  border-color: rgba(111, 217, 255, 0.56);
}

.quick-range-btn {
  padding: 8px 12px;
  font-size: 12px;
}

.quick-range-btn.active {
  background: linear-gradient(90deg, #57d9ff, #5af0cf);
  color: #041019;
  border-color: transparent;
}

.meta-row {
  grid-template-columns: 1fr;
  color: var(--muted);
  font-size: 12px;
}

.floating-panel {
  position: absolute;
  top: 112px;
  right: 0;
  width: min(360px, calc(100vw - 40px));
  z-index: 3;
}

.compact-floating-panel {
  width: min(320px, calc(100vw - 40px));
}

.hidden,
.compact-hidden {
  display: none;
}

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

.metric-card {
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto -18% -38% auto;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(111, 217, 255, 0.14), transparent 68%);
}

.metric-title,
.metric-subtext {
  display: block;
}

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

.metric-value {
  display: block;
  margin: 10px 0 8px;
  font-size: 28px;
}

.metric-subtext {
  color: rgba(168, 191, 209, 0.72);
  font-size: 12px;
  line-height: 1.5;
}

.single-section,
.panel {
  margin-bottom: 14px;
}

.dashboard-page {
  display: block;
  margin-bottom: 12px;
  opacity: 0;
  transform: translate3d(0, 12px, 0) scale(0.994);
  pointer-events: none;
  max-height: 0;
  overflow: hidden;
  will-change: opacity, transform;
  contain: layout paint;
  transition:
    opacity 280ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.dashboard-page.active {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
  pointer-events: auto;
  max-height: none;
  overflow: visible;
}

.page-stage {
  position: relative;
  min-height: 560px;
  transform: translateZ(0);
}

.page-nav {
  margin-bottom: 14px;
}

.fullscreen-nav {
  overflow: hidden;
  transition: max-height 0.24s ease, opacity 0.2s ease, margin-bottom 0.2s ease, padding-top 0.2s ease, padding-bottom 0.2s ease, border-color 0.2s ease;
  max-height: 240px;
  opacity: 1;
}

.fullscreen-nav.is-collapsed {
  max-height: 0;
  opacity: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
  pointer-events: none;
}

.toolbar-link-btn-toggle {
  cursor: pointer;
}

.page-nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.small-btn {
  padding: 8px 12px;
  font-size: 12px;
}

.page-auto-status {
  color: var(--muted);
  font-size: 12px;
}

.page-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-dot {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(111, 217, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
}

.page-dot.active {
  background: linear-gradient(90deg, #57d9ff, #5af0cf);
  color: #041019;
  border-color: transparent;
  box-shadow: 0 0 22px rgba(87, 217, 255, 0.22);
}

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

.comparison-meta {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(111, 217, 255, 0.1);
}

.comparison-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.section-head,
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.section-head h2,
.panel-head h2 {
  margin: 0;
  font-size: 20px;
}

.section-head span,
.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

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

.dual-grid {
  grid-template-columns: minmax(0, 2fr) minmax(320px, 0.9fr);
  margin-bottom: 12px;
}

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

.auto-refresh-form,
.auto-row,
.rank-list,
.warning-list {
  display: grid;
  gap: 12px;
}

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

.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(111,217,255,0.12);
}

.rank-item {
  display: grid;
  gap: 8px;
}

.rank-meta {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
}

.rank-index {
  color: var(--cyan);
  font-weight: 700;
}

.rank-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-subtext,
.rank-value,
.muted,
.asin-cell {
  color: var(--muted);
  font-size: 12px;
}

.rank-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
  overflow: hidden;
}

.rank-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--teal));
}

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

.tall-table-wrap {
  max-height: min(58vh, 560px);
  overflow: auto;
}

.split-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  margin-bottom: 12px;
}

.split-panel {
  min-width: 0;
}

.split-handle {
  position: relative;
  margin: 0 6px;
  cursor: col-resize;
  border-radius: 999px;
  border: 1px solid rgba(111, 217, 255, 0.22);
  background: linear-gradient(180deg, rgba(87, 217, 255, 0.1), rgba(90, 240, 207, 0.14));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.split-handle::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 50%;
  width: 4px;
  transform: translateX(-50%);
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 14%, rgba(111, 217, 255, 0.95) 0 2px, transparent 3px),
    radial-gradient(circle at 50% 50%, rgba(111, 217, 255, 0.95) 0 2px, transparent 3px),
    radial-gradient(circle at 50% 86%, rgba(111, 217, 255, 0.95) 0 2px, transparent 3px);
}

.split-view.dragging,
.split-view.dragging * {
  user-select: none;
}

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(111, 217, 255, 0.1);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

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

.coming-soon {
  padding: 18px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)),
    rgba(255,255,255,0.03);
  border: 1px solid rgba(111, 217, 255, 0.1);
}

.coming-soon strong {
  display: block;
  margin-bottom: 8px;
}

.coming-soon p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.summary-bullet-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.negative-review-summary-strip {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.negative-review-summary-strip .summary-bullet {
  flex: 0 0 min(180px, 22vw);
  min-width: 140px;
}

.summary-bullet {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(111, 217, 255, 0.1);
}

.summary-bullet strong {
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 0.08em;
}

.summary-bullet span {
  color: var(--text);
  line-height: 1.6;
  font-size: 13px;
}

.compact-meta {
  font-size: 12px;
}

.fullscreen-shell .metrics-grid {
  margin-bottom: 14px;
}

.fullscreen-shell .panel,
.fullscreen-shell .metric-card,
.fullscreen-shell .hero-panel {
  border-radius: 20px;
}

.fullscreen-shell .page-stage {
  min-height: calc(100vh - 300px);
}

.warning-item {
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 125, 136, 0.08);
  border: 1px solid rgba(255, 125, 136, 0.18);
  color: #ffd5d9;
}

.warning-item.ok {
  background: rgba(89, 244, 207, 0.08);
  border-color: rgba(89, 244, 207, 0.18);
  color: #cbfff2;
}

@keyframes floatOrb {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(24px, -18px, 0) scale(1.08);
  }
}

@keyframes scanMove {
  0% {
    transform: translateX(-8%) rotate(10deg);
    opacity: 0.2;
  }
  50% {
    transform: translateX(130vw) rotate(10deg);
    opacity: 0.72;
  }
  100% {
    transform: translateX(130vw) rotate(10deg);
    opacity: 0;
  }
}

.empty-state {
  color: var(--muted);
}

@media (max-width: 1100px) {
  .hero,
  .metrics-grid,
  .sales-board-grid,
  .dual-grid,
  .split-view,
  .filter-row,
  .auto-row,
  .comparison-band,
  .compact-action-row,
  .action-btn-group,
  .comparison-custom-grid {
    grid-template-columns: 1fr;
  }

  .floating-panel {
    position: static;
    width: 100%;
    margin-top: 12px;
  }

  .page-nav-actions {
    flex-wrap: wrap;
  }

  .toolbar-row-wide {
    grid-template-columns: 1fr;
  }

  .toolbar-actions {
    justify-content: flex-start;
  }

  .fullscreen-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .fullscreen-status-row {
    justify-content: flex-start;
  }

  .split-handle {
    display: none;
  }
}
