:root {
  /* 方案 B · 芭比泡泡糖（高甜元气热粉主题） */
  --paper: #ffcce2;
  --paper-2: rgba(255, 243, 248, 0.95);
  --paper-milk: #fff6fa;
  --ink: #441f31;
  --ink-2: #824964;
  --ink-3: #ac6f8c;
  --line: #ffadd0;
  --line-2: #ffd1e5;

  /* 语义色：芭比热粉体系 */
  --green: #ff4d94;          /* 芭比主热粉 */
  --green-deep: #d92670;     /* 深按/高对比文字粉 */
  --green-soft: #ffdce9;     /* 柔粉浅底 */
  --gold: #ff7ab0;           /* 元气辅助粉 */
  --gold-soft: #ffe8f2;
  --red: #d92652;            /* 负值警示红 */
  --red-soft: #ffe3eb;

  --grad-pink: linear-gradient(135deg, #ff4d94 0%, #ff7ab0 100%);
  --grad-pink-hover: linear-gradient(135deg, #f23882 0%, #ff63a2 100%);
  --grad-topbar: linear-gradient(135deg, #ff5b9b 0%, #ff7bb0 100%);
  --grad-hero: linear-gradient(135deg, #ff4d94 0%, #ff7bb0 100%);
  --grad-share: linear-gradient(145deg, #ffe2ef 0%, #ffcee3 100%);
  --grad-total: linear-gradient(90deg, #ffcee3 0%, #ffdfed 100%);

  --shadow-sm: 0 6px 20px rgba(255, 77, 148, 0.14);
  --shadow-md: 0 12px 30px rgba(255, 77, 148, 0.22);
  --shadow-lg: 0 24px 56px rgba(217, 38, 112, 0.24);
  --ring: 0 0 0 3px rgba(255, 77, 148, 0.26);

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* 统一温柔圆润的字体体系 */
  --num-font: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "PingFang SC", -apple-system, sans-serif;
  --title-font: ui-rounded, "SF Pro Rounded", "Yuanti SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--paper);
  /* 芭比泡泡糖高甜粉底 + 纯白波点 */
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.62) 1.6px, transparent 1.6px),
    linear-gradient(165deg, #ffc4dd 0%, #ffdfed 54%, #ffcbe2 100%);
  background-size: 22px 22px, 100% 100%;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 细腻飘浮樱花与小爱心背景点缀 */
.sakura-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.deco-petal { position: absolute; filter: drop-shadow(0 6px 14px rgba(255, 107, 159, 0.18)); }
.deco-1 { top: 84px; right: 28px; transform: rotate(14deg); }
.deco-2 { bottom: 48px; left: 24px; transform: rotate(-16deg); }
.deco-3 { top: 118px; right: 96px; transform: rotate(-14deg); }

.topbar, .tabs-wrap, .main { position: relative; z-index: 1; }

/* 奶粉色滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #ffe4f0; }
::-webkit-scrollbar-thumb { background: #ff8dbd; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #ff62a3; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--grad-topbar);
  border-bottom: 1px solid #ff4d94;
  box-shadow: 0 6px 20px rgba(255, 77, 148, 0.22);
}
.topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-badge {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.80);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(176, 26, 92, 0.22);
  overflow: hidden;
  flex-shrink: 0;
}
.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.brand-title-row {
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.2;
}
.brand-mark {
  font-family: var(--title-font);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(176, 26, 92, 0.16);
}
.brand-heart {
  font-size: 13px;
  color: #ffe6f2;
  transform: translateY(-1px);
}
.brand-name {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.90);
  letter-spacing: .8px;
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.tool-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.month-control {
  height: 36px;
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  padding: 0 4px;
  transition: border-color .2s, box-shadow .2s;
}
.month-control:focus-within {
  border-color: var(--green);
  box-shadow: var(--ring);
}
.month-step {
  appearance: none;
  border: 0;
  background: transparent;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.month-step:hover {
  background: #fff1f6;
  color: var(--green-deep);
}
.month-picker {
  height: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 6px;
  color: var(--green);
  font-size: 12.5px;
}
.month-picker span { color: var(--ink-3); font-weight: 500; }
.month-picker input {
  font-family: var(--num-font);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  background: transparent;
  border: 0;
  padding: 0 2px;
  cursor: pointer;
}
.month-picker input:focus { outline: none; }

/* ---------- tabs ---------- */
.tabs-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 32px 0;
}
.tabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  background: rgba(255, 242, 248, 0.94);
  border: 1px solid #ffadd0;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  max-width: 100%;
}
.tab {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-family: var(--title-font);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s ease;
}
.tab:hover {
  color: var(--green-deep);
  background: #fff3f8;
}
.tab.is-active {
  color: #fff;
  background: var(--grad-pink);
  box-shadow: 0 6px 16px rgba(255, 107, 159, 0.32);
  font-weight: 600;
}

/* ---------- layout ---------- */
.main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 32px 80px;
}
.loading {
  color: var(--ink-3);
  padding: 56px 0;
  text-align: center;
  font-size: 14px;
}
.section { margin-bottom: 30px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--title-font);
  font-size: 15.5px;
  letter-spacing: .5px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
/* 迷你五瓣小樱花标题前缀 */
.section-title::before {
  content: "";
  width: 16px;
  height: 16px;
  display: inline-block;
  flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg transform='translate(12 12)' fill='%23ff4d94'%3E%3Cellipse rx='2.8' ry='4.9' transform='rotate(0) translate(0 -4)'/%3E%3Cellipse rx='2.8' ry='4.9' transform='rotate(72) translate(0 -4)'/%3E%3Cellipse rx='2.8' ry='4.9' transform='rotate(144) translate(0 -4)'/%3E%3Cellipse rx='2.8' ry='4.9' transform='rotate(216) translate(0 -4)'/%3E%3Cellipse rx='2.8' ry='4.9' transform='rotate(288) translate(0 -4)'/%3E%3Ccircle r='2.1' fill='%23fff2b2'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
.section-sub {
  color: var(--ink-3);
  font-size: 12px;
  letter-spacing: .2px;
}

/* ---------- cards & Bento 视觉重心 ---------- */
.grid { display: grid; gap: 14px; }

/*
 * 视觉重心重构：5 张经营指标卡采用 Hero + 2x2 Bento 布局
 * 左侧整列留给 C 位「净利润」大女主樱花主卡，右侧 2x2 舒展排列 4 张次级指标卡
 */
.grid-5 {
  grid-template-columns: minmax(250px, 1.24fr) repeat(2, minmax(0, 1fr));
  grid-auto-flow: dense;
  align-items: stretch;
}
.grid-5 > .card.is-accent {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px 26px 24px;
}
.grid-5 > .card.is-accent,
.grid-4 > .card.is-accent {
  background-color: #ff5b9b;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.24) 1.5px, transparent 1.5px),
    var(--grad-hero);
  background-size: 16px 16px, 100% 100%;
  border: 1px solid #ff4d94;
  box-shadow: 0 14px 34px rgba(255, 77, 148, 0.34);
  color: #ffffff;
}
.grid-5 > .card.is-accent::after,
.grid-4 > .card.is-accent::after {
  opacity: 0.95;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cg transform='translate(28 20)' fill='%23ffffff' opacity='0.34'%3E%3Cellipse rx='5' ry='9' transform='rotate(0) translate(0 -7.4)'/%3E%3Cellipse rx='5' ry='9' transform='rotate(72) translate(0 -7.4)'/%3E%3Cellipse rx='5' ry='9' transform='rotate(144) translate(0 -7.4)'/%3E%3Cellipse rx='5' ry='9' transform='rotate(216) translate(0 -7.4)'/%3E%3Cellipse rx='5' ry='9' transform='rotate(288) translate(0 -7.4)'/%3E%3Ccircle r='3.5' fill='%23fff6cc' opacity='0.9'/%3E%3C/g%3E%3Cpath d='M12 38s-5-3.1-5-6.7c0-2 1.5-3.3 3.2-3.3 1 0 1.8.6 1.8 1.3 0-.7.8-1.3 1.8-1.3 1.7 0 3.2 1.3 3.2 3.3C17 34.9 12 38 12 38z' fill='%23ffffff' opacity='0.38'/%3E%3C/svg%3E") center / contain no-repeat;
}
.grid-5 > .card.is-accent .card-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.36);
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
}
.grid-4 > .card.is-accent .card-label {
  color: rgba(255, 255, 255, 0.94);
  font-weight: 600;
}
.grid-5 > .card.is-accent .card-label::before {
  content: "♡";
  font-size: 12px;
  color: #ffffff;
}
.grid-5 > .card.is-accent .card-value,
.grid-5 > .card.is-accent .card-value.sm {
  font-size: clamp(32px, 3vw, 40px);
  font-weight: 700;
  margin-top: 14px;
  letter-spacing: -.4px;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(176, 20, 86, 0.16);
}
.grid-4 > .card.is-accent .card-value,
.grid-4 > .card.is-accent .card-value.sm {
  color: #ffffff;
  font-weight: 700;
}
.grid-5 > .card.is-accent .card-value[style*="red"],
.grid-4 > .card.is-accent .card-value[style*="red"] {
  color: #fff3b0 !important;
}
.grid-5 > .card.is-accent .card-note,
.grid-4 > .card.is-accent .card-note {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.90);
}

/* 右侧 4 张次级指标卡：顶部对齐基线严丝合缝，绝不抢主角风头 */
.grid-5 > .card:not(.is-accent) {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.grid-5 > .card:not(.is-accent) .card-value {
  font-size: 22px;
  font-weight: 600;
  margin-top: 8px;
}
.grid-5 > .card:not(.is-accent) .card-note {
  font-size: 11px;
  margin-top: 6px;
}

.grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: stretch; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }

.card {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #ffbad3;
}
.card-label {
  font-family: var(--title-font);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  letter-spacing: .3px;
}
.card-value {
  font-family: var(--num-font);
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
  margin-top: 8px;
  letter-spacing: -.2px;
  color: var(--ink);
}
.card-value.sm { font-size: 21px; }
.card-value.neg { color: var(--red); }
.card-note {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 5px;
  line-height: 1.5;
}

/* 樱花奶昔渐变主卡（净利润 / 净利润分成） */
.card.is-accent {
  background-color: #ffe0ee;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.65) 1.5px, transparent 1.5px),
    var(--grad-share);
  background-size: 16px 16px, 100% 100%;
  border: 1px solid #ff94c0;
  box-shadow: 0 12px 28px rgba(255, 77, 148, 0.18);
}
/* 右上角半透明樱花浮雕装饰 */
.card.is-accent::after {
  content: "";
  position: absolute;
  top: 12px;
  right: 14px;
  width: 44px;
  height: 44px;
  pointer-events: none;
  opacity: 0.75;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cg transform='translate(28 20)' fill='%23ff94ba' opacity='0.55'%3E%3Cellipse rx='5' ry='9' transform='rotate(0) translate(0 -7.4)'/%3E%3Cellipse rx='5' ry='9' transform='rotate(72) translate(0 -7.4)'/%3E%3Cellipse rx='5' ry='9' transform='rotate(144) translate(0 -7.4)'/%3E%3Cellipse rx='5' ry='9' transform='rotate(216) translate(0 -7.4)'/%3E%3Cellipse rx='5' ry='9' transform='rotate(288) translate(0 -7.4)'/%3E%3Ccircle r='3.5' fill='%23fff6cc'/%3E%3C/g%3E%3Cpath d='M12 38s-5-3.1-5-6.7c0-2 1.5-3.3 3.2-3.3 1 0 1.8.6 1.8 1.3 0-.7.8-1.3 1.8-1.3 1.7 0 3.2 1.3 3.2 3.3C17 34.9 12 38 12 38z' fill='%23ff4d94' opacity='0.55'/%3E%3C/svg%3E") center / contain no-repeat;
}
.card.is-accent .card-label { color: #e02c78; font-weight: 600; }

/* 辅助奶桃轻亮卡（去掉生硬粗竖条，改为极柔和淡桃奶白） */
.card.is-gold {
  background: linear-gradient(155deg, #fff5fa 0%, #ffe6f1 100%);
  border: 1px solid #ffadd0;
}

.split-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed #ffd4e4;
  font-size: 13px;
}
.split-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.split-row .k { color: var(--ink-2); }
.split-row .v {
  font-family: var(--num-font);
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.card.is-accent .split-row .v { color: #e02c78; }

/* ---------- table ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper-2);
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 12px 10px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 16px; }
th:last-child, td:last-child { padding-right: 16px; }
th {
  background: #ffbdd8;
  color: #a81e58;
  font-family: var(--title-font);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .4px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}
tbody tr {
  border-bottom: 1px solid var(--line-2);
  transition: background-color .15s ease;
}
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: #ffe3f0; }
td { color: var(--ink); font-weight: 400; }
td.num {
  font-family: var(--num-font);
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
  font-weight: 500;
}
td.num-profit {
  font-weight: 600;
  color: #e02c78;
}
td.calc { color: var(--ink-2); }

/* 主播复合信息列：昵称 + 新/老标签 + 真实姓名 */
td.cell-anchor { white-space: nowrap; }
.anchor-main { display: flex; align-items: center; gap: 6px; }
.anchor-nick { font-weight: 500; color: var(--ink); }
.anchor-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.tag.tag-muted {
  color: var(--ink-3);
  border-color: var(--line-2);
  background: #fdf9fb;
  font-size: 11px;
  padding: 1px 7px;
}

/* 富内容单元格：仅任务明细允许换行，比例与状态标签始终横向单行不折行 */
td.cell-tasks { white-space: normal; }
td.cell-rate { white-space: nowrap; line-height: 1.35; }
td.cell-center { text-align: center; white-space: nowrap; }
td.cell-rate .tag {
  display: inline-block;
  margin-top: 5px;
  padding: 1px 8px;
  font-family: var(--sans);
  font-size: 11px;
  color: #e02c78;
  background: #fff2f7;
  border-color: #ffc2d8;
}

.task-list { display: grid; gap: 4px; min-width: 192px; }
.task-line {
  display: grid;
  grid-template-columns: minmax(78px, 1fr) 40px 68px;
  gap: 6px;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.5;
}
.task-name { color: var(--ink-2); text-align: left; }
.task-name em {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--ink-3);
  margin-left: 0;
  line-height: 1.35;
  white-space: nowrap;
}
.task-rate { color: var(--ink-3); text-align: right; font-family: var(--num-font); }
.task-amt { font-family: var(--num-font); font-variant-numeric: tabular-nums; font-size: 12.5px; text-align: right; font-weight: 600; }
.task-sum { border-top: 1px dashed var(--line); padding-top: 4px; margin-top: 2px; }
.task-sum .task-name, .task-sum .task-amt { color: #e02c78; font-weight: 600; }

td.total-row, tr.total-row td {
  background: var(--grad-total);
  font-weight: 600;
  color: #4a2e3b;
  border-top: 1px solid #ffcadf;
}

/* 奶甜胶囊标签 */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
  background: #fff9fb;
  white-space: nowrap;
}
.tag.lv {
  color: #e02c78;
  border-color: #ffc2d8;
  background: #fff1f6;
  font-family: var(--num-font);
  font-weight: 600;
}
.tag.new {
  color: #e02c78;
  border-color: #ffc2d8;
  background: #ffedf4;
  font-weight: 600;
}
.tag.warn {
  color: var(--red);
  border-color: #f8c6d0;
  background: var(--red-soft);
}

/* 表单里的生效比例实时预览 */
.rate-preview {
  margin-top: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #ffc7dc;
  border-left: 4px solid #ff4d94;
  background: #fff5f9;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.75;
}
.rate-preview b { color: #e02c78; font-weight: 600; }
.rate-preview .warn-text { color: var(--red); }
.rate-preview .ok-text { color: #e02c78; font-weight: 600; }

.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.link-btn {
  background: #ffe8f2;
  border: 1px solid #ffb8d6;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #e02c78;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--sans);
  transition: all .15s ease;
}
.link-btn:hover {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.link-btn.danger {
  background: #fff6f7;
  border-color: #fad4dc;
  color: var(--red);
}
.link-btn.danger:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--ink-3);
  border: 1.5px dashed #ffc4da;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.78);
}

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--title-font);
  font-size: 13px;
  font-weight: 500;
  padding: 0 18px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  transition: all .18s ease;
}
.btn:hover {
  border-color: #ff85b0;
  color: var(--green-deep);
  background: #fff8fb;
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--grad-pink);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(255, 107, 159, 0.34);
}
.btn-primary:hover {
  background: var(--grad-pink-hover);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px rgba(255, 107, 159, 0.42);
}
.btn-ghost { background: rgba(255, 255, 255, 0.90); }
.btn-sm { height: 32px; padding: 0 15px; font-size: 12.5px; }

/* ---------- form ---------- */
.form-grid { display: grid; gap: 14px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.wide, .field.field-full { grid-column: 1 / -1; }
.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.pill-badge {
  font-family: var(--num-font);
  font-size: 12px;
  font-weight: 600;
  color: #e02c78;
  background: #fff0f6;
  border: 1px solid #ffc2d8;
  border-radius: var(--radius-pill);
  padding: 1px 10px;
}
fieldset .field.wide {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
}
.field label { font-size: 12.5px; font-weight: 500; color: var(--ink-2); letter-spacing: .2px; }
.field .hint { font-size: 11px; color: var(--ink-3); }

input:not([type="checkbox"]):not([type="radio"]):not([type="month"]):not([type="hidden"]),
select, textarea {
  font-family: var(--sans);
  font-size: 13.5px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  width: 100%;
  transition: border-color .18s, box-shadow .18s, background-color .18s;
}
/* 定制圆润粉色下拉箭头，替代复古原生黑三角 */
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ff4d94' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: var(--ring);
}
select:disabled, input:disabled {
  background-color: #fef6f9;
  color: var(--ink-3);
  cursor: not-allowed;
}
textarea { min-height: 68px; resize: vertical; }

/* ---------- 现代粉嫩胶囊点选器 ---------- */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  transition: opacity .18s ease;
}
.pill-group.is-dense {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}
.pill-group.is-disabled {
  opacity: 0.44;
}
.pill-opt {
  appearance: none;
  border: 1px solid #ffcee0;
  background: #fff;
  color: var(--ink-2);
  font-family: var(--num-font);
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-align: center;
  transition: all .16s ease;
  user-select: none;
}
.pill-group.is-dense .pill-opt {
  padding: 7px 4px;
  font-size: 12.5px;
}
.pill-opt:hover:not(:disabled):not(.is-selected) {
  border-color: #ff85b0;
  background: #fff4f8;
  color: #e02c78;
}
.pill-opt:active:not(:disabled) {
  transform: scale(0.95);
}
.pill-opt.is-selected {
  background: var(--grad-pink);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(255, 107, 159, 0.32);
}
.pill-opt:disabled {
  cursor: not-allowed;
}

/* ---------- 圆润粉色滑动开关（Toggle Switch） ---------- */
.toggle-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.toggle-track {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #ffd6e6;
  flex-shrink: 0;
  transition: background .2s ease, box-shadow .2s ease;
}
.toggle-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(235, 77, 134, 0.24);
  transition: transform .2s cubic-bezier(.22, 1, .36, 1);
}
.toggle-input:checked + .toggle-track {
  background: var(--grad-pink);
  box-shadow: 0 3px 10px rgba(255, 107, 159, 0.32);
}
.toggle-input:checked + .toggle-track::after {
  transform: translateX(18px);
}
.toggle-input:focus-visible + .toggle-track {
  box-shadow: var(--ring);
}
.toggle-text {
  font-size: 13px;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.45;
}

/* 新主播月份分组与任务子卡 */
.month-block {
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line-2);
}
.month-block:last-child { margin-bottom: 2px; }

.task-cards {
  display: grid;
  gap: 10px;
}
.task-card {
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  padding: 12px 14px;
}
.task-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.task-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.task-card-hint {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-left: 8px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px 12px;
  margin: 0;
  grid-column: 1 / -1;
  background: #ffeff6;
}
legend {
  font-family: var(--title-font);
  font-size: 12px;
  font-weight: 600;
  color: #e02c78;
  padding: 2px 11px;
  background: #fff0f6;
  border-radius: var(--radius-pill);
  letter-spacing: .4px;
}
.switch-row { display: flex; align-items: center; gap: 10px; }
.switch-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
  cursor: pointer;
}

.device-list { display: grid; gap: 8px; margin-top: 10px; }
.device-row { display: grid; grid-template-columns: 124px 1fr 112px 34px; gap: 8px; align-items: center; }
.device-row .del {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  color: var(--ink-3);
  height: 36px;
  font-size: 16px;
  transition: all .15s;
}
.device-row .del:hover { color: var(--red); border-color: #f6c2cc; background: var(--red-soft); }
.device-total { text-align: right; font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.device-total b { font-family: var(--num-font); font-weight: 600; color: #e02c78; font-size: 15px; }

/* ---------- modal ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(82, 44, 62, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  overflow: hidden;
  z-index: 50;
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal {
  background: #fff6fa;
  border: 1px solid #ffadd0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 840px;
  max-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop .2s ease-out;
}
.modal-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  background: linear-gradient(90deg, #ffd8e9 0%, #ffebf4 100%);
  border-bottom: 1px solid var(--line);
}
.modal-head h3 {
  margin: 0;
  font-family: var(--title-font);
  font-size: 15.5px;
  letter-spacing: .5px;
  font-weight: 600;
  color: #e02c78;
}
.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.85);
  font-size: 18px;
  cursor: pointer;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.modal-close:hover { background: #ffe8f1; color: var(--green-deep); }
.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1 1 auto;
}
.modal-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  background: #ffedf5;
  border-top: 1px solid var(--line);
}
.modal-hint { margin-right: auto; font-size: 12px; color: var(--ink-3); }

/* ---------- misc ---------- */
.bars { display: grid; gap: 10px; margin-top: 10px; }
.bar-row { display: grid; grid-template-columns: 68px 1fr 104px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-track {
  height: 9px;
  background: #ffe8f1;
  border-radius: var(--radius-pill);
  position: relative;
  overflow: hidden;
}
.bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: var(--radius-pill);
  background: var(--grad-pink);
}
.bar-fill.gold { background: linear-gradient(90deg, #ffb3cf 0%, #ff88b3 100%); }
.bar-fill.red { background: linear-gradient(90deg, #f590a4 0%, #e05a74 100%); }
.bar-row .bar-label { color: var(--ink-2); font-weight: 500; }
.bar-row .bar-value { text-align: right; font-family: var(--num-font); font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 500; }

.note-box {
  border: 1px solid var(--line);
  border-left: 3.5px solid #ff85b0;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.82);
  line-height: 1.8;
}
.note-box b { color: #e02c78; font-weight: 600; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  background: var(--grad-pink);
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 26px rgba(255, 107, 159, 0.36);
  font-size: 13px;
  font-weight: 500;
  z-index: 90;
}
.toast.err { background: linear-gradient(135deg, #eb6c84 0%, #d44b66 100%); }

/* ---------- mobile-only / bottom-nav / card list ---------- */
.mobile-only { display: none; }
.bottom-nav { display: none; }

.m-list {
  display: none;
  gap: 12px;
}
.m-card {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 15px;
  box-shadow: var(--shadow-sm);
}
.m-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}
.m-card-title { min-width: 0; }
.m-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.m-name {
  font-family: var(--title-font);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.m-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 3px;
}
.m-profit {
  text-align: right;
  flex-shrink: 0;
}
.m-profit-lbl {
  display: block;
  font-size: 10.5px;
  color: var(--ink-3);
}
.m-profit-val {
  font-family: var(--num-font);
  font-variant-numeric: tabular-nums;
  font-size: 18px;
  font-weight: 600;
  color: #e02c78;
  line-height: 1.25;
}
.m-profit.is-neg .m-profit-val { color: var(--red); }

.m-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  margin-top: 10px;
}
.m-kv {
  background: #ffeef6;
  border: 1px solid #ffd1e5;
  border-radius: 11px;
  padding: 7px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.m-kv span {
  font-size: 11px;
  color: var(--ink-3);
}
.m-kv b {
  font-family: var(--num-font);
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.m-em {
  font-style: normal;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  color: #e02c78;
  background: #ffedf5;
  padding: 1px 6px;
  border-radius: 999px;
  margin-left: 3px;
}
.m-task-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ffe8f2;
  border: 1px solid #ffb8d6;
}
.m-task-box .task-list { min-width: 0; }
.m-card-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-2);
}
.m-card-foot .link-btn {
  padding: 5px 15px;
  font-size: 12.5px;
}

@media (max-width: 900px) {
  .grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-5 > .card.is-accent {
    order: -1;
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@keyframes sheetUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  body {
    background-attachment: scroll;
    -webkit-tap-highlight-color: transparent;
  }
  .deco-1, .deco-2, .deco-3 { display: none; }

  /* 桌面组件隐藏，移动端组件显示 */
  .desktop-only { display: none !important; }
  .mobile-only { display: grid; }
  .tabs-wrap { display: none; }

  /* 紧凑两行顶栏：手机端取消 sticky 与 backdrop-filter，避免与固定底栏在手机浏览器中产生 GPU 合成重影 */
  .topbar {
    position: relative;
    top: auto;
    background: var(--grad-topbar);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .topbar-inner {
    padding: 10px 14px 12px;
    gap: 10px;
    position: relative;
  }
  .brand { gap: 9px; }
  .brand-badge { width: 36px; height: 36px; border-radius: 11px; }
  .brand-mark { font-size: 16.5px; }
  .brand-name { font-size: 11px; }

  .topbar-tools {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }
  .month-control {
    flex: 1 1 auto;
    height: 38px;
    justify-content: space-between;
    padding: 0 6px;
  }
  .month-step {
    width: 32px;
    height: 32px;
    font-size: 19px;
    background: #fff5f9;
    color: #e02c78;
  }
  .month-picker {
    flex: 1;
    justify-content: center;
  }
  .month-label { display: none; }
  .month-picker input { font-size: 14px; text-align: center; }

  .tool-actions {
    position: absolute;
    top: 10px;
    right: 14px;
    gap: 6px;
  }
  .btn-tool {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
  }
  .btn-tool .btn-text { display: none; }

  /* 主内容区留足底部安全距，避免被底部导航栏遮挡 */
  .main {
    padding: 14px 14px calc(92px + env(safe-area-inset-bottom));
  }
  .section { margin-bottom: 22px; }
  .section-head { margin-bottom: 10px; gap: 8px; }
  .section-title { font-size: 14.5px; }
  .section-sub { font-size: 11.5px; }

  /* 首屏 1 大主卡 + 2x2 精致指标方阵 */
  .grid { gap: 10px; }
  .grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-5 > .card.is-accent {
    grid-column: 1 / -1;
    padding: 18px 18px 16px;
  }
  .grid-5 > .card.is-accent .card-value,
  .grid-5 > .card.is-accent .card-value.sm {
    font-size: 32px;
    margin-top: 10px;
  }
  .grid-5 > .card:not(.is-accent) {
    padding: 13px 13px;
  }
  .grid-5 > .card:not(.is-accent) .card-value,
  .grid-5 > .card:not(.is-accent) .card-value.sm {
    font-size: 18px;
    margin-top: 5px;
  }
  .grid-5 > .card:not(.is-accent) .card-note {
    font-size: 10.5px;
    line-height: 1.4;
    text-wrap: balance;
  }

  /* 得物 4 卡在手机上 2x2 整齐方阵 */
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-4 .card {
    padding: 13px 13px;
  }
  .grid-4 .card-value.sm {
    font-size: 18px;
    margin-top: 5px;
  }
  .grid-3, .grid-2 {
    grid-template-columns: 1fr;
  }
  .card {
    border-radius: 17px;
    padding: 15px 16px;
  }
  .card:hover { transform: none; }

  /* 手机端原生底部 Tab Bar：使用实心奶白底 + 独立合成层，防止重影与透字 */
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: #fff0f6;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: translate3d(0, 0, 0);
    border-top: 1px solid #ffadd0;
    box-shadow: 0 -6px 18px rgba(255, 107, 159, 0.12);
    padding: 6px 6px calc(7px + env(safe-area-inset-bottom));
  }
  .bnav-item {
    appearance: none;
    border: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 2px;
    border-radius: 14px;
    color: var(--ink-3);
    font-family: var(--title-font);
    font-size: 10.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color .18s, color .18s;
  }
  .bnav-item.is-active {
    color: #d82670;
    background: #ffd4e7;
    font-weight: 600;
  }
  .bnav-item.is-active svg {
    stroke-width: 2.2;
  }

  /* 手机端底部抽屉式弹窗（Bottom Sheet） */
  .modal-mask {
    align-items: flex-end;
    padding: 0;
  }
  .modal {
    max-width: 100%;
    max-height: 90dvh;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    animation: sheetUp .24s cubic-bezier(.22, 1, .36, 1);
  }
  .modal-head {
    position: relative;
    padding: 18px 18px 13px;
  }
  .modal-head::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    transform: translateX(-50%);
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: #ffbdd5;
  }
  .modal-body {
    padding: 16px 16px 18px;
  }
  .modal-foot {
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  }
  .modal-hint {
    width: 100%;
    font-size: 11px;
    margin-bottom: 2px;
  }
  .modal-foot .btn {
    flex: 1 1 0;
    height: 42px;
    font-size: 14px;
  }

  /* 表单 16px 防 iOS Safari 自动缩放 */
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="month"]):not([type="hidden"]),
  select, textarea {
    font-size: 16px;
    padding: 10px 12px;
  }
  select { padding-right: 34px; }
  .pill-group.is-dense {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }
  .pill-opt {
    padding: 8px 13px;
    font-size: 13px;
  }
  .task-card-hint {
    display: block;
    margin-left: 0;
    margin-top: 2px;
  }
  .device-row {
    grid-template-columns: 1fr 1fr 38px;
    gap: 8px;
  }
  .device-row input[data-dk="item_note"] {
    grid-column: 1 / -1;
    order: 4;
  }
  .device-row .del {
    height: 42px;
  }

  .bar-row {
    grid-template-columns: 58px 1fr 86px;
    gap: 8px;
    font-size: 12px;
  }
  .note-box { font-size: 12px; padding: 10px 12px; }

  .toast {
    bottom: calc(80px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 32px);
    text-align: center;
  }
}
