:root {
  /* 取自 kelanling.com 的纸色、林绿和金色 */
  --bg: #fbfaf6;
  --panel: #ffffff;
  --cream: #f4f0e8;
  --gold: #b99755;
  --gold-soft: #f4f0e8;
  --rose: #6f405f;
  --teal: #557866;
  --ink: #183a32;
  --ink-2: #244c41;
  --muted: #71817b;
  --line: rgba(24, 58, 50, 0.14);
  --warn: #b99755;
  --shadow: 0 10px 35px rgba(24, 58, 50, 0.06);
  --radius: 22px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  color: #1d2d29;
  background: var(--bg);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body {
  overflow: hidden;
}

body.page-list {
  overflow: hidden;
}

.aura {
  position: fixed;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.aura-left {
  left: -12vw;
  top: -16vw;
  background: rgba(127, 154, 132, 0.22);
}

.aura-right {
  right: -10vw;
  bottom: -18vw;
  background: rgba(185, 151, 85, 0.16);
}

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.app-main {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow: auto;
}

.sidebar {
  display: flex;
  flex-direction: column;
  flex: 0 0 228px;
  width: 228px;
  height: 100vh;
  padding: 18px 14px 12px;
  background: #fff;
  border-right: 1px solid var(--line);
  z-index: 2;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.sidebar-brand strong {
  display: block;
  color: var(--ink);
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 18px;
  letter-spacing: 0.08em;
}

.sidebar-brand em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.sidebar-action {
  display: block;
  margin: 18px 0 8px;
  padding: 11px 14px;
  color: var(--cream);
  background: var(--ink);
  border-radius: 999px;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.12em;
  font-size: 14px;
}

.sidebar-action.is-active {
  background: var(--ink-2);
}

.sidebar-nav,
.sidebar-stores {
  margin-top: 16px;
}

.sidebar-nav p,
.sidebar-stores p {
  margin: 0 8px 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.16em;
}

.sidebar-nav a,
.sidebar-store-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  padding: 9px 10px;
  color: var(--ink-2);
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
}

.sidebar-nav a svg {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.sidebar-nav a:hover,
.sidebar-store-list a:hover {
  background: var(--cream);
}

.sidebar-nav a.is-active,
.sidebar-store-list a.is-active {
  color: var(--cream);
  background: var(--ink);
}

.sidebar-stores {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
}

.sidebar-filter {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.sidebar-store-list {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 246px;
  scrollbar-width: thin;
  scrollbar-color: var(--leaf) transparent;
}

.sidebar-account {
  flex: none;
  margin-top: 4px;
}

.frame {
  position: relative;
  z-index: 1;
  min-height: 100%;
  padding: 16px 20px 18px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 0 4px 12px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 280px;
  min-width: 240px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #6f8f7c, var(--ink) 62%, #10241f);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.eyebrow:before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

.brand h1,
.topbar h1 {
  margin-top: 6px;
  color: var(--ink);
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.06em;
}

.topbar-side {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.store-nav,
.page-nav {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  overflow: hidden;
}

.store-nav a,
.page-nav a {

  display: flex;
  align-items: center;
  height: 100%;
  min-height: 44px;
  padding: 0 14px;
  color: var(--teal);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.store-nav a.is-active,
.page-nav a.is-active {
  color: var(--gold-soft);
  background: var(--ink);
}

.meta-chip {
  min-width: 148px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.meta-chip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.16em;
}

.meta-chip strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  min-height: 0;
}

.kpi-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.kpi-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: var(--gold);
}

.kpi-icon svg {
  width: 42px;
  height: 42px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-card label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.kpi-card strong {
  display: block;
  margin-top: 4px;
  font-size: 26px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.kpi-card em {
  margin-left: 6px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
  font-weight: 400;
}

.panel {
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px 10px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.panel-head h2 {
  color: var(--ink);
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.panel-head span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.chart {
  flex: 1;
  min-height: 0;
}

.table-wrap {
  margin-top: 8px;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 10px 8px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.08em;
  position: sticky;
  top: 0;
  background: var(--cream);
}

td {
  color: var(--ink);
}

.times {
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid currentColor;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.tag-green {
  color: #2f7d46;
}

.tag-yellow {
  color: #9a7424;
}

.tag-red {
  color: #8f3d3d;
}

.tag-unpaid {
  color: var(--rose);
}

.detail-link {
  display: inline-block;
  padding: 6px 14px;
  color: var(--gold-soft);
  background: var(--ink);
  border-radius: 999px;
  text-decoration: none;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.idle-text {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.remain-text {
  color: var(--ink-2);
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .kpi-row {
    grid-template-columns: 1fr 1fr;
  }

  .chart {
    flex: none;
    height: 280px;
    min-height: 280px;
  }
}

@media (max-width: 720px) {
  html,
  body,
  .app-shell,
  .app-main,
  .sidebar {
    height: auto;
    overflow: visible;
  }

  .app-shell {
    display: block;
  }

  .sidebar {
    width: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-store-list {
    max-height: 246px;
  }
}
