:root {
  --yg-primary: #2d2442;
  --yg-dark: #211a32;
  --yg-page: color-mix(in srgb, #2d2442 6%, #eceef5);
  --yg-text: #0f172a;
  --yg-muted: #64748b;
  --yg-line: #e5e7eb;
  --saas-radius: 8px;
  --saas-shadow: 0 1px 2px rgb(15 23 42 / .04), 0 4px 12px rgb(15 23 42 / .04);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: row;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--yg-text);
  background: var(--yg-page);
  -webkit-font-smoothing: antialiased;
}
.sidebar {
  width: 220px;
  flex: none;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  background: var(--yg-primary);
  color: #fff;
}
.sidebar-brand {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 22px;
  font-weight: 720;
  font-size: 16px;
  letter-spacing: .04em;
  border-bottom: 1px solid rgb(255 255 255 / .08);
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgb(255 255 255 / .72);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
}
.sidebar a i { width: 16px; text-align: center; }
.sidebar a.is-on,
.sidebar a:hover {
  background: rgb(255 255 255 / .12);
  color: #fff;
}
.sidebar-foot {
  margin-top: auto;
  padding: 14px 12px 16px;
  border-top: 1px solid rgb(255 255 255 / .08);
}
.sidebar-user {
  font-size: 12px;
  color: rgb(255 255 255 / .55);
  padding: 0 8px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-foot button {
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: rgb(255 255 255 / .1);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.sidebar-foot button:hover { background: rgb(255 255 255 / .18); }
.shell {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  flex: none;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--yg-line);
}
.topbar-title { font-size: 15px; font-weight: 700; color: var(--yg-primary); }
.page {
  flex: 1;
  width: 100%;
  margin: 0;
  padding: 18px 22px 28px;
  min-height: 0;
  overflow: auto;
}
.page-inner {
  width: 100%;
  max-width: 1280px;
}

.yg-dash { display: flex; flex-direction: column; gap: 16px; }
.yg-ops-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: visible;
  position: relative;
  z-index: 5;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--yg-line);
  border-radius: var(--saas-radius);
  box-shadow: var(--saas-shadow);
}
.yg-ops-head p { margin: 0; color: #64748b; font-size: 13px; }
.yg-ops-filters {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: auto;
  flex: 0 0 auto;
  overflow: visible;
  position: relative;
  z-index: 6;
}
.yg-ops-combo {
  position: relative;
  width: 220px;
  flex: 0 0 220px;
  z-index: 7;
}
.yg-ops-combo-btn,
.yg-ops-period,
.yg-ops-export,
.yg-ops-filters input[type="date"],
.yg-ops-filters input[type="search"],
.yg-ops-filters button {
  height: 31px;
  min-height: 31px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  box-shadow: none;
  font-size: 13px;
}
.yg-ops-combo-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px;
  line-height: 1;
  cursor: pointer;
}
.yg-ops-combo-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.yg-ops-combo-btn i { color: #94a3b8; }
.yg-ops-combo-panel {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 280px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgb(15 23 42 / .12);
  z-index: 80;
  padding: 8px;
}
.yg-ops-combo.is-open .yg-ops-combo-panel { display: block; }
.yg-ops-combo-search {
  display: block;
  width: 100%;
  height: 32px;
  margin: 0 0 6px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
}
.yg-ops-combo-search:focus {
  outline: none;
  border-color: #7c6bf2;
  box-shadow: 0 0 0 3px rgb(124 107 242 / .16);
}
.yg-ops-combo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 240px;
  overflow: auto;
}
.yg-ops-combo-list li {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.yg-ops-combo-list li:hover { background: #f5f3ff; }
.yg-ops-combo-list li.is-on { background: #efeaff; color: #6d5aef; font-weight: 600; }
.yg-ops-combo-list li.is-hide { display: none; }
.yg-ops-period {
  display: inline-block;
  width: 108px;
  min-width: 108px;
  max-width: 108px;
  flex: 0 0 108px;
  padding: 0 8px;
}
.yg-ops-channel {
  width: 168px;
  min-width: 168px;
  max-width: 168px;
  flex: 0 0 168px;
}
.yg-ops-type {
  width: 118px;
  min-width: 118px;
  max-width: 118px;
  flex: 0 0 118px;
}
.yg-ops-filters input[type="search"] {
  width: 180px;
  min-width: 160px;
  padding: 0 12px;
}
.yg-ops-head:has(> .yg-ops-filters:only-child) {
  justify-content: flex-end;
}
.yg-ops-filters button {
  padding: 0 12px;
  cursor: pointer;
  font-weight: 600;
  background: #2d2442;
  border-color: #2d2442;
  color: #fff;
}
.yg-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.yg-stat {
  background: #2d2442;
  border: 0;
  border-radius: 8px;
  padding: 18px 20px 16px;
  min-height: 96px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
  text-decoration: none;
  box-shadow: none;
}
.yg-stat, .yg-stat-label, .yg-stat-value, .yg-stat-icon, .yg-stat-icon i { color: #fff; }
.yg-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  background: rgb(255 255 255 / .18);
  font-size: 16px;
}
.yg-stat-body { min-width: 0; }
.yg-stat-label { font-size: 13px; font-weight: 500; }
.yg-stat-value {
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.yg-stat-0 { background: #2d2442; }
.yg-stat-1 { background: #7c3aed; }
.yg-stat-2 { background: #0284c7; }
.yg-stat-3 { background: #0d9488; }
.yg-stat-4 { background: #059669; }
.yg-stat-5 { background: #d97706; }
.yg-stat-6 { background: #2563eb; }
.yg-stat-7 { background: #0ea5e9; }
.yg-stat-8 { background: #334155; }
.yg-ops-kpi-sub,
.yg-ops-kpi-delta {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: rgb(255 255 255 / .82);
}
.yg-ops-kpi-delta.is-down { color: #fecaca; }
.card.yg-panel {
  background: #fff;
  border: 1px solid var(--yg-line);
  border-radius: var(--saas-radius);
  box-shadow: var(--saas-shadow);
  overflow: hidden;
}
.card-body { padding: 18px 20px 16px; }
.yg-ops-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 16px;
}
.yg-ops-charts > .yg-panel { min-width: 0; overflow: hidden; }
.yg-ops-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.yg-ops-card-head h5 { margin: 0; font-size: 15px; font-weight: 700; color: #0f172a; }
.yg-ops-card-head span { display: block; margin-top: 2px; color: #94a3b8; font-size: 12px; }
.yg-ops-card-head em { font-style: normal; color: #7c6bf2; font-size: 13px; font-weight: 600; white-space: nowrap; }
.yg-ops-line-legend { display: flex; gap: 14px; color: #475569; font-size: 12px; white-space: nowrap; }
.yg-ops-line-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.yg-ops-line-legend .is-a { background: #7c6bf2; }
.yg-ops-line-legend .is-b { background: #5b8def; }
.yg-ops-chart { width: 100%; min-width: 0; min-height: 268px; }
.yg-ops-chart .apexcharts-canvas,
.yg-ops-donut .apexcharts-canvas { max-width: 100% !important; }
.yg-ops-mix { display: flex; align-items: center; gap: 16px; min-height: 176px; }
.yg-ops-donut-wrap {
  position: relative;
  width: 176px;
  height: 176px;
  flex: 0 0 176px;
}
.yg-ops-donut { width: 176px !important; height: 176px !important; }
.yg-ops-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
}
.yg-ops-donut-center b { font-size: 26px; font-weight: 700; line-height: 1.1; color: #0f172a; }
.yg-ops-donut-center span { margin-top: 2px; font-size: 12px; color: #64748b; }
.yg-ops-mix-legend { display: flex; flex-direction: column; gap: 12px; color: #334155; font-size: 13px; }
.yg-ops-mix-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.yg-ops-mix-legend .is-old { background: #7c6bf2; }
.yg-ops-mix-legend .is-new { background: #c4b5fd; }
.yg-ops-mix-legend b { margin-left: 6px; font-weight: 600; }
.yg-ops-mix-legend em { font-style: normal; color: #94a3b8; margin-left: 6px; }
.yg-ops-mix-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eef2f7;
  color: #64748b;
  font-size: 13px;
}
.yg-ops-mix-foot.is-sub { border: 0; margin-top: 6px; padding-top: 0; }
.yg-ops-mix-foot b { color: #0f172a; font-size: 16px; }
.yg-ops-retain {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  height: 210px;
  padding: 4px 4px 0;
}
.yg-ops-retain-col { display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.yg-ops-retain-track {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.yg-ops-retain-bar {
  width: 48%;
  min-width: 16px;
  max-width: 34px;
  border-radius: 8px 8px 5px 5px;
  background: linear-gradient(to top, #7c6bf2 0 58%, #c4b5fd 58% 100%);
}
.yg-ops-retain-d { margin-top: 8px; color: #94a3b8; font-size: 12px; }
.yg-ops-retain-pct { margin-top: 2px; color: #475569; font-size: 12px; }
.yg-ops-hours {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 6px;
  height: 168px;
  padding: 4px 2px 0;
}
.yg-ops-hour { height: 100%; }
.yg-ops-hour-track {
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.yg-ops-hour-bar {
  width: 100%;
  border-radius: 5px 5px 2px 2px;
  background: #ddd6fe;
}
.yg-ops-hour.is-peak .yg-ops-hour-bar { background: #7c6bf2; }
.yg-ops-hours-axis {
  display: flex;
  justify-content: space-between;
  padding: 8px 2px 0;
  color: #94a3b8;
  font-size: 12px;
}
.yg-ops-hot-links { color: #94a3b8; font-size: 12px; white-space: nowrap; }
.yg-ops-hot-links a { color: #6d5aef; text-decoration: none; font-weight: 600; }
.yg-ops-hot-links a:hover { text-decoration: underline; }
.yg-ops-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 31px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  flex: 0 0 auto;
}
.yg-ops-chip.is-on,
.yg-ops-chip:hover {
  background: #2d2442;
  border-color: #2d2442;
  color: #fff;
}
.yg-ops-hot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 48px;
  padding: 4px 0;
}
.yg-ops-hot ol { list-style: none; margin: 0; padding: 0; min-width: 0; }
.yg-ops-hot li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1.8fr) minmax(72px, .8fr) 52px;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #f3f4f6;
  color: #0f172a;
  font-size: 13px;
}
.yg-ops-hot li:last-child { border-bottom: 0; }
.yg-ops-rank {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: #f3f0ff;
  color: #7c6bf2;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  align-self: start;
  margin-top: 1px;
}
.yg-ops-hot li.is-top .yg-ops-rank { background: #ece7ff; color: #6d5aef; }
.yg-ops-title {
  overflow: visible;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
  font-weight: 500;
  color: #1e293b;
}
.yg-ops-bar {
  height: 8px;
  background: #eef2f7;
  border-radius: 99px;
  overflow: hidden;
}
.yg-ops-bar i { display: block; height: 100%; background: #7c6bf2; border-radius: 99px; }
.yg-ops-num {
  text-align: right;
  color: #64748b;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.yg-ops-empty {
  display: block;
  padding: 28px 8px 16px;
  color: #94a3b8;
  font-size: 13px;
}
.table { width: 100%; border-collapse: collapse; background: #fff; }
.table th, .table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid #f3f4f6; }
.table th { background: #f8fafc; color: var(--yg-muted); font-weight: 650; font-size: 12px; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbff; }
.empty { text-align: center; color: var(--yg-muted); padding: 36px; }

body.is-login {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background:
    radial-gradient(1200px 500px at 50% -10%, #d9d2ee 0%, transparent 55%),
    var(--yg-page);
}
body.is-login .page {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
}
body.is-login .page-inner {
  width: 100%;
  max-width: 440px;
}
.login {
  width: 100%;
  background: #fff;
  padding: 40px 36px;
  border-radius: 16px;
  border: 1px solid var(--yg-line);
  box-shadow: var(--saas-shadow);
}
.login h1 { margin: 0 0 24px; text-align: center; font-size: 22px; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login label { display: flex; flex-direction: column; gap: 6px; color: var(--yg-muted); }
.login input {
  height: 38px;
  border: 1px solid var(--yg-line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--yg-text);
}
.login button {
  margin-top: 16px;
  height: 42px;
  background: var(--yg-primary);
  color: #fff;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.error { color: #dc2626; }

@media (max-width: 1199px) {
  .yg-ops-charts, .yg-ops-hot, .yg-stat-grid { grid-template-columns: 1fr 1fr; }
  .yg-ops-head { flex-wrap: wrap; }
}
@media (max-width: 767px) {
  .yg-stat-grid, .yg-ops-charts, .yg-ops-hot { grid-template-columns: 1fr; }
  .yg-ops-filters { flex-wrap: wrap; }
  .page { padding: 14px; }
  .sidebar { width: 196px; }
  .topbar { padding: 0 14px; }
}
