:root {
  --nav: #072851;
  --nav-deep: #031b38;
  --primary: #1d63ff;
  --text: #152033;
  --muted: #68758a;
  --line: #e5eaf3;
  --page: #f5f7fb;
  --green: #16b96b;
  --orange: #f59a23;
  --red: #ff4d57;
  --purple: #725cff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--page);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
}

[v-cloak] {
  display: none;
}

a {
  color: #1261ff;
  text-decoration: none;
}

svg {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #eef3fb;
}

.login-panel {
  width: 420px;
  padding: 36px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(20, 42, 80, .12);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brand-mark,
.xhs-logo {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #fff;
  font-weight: 700;
  background: #ff2442;
}

.login-brand h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.login-brand p {
  margin: 0;
  color: var(--muted);
}

.full-btn {
  width: 100%;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  color: #fff;
  background: linear-gradient(180deg, var(--nav), var(--nav-deep));
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.system-title {
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 22px;
  font-size: 20px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.menu-group-title {
  display: grid;
  grid-template-columns: 42px 1fr 20px;
  align-items: center;
  gap: 12px;
  padding: 28px 18px 18px;
  font-size: 18px;
  font-weight: 600;
}

.xhs-logo {
  width: 40px;
  height: 40px;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 12px;
  padding: 0 16px;
}

.nav-list button {
  height: 54px;
  border: 0;
  border-radius: 6px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: rgba(255, 255, 255, .88);
  background: transparent;
  font-size: 16px;
  cursor: pointer;
  text-align: left;
}

.nav-list button.active {
  color: #fff;
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(29, 99, 255, .35);
}

.collapse-row {
  margin-top: auto;
  height: 62px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  color: rgba(255, 255, 255, .88);
  font-size: 16px;
}

.main-area {
  min-width: 0;
}

.topbar {
  height: 72px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  box-shadow: 0 2px 8px rgba(31, 45, 61, .08);
}

.top-left,
.top-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.crumb {
  font-size: 18px;
  font-weight: 600;
}

.notice {
  position: relative;
  display: inline-flex;
}

.notice em {
  position: absolute;
  right: -8px;
  top: -10px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ff3d4f;
  color: #fff;
  font-style: normal;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: #d7eef9;
  color: #0b477a;
  font-weight: 700;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.content {
  padding: 28px 32px 40px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
}

.page-head h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.page-head p {
  margin: 0;
  color: var(--muted);
}

.row-head {
  align-items: center;
}

.toolbar {
  display: grid;
  grid-template-columns: auto minmax(260px, 360px) minmax(160px, 220px) minmax(160px, 220px) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}

.update-toolbar {
  grid-template-columns: 220px auto auto auto;
}

.detail-toolbar {
  grid-template-columns: 260px 320px 220px;
}

.analysis-toolbar {
  grid-template-columns: 150px 190px 190px 190px 150px auto;
}

.stat-strip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 0;
  margin-bottom: 24px;
  box-shadow: 0 6px 16px rgba(21, 32, 51, .06);
}

.detail-stats {
  grid-template-columns: repeat(5, minmax(160px, 1fr));
}

.stat-item {
  min-height: 86px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px;
  border-right: 1px solid var(--line);
}

.stat-item:last-child {
  border-right: 0;
}

.stat-item span,
.metric-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
}

.stat-item label,
.metric-card label {
  display: block;
  color: var(--muted);
  margin-bottom: 6px;
}

.stat-item strong {
  font-size: 28px;
  line-height: 1;
}

.blue span,
.metric-icon.blue {
  color: #1765ff;
  background: #e8efff;
}

.green span,
.metric-icon.green {
  color: var(--green);
  background: #ddf7ea;
}

.orange span,
.metric-icon.orange {
  color: var(--orange);
  background: #fff0db;
}

.red span,
.metric-icon.red {
  color: var(--red);
  background: #ffe3e6;
}

.metric-icon.purple {
  color: var(--purple);
  background: #eeeaff;
}

.data-panel,
.week-section,
.analysis-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(21, 32, 51, .06);
}

.data-panel {
  padding: 16px;
}

.el-table {
  --el-table-header-bg-color: #f7f9fc;
  --el-table-border-color: #e8edf5;
  font-size: 14px;
}

.el-button svg {
  margin-right: 6px;
}

.inline-progress {
  color: #596579;
  display: inline-block;
  min-width: 90px;
}

.week-section {
  margin-top: 14px;
  padding: 10px;
  overflow-x: auto;
}

.week-section h3 {
  margin: 0;
  padding: 0 0 10px 2px;
  font-size: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.metric-card {
  min-height: 84px;
  padding: 16px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  grid-template-columns: 42px 1fr;
  column-gap: 10px;
  align-items: center;
  box-shadow: 0 6px 16px rgba(21, 32, 51, .06);
}

.metric-card .metric-icon {
  width: 42px;
  height: 42px;
  grid-row: span 2;
}

.metric-card strong {
  font-size: 22px;
}

.analysis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.analysis-panel {
  padding: 14px;
  min-width: 0;
}

.panel-head {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.panel-head h3 {
  margin: 0;
  font-size: 18px;
}

.panel-head button {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
}

.bar-cell {
  width: 94px;
  height: 6px;
  border-radius: 999px;
  background: #e9edf5;
  overflow: hidden;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

.bar-cell span {
  display: block;
  height: 100%;
  max-width: 100%;
  background: linear-gradient(90deg, #18b86f, #1d63ff);
}

.range-mode {
  display: grid;
  gap: 18px;
  margin-bottom: 24px;
}

.drawer-block {
  padding: 18px 0;
}

@media (max-width: 1280px) {
  .app-shell {
    grid-template-columns: 240px 1fr;
  }

  .system-title {
    font-size: 18px;
  }

  .toolbar,
  .analysis-toolbar {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(4, minmax(150px, 1fr));
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .collapse-row {
    display: none;
  }

  .content {
    padding: 20px 14px;
  }

  .toolbar,
  .update-toolbar,
  .detail-toolbar,
  .analysis-toolbar,
  .analysis-grid,
  .stat-strip {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .stat-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
