/* 家务分摊计算器 —— 莓果粉 · 转盘与排班 */
.c60{
  --a:#be185d;
  --a2:#f472b6;
  --a-soft:rgba(190,24,93,.10);
  --a-line:rgba(190,24,93,.26);
}

/* 首屏：粉纸 + 便签横线 */
.c60-hero{
  background:
    radial-gradient(700px 300px at 8% 0%, rgba(255,255,255,.9), transparent 62%),
    repeating-linear-gradient(0deg, rgba(190,24,93,.05) 0 1px, transparent 1px 28px),
    linear-gradient(130deg, #fdf2f8 0%, #fce7f3 48%, #fff1f2 100%);
}
:root[data-theme="dark"] .c60-hero{
  background:
    radial-gradient(700px 300px at 8% 0%, rgba(244,114,182,.13), transparent 62%),
    repeating-linear-gradient(0deg, rgba(244,114,182,.05) 0 1px, transparent 1px 28px),
    linear-gradient(130deg,#1b0713 0%,#260a1a 48%,#0e1626 100%);
}

/* 自绘：家务转盘 + 排班便签 */
.c60-hero-art .ch-wheel{
  position:absolute;
  left:14px;
  top:20px;
  width:150px;
  height:150px;
  border-radius:50%;
  background:conic-gradient(#be185d 0 25%, #f472b6 25% 50%, #fbcfe8 50% 75%, #db2777 75% 100%);
  box-shadow:0 16px 30px rgba(190,24,93,.24);
  display:grid;
  place-items:center;
  animation:ch-turn 22s linear infinite;
}
@keyframes ch-turn{to{transform:rotate(360deg);}}
.c60-hero-art .ch-ring{
  position:absolute;
  inset:9px;
  border-radius:50%;
  border:2px dashed rgba(255,255,255,.62);
}
.c60-hero-art .ch-core{
  width:72px;
  height:72px;
  border-radius:50%;
  background:linear-gradient(160deg,#ffffff,#fdf2f8);
  display:grid;
  place-items:center;
  color:#be185d;
  font-size:11px;
  font-weight:800;
  line-height:1.25;
  letter-spacing:1px;
  box-shadow:0 4px 12px rgba(190,24,93,.18);
  animation:ch-turn-rev 22s linear infinite;
}
.c60-hero-art .ch-core b{font-size:14px;}
@keyframes ch-turn-rev{to{transform:rotate(-360deg);}}
.c60-hero-art .ch-dot{
  position:absolute;
  width:13px;
  height:13px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 0 0 3px rgba(190,24,93,.18);
}
.c60-hero-art .ch-dot.d1{left:18px;top:34px;}
.c60-hero-art .ch-dot.d2{right:22px;top:64px;}
.c60-hero-art .ch-dot.d3{left:52px;bottom:20px;}
.c60-hero-art .ch-note{
  position:absolute;
  right:2px;
  top:78px;
  width:112px;
  padding:11px 12px 12px;
  border-radius:8px;
  background:linear-gradient(170deg,#ffffff,#fdf2f8);
  border:1px solid rgba(190,24,93,.24);
  box-shadow:0 12px 24px rgba(190,24,93,.16);
  transform:rotate(5deg);
}
.c60-hero-art .ch-note::before{
  content:"本周排班";
  display:block;
  margin-bottom:7px;
  font-size:9.5px;
  font-weight:900;
  letter-spacing:2px;
  color:#be185d;
}
.c60-hero-art .ch-note i{
  display:block;
  height:6px;
  margin-bottom:6px;
  border-radius:4px;
  background:rgba(190,24,93,.16);
}
.c60-hero-art .ch-note i:nth-child(1){width:86%;background:rgba(190,24,93,.5);}
.c60-hero-art .ch-note i:nth-child(2){width:64%;}
.c60-hero-art .ch-note i:nth-child(3){width:92%;}
.c60-hero-art .ch-note i:nth-child(4){width:48%;}
:root[data-theme="dark"] .c60-hero-art .ch-wheel{
  background:conic-gradient(#be185d 0 25%, #f472b6 25% 50%, #9d174d 50% 75%, #db2777 75% 100%);
  box-shadow:0 16px 30px rgba(0,0,0,.45);
}
:root[data-theme="dark"] .c60-hero-art .ch-core{
  background:linear-gradient(160deg,#1a0812,#12060d);
  color:#f472b6;
}
:root[data-theme="dark"] .c60-hero-art .ch-note{
  background:linear-gradient(170deg,#160812,#10050b);
  border-color:rgba(244,114,182,.28);
}
:root[data-theme="dark"] .c60-hero-art .ch-note::before{color:#f472b6;}
:root[data-theme="dark"] .c60-hero-art .ch-note i{background:rgba(244,114,182,.18);}
:root[data-theme="dark"] .c60-hero-art .ch-note i:nth-child(1){background:rgba(244,114,182,.5);}
:root[data-theme="dark"] .c60-hero-art .chip{background:rgba(14,22,38,.9);border-color:var(--line);}
:root[data-theme="dark"] .c60-hero-art .chip b{color:#f472b6;}

/* 主结果：莓果渐变 */
.c60-metric.is-hero{
  background:linear-gradient(135deg,#831843,#be185d 48%,#e11d48 100%);
  box-shadow:0 16px 34px rgba(190,24,93,.3);
}
.c60-metric.is-hero .v{font-size:clamp(30px,3.6vw,44px);}

/* 家务 / 成员行编辑器 */
.ch-row-head,
.ch-row,
.ch-mem-head,
.ch-row-mem{
  display:grid;
  gap:8px;
  align-items:center;
}
.ch-row-head,
.ch-row{grid-template-columns:minmax(0,1.6fr) 62px 74px 68px 30px;}
.ch-mem-head,
.ch-row-mem{grid-template-columns:minmax(0,1.2fr) 96px minmax(0,1fr) 30px;}
.ch-row-head,
.ch-mem-head{
  margin:2px 0 6px;
  padding:0 3px;
  font-size:10.5px;
  font-weight:800;
  color:var(--muted);
  letter-spacing:.3px;
}
.ch-mem-head{margin-top:2px;}
.ch-rows{display:flex;flex-direction:column;gap:7px;margin-bottom:8px;}
.ch-row,
.ch-row-mem{
  padding:6px;
  border-radius:10px;
  background:var(--soft);
  border:1px solid transparent;
  transition:border-color .16s,background .16s;
}
.ch-row:focus-within,
.ch-row-mem:focus-within{background:var(--card);border-color:var(--a-line);}
.ch-row.is-bad,
.ch-row-mem.is-bad{background:var(--err-soft);border-color:rgba(220,38,38,.4);}
.ch-row input,
.ch-row select,
.ch-row-mem input{
  width:100%;
  min-width:0;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--card);
  color:var(--ink);
  font-family:var(--font);
  font-size:12.5px;
  font-weight:700;
  padding:7px 8px;
  outline:0;
}
.ch-row input:focus,
.ch-row select:focus,
.ch-row-mem input:focus{border-color:var(--a);box-shadow:0 0 0 3px rgba(190,24,93,.12);}
.ch-row select{
  appearance:none;
  padding-right:18px;
  cursor:pointer;
  background-image:linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%);
  background-position:calc(100% - 11px) 55%,calc(100% - 6px) 55%;
  background-size:4px 4px,4px 4px;
  background-repeat:no-repeat;
}
.ch-del{
  width:27px;height:27px;
  border-radius:8px;
  border:1px solid var(--line);
  background:var(--card);
  color:var(--muted);
  font-size:15px;
  line-height:1;
  cursor:pointer;
}
.ch-del:hover{border-color:var(--err);color:var(--err);}
.ch-err{
  grid-column:1/-1;
  font-size:11px;
  font-weight:700;
  color:var(--err);
}
:root[data-theme="dark"] .ch-row input,
:root[data-theme="dark"] .ch-row select,
:root[data-theme="dark"] .ch-row-mem input,
:root[data-theme="dark"] .ch-del{background:#191019;}

/* 容差滑杆刻度 */
.ch-tol-scale{
  display:flex;
  justify-content:space-between;
  margin:-2px 0 4px;
  font-size:10.5px;
  font-weight:700;
  color:var(--muted);
}
#chTol{background:linear-gradient(to right,#be185d 0%,#f472b6 44%,var(--soft) 100%);}
#chTolOut{color:#be185d;font-weight:900;}
:root[data-theme="dark"] #chTolOut{color:#f472b6;}

/* 小标题 */
.ch-sub{
  position:relative;
  margin:20px 0 2px;
  padding-left:13px;
  font-size:13.5px;
  font-weight:900;
  color:var(--ink);
}
.ch-sub::before{
  content:"";
  position:absolute;
  left:0;top:4px;bottom:4px;
  width:4px;
  border-radius:4px;
  background:linear-gradient(180deg,#be185d,#f472b6);
}

/* 负荷条 */
#chBars .c60-bar-row{grid-template-columns:80px minmax(0,1fr) 92px;}
#chBars .c60-bar-row .bf{background:linear-gradient(90deg,#be185d,#f472b6);}

/* 成员明细 */
#chMemberTable td:first-child{font-weight:900;color:var(--ink);}
#chMemberTable td:nth-child(n+2):nth-child(-n+6){font-variant-numeric:tabular-nums;}
#chMemberTable td:nth-child(7){font-weight:900;white-space:nowrap;}
#chMemberTable tr.is-over td:nth-child(7){color:#b91c1c;}
#chMemberTable tr.is-ok td:nth-child(7){color:#15803d;}
#chMemberTable tr.is-over td{background:rgba(220,38,38,.05);}
:root[data-theme="dark"] #chMemberTable tr.is-over td:nth-child(7){color:#f87171;}
:root[data-theme="dark"] #chMemberTable tr.is-ok td:nth-child(7){color:#86efac;}

/* 七天轮值表 */
.ch-schedule th{text-align:center;white-space:nowrap;}
.ch-schedule td:first-child{font-weight:900;color:var(--ink);white-space:nowrap;}
.ch-schedule th:first-child{text-align:left;}
.ch-schedule td{vertical-align:top;min-width:88px;}
.ch-sched-chip{
  display:inline-block;
  margin:2px 3px 2px 0;
  padding:2px 7px;
  border-radius:6px;
  background:rgba(190,24,93,.09);
  color:var(--ink2);
  font-size:11px;
  font-weight:700;
  white-space:nowrap;
}
:root[data-theme="dark"] .ch-sched-chip{background:rgba(244,114,182,.14);}
.ch-schedule td.empty{color:var(--muted);font-size:11.5px;}

/* 分配明细 */
#chAssignTable td:first-child{font-weight:800;color:var(--ink);}
#chAssignTable td:nth-child(n+2){font-variant-numeric:tabular-nums;}
#chBatchTable td:nth-child(n+2){font-variant-numeric:tabular-nums;}
#chBatchTable td:last-child{font-weight:900;}

/* 偏差提醒 */
#chWarnList li b{color:#9d174d;}
:root[data-theme="dark"] #chWarnList li b{color:#f472b6;}

@media (max-width:960px){
  .c60-hero-art{display:none;}
}
@media (max-width:640px){
  .ch-row-head,.ch-mem-head{display:none;}
  .ch-row{grid-template-columns:1fr 1fr 1fr;gap:6px;padding:9px;}
  .ch-row .ch-name{grid-column:1/-1;}
  .ch-row .ch-del{width:100%;}
  .ch-row-mem{grid-template-columns:1fr 1fr;gap:6px;padding:9px;}
  .ch-row-mem .ch-mname{grid-column:1/-1;}
  .ch-row-mem .ch-del{width:100%;}
  #chMemberTable,#chAssignTable,#chBatchTable{min-width:560px;}
  #chBars .c60-bar-row{grid-template-columns:66px minmax(0,1fr) 84px;}
  .ch-tol-scale{font-size:9.5px;}
}
@media print{
  .c60-actions,.c60-batch,.c60-hist,#chBars{display:none!important;}
  .c60-metric.is-hero{box-shadow:none;-webkit-print-color-adjust:exact;print-color-adjust:exact;}
  .ch-sched-chip{background:#fce7f3!important;-webkit-print-color-adjust:exact;print-color-adjust:exact;}
  .ch-schedule{break-inside:avoid;}
}
