:root {
  --bg: #f4efe3;
  --paper: rgba(255, 250, 240, 0.92);
  --card: rgba(255, 248, 235, 0.88);
  --ink: #2e261d;
  --muted: #6d6154;
  --muted-light: #999;
  --muted-lighter: #bbb;
  --border-light: #f0f0f0;
  --border-card: rgba(113, 88, 58, 0.08);
  --green: #607d63;
  --green-deep: #445848;
  --green-bright: #27ae60;
  --gold: #d18a3a;
  --gold-dark: #b8860b;
  --red: #bb5238;
  --red-deep: #c62828;
  --warm-accent: #bb5238;
  --glass-bg: rgba(233, 219, 208, 0.7);
  --shadow: 0 22px 50px rgba(72, 56, 35, 0.18);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --transition: 0.2s ease;
  --z-dropdown: 100;
  --z-modal: 1000;
  --z-toast: 9999;
  --z-celebration: 9998;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top, rgba(214, 138, 58, 0.18), transparent 28%),
    linear-gradient(180deg, #efe6d6 0%, #f6f0e4 38%, #e7ede0 100%);
  color: var(--ink);
}

.app-shell {
  min-height: 100vh;
  width: 100%;
  padding: 14px 14px 14px;
  max-width: 430px;
  margin: 0 auto;
}

.connect-card {
  border-radius: var(--radius-lg);
  background: rgba(255, 248, 235, 0.9);
  box-shadow: var(--shadow);
  border: 1px solid rgba(113, 88, 58, 0.08);
  padding: 14px;
  margin-bottom: 14px;
}

.connect-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.connect-head h2 {
  margin: 6px 0 0;
  font-size: 1.05rem;
}

.connect-status {
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(96, 125, 99, 0.12);
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.connect-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.topbar > div:first-child {
  min-width: 0;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar h1 {
  margin: 6px 0 0;
  font-size: 1.1rem;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.eyebrow {
  margin: 0;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  color: var(--green);
  text-transform: uppercase;
}

.eyebrow.warm {
  color: var(--gold);
}

.avatar-orb {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.9rem;
  background: linear-gradient(145deg, #d18a3a, #ba5238);
  color: #fff7eb;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.screen {
  display: none;
  gap: 10px;
  flex-direction: column;
}

.screen.is-active {
  display: flex;
}

.scene-card,
.status-card,
.title-card,
.monster-card,
.footer-card,
.plan-card {
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  border: 1px solid rgba(113, 88, 58, 0.08);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 12px 12px 10px;
  min-height: 170px;
  background:
    linear-gradient(180deg, rgba(255, 241, 213, 0.85), rgba(246, 232, 209, 0.95)),
    var(--card);
}

.battle-card {
  border-radius: 14px;
  padding: 10px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: linear-gradient(135deg, rgba(96, 125, 99, 0.32), rgba(68, 88, 72, 0.3));
  box-shadow: 0 14px 28px rgba(68, 88, 72, 0.22);
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}
.battle-card.success {
  background: linear-gradient(135deg, rgba(39, 174, 96, 0.24), rgba(30, 132, 73, 0.2));
  border-color: rgba(255, 200, 50, 0.7);
  animation: successGlow 1.8s ease-in-out infinite alternate;
}
@keyframes successGlow {
  0% { box-shadow: 0 0 12px rgba(255, 200, 50, 0.25), 0 14px 28px rgba(68, 88, 72, 0.15); }
  100% { box-shadow: 0 0 22px rgba(255, 200, 50, 0.45), 0 14px 28px rgba(68, 88, 72, 0.15); }
}

/* 庆祝烟花容器 */
.celebration-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  overflow: hidden;
}
.celebration-particle {
  position: absolute;
  font-size: 1.6rem;
  animation: particleFall linear forwards;
  pointer-events: none;
  will-change: transform, opacity;
}
@keyframes particleFall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(85vh) rotate(720deg) scale(0.3); }
}
.battle-card.failed {
  background: linear-gradient(135deg, rgba(192, 57, 43, 0.26), rgba(146, 43, 33, 0.2));
  border-color: rgba(192, 57, 43, 0.5);
}
.battle-card.lagging {
  background: linear-gradient(135deg, rgba(230, 126, 34, 0.26), rgba(175, 96, 26, 0.2));
  border-color: rgba(230, 126, 34, 0.5);
}
.battle-card.leading {
  background: linear-gradient(135deg, rgba(26, 188, 156, 0.26), rgba(22, 160, 133, 0.2));
  border-color: rgba(26, 188, 156, 0.5);
}
.battle-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.battle-topline p {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}
#daily-battle-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.75);
}
#daily-battle-desc {
  margin: 4px 0 0;
  font-size: 0.8rem;
  font-weight: 700;
}

.battle-progress-track {
  margin-top: 6px;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  overflow: hidden;
}

#daily-battle-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: rgba(25, 25, 25, 0.55);
  transition: width 0.25s ease;
}

.battle-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 700;
}

.battle-kpi-row {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.kpi-mini {
  padding: 6px 6px 5px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(113, 88, 58, 0.12);
  text-align: center;
}

.kpi-mini span {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.kpi-mini strong {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
  line-height: 1.05;
}

.kpi-mini em {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-size: 0.66rem;
  color: var(--muted);
  opacity: 0.9;
}

.mist {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  filter: blur(10px);
}

.mist-a {
  width: 180px;
  height: 44px;
  right: -10px;
  top: 28px;
}

.mist-b {
  width: 140px;
  height: 36px;
  left: 18px;
  top: 62px;
}

.mountains {
  position: absolute;
  inset: auto 0 0;
  height: 110px;
}

.mountain {
  position: absolute;
  bottom: 0;
  border-radius: 100px 100px 0 0;
}

.mountain-back {
  left: -20px;
  width: 180px;
  height: 70px;
  background: #8aa28d;
}

.mountain-mid {
  left: 120px;
  width: 180px;
  height: 85px;
  background: #69826d;
}

.mountain-front {
  right: -8px;
  width: 160px;
  height: 95px;
  background: #4d6653;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-copy {
  min-width: 0;
  width: 100%;
}

.hero-copy h2,
.title-card h2 {
  margin: 4px 0 8px;
  font-size: 1.25rem;
}

.title-card p,
.monster-desc,
.status-card span {
  color: var(--muted);
  line-height: 1.55;
}

.monster-figure {
  position: absolute;
  right: 0;
  top: 8px;
  width: 100px;
  z-index: 2;
  pointer-events: none;
}

.monster-photo-frame {
  width: 110px;
  height: 160px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  position: relative;
  isolation: isolate;
}

.monster-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  border-radius: 0;
  transform: translate(0, -10px) scale(1.8);
  filter: saturate(1.03) contrast(1.03) drop-shadow(0 20px 28px rgba(72, 56, 35, 0.2));
  z-index: 1;
  position: relative;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.status-card {
  padding: 10px;
}

.status-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.status-card strong {
  display: block;
  margin: 4px 0 2px;
  font-size: 0.82rem;
}

.section-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.ghost-btn,
.primary-btn,
.done-btn,
.danger-btn,
.pass-btn {
  border: none;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), opacity var(--transition), box-shadow var(--transition);
}

.ghost-btn {
  background: rgba(96, 125, 99, 0.12);
  color: var(--green-deep);
}

.ghost-btn:hover {
  background: rgba(96, 125, 99, 0.2);
}

.ghost-btn:active {
  transform: scale(0.96);
  opacity: 0.8;
}

.primary-btn,
.done-btn {
  background: linear-gradient(135deg, var(--gold), var(--red));
  color: #fff9ef;
}

.primary-btn:hover, .done-btn:hover {
  box-shadow: 0 4px 16px rgba(187, 82, 56, 0.3);
  opacity: 0.92;
}

.primary-btn:active, .done-btn:active {
  transform: scale(0.96);
}

.primary-btn:disabled, .done-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
button.is-loading {
  opacity: 0.7;
  cursor: wait;
}
button.is-loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: -1px;
}

.danger-btn {
  background: rgba(187, 82, 56, 0.12);
  color: var(--red);
}

.danger-btn:hover {
  background: rgba(187, 82, 56, 0.22);
}

.danger-btn:active {
  transform: scale(0.96);
}

.pass-btn {
  background: rgba(39, 174, 96, 0.12);
  color: var(--green-deep);
  padding: 8px 14px;
  font-size: 0.82rem;
}

.pass-btn:hover {
  background: rgba(39, 174, 96, 0.22);
}

.pass-btn:active {
  transform: scale(0.96);
}

.monster-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.week-ahead-card {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(255, 250, 240, 0.9), rgba(236, 242, 229, 0.82));
  border: 1px solid rgba(113, 88, 58, 0.08);
  box-shadow: var(--shadow-sm);
}

.week-ahead-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.week-ahead-head h3 {
  margin: 0 0 3px;
  font-size: 0.95rem;
}

.week-ahead-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.week-ahead-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.week-ahead-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(96, 125, 99, 0.12);
}

.week-ahead-item.empty {
  opacity: 0.82;
}

.week-ahead-date {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.week-ahead-date strong {
  font-size: 0.86rem;
}

.week-ahead-date span {
  color: var(--muted);
  font-size: 0.72rem;
}

.week-ahead-date b {
  width: fit-content;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(209, 138, 58, 0.18);
  color: var(--gold-dark);
  font-size: 0.66rem;
}

.week-ahead-tasks {
  min-width: 0;
  display: grid;
  gap: 3px;
  color: var(--ink);
  font-size: 0.78rem;
  line-height: 1.35;
}

.week-ahead-tasks span,
.week-ahead-tasks em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-ahead-tasks em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.72rem;
}

.week-ahead-no-task {
  color: var(--muted);
}

.week-ahead-status {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(96, 125, 99, 0.12);
  color: var(--green-deep);
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.week-ahead-empty {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.week-ahead-empty.error {
  color: var(--red);
}

.monster-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
}

.monster-card.done {
  background: linear-gradient(180deg, rgba(242, 245, 236, 0.95), rgba(233, 240, 224, 0.95));
}

.monster-badge,
.difficulty {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(96, 125, 99, 0.14);
  color: var(--green-deep);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.monster-badge.danger,
.difficulty.pending {
  background: rgba(187, 82, 56, 0.14);
  color: var(--red);
}

.monster-name {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.2;
}

.monster-desc {
  margin: 2px 0 0;
  font-size: 0.82rem;
}

/* 紧凑操作按钮 */
.compact-btn {
  padding: 5px 12px !important;
  font-size: 0.78rem !important;
  border-radius: 8px !important;
  flex-shrink: 0;
}
.done-label {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.monster-portrait {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: 0 0 auto;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.6), rgba(255,255,255,0.05)), #d8aa74;
}

.monster-portrait.red { background-color: #c36648; }
.monster-portrait.teal { background-color: #5d8e84; }
.monster-portrait.gold { background-color: #d4a049; }

.monster-portrait.suanshiyao {
  background-color: #8c7f72;
  background-image:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.05)),
    url('./assets/suanshiyao.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.monster-portrait.fengyuyao {
  background-color: #7ca7bf;
  background-image:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.05)),
    url('./assets/fengyuyao.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.monster-portrait.jiqiaoyao {
  background-color: #b9894f;
  background-image:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.05)),
    url('./assets/jiqiaoyao.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.monster-portrait.mingbianyao {
  background-color: #86b9ae;
  background-image:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.05)),
    url('./assets/mingbianyao.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.monster-portrait.shujuanyao {
  background-color: #8da19d;
  background-image:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.05)),
    url('./assets/shujuanyao.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.monster-meta {
  flex: 1;
}

.monster-topline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.action-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.footer-card,
.title-card,
.submit-bar {
  padding: 10px;
}

.journey-path {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.day-node {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  background: rgba(255, 250, 240, 0.76);
  border-radius: var(--radius-md);
  border: 1px solid rgba(84, 71, 55, 0.08);
}

.day-node strong {
  display: block;
  margin: 4px 0;
  font-size: 1.25rem;
}

.day-node small {
  color: var(--muted);
}

.day-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 8px;
  background: #c4c5bc;
  box-shadow: 0 0 0 8px rgba(191, 163, 108, 0.1);
}

.day-node.done .day-dot,
.day-node.current .day-dot {
  background: var(--gold);
}

.day-node.weekend {
  background: linear-gradient(135deg, rgba(209, 138, 58, 0.14), rgba(96, 125, 99, 0.1));
}

.day-plan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-editor {
  border-radius: var(--radius-md);
  background: rgba(255, 248, 235, 0.9);
  box-shadow: var(--shadow);
  border: 1px solid rgba(113, 88, 58, 0.08);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plan-editor-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.plan-editor-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.editor-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.editor-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.editor-field label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.editor-field input,
.editor-field select {
  width: 100%;
  border: 1px solid rgba(113, 88, 58, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 252, 246, 0.96);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.merit-grid {
  grid-template-columns: repeat(2, 1fr);
}
.merit-grid .status-card strong {
  font-size: 0.78rem;
}
.merit-grid .status-card span {
  font-size: 0.75rem;
}

.merit-ledger {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.week-select-card {
  border-radius: var(--radius-md);
  background: rgba(255, 248, 235, 0.88);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(113, 88, 58, 0.08);
  padding: 10px 12px;
}

.week-select-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.week-select {
  width: 100%;
  border: 1px solid rgba(113, 88, 58, 0.14);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 252, 246, 0.96);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
}

.ledger-card {
  border-radius: var(--radius-md);
  background: rgba(255, 248, 235, 0.9);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(113, 88, 58, 0.08);
  padding: 12px;
  display: none;
}

.ledger-card.is-active {
  display: block;
}

.ledger-empty {
  display: none;
  border-radius: var(--radius-md);
  background: rgba(255, 248, 235, 0.72);
  border: 1px dashed rgba(113, 88, 58, 0.18);
  padding: 12px;
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
  font-size: 0.82rem;
}

.ledger-empty.is-active {
  display: block;
}

.ledger-card.current {
  background: linear-gradient(160deg, rgba(209, 138, 58, 0.16), rgba(255, 249, 237, 0.95));
}

.ledger-card.settled {
  background: linear-gradient(180deg, rgba(242, 245, 236, 0.95), rgba(233, 240, 224, 0.95));
}

.ledger-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.ledger-week {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.ledger-head h3 {
  margin: 0;
  font-size: 0.82rem;
}

.ledger-badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.ledger-badge.pending {
  background: rgba(209, 138, 58, 0.16);
  color: #9a611d;
}

/* ─── Toast ─── */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ═══ 家长端首页紧凑布局 ═══ */
.parent-hero-compact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin: 0;
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.parent-hero-left {
  flex: 0 0 auto;
}

.parent-hero-avatar {
  width: 60px;
  height: 60px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(72, 56, 35, 0.18));
}

.parent-hero-right {
  flex: 1;
  min-width: 0;
}

.parent-hero-title {
  margin: 0 0 2px;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.3;
}

.parent-hero-desc {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
}

.parent-alert-banner {
  display: none;
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(187, 82, 56, 0.12);
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 700;
  animation: alertPulse 2s ease-in-out infinite;
}

@keyframes alertPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.parent-kpi-row {
  display: flex;
  gap: 6px;
  padding: 8px 0 0;
}

.parent-kpi-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
  background: var(--card);
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}

.parent-kpi-value {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}

.parent-kpi-label {
  font-size: 0.66rem;
  color: var(--muted);
  margin-top: 2px;
}
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast, 2000);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s forwards;
  pointer-events: auto;
  max-width: 90vw;
  text-align: center;
}
.toast.success { background: #e8f5e9; color: #2e7d32; }
.toast.error { background: #ffebee; color: #c62828; }
.toast.info { background: #fff8e1; color: #e65100; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

.ledger-badge.done {
  background: rgba(96, 125, 99, 0.14);
  color: var(--green-deep);
}

.ledger-score {
  margin: 8px 0 4px;
  font-size: 0.82rem;
  font-weight: 800;
}

.ledger-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.plan-card {
  padding: 14px;
}

.plan-card.highlight {
  background: linear-gradient(160deg, rgba(209, 138, 58, 0.16), rgba(255, 249, 237, 0.92));
}

.plan-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.plan-card h3 {
  margin: 0;
}

.plan-card ul {
  margin: 0;
  padding-left: 16px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.submit-bar {
  display: flex;
  gap: 10px;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: none;
}

.submit-bar button {
  flex: 1;
}
.plan-editor-toggle-wrap {
  margin-top: 0;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 10px;
  width: calc(100% - 28px);
  max-width: 402px;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  z-index: 500;
  margin-top: 0;
  background: rgba(255, 250, 240, 0.88);
  border: 1px solid rgba(84, 71, 55, 0.08);
  border-radius: 999px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  padding: 6px;
  overflow: visible;
}

#main-app {
  padding-bottom: 76px;
}

.nav-item {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 10px 6px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.7rem;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.nav-item + .nav-item {
  margin-left: 2px;
}

.home-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin: -4px;
}
.home-action-row > * {
  margin: 4px;
}

.nav-item.is-active {
  background: linear-gradient(135deg, rgba(209, 138, 58, 0.22), rgba(96, 125, 99, 0.18));
  color: var(--ink);
}

@media (max-width: 390px) {
  .status-grid {
    grid-template-columns: 1fr;
  }

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

  .editor-row {
    grid-template-columns: 1fr;
  }

  .hero-content {
    flex-direction: column;
  }

  .monster-figure {
    margin-left: auto;
  }
}

/* ═══ 提取的通用 CSS 类（替代 inline style） ═══ */

/* 照片缩略图 — 通用 */
.photo-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  cursor: pointer;
  transition: transform var(--transition);
  background: #f4efe7;
}
.photo-thumb:hover {
  transform: scale(1.15);
}
.photo-thumb.small {
  width: 36px;
  height: 36px;
}

.review-photos img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  cursor: pointer;
}

.photo-browser-overlay {
  z-index: 2200;
  align-items: stretch;
  justify-content: center;
  background: rgba(20, 16, 12, 0.9);
  padding: 0;
}
.photo-browser-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 58px 18px 70px;
  touch-action: pan-y;
}
.photo-browser-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
  background: rgba(255, 255, 255, 0.06);
}
.photo-browser-close,
.photo-browser-nav {
  position: absolute;
  z-index: 2;
  border: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.photo-browser-close {
  right: 16px;
  top: max(16px, env(safe-area-inset-top));
  width: 40px;
  height: 40px;
  border-radius: 999px;
  font-size: 1.2rem;
}
.photo-browser-nav {
  top: 50%;
  width: 42px;
  height: 58px;
  transform: translateY(-50%);
  border-radius: 999px;
  font-size: 2rem;
  line-height: 1;
}
.photo-browser-nav.prev { left: 12px; }
.photo-browser-nav.next { right: 12px; }
.photo-browser-counter {
  position: absolute;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 2;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  padding: 6px 12px;
  font-size: 0.78rem;
  backdrop-filter: blur(8px);
}

/* 照片预览（上传时） */
.photo-preview-wrap {
  display: inline-block;
  position: relative;
  margin: 4px;
  z-index: 2;
}
.photo-preview-img {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-xs);
  object-fit: cover;
}
.photo-remove-btn {
  position: relative;
  z-index: 2;
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--red);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 14px;
  cursor: pointer;
  line-height: 20px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition);
}
.photo-remove-btn:hover {
  transform: scale(1.15);
}

/* 照片行 */
.photo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.zhaoyao-photo-previews {
  min-height: 32px;
  padding-top: 6px;
}

#zhaoyao-photo-count {
  margin-top: 6px;
  font-weight: 600;
}

/* 修行录 — 柱状图 */
.chart-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity var(--transition);
}
.chart-bar-item:hover {
  opacity: 0.75;
}
.chart-bar-value {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}
.chart-bar {
  border-radius: 4px 4px 0 0;
  transition: height 0.3s ease;
}
.chart-bar-label {
  font-size: 0.65rem;
  color: var(--muted-light);
}

/* 修行录 — 日列表 */
.day-list-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform var(--transition), box-shadow var(--transition);
}
.day-list-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.day-list-title {
  font-weight: 600;
  font-size: 0.9rem;
}
.day-list-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}
.day-list-score {
  font-weight: 700;
  font-size: 1.1rem;
}
.day-list-score-label {
  font-size: 0.72rem;
  color: var(--muted-light);
}
.score-positive { color: var(--green-bright); }
.score-negative { color: var(--red); }
.score-zero { color: var(--muted-light); }

/* 修行录 — 日详情 */
.day-detail-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 12px;
  box-shadow: var(--shadow-md);
}
.day-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.day-detail-header h3 {
  margin: 0;
  font-size: 1rem;
}
.close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--muted-light);
  padding: 4px 8px;
  border-radius: 8px;
  transition: background var(--transition);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.close-btn:hover {
  background: rgba(0,0,0,0.06);
}
.day-detail-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.day-detail-summary span {
  font-size: 0.85rem;
  color: var(--muted);
}
.adjust-btn {
  padding: 6px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--red);
  background: rgba(187, 82, 56, 0.08);
  color: var(--red);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  min-height: 36px;
  transition: background var(--transition);
}
.adjust-btn:hover {
  background: rgba(187, 82, 56, 0.16);
}

/* 任务明细行 */
.task-detail-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.task-detail-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.task-detail-name {
  font-weight: 600;
}
.task-detail-status {
  font-size: 0.82rem;
}
.task-detail-time {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 2px;
}
.task-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
}
.task-comment {
  font-size: 0.8rem;
  color: var(--red);
  margin-top: 2px;
}

/* 状态标签（妖怪谱） */
.plan-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}
.plan-tag.locked { background: rgba(0,0,0,0.06); color: var(--muted-light); }
.plan-tag.dirty { background: rgba(255,152,0,0.15); color: #e65100; }
.plan-tag.approved { background: rgba(46,125,50,0.12); color: #2e7d32; }
.plan-tag.pending { background: rgba(184,134,11,0.12); color: var(--gold-dark); }
.plan-tag.rejected { background: rgba(198,40,40,0.12); color: var(--red-deep); }
.task-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  margin-left: 6px;
  flex-shrink: 0;
}
.task-tag.new { background: rgba(255,152,0,0.15); color: #e65100; }
.task-tag.confirmed { background: rgba(46,125,50,0.1); color: #2e7d32; }

/* 功德簿明细行 */
.merit-daily-section {
  margin-top: 12px;
}
.merit-daily-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6px 0;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  transition: background var(--transition);
}
.merit-daily-row:hover {
  background: rgba(0,0,0,0.02);
}
.merit-daily-date {
  font-size: 0.82rem;
  flex-shrink: 0;
}
.merit-daily-score {
  font-weight: 600;
  font-size: 0.82rem;
  text-align: right;
}
.merit-adjust-note {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--gold-dark);
  margin-top: 1px;
}
.merit-adjust-icon {
  font-size: 0.7rem;
  color: var(--muted);
}
.merit-section-title {
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 6px;
  margin-top: 12px;
}

/* 历史按钮栏 */
.history-range-bar {
  display: flex;
  gap: 4px;
}
.history-range-btn {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1.5px solid #ddd;
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.history-range-btn:hover {
  border-color: rgba(187, 82, 56, 0.4);
}
.history-range-btn.active {
  border-color: var(--red);
  background: rgba(187, 82, 56, 0.08);
  color: var(--red);
}

/* 历史图表区域 */
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
  margin-bottom: 8px;
}
.history-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}
.history-subtitle {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}
#history-chart {
  padding: 0 0;
  margin-bottom: 8px;
}
.history-chart-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(113, 88, 58, 0.08);
}
.history-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.history-chart-title {
  font-weight: 600;
  font-size: 0.9rem;
}
#history-chart-summary {
  font-size: 0.8rem;
  color: var(--muted);
}
#history-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 80px;
  overflow-x: auto;
}
#history-day-list {
  padding: 0;
}
#history-day-detail {
  display: none;
  padding: 0;
  margin-top: 10px;
}
.history-placeholder {
  color: var(--muted);
  text-align: center;
}

/* 登出按钮 */
.logout-btn {
  background: rgba(187, 82, 56, 0.15);
  color: var(--red);
  border: none;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--transition);
}
.logout-btn:hover {
  background: rgba(187, 82, 56, 0.25);
}

/* 妖怪谱步骤条 */
#plan-steps {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}
.plan-step {
  flex: 1;
  text-align: center;
  padding: 5px 2px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.04);
  color: var(--muted);
  transition: background var(--transition), color var(--transition);
}
.plan-step.step-done { background: rgba(46, 125, 50, 0.15); color: #2e7d32; }
.plan-step.step-current { background: rgba(21, 101, 192, 0.15); color: #1565c0; }
.plan-step.step-pending { background: rgba(184, 134, 11, 0.2); color: #b8860b; }

/* 妖怪谱卡片状态 */
.plan-card.day-past { opacity: 0.6; }
.plan-card li { display: flex; justify-content: space-between; align-items: center; }
.plan-task-delete {
  padding: 4px 10px;
  font-size: 0.75rem;
  flex-shrink: 0;
  min-height: 32px;
  min-width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* 历史详情右侧对齐 */
.day-list-right { text-align: right; }

/* 妖怪谱审批状态徽章 */
#plan-status-badge {
  display: none;
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.82rem;
}
#plan-status-badge.badge-warning { color: #b8860b; background: rgba(184, 134, 11, 0.12); }
#plan-status-badge.badge-success { color: #2e7d32; background: rgba(46, 125, 50, 0.12); }
#plan-status-badge.badge-error { color: #c62828; background: rgba(198, 40, 40, 0.12); }
#plan-status-badge.badge-info { color: #1565c0; background: rgba(21, 101, 192, 0.12); }
#plan-dirty-banner {
  display: none;
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 152, 0, 0.15);
  color: #e65100;
  font-weight: 600;
  font-size: 0.8rem;
}

.plan-status-inline {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

/* 调分输入框 */
.adjust-reason-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 0.9rem;
  box-sizing: border-box;
}

/* 确认结算区域 */
#confirm-section,
#plan-status-line,
#plan-action-bar,
#plan-editor,
#plan-submit-bar {
  display: none;
}
.confirm-full-btn {
  width: 100%;
  margin-top: 8px;
}

/* 加载态 */
.loading-text {
  text-align: center;
  color: var(--muted-light);
  padding: 16px;
}
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0,0,0,0.1);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 24px 16px;
  color: var(--muted);
}
.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 8px;
  opacity: 0.5;
}
.empty-state-text {
  font-size: 0.9rem;
  line-height: 1.5;
}

/* ═══ 弹窗 (统一定义) ═══ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: var(--z-modal);
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.is-active {
  display: flex;
}
.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  width: 100%;
  max-width: 380px;
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.modal-box h3 { margin: 0 0 6px; font-size: 1.1rem; }

/* ═══ 连胜成就系统 ═══ */
.streak-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 2px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(113, 88, 58, 0.08);
}
.streak-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.streak-info {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-shrink: 0;
}
.streak-label {
  font-size: 0.82rem;
  font-weight: 600;
}
.streak-count {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
}
.streak-unit {
  font-size: 0.72rem;
  color: var(--muted);
}
.streak-bar-wrap {
  flex: 1;
  min-width: 0;
  padding-top: 18px;
}
.streak-bar {
  position: relative;
  height: 10px;
  background: #f0ebe3;
  border-radius: 5px;
  overflow: visible;
}
.streak-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--gold-dark), var(--red));
  border-radius: 5px;
  transition: width 0.6s ease;
  max-width: 100%;
}
.streak-mark {
  position: absolute;
  top: -22px;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  font-size: 0.56rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  line-height: 0.9;
}
.streak-mark[data-edge="start"] {
  transform: translateX(0);
}
.streak-mark[data-edge="end"] {
  transform: translateX(-100%);
}
.streak-mark-icon {
  font-size: 0.6rem;
  line-height: 0.9;
}
.streak-mark-value {
  line-height: 0.9;
}
.streak-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.streak-actions:empty {
  display: none;
}
.streak-claim-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.streak-claim-btn:active {
  transform: scale(0.97);
}
.streak-claim-btn.bronze {
  background: linear-gradient(135deg, #cd7f32, #daa520);
  color: #fff;
  box-shadow: 0 2px 8px rgba(205, 127, 50, 0.3);
}
.streak-claim-btn.gold {
  background: linear-gradient(135deg, #ffd700, #ffb300);
  color: #5d4037;
  box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

/* 成就历史列表 */
.achievement-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.achievement-list:empty {
  display: none;
}
.achievement-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(113, 88, 58, 0.06);
}
.achievement-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.achievement-detail {
  flex: 1;
  min-width: 0;
}
.achievement-reward {
  font-weight: 700;
  font-size: 0.88rem;
}
.achievement-meta {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 1px;
}
.achievement-badge {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  flex-shrink: 0;
}
.achievement-badge.claimed {
  background: rgba(255, 152, 0, 0.12);
  color: #e65100;
}
.achievement-badge.redeemed {
  background: rgba(46, 125, 50, 0.1);
  color: #2e7d32;
}

/* 功德结算折叠 */
.merit-settlement-details {
  margin-bottom: 8px;
}
.merit-settlement-summary {
  font-weight: 700;
  font-size: 0.82rem;
  padding: 10px 14px;
  background: var(--card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(113, 88, 58, 0.06);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.merit-settlement-summary::-webkit-details-marker { display: none; }
.merit-settlement-summary::before { content: "▶ "; font-size: 0.7rem; }
.merit-settlement-details[open] > .merit-settlement-summary::before { content: "▼ "; }
.merit-settlement-details[open] > .merit-settlement-summary {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  margin-bottom: 0;
}

/* ═══ 抽奖转盘 ═══ */
.lottery-modal-box {
  text-align: center;
  max-width: 340px !important;
}
.lottery-wheel-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  margin: 16px auto;
}
.lottery-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.6rem;
  z-index: 2;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
  color: var(--red);
}
.lottery-wheel {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  border: 4px solid var(--gold-dark);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}
.lottery-slice {
  position: absolute;
  width: 0; height: 0;
  left: 50%; top: 50%;
  transform-origin: 0 0;
}
.lottery-slice-label {
  position: absolute;
  font-size: 0.62rem;
  font-weight: 700;
  white-space: nowrap;
  transform-origin: center;
}
.lottery-result {
  margin: 12px 0 0;
}
.lottery-result-text {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--red);
  animation: lottery-pop 0.5s ease;
}
@keyframes lottery-pop {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}
#lottery-tier-label {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 4px 0 0;
}
.redemption-modal-box {
  max-width: 360px !important;
}
.redemption-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.redemption-option,
.redemption-reward {
  width: 100%;
  border: 1px solid rgba(113, 88, 58, 0.1);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  padding: 12px 14px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.redemption-option strong {
  display: block;
  font-size: 0.92rem;
}
.redemption-option span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
}
.redemption-option.gold,
.redemption-reward.gold {
  border-color: rgba(184, 134, 11, 0.26);
  background: linear-gradient(135deg, #fffaf0, #fff3cf);
}
.redemption-option.bronze,
.redemption-reward.bronze {
  border-color: rgba(187, 82, 56, 0.18);
  background: linear-gradient(135deg, #fff8f2, #fff1e7);
}
.redemption-reward {
  font-weight: 700;
  text-align: center;
}
.redemption-reward:disabled {
  cursor: wait;
  opacity: 0.72;
}

.zhaoyao-layout {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}
.zhaoyao-layout > * + * {
  margin-top: 10px;
}
.zhaoyao-panel,
.zhaoyao-report-box {
  background: rgba(255, 248, 235, 0.88);
  border: 1px solid rgba(113, 88, 58, 0.1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 12px;
}
.zhaoyao-panel .section-head {
  padding-bottom: 7px;
  margin-bottom: 9px;
  border-bottom: 1px solid rgba(113, 88, 58, 0.08);
}
.zhaoyao-panel .editor-row {
  gap: 8px;
  margin-bottom: 8px;
}
.zhaoyao-panel .editor-field {
  margin-bottom: 8px;
}
.zhaoyao-panel .editor-field:last-child {
  margin-bottom: 0;
}
.zhaoyao-panel .submit-bar {
  margin-top: 2px;
}
.zhaoyao-submit-status {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.zhaoyao-reason-box label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
  margin: 0 0 7px;
}
.zhaoyao-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(87, 70, 55, 0.16) !important;
  border-radius: var(--radius-sm) !important;
  background:
    linear-gradient(45deg, transparent 50%, var(--green-deep) 50%) right 16px center / 7px 7px no-repeat,
    rgba(255, 252, 246, 0.96) !important;
  color: var(--ink) !important;
  padding: 10px 34px 10px 14px !important;
  font-weight: 700 !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.68);
}
.zhaoyao-select.compact {
  width: auto;
  min-width: 108px;
  flex: 0 0 auto;
}
.zhaoyao-reason-grid {
  display: flex;
  flex-wrap: wrap;
  margin: -3px;
}
.zhaoyao-reason-grid button,
.zhaoyao-tags span {
  border: 1px solid rgba(113, 88, 58, 0.14);
  border-radius: 999px;
  background: rgba(255, 252, 246, 0.9);
  color: var(--ink);
  padding: 6px 9px;
  font-size: 0.78rem;
  margin: 3px;
}
.zhaoyao-reason-grid button {
  cursor: pointer;
  font-weight: 700;
}
.zhaoyao-reason-grid button.is-active {
  background: var(--green-deep);
  color: #fff;
  border-color: var(--green-deep);
}
.zhaoyao-report-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}
.zhaoyao-report-list > * + * {
  margin-top: 8px;
}
.zhaoyao-report-card {
  width: 100%;
  border: 1px solid rgba(113, 88, 58, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 252, 246, 0.96);
  color: var(--ink);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}
.zhaoyao-report-card.is-active {
  border-color: rgba(96, 125, 99, 0.42);
  box-shadow: inset 0 0 0 1px rgba(96, 125, 99, 0.18);
}
.zhaoyao-report-card.static {
  cursor: default;
}
.zhaoyao-report-card strong,
.zhaoyao-report-card span,
.zhaoyao-report-card em {
  display: block;
}
.zhaoyao-report-card strong {
  font-size: 0.9rem;
}
.zhaoyao-report-card span {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 4px;
}
.zhaoyao-report-card em {
  color: #9a6b2f;
  font-size: 0.74rem;
  font-style: normal;
  margin-top: 5px;
}
.zhaoyao-report-card em.done { color: var(--green); }
.zhaoyao-report-card em.failed { color: var(--red); }
.zhaoyao-report-box.empty {
  color: var(--muted);
  font-size: 0.86rem;
}
.zhaoyao-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.zhaoyao-detail-head h3 {
  margin: 0;
  font-size: 1rem;
}
.zhaoyao-detail-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}
.zhaoyao-detail-head span {
  border-radius: 999px;
  background: rgba(96, 125, 99, 0.12);
  color: var(--green-deep);
  padding: 5px 9px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.zhaoyao-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.zhaoyao-detail-close {
  padding: 6px 10px;
  min-height: auto;
}
.zhaoyao-meta-list p {
  margin: 0 0 6px;
}
.zhaoyao-meta-list p:last-child {
  margin-bottom: 0;
}
.zhaoyao-mini-section {
  border-top: 1px dashed rgba(113, 88, 58, 0.15);
  padding-top: 10px;
  margin-top: 10px;
}
.zhaoyao-mini-section h4 {
  margin: 0 0 7px;
  font-size: 0.86rem;
}
.zhaoyao-mini-section p,
.zhaoyao-mini-section li {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.55;
}
.zhaoyao-mini-section ul {
  margin: 0;
  padding-left: 18px;
}
.zhaoyao-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.zhaoyao-confidence {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.75rem;
}
.zhaoyao-trend-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin: -4px -4px 8px;
}
.zhaoyao-trend-actions > * {
  margin: 4px;
}
.zhaoyao-trend-actions select {
  min-width: 96px;
}
.modal-box p { margin: 0 0 14px; font-size: 0.85rem; color: #666; }
.modal-box textarea {
  width: 100%;
  min-height: 80px;
  max-height: 120px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 0.9rem;
  resize: vertical;
  box-sizing: border-box;
}
.modal-btns { display: flex; gap: 10px; margin-top: 14px; }
.modal-btns button {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.modal-btns .cancel-btn { background: #f0f0f0; color: #666; }
.modal-btns .confirm-btn,
.modal-btns .confirm-reject-btn { background: var(--red); color: #fff; }

/* 收服弹窗 拍照区 */
.photo-upload-area {
  border: 2px dashed #ddd;
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  margin: 10px 0;
  position: relative;
  overflow: hidden;
}
.photo-upload-area.has-photo { border-color: var(--red); }
.photo-upload-area img { max-width: 100%; max-height: 160px; border-radius: 8px; }
.photo-upload-area input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 1; }
.upload-hint { color: #999; font-size: 0.85rem; }
.checkin-note-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 0.9rem;
  box-sizing: border-box;
  margin-top: 8px;
}
#photo-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  justify-content: center;
}

/* 审批栏 */
.approve-bar { display: flex; gap: 10px; margin-top: 12px; }
.approve-bar .primary-btn { flex: 1; }
.approve-bar .danger-btn {
  flex: 1;
  background: var(--red);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

/* 调分行 */
.adjust-row { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.adjust-row button { padding: 4px 10px; border-radius: 8px; border: 1px solid #ccc; background: #fff; cursor: pointer; font-size: 0.8rem; }
.adjust-row button.active { background: var(--glass-bg); border-color: var(--red); }
.adjust-row input { flex: 1; min-width: 100px; padding: 4px 8px; border: 1px solid #ccc; border-radius: 8px; font-size: 0.8rem; }
.day-node[data-adjustable] { cursor: pointer; }
.day-node[data-adjustable]:hover { background: rgba(0, 0, 0, 0.03); border-radius: 12px; }

/* 调分按钮网格 */
.score-btn-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0; }
.score-btn-grid button {
  min-height: 44px;
  min-width: 44px;
  padding: 10px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 10px;
  border: 2px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: all var(--transition);
}
.score-btn-grid button:hover {
  border-color: var(--gold);
  background: rgba(209, 138, 58, 0.08);
}
.score-btn-grid button.selected {
  border-color: var(--red);
  background: rgba(187, 82, 56, 0.12);
  color: var(--red);
}

/* 结算卡片 */
.confirm-card {
  background: var(--glass-bg);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
}
.confirm-card h3 { margin: 0 0 6px; font-size: 0.82rem; }
.confirm-card label { display: block; margin-bottom: 3px; font-size: 0.8rem; font-weight: 600; }
.confirm-card textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 6px;
  box-sizing: border-box;
}

/* 审核弹窗 */
.review-photos { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.review-photos img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: transform var(--transition);
}
.review-photos img:hover { transform: scale(1.1); }
.review-note { font-size: 0.8rem; color: #666; margin: 4px 0; font-style: italic; }
.review-comment { font-size: 0.8rem; color: var(--red); margin: 4px 0; }
.review-btns { display: flex; gap: 8px; margin-top: 8px; }
.review-btns button { flex: 1; padding: 8px; border-radius: 10px; border: none; font-weight: 600; font-size: 0.85rem; cursor: pointer; }
.review-btns .pass-btn { background: var(--green-bright, #27ae60); color: #fff; }
.review-btns .fail-btn { background: var(--red); color: #fff; }
.review-btns .reviewed-btn { background: #eee; color: #999; cursor: default; }

/* 焦点可见 */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* 额外移动端断点 */
@media (max-width: 340px) {
  .app-shell {
    padding: 20px 12px 18px;
  }
  .battle-kpi-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  .kpi-mini strong {
    font-size: 0.85rem;
  }
  .parent-kpi-row {
    gap: 4px;
  }
  .parent-kpi-value {
    font-size: 1rem;
  }
  .modal-box {
    padding: 16px;
  }
}

@media (min-width: 480px) {
  .app-shell {
    padding: 30px 24px 26px;
  }
}

/* ═══ 奖励配置区 ═══ */
.reward-config-section {
  padding: 10px 12px 14px;
}
.reward-config-intro {
  margin: 0 2px 10px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}
.reward-tier-block {
  margin-bottom: 10px;
}
.reward-tier-block h4 {
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0 0 8px;
}
.reward-tier-hint {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
  margin: -4px 0 8px;
}
.reward-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
}
.reward-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(113, 88, 58, 0.06);
  border-radius: 12px;
  font-size: 0.84rem;
}
.reward-item-row button {
  border: none;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-size: 0.78rem;
  padding: 2px 6px;
}
.reward-add-row {
  display: flex;
  gap: 6px;
}
.reward-add-row input {
  flex: 1;
  padding: 6px 10px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 0.82rem;
}
.reward-add-btn {
  padding: 6px 12px !important;
  font-size: 0.78rem !important;
  white-space: nowrap;
}

.plan-problem-editor {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed rgba(113, 88, 58, 0.2);
}
.plan-problem-editor h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
}
.carry-forward-list h4 {
  margin: 8px 0 6px;
  font-size: 0.82rem;
}
.carry-forward-items {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}
.carry-forward-items label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}
.next-week-problem-list {
  display: grid;
  gap: 6px;
}
.plan-problem-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  background: rgba(255, 252, 246, 0.85);
  border: 1px solid rgba(113, 88, 58, 0.12);
  border-radius: 10px;
  padding: 8px 10px;
}
.plan-problem-row strong {
  display: block;
  font-size: 0.84rem;
}
.plan-problem-row p,
.plan-problem-row em {
  display: block;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
}

.today-problem-list {
  display: grid;
  gap: 8px;
}
.problem-progress-card {
  background: rgba(255, 252, 246, 0.95);
  border: 1px solid rgba(113, 88, 58, 0.1);
  border-radius: 12px;
  padding: 10px;
}
.problem-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.problem-progress-head strong {
  font-size: 0.88rem;
}
.problem-progress-head span {
  font-size: 0.74rem;
  color: var(--muted);
}
.problem-progress-desc {
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
}
.problem-progress-row select,
.problem-progress-card textarea {
  width: 100%;
  border: 1px solid rgba(113, 88, 58, 0.2);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  font-size: 0.8rem;
}
.problem-progress-card textarea {
  margin-top: 6px;
  min-height: 64px;
  resize: vertical;
}

.problem-analytics-section {
  margin-top: 6px;
}
.problem-analytics-summary {
  background: rgba(255, 248, 235, 0.88);
  border: 1px solid rgba(113, 88, 58, 0.1);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 10px 12px;
  font-size: 0.82rem;
}
.problem-analytics-summary.empty {
  color: var(--muted);
}
.problem-analytics-summary p {
  margin: 0;
}
.problem-analytics-summary ul {
  margin: 7px 0 0;
  padding-left: 18px;
}
.problem-analytics-list {
  display: grid;
  gap: 8px;
}
.problem-analytics-card {
  background: rgba(255, 252, 246, 0.96);
  border: 1px solid rgba(113, 88, 58, 0.1);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 10px 12px;
}
.problem-analytics-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.problem-analytics-head strong {
  font-size: 0.88rem;
}
.problem-analytics-head span {
  font-size: 0.74rem;
  color: var(--muted);
}
.problem-analytics-card p {
  margin: 5px 0;
  color: var(--muted);
  font-size: 0.79rem;
}
.problem-progress-track {
  margin-top: 6px;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(113, 88, 58, 0.15);
  overflow: hidden;
}
.problem-progress-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #607d63, #d18a3a);
}
.problem-analytics-kpi {
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--muted);
}
.problem-analytics-card ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 0.76rem;
}

/* --- weekly-problems extra polish --- */
.plan-problem-row-main { flex: 1; display: grid; gap: 6px; min-width: 0; }
.plan-problem-row-main input[type=text],
.plan-problem-row-main textarea {
  width: 100%; box-sizing: border-box;
  border: 1px solid rgba(113, 88, 58, 0.2);
  border-radius: 8px; padding: 6px 8px;
  background: #fff; font-size: 0.82rem; font-family: inherit;
}
.plan-problem-row-main textarea { min-height: 48px; resize: vertical; }
.plan-problem-row-main .field-hint { font-size: 0.72rem; color: var(--muted); }
.problem-progress-card textarea.required { border-color: #d18a3a; background: #fffaf0; }
.problem-note-hint { margin: 4px 0 0; font-size: 0.72rem; color: #b9650b; }

.problem-review-row {
  margin-top: 6px;
  margin-bottom: 4px;
}

.problem-review-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 700;
}

.problem-review-badge.draft { background: #f0ede7; color: #6d5b43; }
.problem-review-badge.pending { background: #fff3d6; color: #996515; }
.problem-review-badge.approved { background: #e6f4df; color: #2f6f28; }
.problem-review-badge.rejected { background: #fde7e0; color: #a13c19; }

.problem-card-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.problem-review-comment {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: #9f1239;
}

/* 任务卡同款的"问题卡" */
.monster-card.problem-monster-card .problem-portrait {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff3d6, #ffe1ec);
  font-size: 26px;
}
.monster-card.problem-monster-card .problem-desc-sub {
  color: #6b5a3a;
  font-size: 0.78rem;
  margin-top: 2px;
}
.monster-card.problem-monster-card .problem-edit-row {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}
.monster-card.problem-monster-card .problem-edit-row select,
.monster-card.problem-monster-card .problem-edit-row textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(113, 88, 58, 0.2);
  border-radius: 10px;
  padding: 6px 10px;
  background: #fff;
  font-size: 0.82rem !important;
  line-height: 1.4 !important;
  font-family: inherit;
  color: #3a2f1f;
}
.monster-card.problem-monster-card .problem-edit-row textarea {
  min-height: 56px;
  resize: vertical;
}
.monster-card.problem-monster-card .problem-edit-row textarea.required {
  border-color: #d18a3a;
  background: #fffaf0;
}
.monster-card.problem-monster-card .problem-edit-row select:disabled,
.monster-card.problem-monster-card .problem-edit-row textarea:disabled {
  background: #f5f1ea;
  color: #6b6760;
}

/* 整组提交/审核 banner */
.problem-batch-banner {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 246, 224, 0.7);
  border: 1px solid rgba(196, 154, 84, 0.25);
}
.problem-batch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.problem-batch-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #f2ead6;
  color: #6b5a3a;
}
.problem-batch-badge.pending { background: #fde7c2; color: #8a5a14; }
.problem-batch-badge.approved { background: #d4f5d4; color: #1f6a2e; }
.problem-batch-badge.rejected { background: #fcd5d5; color: #9f1239; }
.problem-batch-badge.draft { background: #ece6d6; color: #5b4f36; }
.problem-batch-tip {
  margin: 6px 0 0;
  font-size: 0.76rem;
  color: #7c6a45;
}
.problem-batch-comment {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: #9f1239;
}
.problem-batch-done {
  font-size: 0.85rem;
  color: #1f6a2e;
  font-weight: 600;
}

/* 家长端：今日问题进展只读徽标 */
.problem-progress-status {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  background: #f1ebe0;
  color: #5b4628;
}
.problem-progress-status--progress { background: #e3f2db; color: #426a25; }
.problem-progress-status--none { background: #ecebe7; color: #6b6760; }
.problem-progress-status--missing { background: #fbe5dc; color: #a84418; }
.problem-progress-note { margin: 6px 0 0; font-size: 0.82rem; color: #4a3826; }

/* ─── AI 周分析建议（计划编辑 / 审批） ─── */
.plan-ai-summary {
  margin: 12px 0;
  padding: 12px 14px;
  background: #fff8e7;
  border: 1px solid #e7d2a3;
  border-radius: 12px;
}
.plan-ai-summary-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 6px;
}
.plan-ai-summary-header h3 { margin: 0; font-size: 0.96rem; color: #6d5310; }
.plan-ai-summary-body { font-size: 0.84rem; color: #4a3b0d; }
.plan-ai-summary-body.empty { color: var(--muted); }
.problem-rec-summary {
  margin: 0 0 8px;
  font-weight: 600;
  color: #6d5310;
}
.problem-rec-summary .stale-tag { margin-left: 6px; font-weight: 400; color: var(--muted); font-size: 0.74rem; }
.problem-rec-block { margin-top: 8px; }
.problem-rec-block h4 {
  margin: 0 0 4px; font-size: 0.84rem; color: #6d5310;
}
.problem-rec-list {
  margin: 0; padding-left: 22px;
  display: flex; flex-direction: column; gap: 6px;
}
.problem-rec-list li { line-height: 1.4; }
.problem-rec-list li:has(.plan-adopt-btn) {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.problem-rec-list .rec-main { flex: 1; min-width: 0; }
.plan-adopt-btn {
  flex: 0 0 auto;
  padding: 5px 10px;
  font-size: 0.76rem;
  white-space: nowrap;
}
.problem-rec-list li strong { color: #4a3b0d; }
.problem-rec-list .rec-action { margin: 2px 0 0; color: #2f3e2f; }
.problem-rec-list .rec-reason { margin: 2px 0 0; font-size: 0.76rem; color: #7a6a3a; font-style: italic; }

@media (max-width: 360px) {
  .problem-analytics-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .problem-progress-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .plan-problem-row { flex-direction: column; }
  .plan-problem-row > button { align-self: flex-end; }
  .carry-forward-items label { font-size: 0.78rem; }
  .plan-ai-summary { padding: 10px 12px; }
  .plan-ai-summary-header { flex-direction: column; align-items: flex-start; }
}

/* iOS Safari fix: prevent auto-zoom-on-focus by guaranteeing form controls render at >= 16px. */
@media (max-width: 820px) {
  input, select, textarea { font-size: 16px !important; }
}

/* ????(???/???)?? */
.plan-additions-panel {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(255, 196, 105, 0.08);
  border: 1px dashed rgba(206, 145, 50, 0.45);
  border-radius: 10px;
}
.plan-additions-head h3 {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink, #444);
}
.plan-additions-head p {
  margin: 4px 0 8px;
  font-size: 0.74rem;
  color: var(--muted, #888);
  line-height: 1.5;
}
.addition-section-title {
  margin: 8px 0 4px;
  font-size: 0.78rem;
  color: var(--muted, #888);
  font-weight: 600;
}
.plan-additions-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.addition-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
}
.addition-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 0.82rem;
  flex: 1;
  min-width: 0;
}
.addition-problem-summary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
}
.addition-problem-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}
.addition-subject {
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--muted, #777);
}
.addition-title {
  font-weight: 600;
  word-break: break-word;
}
.addition-problem-desc {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  color: var(--muted-text, #5a5448);
}
.addition-problem-desc.muted {
  color: var(--muted, #888);
}
.addition-date {
  font-size: 0.72rem;
  color: var(--muted, #888);
}
.addition-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.addition-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.addition-pending {
  background: rgba(255, 196, 105, 0.25);
  color: #a06a14;
}
.addition-rejected {
  background: rgba(216, 64, 64, 0.15);
  color: #b6291c;
}
.addition-del-btn {
  border: none;
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink, #444);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.addition-del-btn:hover { background: rgba(0, 0, 0, 0.1); }

/* Parent: additions review card */
.plan-additions-review {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px dashed rgba(206, 145, 50, 0.45);
  border-radius: 10px;
  background: rgba(255, 196, 105, 0.06);
}
.plan-additions-review h4 {
  margin: 0 0 6px;
  font-size: 0.9rem;
}
.plan-additions-review .review-empty {
  font-size: 0.78rem;
  color: var(--muted, #888);
}
.plan-additions-review-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* 统一登录页 */
.login-shell {
  display: flex;
  align-items: center;
}
.login-topbar {
  margin-top: 18px;
}
.login-unified-card {
  position: relative;
  overflow: hidden;
}
.login-unified-card::before {
  content: '';
  position: absolute;
  inset: -70px -80px auto auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(209, 138, 58, 0.18), transparent 68%);
  pointer-events: none;
}
.login-role-hint {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
}
.login-role-hint span {
  border: 1px solid rgba(96, 125, 99, 0.16);
  border-radius: 999px;
  background: rgba(96, 125, 99, 0.08);
  color: var(--green-deep);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: center;
  padding: 9px 8px;
}
.login-routing-note {
  margin: 10px 2px 0;
  text-align: center;
}

/* 成就档位配置 */
.reward-tier-create-card,
.reward-tier-config-card {
  border: 1px solid rgba(96, 125, 99, 0.14);
  border-radius: 16px;
  background: rgba(255, 250, 240, 0.68);
  padding: 0;
  margin-bottom: 10px;
  overflow: hidden;
}
.reward-tier-add-row {
  grid-template-columns: 0.8fr 1fr;
}
.reward-tier-add-row select,
.reward-tier-create-card input {
  width: 100%;
  border: 1px solid rgba(96, 125, 99, 0.18);
  border-radius: 999px;
  padding: 10px 12px;
  background: #fffaf0;
  color: var(--ink);
}
.reward-create-summary,
.reward-tier-summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.reward-create-summary::-webkit-details-marker,
.reward-tier-summary::-webkit-details-marker {
  display: none;
}
.reward-create-summary::marker,
.reward-tier-summary::marker {
  content: "";
}
.reward-create-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  font-weight: 900;
}
.reward-create-summary small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: right;
}
.reward-create-form {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px dashed rgba(113, 88, 58, 0.14);
}
.reward-tier-config-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.reward-tier-config-head h4 {
  margin: 0 0 4px;
}
.danger-mini-btn {
  border: 0;
  border-radius: 999px;
  background: rgba(187, 82, 56, 0.12);
  color: var(--red-deep);
  font-weight: 800;
  padding: 7px 10px;
}
.streak-mark {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.streak-mark span {
  pointer-events: none;
}
.reward-tier-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
}
.reward-tier-point-badge {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 8px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f7d678, #d8843f);
  color: #fffaf0;
  font-weight: 950;
  box-shadow: 0 6px 16px rgba(216, 132, 63, 0.22);
}
.reward-tier-summary-main {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  gap: 2px;
}
.reward-tier-summary-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 0.9rem;
}
.reward-tier-summary-main span,
.reward-tier-body-head p,
.reward-tier-desc,
.reward-empty-state {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}
.reward-tier-summary-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reward-tier-preview {
  display: flex;
  grid-column: 2 / 4;
  grid-row: 2;
  justify-content: flex-start;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}
.reward-preview-chip,
.reward-preview-more,
.reward-preview-empty {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px;
  background: rgba(96, 125, 99, 0.09);
  color: var(--green-deep);
  padding: 4px 7px;
  font-size: 0.68rem;
  font-weight: 800;
}
.reward-preview-empty {
  color: var(--muted);
  background: rgba(113, 88, 58, 0.07);
}
.reward-tier-chevron {
  grid-column: 3;
  grid-row: 1;
  color: var(--muted);
  font-weight: 900;
  transition: transform 0.16s ease;
}
.reward-tier-config-card[open] .reward-tier-chevron {
  transform: rotate(180deg);
}
.reward-tier-body {
  padding: 2px 12px 12px;
  border-top: 1px dashed rgba(113, 88, 58, 0.14);
}
.reward-tier-body-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
}
.reward-tier-body-head p,
.reward-tier-desc,
.reward-empty-state {
  margin: 0;
}
.reward-tier-config-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.mini-btn {
  padding: 7px 10px;
  font-size: 0.76rem;
}
.reward-item-row em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.72rem;
  font-style: normal;
}
.reward-item-row > div {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
@media (max-width: 430px) {
  .reward-tier-body-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
.reward-edit-modal-box {
  max-width: 420px;
}
.reward-edit-form {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.reward-edit-form label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-weight: 800;
  font-size: 0.82rem;
}
.reward-edit-form input,
.reward-edit-form select,
.reward-edit-form textarea {
  width: 100%;
  border: 1px solid rgba(96, 125, 99, 0.18);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fffaf0;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}
.reward-edit-form textarea {
  min-height: 74px;
  resize: vertical;
}
