/* Creator Rewards Program
   手机网页。不画状态栏、电量、信号和机框。 */

:root {
  --text: #161616;
  --muted: #8d8d8d;
  --line: #e6e6e6;
  --chip: #ececec;
  --link: #fe2c55;
  --std: #3b6dff;
  --extra: #2ec8e0;
  --act: #f2c431;
  --page: 30rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
  color-scheme: light;
}

body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family: "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Noto Sans JP", Meiryo, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  color: inherit;
}

.app {
  width: min(100%, var(--page));
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 1.5rem;
  background: #fff;
}

/* ---------- 顶栏 ---------- */

.top {
  display: grid;
  grid-template-columns: 2.6rem 1fr 2.6rem;
  align-items: center;
  min-height: 3.6rem;
  padding: 0.55rem 0.45rem 0.15rem;
}

.title-block {
  text-align: center;
}

.title-block h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.title-block p {
  margin: 0.12rem 0 0;
  color: #9a9a9a;
  font-size: 0.72rem;
  line-height: 1.3;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.icon-btn svg {
  width: 1.45rem;
  height: 1.45rem;
}

.close svg {
  width: 1.15rem;
  height: 1.15rem;
}

/* ---------- 欢迎条 ---------- */

.banner {
  padding: 0.35rem 1rem 0.15rem;
}

.banner-top {
  display: grid;
  grid-template-columns: 1.45rem 1fr 1.45rem;
  align-items: center;
  column-gap: 0.55rem;
}

.bell {
  width: 1.35rem;
  height: 1.35rem;
}

.banner h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.banner-body {
  margin: 0.55rem 0 0 2rem;
  color: #3a3a3a;
  font-size: 0.95rem;
  line-height: 1.55;
}

.text-link {
  display: inline-block;
  margin: 0.85rem 0 0.2rem 2rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font-size: 0.98rem;
  font-weight: 600;
  cursor: pointer;
}

.text-link:hover {
  opacity: 0.8;
}

/* ---------- 切换 ---------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 1.15rem 1rem 0;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  border: 0;
  border-radius: 999px;
  padding: 0.42rem 0.95rem;
  background: var(--chip);
  color: #1a1a1a;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.tab svg {
  width: 0.85rem;
  height: 0.85rem;
}

.tab.is-on {
  background: #111;
  color: #fff;
}

.tab-pop {
  position: relative;
}

.menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 6;
  min-width: 15.5rem;
  padding: 0.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.menu button {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 0;
  border-radius: 0.5rem;
  background: #f5f5f5;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
}

/* ---------- 金额 ---------- */

.summary {
  margin: 1.35rem 1rem 0;
}

.head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.head-row h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.info {
  display: inline-grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.12rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #9a9a9a;
  vertical-align: -0.18rem;
  cursor: pointer;
}

.info svg {
  width: 1rem;
  height: 1rem;
}

.period {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.1rem;
  color: #222;
  font-size: 0.95rem;
  font-weight: 600;
}

.period.is-static .arrow {
  visibility: hidden;
}

.arrow {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.arrow svg {
  width: 1rem;
  height: 1rem;
}

.bubble {
  margin: 0.55rem 0 0;
  padding: 0.55rem 0.7rem;
  color: #333;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
  font-size: 0.78rem;
  line-height: 1.5;
}

.amount {
  margin: 0.45rem 0 0;
  font-size: clamp(2.15rem, 9vw, 2.65rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.range {
  margin: 0.45rem 0 0;
  color: #8a8a8a;
  font-size: 0.95rem;
}

/* ---------- 明细卡片 ---------- */

.sheet {
  margin: 0.85rem 1rem 0;
  border: 1px solid #e5e5e5;
  border-radius: 0.9rem;
  overflow: hidden;
}

.sheet + .sheet {
  margin-top: 0.7rem;
}

.row,
.sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  background: #fff;
}

.row {
  padding: 0.95rem 0.85rem;
  border: 0;
  font-size: 0.98rem;
  text-align: left;
}

button.row {
  cursor: pointer;
}

.subs {
  padding: 0 0.85rem 0.85rem;
}

.sub {
  padding: 0.38rem 0;
  font-size: 0.95rem;
}

.name,
.tail {
  display: flex;
  align-items: center;
  min-width: 0;
}

.name {
  gap: 0.45rem;
}

.tail {
  flex: 0 0 auto;
  gap: 0.15rem;
  font-variant-numeric: tabular-nums;
}

.chev {
  width: 0.95rem;
  height: 0.95rem;
  color: #b0b0b0;
}

.dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 0.12rem;
  flex: 0 0 auto;
}

.dot.std { background: var(--std); }
.dot.extra { background: var(--extra); }
.dot.act { background: var(--act); }

.note {
  margin: 0.8rem 1rem 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.65;
}

.note .info {
  margin-left: 0.15rem;
}

/* ---------- 柱状图 ---------- */

.chart-box {
  display: grid;
  grid-template-columns: 2.15rem minmax(0, 1fr);
  height: 15.5rem;
  margin: 0.85rem 0.7rem 0 0.35rem;
}

.y-axis {
  position: relative;
  color: #a3a3a3;
  font-size: 0.72rem;
}

.y-axis span {
  position: absolute;
  right: 0.28rem;
  transform: translateY(-50%);
  line-height: 1;
}

.y-axis span:nth-child(1) { top: 0.35rem; }
.y-axis span:nth-child(2) { top: calc(0.35rem + (100% - 0.7rem) * 0.3333); }
.y-axis span:nth-child(3) { top: calc(0.35rem + (100% - 0.7rem) * 0.6667); }
.y-axis span:nth-child(4) { top: calc(100% - 0.35rem); }

.plot {
  position: relative;
  min-width: 0;
}

.grid i,
.bars {
  position: absolute;
  left: 0;
  right: 0.15rem;
}

.grid i {
  right: 0.15rem;
  border-top: 1px solid #ececec;
}

.grid i:nth-child(1) { top: 0.35rem; }
.grid i:nth-child(2) { top: calc(0.35rem + (100% - 0.7rem) * 0.3333); }
.grid i:nth-child(3) { top: calc(0.35rem + (100% - 0.7rem) * 0.6667); }
.grid i:nth-child(4) { top: calc(100% - 0.35rem); }

.bars {
  top: 0.35rem;
  bottom: 0.35rem;
  display: flex;
  align-items: stretch;
  gap: 2px;
}

.bar {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.seg {
  position: absolute;
  left: 0;
  width: 100%;
}

.seg.std { background: var(--std); }
.seg.extra { background: var(--extra); }
.seg.act { background: var(--act); }

.bar:hover .seg,
.bar.is-on .seg {
  filter: brightness(0.92);
}

.tip {
  position: absolute;
  z-index: 2;
  width: min(16.4rem, 92%);
  padding: 0.75rem 0.8rem 0.65rem;
  background: #fff;
  border-radius: 0.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.tip[hidden] {
  display: none;
}

.tip-top,
.tip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.tip-top {
  margin-bottom: 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
}

.tip-row {
  margin-top: 0.38rem;
  font-size: 0.84rem;
}

.tip-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.tip-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tip .money {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.icon-btn:focus-visible,
.tab:focus-visible,
.text-link:focus-visible,
.arrow:focus-visible,
.info:focus-visible,
.row:focus-visible,
.bar:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

@media (max-width: 359px) {
  .title-block h1 {
    font-size: 0.92rem;
  }

  .banner-body,
  .range {
    font-size: 0.86rem;
  }

  .tab {
    padding: 0.38rem 0.72rem;
    font-size: 0.82rem;
  }

  .amount {
    font-size: 2rem;
  }

  .chart-box {
    height: 13.5rem;
  }
}

@media (min-width: 768px) {
  .app {
    min-height: 100vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
