:root {
  --ink: #1b1f23;
  --ink-soft: #4f575f;
  --muted: #7a838d;
  --line: #e5e8eb;
  --canvas: #f4f6f7;
  --panel: #ffffff;
  --accent: #f05a3c;
  --accent-deep: #d74429;
  --accent-soft: #fff0ec;
  --green: #14835f;
  --green-soft: #e8f6f0;
  --blue: #3079bd;
  --blue-soft: #eaf3fb;
  --sidebar: #191d22;
  --shadow: 0 8px 24px rgba(25, 29, 34, 0.08);
  --sidebar-width: 232px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(240, 90, 60, 0.18);
  outline-offset: 2px;
}

img {
  display: block;
  max-width: 100%;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  color: #fff;
  background: var(--sidebar);
  transition: transform 180ms ease;
}

.brand {
  display: flex;
  height: 76px;
  align-items: center;
  gap: 11px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.brand-copy strong {
  display: block;
  font-size: 17px;
  font-weight: 720;
  line-height: 1.15;
}

.brand-copy span {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
}

.sidebar-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  padding: 22px 14px;
}

.nav-label {
  padding: 0 12px 8px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 11px;
}

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  padding: 0 13px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  transition: color 150ms ease, background 150ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.active {
  color: #fff;
  background: rgba(240, 90, 60, 0.17);
}

.nav-item.active::before {
  position: absolute;
  inset: 8px auto 8px -14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  content: "";
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.sidebar-foot {
  margin: 0 14px 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.035);
}

.sidebar-foot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #fff;
  font-size: 12px;
}

.sidebar-foot p {
  margin: 9px 0 0;
  font-size: 11px;
  line-height: 1.6;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-left: var(--sidebar-width);
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.topbar-left,
.topbar-actions,
.profile-button {
  display: flex;
  align-items: center;
}

.topbar-left {
  min-width: 0;
  gap: 14px;
}

.mobile-menu {
  display: none;
}

.breadcrumb {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb strong {
  color: var(--ink);
  font-weight: 650;
}

.topbar-actions {
  position: relative;
  gap: 9px;
}

.icon-button,
.mobile-menu {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.icon-button:hover,
.mobile-menu:hover {
  background: #f7f8f9;
}

.icon-button svg,
.mobile-menu svg {
  width: 17px;
  height: 17px;
}

.notification-button::after {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -17px 0 0 15px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  content: "";
}

.profile-button {
  height: 38px;
  gap: 10px;
  padding: 0 7px 0 5px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
}

.profile-button:hover {
  border-color: var(--line);
  background: #f7f8f9;
}

.avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #313941;
  font-size: 12px;
  font-weight: 700;
}

.profile-copy {
  min-width: 0;
  text-align: left;
}

.profile-copy strong,
.profile-copy span {
  display: block;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy strong {
  font-size: 12px;
  font-weight: 650;
}

.profile-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.profile-button > svg {
  width: 14px;
  height: 14px;
  color: var(--muted);
}

.popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 70;
  width: 280px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.popover[hidden] {
  display: none;
}

.notice-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 10px;
  border-radius: 6px;
}

.notice-item + .notice-item {
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.notice-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
}

.notice-icon svg {
  width: 15px;
  height: 15px;
}

.notice-item strong {
  display: block;
  font-size: 12px;
}

.notice-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.content {
  margin-left: var(--sidebar-width);
  padding: 28px 30px 44px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.page-heading h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 720;
  line-height: 1.3;
}

.page-heading p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.secondary-button,
.text-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border-radius: 6px;
  font-weight: 620;
  white-space: nowrap;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
}

.secondary-button:hover {
  border-color: #cfd4d9;
  background: #fafafa;
}

.text-button {
  min-height: 32px;
  padding: 0 9px;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-weight: 560;
  text-decoration: none;
}

.text-button:hover:not(:disabled) {
  color: var(--accent);
  background: var(--accent-soft);
}

.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.secondary-button svg,
.text-button svg {
  width: 16px;
  height: 16px;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.summary-item {
  min-width: 0;
  padding: 20px 22px;
}

.summary-item + .summary-item {
  border-left: 1px solid var(--line);
}

.summary-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.summary-label svg {
  width: 15px;
  height: 15px;
}

.summary-value {
  margin-top: 10px;
  overflow: hidden;
  font-size: 26px;
  font-weight: 730;
  line-height: 1;
  text-overflow: ellipsis;
}

.summary-note {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.summary-note.positive {
  color: var(--green);
}

.earnings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(290px, 0.85fr);
  gap: 20px;
  margin-bottom: 20px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel-head {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 680;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.segment-control {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}

.segment-button {
  min-height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  white-space: nowrap;
}

.segment-button:hover {
  color: var(--ink);
  background: #f5f6f7;
}

.segment-button.active {
  color: var(--ink);
  background: #eef0f2;
  font-weight: 650;
}

.trend-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 0;
}

.trend-total {
  font-size: 28px;
  font-weight: 740;
}

.trend-total small {
  margin-left: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.trend-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--green);
  font-size: 11px;
}

.trend-change svg {
  width: 14px;
  height: 14px;
}

.chart-wrap {
  height: 280px;
  padding: 12px 18px 16px 8px;
}

.chart-wrap svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid {
  stroke: #edf0f2;
  stroke-width: 1;
}

.chart-label {
  fill: #8b939b;
  font-family: inherit;
  font-size: 10px;
}

.chart-area {
  fill: url("#chartAreaGradient");
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
}

.chart-dot {
  fill: #fff;
  stroke: var(--accent);
  stroke-width: 2;
}

.ranking-list {
  margin: 0;
  padding: 6px 20px 14px;
  list-style: none;
}

.ranking-item {
  display: grid;
  grid-template-columns: 24px 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 0;
}

.ranking-item + .ranking-item {
  border-top: 1px solid var(--line);
}

.rank-index {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.ranking-item:nth-child(-n+3) .rank-index {
  color: var(--accent);
}

.rank-thumb {
  width: 44px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 4px;
  background: #e9ebed;
}

.rank-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-name {
  min-width: 0;
}

.rank-name strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 620;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-name span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.rank-income {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 680;
  white-space: nowrap;
}

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

.settlement-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
}

.settlement-table th,
.settlement-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.settlement-table th {
  color: var(--muted);
  background: #fafbfb;
  font-size: 11px;
  font-weight: 620;
}

.settlement-table tbody tr {
  transition: background 120ms ease;
}

.settlement-table tbody tr:hover {
  background: #fcfcfd;
}

.settlement-table tbody tr:last-child td {
  border-bottom: 0;
}

.number-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.number-main {
  font-weight: 650;
}

.settlement-status {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.settled {
  color: var(--green);
  background: var(--green-soft);
}

.processing {
  color: var(--blue);
  background: var(--blue-soft);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  display: flex;
  max-width: min(360px, calc(100vw - 32px));
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border: 1px solid #cfe8dd;
  border-radius: 7px;
  color: #0f694c;
  background: #f1faf6;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast svg {
  width: 17px;
  height: 17px;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: none;
  background: rgba(0, 0, 0, 0.42);
}

@media (max-width: 1080px) {
  .summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-item:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .summary-item:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .earnings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    width: 232px;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.show {
    display: block;
  }

  .mobile-menu {
    display: inline-grid;
  }

  .topbar {
    padding: 0 18px;
  }

  .content {
    padding: 24px 18px 38px;
  }
}

@media (max-width: 620px) {
  .topbar {
    height: 58px;
    padding: 0 14px;
  }

  .profile-copy,
  .profile-button > svg {
    display: none;
  }

  .profile-button {
    padding: 0;
  }

  .content {
    padding: 20px 14px 32px;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: 19px;
  }

  .page-heading h1 {
    font-size: 22px;
  }

  .page-heading .secondary-button {
    width: 100%;
  }

  .summary-strip {
    grid-template-columns: 1fr 1fr;
  }

  .summary-item {
    padding: 17px 15px;
  }

  .summary-value {
    font-size: 22px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .segment-control {
    width: 100%;
  }

  .segment-button {
    flex: 1;
  }

  .trend-summary {
    padding: 18px 16px 0;
  }

  .trend-total {
    font-size: 24px;
  }

  .chart-wrap {
    height: 245px;
    padding-left: 0;
  }

  .ranking-list {
    padding-inline: 14px;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }
}
