/* ============================================================
   漫道云 AI · 数据概览  styles
   ============================================================ */

:root {
  --color-bg: #f4f5f9;
  --color-surface: #ffffff;
  --color-border: #ebecf1;
  --color-border-soft: #f1f2f6;
  --color-text: #1e2230;
  --color-text-soft: #5a6072;
  --color-muted: #8a8f9d;
  --color-muted-2: #b6bac5;
  --color-primary: #7b5cf0;
  --color-primary-50: #f0ebff;
  --color-primary-100: #e3dbff;
  --color-primary-200: #c9bbff;
  --color-primary-600: #6a49ea;
  --color-primary-700: #5b39d8;
  --color-accent-rose: #f26a7c;
  --color-accent-mint: #2fb689;
  --color-accent-amber: #f4a33a;
  --color-accent-sky: #5b8dff;
  --shadow-card: 0 1px 2px rgba(15, 17, 30, 0.04), 0 6px 18px rgba(70, 80, 140, 0.05);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --font-sans: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei",
    system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 1280px;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: transparent;
}

input {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: 0;
  outline: 0;
  background: transparent;
}

/* =============== Top bar ================ */

.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  height: 58px;
  padding: 0 28px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.top-bar__left {
  display: flex;
  align-items: center;
  gap: 44px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.2px;
}

.brand__logo {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
}

.brand__name {
  display: inline-flex;
  align-items: baseline;
  color: #1a1d2b;
}

.brand__name-accent {
  color: var(--color-primary);
  margin-left: 3px;
  font-weight: 700;
}

.top-nav {
  display: flex;
  gap: 30px;
}

.top-nav__item {
  position: relative;
  padding: 20px 0;
  font-size: 13.5px;
  color: #4c5264;
  font-weight: 500;
  transition: color 0.15s ease;
}

.top-nav__item:hover {
  color: var(--color-text);
}

.top-nav__item.is-active {
  color: var(--color-primary);
}

.top-nav__item.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--color-primary);
  transform: translateX(-50%);
}

.top-bar__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  min-width: 240px;
  background: #f2f3f7;
  border-radius: 999px;
  color: var(--color-muted);
  transition: background 0.15s ease;
}

.search:hover {
  background: #ecedf2;
}

.search input {
  flex: 1;
  font-size: 13px;
  color: var(--color-text);
}

.search input::placeholder {
  color: #a9adb8;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #f5f6fa;
  transition: background 0.15s ease;
}

.icon-btn:hover {
  background: #ececf2;
}

.icon-btn__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: #ff4d4f;
  border: 2px solid #fff;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: #f5f6fa;
  font-size: 12.5px;
  font-weight: 500;
  color: #4c5264;
}

.user-chip__avatar {
  display: inline-flex;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  align-items: center;
  justify-content: center;
}

/* =============== Layout ================ */

.layout {
  display: grid;
  grid-template-columns: 196px 1fr;
  gap: 0;
  min-height: calc(100vh - 58px);
}

.sidebar {
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 18px 14px;
}

.main {
  padding: 22px 26px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* =============== Sidebar nav ================ */

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: #51566a;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  text-align: left;
}

.side-nav__link--group {
  width: 100%;
  justify-content: flex-start;
}

.side-nav__link:hover {
  background: #f4f4fa;
  color: var(--color-text);
}

.side-nav__link .caret {
  margin-left: auto;
  color: #b4b8c4;
  transition: transform 0.2s ease;
}

.side-nav__group.is-open .caret {
  transform: rotate(180deg);
}

.side-nav__icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: #8a8f9d;
}

.side-nav__sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 6px 8px;
  margin-left: 10px;
  border-left: 1px solid #edeef2;
}

.side-nav__sublink {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12.5px;
  color: #6a6f80;
  transition: background 0.15s ease, color 0.15s ease;
}

.side-nav__sublink:hover {
  color: var(--color-text);
  background: #f5f5fb;
}

.side-nav__sublink.is-active {
  background: var(--color-primary-50);
  color: var(--color-primary);
  font-weight: 500;
}

.side-nav__sublink.is-active svg {
  color: var(--color-primary);
}

/* =============== Hero banner ================ */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  padding: 22px 26px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  color: #fff;
  background:
    radial-gradient(120% 180% at 100% 0%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0) 45%),
    radial-gradient(140% 160% at 0% 100%, rgba(129, 83, 255, 0.65) 0%, rgba(129, 83, 255, 0) 60%),
    linear-gradient(118deg, #5f44dc 0%, #7856ee 40%, #8f68ff 100%);
  box-shadow: 0 12px 28px rgba(94, 72, 217, 0.28);
}

.hero__decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
}

.hero__blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
  opacity: 0.6;
}

.hero__blob--a {
  width: 260px;
  height: 260px;
  background: rgba(178, 145, 255, 0.55);
  top: -90px;
  right: 10%;
}

.hero__blob--b {
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.35);
  bottom: -60px;
  right: -40px;
}

.hero__blob--c {
  width: 120px;
  height: 120px;
  background: rgba(124, 92, 240, 0.8);
  top: 20%;
  left: -30px;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 640px;
}

.hero__title {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.hero__desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
}

.hero__tools {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.date-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  transition: background 0.15s ease;
}

.date-picker:hover {
  background: rgba(255, 255, 255, 0.22);
}

.hero-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background 0.15s ease, color 0.15s ease;
}

.hero-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.hero-btn.is-active {
  background: #fff;
  color: var(--color-primary-700);
  border-color: #fff;
  font-weight: 500;
}

.hero-btn--icon {
  width: 34px;
  height: 30px;
  padding: 0;
}

/* =============== Stats ================ */

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

.stat-card {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 14px 16px 4px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 108px;
}

.stat-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stat-card__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6a6f80;
  font-size: 12.5px;
  font-weight: 500;
}

.stat-card__ico {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.stat-card__ico--mint {
  color: var(--color-accent-mint);
  background: rgba(47, 182, 137, 0.1);
}

.stat-card__ico--rose {
  color: var(--color-accent-rose);
  background: rgba(242, 106, 124, 0.1);
}

.stat-card__ico--violet {
  color: var(--color-primary);
  background: rgba(123, 92, 240, 0.1);
}

.stat-card__ico--sky {
  color: var(--color-accent-sky);
  background: rgba(91, 141, 255, 0.1);
}

.stat-card__link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #9da2b0;
  font-size: 11.5px;
  transition: color 0.15s ease;
}

.stat-card__link:hover {
  color: var(--color-primary);
}

.stat-card__link--accent {
  color: var(--color-primary);
  font-weight: 500;
}

.stat-card__body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
  min-height: 54px;
}

.stat-card__body--center {
  align-items: center;
  justify-content: flex-start;
  padding-top: 14px;
}

.stat-card__value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  line-height: 1;
  color: #1e2230;
}

.stat-card__value--big .stat-card__num {
  font-size: 30px;
}

.stat-card__num {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

.stat-card__sub {
  font-size: 12px;
  color: #a3a7b5;
  font-weight: 500;
}

.stat-card__spark {
  width: 120px;
  height: 46px;
  flex-shrink: 0;
}

.stat-card__foot {
  margin-top: 4px;
  color: #a3a7b5;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

/* =============== Panel ================ */

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px 20px 22px;
  box-shadow: var(--shadow-card);
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.panel__title::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--color-primary);
  margin-right: 8px;
  vertical-align: -1px;
}

.panel__tools {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 12px;
  border-radius: 8px;
  background: #f5f6fa;
  color: #5a6072;
  font-size: 12.5px;
  border: 1px solid transparent;
  transition: background 0.15s ease;
}

.chip-btn:hover {
  background: #ececf3;
}

.chip-btn svg {
  color: #9aa0ac;
}

.seg {
  display: inline-flex;
  padding: 3px;
  background: #f5f6fa;
  border-radius: 10px;
}

.seg__btn {
  padding: 6px 14px;
  font-size: 12.5px;
  color: #5a6072;
  border-radius: 7px;
  transition: background 0.15s ease, color 0.15s ease;
}

.seg__btn.is-active {
  color: #fff;
  background: var(--color-primary);
  box-shadow: 0 4px 10px rgba(123, 92, 240, 0.25);
  font-weight: 500;
}

.seg__btn:not(.is-active):hover {
  color: var(--color-text);
}

.panel__legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.legend-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  line-height: 1.3;
}

.legend-tag--violet {
  background: var(--color-primary-50);
  color: var(--color-primary-700);
  border-color: #e0d6ff;
}

.legend-tag--violet .legend-dot {
  background: var(--color-primary);
}

.legend-tag--amber {
  background: #fff4e0;
  color: #a7670b;
  border-color: #fadeb0;
}

.legend-tag--amber .legend-dot {
  background: var(--color-accent-amber);
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.legend-close {
  color: currentColor;
  opacity: 0.5;
  font-size: 13px;
  line-height: 1;
  margin-left: 2px;
}

.panel__chart {
  width: 100%;
  height: 310px;
}

/* =============== Floating help ================ */

.floating-help {
  position: fixed;
  right: 20px;
  bottom: 80px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #b8beca;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(20, 22, 34, 0.18);
  opacity: 0.75;
}
