:root {
  --leaf: #2f8c55;
  --leaf-dark: #1f6f43;
  --mint: #e7f6df;
  --sky: #dff4f0;
  --sun: #f7b63b;
  --soil: #8d5a31;
  --ink: #20322a;
  --muted: #65746c;
  --paper: #fffdf5;
  --panel: rgba(255, 255, 255, 0.88);
  --line: rgba(47, 140, 85, 0.18);
  --danger: #c24136;
  --shadow: 0 18px 48px rgba(31, 111, 67, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 14%, rgba(247, 182, 59, 0.18), transparent 26rem),
    radial-gradient(circle at 86% 20%, rgba(47, 140, 85, 0.14), transparent 24rem),
    linear-gradient(135deg, #fbf8ea 0%, #e6f5df 47%, #d9f2ed 100%);
  font-family: ui-rounded, "Nunito", "Avenir Next Rounded", "Segoe UI", system-ui, sans-serif;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.garden-app {
  min-height: 100dvh;
  padding: clamp(14px, 2.4vw, 28px);
  opacity: 1;
  transition: opacity 180ms ease;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  max-width: 1480px;
  margin: 0 auto 12px;
}

.compact-topbar {
  min-height: 44px;
}

.micro-label,
.eyebrow {
  margin: 0 0 6px;
  color: var(--leaf-dark);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(32, 50, 42, 0.12);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.icon-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(32, 50, 42, 0.16);
}

.sound-toggle {
  color: var(--leaf-dark);
}

.sound-toggle.is-muted {
  color: #69746d;
  background: rgba(238, 242, 239, 0.92);
  box-shadow: inset 0 0 0 1px rgba(105, 116, 109, 0.18);
}

.garden-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: clamp(16px, 2vw, 24px);
  max-width: 1480px;
  margin: 0 auto;
}

.stage-panel,
.reward-panel,
.collection-panel,
.modal-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.stage-panel {
  position: relative;
  min-height: 670px;
  padding: clamp(18px, 2.6vw, 34px);
  border-radius: 26px;
  overflow: hidden;
}

.plant-name-row,
.panel-heading,
.modal-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-header > div {
  flex: 1;
  text-align: center;
}

.modal-header .close-dialog {
  position: absolute;
  right: 0;
  top: 0;
}

.plant-name-row h2,
.panel-heading h2,
.modal-header h2 {
  margin: 0;
}

.modal-header h2 {
  font-size: clamp(22px, 5vw, 30px);
  line-height: 1.12;
}

.plant-name-row h2 {
  font-size: clamp(28px, 4.5vw, 56px);
  letter-spacing: 0;
}

.plant-scene {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(350px, 48vh, 500px);
  margin: 14px 0;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 56%),
    linear-gradient(180deg, var(--sky) 0%, #eaf7df 64%, #d2e2a3 100%);
  overflow: hidden;
}

.sun {
  position: absolute;
  top: 36px;
  right: 70px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 22px rgba(247, 182, 59, 0.14), 0 0 42px rgba(247, 182, 59, 0.42);
}

.cloud {
  position: absolute;
  width: 150px;
  height: 54px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: 14px;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  left: 26px;
  width: 54px;
  height: 54px;
}

.cloud::after {
  right: 28px;
  width: 72px;
  height: 72px;
}

.cloud-a {
  top: 72px;
  left: 8%;
}

.cloud-b {
  top: 152px;
  right: 18%;
  transform: scale(0.74);
  opacity: 0.72;
}

.watering-animation {
  position: absolute;
  z-index: 5;
  top: clamp(-22px, calc(5vw - 40px), 2px);
  left: clamp(118px, calc(5vw + 100px), 152px);
  width: clamp(150px, 22vw, 240px);
  height: clamp(150px, 22vw, 240px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-18%, -16%) rotate(0deg) scale(0.82);
  transform-origin: 58% 54%;
}

.watering-animation.is-active {
  animation: wateringCanPour 2800ms ease-in-out both;
}

.watering-animation img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 18px 20px rgba(45, 80, 104, 0.24));
}

.plant-spot {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: end center;
  width: min(62vw, 430px);
  height: min(58vw, 430px);
  margin-top: 46px;
}

.plant-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 22px 24px rgba(32, 50, 42, 0.18));
  transform-origin: center bottom;
  animation: growIn 420ms ease both;
}

.plant-image.is-hidden {
  display: none;
}

.plant-card img.is-hidden,
.small-fallback.is-hidden {
  display: none;
}

.plant-fallback {
  position: relative;
  display: grid;
  place-items: end center;
  width: 260px;
  height: 320px;
  transform-origin: center bottom;
  animation: growIn 420ms ease both;
}

.plant-fallback.is-hidden {
  display: none;
}

.fallback-stem {
  width: 20px;
  height: var(--fallback-height, 130px);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--leaf-dark), #55ad6f);
}

.fallback-leaf {
  position: absolute;
  bottom: 110px;
  width: 96px;
  height: 48px;
  border-radius: 100% 0 100% 0;
  background: #50aa61;
  transform-origin: right center;
}

.fallback-left {
  left: 54px;
  transform: rotate(-18deg);
}

.fallback-right {
  right: 54px;
  transform: scaleX(-1) rotate(-18deg);
}

.fallback-bloom {
  position: absolute;
  bottom: 194px;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #7b4f24 0 22%, transparent 23%),
    conic-gradient(#f7b63b 0 12%, #f18f45 12% 24%, #f7b63b 24% 36%, #f18f45 36% 48%, #f7b63b 48% 60%, #f18f45 60% 72%, #f7b63b 72% 84%, #f18f45 84% 100%);
  box-shadow: 0 16px 24px rgba(141, 90, 49, 0.18);
}

.fallback-seed {
  position: absolute;
  bottom: 36px;
  width: 74px;
  height: 50px;
  border-radius: 54% 46% 52% 48%;
  background: #8d5a31;
}

.plant-fallback.stage-1 .fallback-stem,
.plant-fallback.stage-1 .fallback-leaf,
.plant-fallback.stage-1 .fallback-bloom {
  display: none;
}

.plant-fallback.stage-2 {
  --fallback-height: 80px;
}

.plant-fallback.stage-2 .fallback-bloom,
.plant-fallback.stage-2 .fallback-right {
  display: none;
}

.plant-fallback.stage-2 .fallback-left {
  bottom: 78px;
  left: 88px;
  width: 72px;
  height: 36px;
}

.plant-fallback.stage-3 {
  --fallback-height: 150px;
}

.plant-fallback.stage-3 .fallback-bloom {
  display: none;
}

.plant-fallback.stage-4 {
  --fallback-height: 188px;
}

.plant-fallback.stage-5 {
  --fallback-height: 188px;
}

.plant-fallback.stage-5 .fallback-bloom::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: -18px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #de553c;
  box-shadow: -76px 6px 0 #de553c;
}

.soil {
  position: absolute;
  z-index: 1;
  bottom: 46px;
  width: min(70%, 560px);
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(141, 90, 49, 0.58), rgba(141, 90, 49, 0.1) 62%, transparent 70%);
}

.progress-panel {
  position: relative;
  z-index: 3;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.74);
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--leaf-dark);
  font-size: 14px;
  font-weight: 900;
}

.progress-header strong {
  padding: 5px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--leaf-dark);
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.progress-track {
  height: 18px;
  border-radius: 999px;
  background: rgba(47, 140, 85, 0.14);
  overflow: hidden;
}

.mature-collect-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(47, 140, 85, 0.22);
  border-radius: 16px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  background: linear-gradient(135deg, rgba(229, 250, 217, 0.96), rgba(255, 248, 225, 0.96));
}

.mature-collect-panel[hidden] {
  display: none;
}

.mature-collect-panel .primary-button {
  flex: 0 0 auto;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--leaf), var(--sun));
  transition: width 260ms ease;
}

.side-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.reward-panel,
.collection-panel {
  padding: 18px;
  border-radius: 24px;
}

.reward-buttons {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.reward-button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(47, 140, 85, 0.18);
  border-radius: 18px;
  color: var(--ink);
  text-align: left;
  background: #fff;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.reward-button:hover {
  transform: translateY(-2px);
  border-color: rgba(47, 140, 85, 0.42);
  box-shadow: 0 12px 28px rgba(47, 140, 85, 0.12);
}

.reward-button:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.reward-button strong {
  font-size: 15px;
}

.water-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 8px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  background: var(--leaf);
}

.text-button {
  color: var(--leaf-dark);
  background: transparent;
  font-weight: 900;
}

.primary-button,
.secondary-button,
.danger-button {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 14px;
  font-weight: 900;
}

.primary-button {
  color: #fff;
  background: var(--leaf-dark);
}

.secondary-button {
  color: var(--ink);
  background: var(--mint);
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

.primary-button,
.secondary-button,
.danger-button,
.text-button {
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.danger-button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.modal-actions {
  position: sticky;
  bottom: -22px;
  z-index: 18;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid rgba(47, 140, 85, 0.14);
  background: linear-gradient(0deg, rgba(255, 253, 245, 0.98), rgba(255, 253, 245, 0.9));
  backdrop-filter: blur(14px);
}

.collection-grid,
.plant-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.collection-item,
.plant-card {
  min-height: 110px;
  border: 1px solid rgba(47, 140, 85, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  overflow: hidden;
  cursor: pointer;
  transition: all 160ms ease;
}

.plant-card:hover {
  border-color: rgba(47, 140, 85, 0.36);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(31, 111, 67, 0.12);
}

.collection-item {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px;
}

.collection-item img,
.plant-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.plant-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  height: 100%;
  justify-content: center;
}

.plant-picker-item img {
  width: 60px;
  height: 60px;
}

.plant-picker-item .plant-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  line-height: 1.2;
}

.plant-picker-item .plant-status {
  font-size: 11px;
  color: #2f8c55;
  font-weight: 500;
  background: rgba(47, 140, 85, 0.08);
  padding: 2px 6px;
  border-radius: 8px;
}

.plant-card.is-active {
  border-color: var(--leaf-dark);
  background: rgba(47, 140, 85, 0.08);
}

.small-fallback {
  width: 44px;
  height: 44px;
  border-radius: 50% 50% 46% 46%;
  background: radial-gradient(circle at 50% 20%, #f7b63b 0 18%, #2f8c55 19% 48%, #8d5a31 49% 100%);
}

.plant-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px 8px;
  color: var(--ink);
}

.plant-card.is-active {
  outline: 3px solid rgba(247, 182, 59, 0.72);
}

.plant-card span {
  max-width: 100%;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
}

.plant-card small {
  color: var(--leaf-dark);
  font-size: 11px;
  font-weight: 900;
}

.empty-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.group-garden-app {
  min-height: 100dvh;
}

.group-layout {
  display: grid;
  gap: clamp(16px, 2vw, 24px);
  max-width: 1480px;
  margin: 0 auto;
}

/* 默认两列布局（如果有需要的话） */
.group-layout:not(.group-layout-compact) {
  grid-template-columns: minmax(270px, 350px) minmax(0, 1fr);
}

/* 紧凑布局模式 - 小组面板占据全部宽度 */
.group-layout-compact {
  grid-template-columns: minmax(0, 1fr);
}

.group-control-panel,
.groups-panel,
.group-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.group-control-panel,
.groups-panel {
  border-radius: 26px;
  padding: clamp(16px, 2vw, 24px);
}

.group-control-panel {
  align-self: start;
  display: grid;
  gap: 18px;
  position: sticky;
  top: 18px;
}

.group-control-panel #active-group-name {
  margin: 0;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.02;
}

.group-reward-panel {
  border-radius: 22px;
  padding: 18px;
  box-shadow: none;
}

.group-helper {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.group-main-heading {
  text-align: center;
}

.group-main-heading h1 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 46px);
  line-height: 1.05;
}

.group-count-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  min-height: 40px;
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
  background: var(--leaf-dark);
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.group-card {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 330px;
  padding: 14px;
  border-radius: 18px;
  outline: 0 solid transparent;
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, outline-color 160ms ease;
}

.group-card:hover,
.group-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(47, 140, 85, 0.36);
  box-shadow: 0 20px 44px rgba(31, 111, 67, 0.18);
}

.group-card.is-active {
  border-color: rgba(247, 182, 59, 0.72);
  outline: 4px solid rgba(247, 182, 59, 0.2);
}

.group-card.is-mature {
  background:
    linear-gradient(180deg, rgba(255, 248, 225, 0.58), rgba(255, 255, 255, 0.74)),
    var(--panel);
}

.group-card.is-magic {
  border-color: rgba(247, 182, 59, 0.62);
}

.group-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.group-card-header h2 {
  margin: 0;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.group-collection-button {
  min-height: 36px;
  padding: 7px 9px;
  border-radius: 12px;
  font-size: 13px;
  white-space: nowrap;
}

.group-plant-scene {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 200px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), transparent 58%),
    linear-gradient(180deg, var(--sky) 0%, #edf8e5 68%, #d5e3a5 100%);
  overflow: hidden;
}

.group-plant-scene.is-magic-scene {
  animation: magicSceneWash 2200ms ease-out both;
  background:
    linear-gradient(180deg, rgba(255, 236, 154, 0.04), transparent 58%),
    linear-gradient(180deg, var(--sky) 0%, #edf8e5 68%, #d5e3a5 100%);
}

.group-plant-scene.is-magic-scene.level-up {
  animation: magicSceneWashLevelUp 3600ms ease-out both !important;
  background:
    linear-gradient(180deg, rgba(255, 236, 154, 0.04), transparent 58%) !important,
    linear-gradient(180deg, var(--sky) 0%, #edf8e5 68%, #d5e3a5 100%) !important;
}

.group-plant-scene.is-magic-scene.level-up .magic-burst span {
  background: linear-gradient(90deg, transparent, #fff9c4, transparent);
  box-shadow:
    0 0 4px 1px rgba(255, 249, 196, 0.7),
    0 0 10px 2px rgba(255, 236, 154, 0.3);
}

.group-plant-scene.is-magic-scene.level-up .magic-burst span:nth-child(3n) {
  background: linear-gradient(90deg, transparent, #ffffff, transparent);
  box-shadow:
    0 0 4px 1px rgba(255, 255, 255, 0.75),
    0 0 10px 2px rgba(255, 236, 154, 0.32);
}

.group-plant-scene.is-magic-scene.level-up .magic-burst span:nth-child(5n) {
  background: linear-gradient(90deg, transparent, #ffe082, transparent);
  box-shadow:
    0 0 4px 1px rgba(255, 224, 130, 0.7),
    0 0 10px 2px rgba(255, 220, 93, 0.3);
}

.group-plant-scene.is-magic-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 236, 154, 0.22), transparent 28%),
    radial-gradient(circle at 65% 45%, rgba(255, 244, 188, 0.18), transparent 32%),
    radial-gradient(circle at 45% 65%, rgba(255, 255, 255, 0.16), transparent 30%),
    radial-gradient(circle at 30% 70%, rgba(255, 239, 153, 0.14), transparent 26%);
  opacity: 0;
  animation: magicSceneTint 2100ms ease-out both;
}

.group-plant-scene.is-magic-scene.level-up::after {
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.18), transparent 28%),
    radial-gradient(circle at 70% 40%, rgba(255, 249, 196, 0.16), transparent 32%),
    radial-gradient(circle at 40% 65%, rgba(255, 236, 154, 0.14), transparent 30%);
  opacity: 0;
  animation: magicSceneTintLevelUp 3600ms ease-out both;
}

.group-plant-scene.is-magic-scene::before {
  display: none;
}

.group-plant-image {
  position: relative;
  z-index: 2;
  display: block;
  width: min(66%, 156px);
  max-height: 138px;
  object-fit: contain;
  filter: drop-shadow(0 15px 18px rgba(32, 50, 42, 0.18));
  transform-origin: center bottom;
}

.group-plant-image.is-stage-fading {
  animation: stageFadeOut 240ms ease-in both;
}

.group-plant-image.is-stage-revealing {
  animation: stageFadeIn 620ms ease-out both;
}

.magic-burst {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.magic-burst::before {
  display: none;
}

.magic-burst::after {
  display: none;
}

.magic-burst span {
  position: absolute;
  left: var(--spark-left);
  bottom: 30px;
  width: calc(12px * var(--spark-size));
  height: calc(2px * var(--spark-size));
  background: linear-gradient(90deg, transparent, #ffffff, transparent);
  opacity: 0;
  transform: translate(-50%, 18px) scale(0.35) rotate(45deg);
  animation: magicSparkRise 1450ms ease-out var(--spark-delay) both;
}

.magic-burst span::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, #ffffff, transparent);
  transform: rotate(90deg);
}

.magic-burst span:nth-child(3n) {
  background: linear-gradient(90deg, transparent, #fff9c4, transparent);
}

.magic-burst span:nth-child(3n)::before {
  background: linear-gradient(90deg, transparent, #fff9c4, transparent);
}

.magic-burst span:nth-child(5n) {
  background: linear-gradient(90deg, transparent, #ffffff, transparent);
}

.group-watering-can {
  position: absolute;
  z-index: 4;
  top: -18px;
  left: 34px;
  width: 104px;
  height: 104px;
  opacity: 0;
  pointer-events: none;
  transform-origin: 58% 54%;
}

.group-watering-can.is-active {
  animation: groupWateringCanPour 2200ms ease-in-out both;
}

.group-watering-can img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 14px 16px rgba(45, 80, 104, 0.24));
}

.group-card-meta,
.group-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.group-card-meta strong {
  font-size: 16px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.group-stage-name,
.group-progress-copy {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.group-stage-name,
.group-progress-copy strong {
  min-width: 0;
  flex: 0 1 auto;
  text-align: right;
}

.group-progress-track {
  height: 12px;
}

.group-card-actions:empty {
  display: none;
}

.settings-grid,
.group-name-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.group-name-editor-wrap {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(47, 140, 85, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.field {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(47, 140, 85, 0.13);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.field input,
.rule-row input,
.reward-row input,
.new-rule input,
.new-reward input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(47, 140, 85, 0.18);
  border-radius: 12px;
  padding: 9px 11px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.field input:focus,
.rule-row input:focus,
.reward-row input:focus,
.new-rule input:focus,
.new-reward input:focus {
  border-color: rgba(47, 140, 85, 0.55);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(47, 140, 85, 0.1);
}

.rule-row input[type="number"],
.reward-row input[type="number"],
.new-rule input[type="number"],
.new-reward input[type="number"] {
  text-align: center;
}

.group-name-field span {
  color: var(--leaf-dark);
}

.group-collection-grid {
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}

/* 历史记录样式 */
.history-table-container {
  max-height: 400px;
  overflow-y: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.history-table th {
  position: sticky;
  top: 0;
  padding: 12px;
  text-align: left;
  font-weight: 900;
  color: var(--muted);
  background: rgba(255, 253, 245, 0.98);
  border-bottom: 2px solid var(--line);
  z-index: 1;
}

.history-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.history-row:hover {
  background: rgba(47, 140, 85, 0.04);
}

.history-amount-add {
  font-weight: 900;
  color: var(--leaf);
}

.history-amount-subtract {
  font-weight: 900;
  color: var(--danger);
}

.history-delete-button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--danger);
  font-size: 18px;
  font-weight: 900;
  background: #fff;
  transition: all 160ms ease;
}

.history-delete-button:hover {
  border-color: var(--danger);
  background: rgba(194, 65, 54, 0.08);
  transform: scale(1.05);
}

.history-delete-button:active {
  transform: scale(0.95);
}

.history-button {
  min-height: 42px;
  padding: 10px 16px;
  border: 2px solid rgba(47, 140, 85, 0.2);
  border-radius: 14px;
  color: var(--leaf-dark);
  background: rgba(47, 140, 85, 0.08);
  font-size: 15px;
  font-weight: 900;
  transition: all 160ms ease;
}

.history-button:hover {
  border-color: rgba(47, 140, 85, 0.4);
  background: rgba(47, 140, 85, 0.16);
  transform: translateY(-1px);
}

.history-button:active {
  transform: translateY(0);
}

/* 按钮区域布局 - 4个按钮 */
.group-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

/* 图标按钮样式 */
.add-points-button,
.subtract-points-button,
.shop-button,
.history-button {
  display: grid;
  place-items: center;
  min-width: 0;
  font-size: 20px;
  padding: 10px;
  line-height: 1;
}

/* 收藏区按钮 */
.group-collection-button {
  font-size: 16px;
}

@media (min-width: 900px) and (max-width: 1320px) {
  .group-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .group-card {
    padding: 12px;
  }

  .group-card-header {
    gap: 8px;
  }

  .group-card-actions {
    gap: 6px;
  }

  .add-points-button,
  .subtract-points-button,
  .shop-button,
  .history-button {
    padding: 8px 6px;
    font-size: 18px;
  }

  .group-card-meta,
  .group-progress-copy {
    gap: 8px;
  }
}

@keyframes magicSceneWash {
  0% {
    filter: brightness(1);
    background-size: 100% 100%;
  }
  50% {
    filter: brightness(1.02);
  }
  100% {
    filter: brightness(1);
    background-size: 110% 110%;
  }
}

@keyframes magicSceneWashLevelUp {
  0% {
    filter: brightness(1);
    background-size: 100% 100%;
  }
  35% {
    filter: brightness(1.03);
  }
  50% {
    filter: brightness(1.04);
  }
  100% {
    filter: brightness(1);
    background-size: 125% 125%;
  }
}

@keyframes magicSceneTint {
  0% {
    opacity: 0;
    transform: scale(1);
  }
  30% {
    opacity: 0.7;
    transform: scale(1.03);
  }
  70% {
    opacity: 0.5;
    transform: scale(1.05);
  }
  100% {
    opacity: 0;
    transform: scale(1.07);
  }
}

@keyframes magicSceneTintLevelUp {
  0% {
    opacity: 0;
    transform: scale(1);
  }
  28% {
    opacity: 0.8;
    transform: scale(1.05);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.08);
  }
  72% {
    opacity: 0.5;
    transform: scale(1.10);
  }
  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}

@keyframes stageFadeOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.6);
  }
}

@keyframes stageFadeIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  60% {
    transform: scale(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes growIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  60% {
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes groupWateringCanPour {
  0% {
    opacity: 0;
    transform: translate(-58%, -34%) rotate(8deg) scale(0.72);
  }
  14% {
    opacity: 1;
    transform: translate(-16%, -14%) rotate(0deg) scale(0.9);
  }
  28%,
  84% {
    opacity: 1;
    transform: translate(0, 0) rotate(18deg) scale(0.96);
  }
  100% {
    opacity: 0;
    transform: translate(-40%, -24%) rotate(4deg) scale(0.78);
  }
}

@keyframes magicSparkRise {
  0% {
    opacity: 0;
    transform: translate(-50%, 18px) scale(0.35);
    filter: blur(0px);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, 10px) scale(1);
    filter: blur(0px);
  }
  40% {
    opacity: 0.95;
    transform: translate(-50%, -20px) scale(0.85) rotate(calc(var(--spark-rotate, 0deg) * 0.3));
    filter: blur(0px);
  }
  70% {
    opacity: 0.7;
    transform: translate(-50%, -50px) scale(0.6) rotate(calc(var(--spark-rotate, 0deg) * 0.6));
    filter: blur(0.5px);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -100px) scale(0.3) rotate(var(--spark-rotate, 0deg));
    filter: blur(1px);
  }
}

@keyframes magicSparkRiseLevelUp {
  0% {
    opacity: 0;
    transform: translate(-50%, 18px) scale(0.45);
    filter: blur(0px);
  }
  12% {
    opacity: 1;
    transform: translate(-50%, 10px) scale(1.15);
    filter: blur(0px);
  }
  35% {
    opacity: 0.98;
    transform: translate(-50%, -25px) scale(0.98) rotate(calc(var(--spark-rotate, 0deg) * 0.25));
    filter: blur(0px);
  }
  65% {
    opacity: 0.85;
    transform: translate(-50%, -60px) scale(0.72) rotate(calc(var(--spark-rotate, 0deg) * 0.55));
    filter: blur(0.5px);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -200px) scale(0.35) rotate(var(--spark-rotate, 0deg));
    filter: blur(1px);
  }
}

@keyframes wateringCanPour {
  0% {
    opacity: 0;
    transform: translate(-58%, -34%) rotate(8deg) scale(0.72);
  }
  14% {
    opacity: 1;
    transform: translate(-16%, -14%) rotate(0deg) scale(0.9);
  }
  28%,
  84% {
    opacity: 1;
    transform: translate(0, 0) rotate(18deg) scale(0.96);
  }
  100% {
    opacity: 0;
    transform: translate(-40%, -24%) rotate(4deg) scale(0.78);
  }
}

.modal {
  width: min(94vw, 560px);
  max-width: calc(100vw - 24px);
  max-height: min(72dvh, 680px);
  margin: 18px auto auto;
  padding: 0;
  border: 0;
  border-radius: 26px;
  background: transparent;
  overflow: hidden;
}

.modal.wide,
.modal-card.wide {
  width: min(94vw, 780px);
  max-width: calc(100vw - 24px);
}

.shop-dialog {
  max-height: 120vh !important;
}

.modal::backdrop {
  background: rgba(32, 50, 42, 0.42);
  backdrop-filter: blur(6px);
}

.modal-card {
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 100%;
  max-height: min(72dvh, 680px);
  padding: 22px;
  border-radius: 26px;
  border: 1px solid rgba(47, 140, 85, 0.16);
  background: rgba(255, 253, 245, 0.96);
  box-shadow: 0 28px 72px rgba(31, 111, 67, 0.22);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-header {
  position: sticky;
  top: -22px;
  z-index: 20;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  min-height: 64px;
  padding: 4px 0 14px;
  border-bottom: 1px solid rgba(47, 140, 85, 0.14);
  background: linear-gradient(180deg, rgba(255, 253, 245, 0.98), rgba(255, 253, 245, 0.92));
  backdrop-filter: blur(14px);
}

.modal-header > div:first-child {
  grid-column: 2;
  min-width: 0;
  text-align: center;
}

.modal-header h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.12;
}

.modal-header-actions {
  grid-column: 3;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  text-align: right;
}

.modal-header .modal-header-actions .close-dialog {
  position: static;
}

.modal-header-actions .icon-button {
  width: 44px;
  height: 44px;
}

.celebration-modal {
  width: min(92vw, 620px);
  max-height: min(88dvh, 680px);
}

.confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.celebration-modal::backdrop {
  background: rgba(28, 45, 38, 0.48);
  backdrop-filter: blur(8px);
}

.success-card,
.celebration-card {
  justify-items: center;
  text-align: center;
}

.celebration-card {
  position: relative;
  gap: 18px;
  max-height: min(88dvh, 680px);
  padding: 38px 28px 30px;
  border: 0;
  border-radius: 28px;
  overflow: hidden;
  background: #fffdf8;
  box-shadow:
    0 26px 70px rgba(27, 72, 52, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.78);
}

.celebration-title {
  width: min(100%, 520px);
  margin: 4px auto 0;
  color: #2f8c55;
  font-size: clamp(26px, 3.2vw, 34px);
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: 0;
}

.celebration-plant-stage {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(100%, 520px);
  min-height: 320px;
  padding: 34px 24px 28px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 28%, rgba(111, 195, 116, 0.28), transparent 34%),
    linear-gradient(180deg, rgba(221, 246, 218, 0.92), rgba(207, 239, 204, 0.9));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.74);
}

.celebration-plant-frame {
  display: grid;
  place-items: center;
  width: 148px;
  height: 132px;
  border-radius: 28px;
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.46), transparent 72%);
}

.celebration-plant-frame img {
  display: block;
  width: 132px;
  max-width: 88%;
  max-height: 122px;
  object-fit: contain;
  filter: drop-shadow(0 12px 14px rgba(32, 50, 42, 0.18));
}

.celebration-card h3 {
  margin: 2px 0 0;
  color: #2f8c55;
  font-size: 28px;
  line-height: 1.1;
}

.success-card p,
.celebration-card p {
  margin: 0;
  color: #2d3d34;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.4;
}

.celebration-intro {
  max-width: 430px;
}

.celebration-card .primary-button {
  min-width: 190px;
  margin-top: 0;
  box-shadow: 0 14px 28px rgba(31, 111, 67, 0.22);
}

@media (max-width: 980px) {
  .garden-layout {
    grid-template-columns: 1fr;
  }

  .group-layout {
    grid-template-columns: 1fr;
  }

  .group-control-panel {
    position: static;
  }

  .stage-panel {
    min-height: auto;
  }

  .side-panel {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .garden-app {
    padding: 12px;
  }

  .topbar,
  .plant-name-row,
  .progress-copy,
  .mature-collect-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .mature-collect-panel .primary-button {
    width: 100%;
  }

  .top-actions {
    align-self: flex-end;
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

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

  .group-main-heading,
  .group-card-header,
  .settings-grid,
  .group-name-editor {
    grid-template-columns: 1fr;
  }

  .group-card {
    min-height: 390px;
  }

  .group-card-header,
  .group-card-meta,
  .group-progress-copy {
    align-items: stretch;
    flex-direction: column;
  }

  .group-main-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .group-collection-button,
  .group-card-actions .primary-button {
    width: 100%;
  }

  .plant-scene {
    min-height: 330px;
  }

  .plant-spot {
    width: 260px;
    height: 300px;
  }

  .sun {
    right: 28px;
    width: 66px;
    height: 66px;
  }

  .watering-animation {
    top: -22px;
    left: 116px;
    width: 150px;
    height: 150px;
  }

  .cloud-b {
    display: none;
  }

  .rule-row,
  .new-rule,
  .reward-row,
  .new-reward,
  .rewards-editor-header {
    grid-template-columns: 1fr;
  }

  .rule-editor-header {
    display: none;
  }

  .rule-row {
    align-items: stretch;
    padding: 12px;
  }

  .modal {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    max-height: 68dvh;
    margin-top: 12px;
  }

  .shop-dialog {
    max-height: 120vh !important;
  }

  .modal-card,
  .modal-card.wide {
    width: 100%;
    max-height: 68dvh;
    padding: 16px;
    border-radius: 20px;
  }

  .shop-modal-card {
    height: 110vh !important;
    max-height: 110vh !important;
  }

  .modal-header {
    top: -16px;
  }

  .modal-actions {
    bottom: -16px;
    justify-content: stretch;
  }

  .modal-actions button,
  .new-rule button,
  .new-reward button {
    width: 100%;
  }

  .celebration-modal {
    max-height: 86dvh;
  }

  .celebration-card {
    gap: 8px;
    max-height: 86dvh;
    padding: 20px 16px 18px;
    border-radius: 22px;
  }

  .celebration-title {
    font-size: 24px;
  }

  .celebration-plant-stage {
    min-height: 260px;
    padding: 26px 16px 22px;
  }

  .celebration-plant-frame {
    width: 116px;
    height: 104px;
    border-radius: 24px;
  }

  .celebration-plant-frame img {
    width: 104px;
    max-height: 96px;
  }

  .celebration-card h3 {
    font-size: 24px;
  }

  .celebration-card p {
    font-size: 18px;
  }

  .celebration-card .primary-button {
    width: 100%;
    min-width: 0;
  }
}

/* 浇水面板弹窗 */
.reward-modal {
  padding: 0;
  border: none;
  background: transparent;
}

.reward-modal::backdrop {
  background: rgba(32, 50, 42, 0.4);
  backdrop-filter: blur(8px);
}

.reward-modal-card {
  max-width: 480px;
  padding: 24px;
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.reward-modal-card .modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.reward-modal-card .modal-header h2 {
  margin: 0;
  font-size: 28px;
}

/* 小组浇水按钮样式 */
.group-water-button {
  width: 100%;
  min-height: 42px;
  margin-top: 8px;
  padding: 10px 16px;
  border: 2px solid rgba(47, 140, 85, 0.3);
  border-radius: 14px;
  color: var(--leaf-dark);
  background: var(--mint);
  font-size: 15px;
  font-weight: 900;
  transition: all 160ms ease;
}

.group-water-button:hover {
  border-color: var(--leaf);
  background: rgba(47, 140, 85, 0.12);
  transform: translateY(-1px);
}

.group-water-button:active {
  transform: translateY(0);
}

/* 响应式调整 */
@media (max-width: 768px) {
  .reward-modal-card {
    max-width: calc(100vw - 32px);
    border-radius: 20px;
  }
}


/* 加分按钮 */
.add-points-button {
  min-height: 42px;
  padding: 10px 16px;
  border: 2px solid rgba(47, 140, 85, 0.3);
  border-radius: 14px;
  color: var(--leaf-dark);
  background: var(--mint);
  font-size: 15px;
  font-weight: 900;
  transition: all 160ms ease;
}

.add-points-button:hover {
  border-color: var(--leaf);
  background: rgba(47, 140, 85, 0.12);
  transform: translateY(-1px);
}

.add-points-button:active {
  transform: translateY(0);
}

/* 减分按钮 */
.subtract-points-button {
  min-height: 42px;
  padding: 10px 16px;
  border: 2px solid rgba(194, 65, 54, 0.3);
  border-radius: 14px;
  color: var(--danger);
  background: rgba(253, 235, 233, 0.8);
  font-size: 15px;
  font-weight: 900;
  transition: all 160ms ease;
}

.subtract-points-button:hover {
  border-color: var(--danger);
  background: rgba(194, 65, 54, 0.08);
  transform: translateY(-1px);
}

.subtract-points-button:active {
  transform: translateY(0);
}

/* 商城按钮 */
.shop-button {
  min-height: 42px;
  padding: 10px 16px;
  border: 2px solid rgba(47, 140, 85, 0.2);
  border-radius: 14px;
  color: var(--leaf-dark);
  background: rgba(47, 140, 85, 0.08);
  font-size: 15px;
  font-weight: 900;
  transition: all 160ms ease;
}

.shop-button:hover {
  border-color: rgba(47, 140, 85, 0.4);
  background: rgba(47, 140, 85, 0.16);
  transform: translateY(-1px);
}

.shop-button:active {
  transform: translateY(0);
}

/* 收藏区按钮样式调整 */
.group-collection-button {
  min-height: 42px;
  padding: 10px 16px;
}

/* 减分面板弹窗 */
.penalty-modal {
  padding: 0;
  border: none;
  background: transparent;
}

.penalty-modal::backdrop {
  background: rgba(32, 50, 42, 0.4);
  backdrop-filter: blur(8px);
}

.penalty-modal-card {
  max-width: 480px;
  padding: 24px;
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.penalty-modal-card .modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.penalty-modal-card .modal-header h2 {
  margin: 0;
  font-size: 28px;
}

/* 减分按钮样式 */
.penalty-buttons {
  display: grid;
  gap: 10px;
}

.penalty-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 12px 16px;
  border: 2px solid rgba(194, 65, 54, 0.2);
  border-radius: 16px;
  background: var(--panel);
  font-size: 15px;
  font-weight: 700;
  transition: all 160ms ease;
}

.penalty-button:hover {
  border-color: rgba(194, 65, 54, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(194, 65, 54, 0.16);
}

.penalty-button:disabled {
  opacity: 0.6;
  transform: none;
}

.penalty-button strong {
  color: var(--danger);
  font-size: 15px;
}

.penalty-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 8px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  background: var(--danger);
}

/* 规则编辑部分分隔 */
.rule-section-header {
  margin: 20px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.rule-section-header:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* 规则两列布局 */
.rules-two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 4px 0 8px 0;
}

.rule-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(47, 140, 85, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.rule-column-header {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(47, 140, 85, 0.14);
}

.rule-column-header h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 900;
  color: var(--leaf-dark);
}

.rule-column.reward-rules .rule-column-header h3 {
  color: var(--leaf);
}

.rule-column.penalty-rules .rule-column-header h3 {
  color: var(--danger);
}

.rule-column-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.rule-editor-list,
.rewards-editor-list {
  display: grid;
  gap: 8px;
}

.rule-row,
.reward-row,
.new-rule,
.new-reward {
  display: grid;
  gap: 8px;
  align-items: center;
}

.rule-row,
.new-rule {
  grid-template-columns: minmax(0, 1fr) 82px 42px;
}

.reward-row,
.new-reward {
  grid-template-columns: minmax(0, 1fr) 92px 74px 42px;
}

.rule-row,
.reward-row {
  padding: 8px;
  border: 1px solid rgba(47, 140, 85, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
}

.new-rule,
.new-reward {
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed rgba(47, 140, 85, 0.28);
  border-radius: 14px;
  background: rgba(231, 246, 223, 0.34);
}

.rewards-editor-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px 74px 42px;
  gap: 8px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.delete-button,
.add-rule-button,
.add-reward-button {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  box-shadow: none;
}

.delete-button {
  color: var(--danger);
  border: 1px solid rgba(194, 65, 54, 0.18);
  background: rgba(253, 235, 233, 0.82);
}

.delete-button:hover {
  border-color: rgba(194, 65, 54, 0.4);
  background: rgba(194, 65, 54, 0.1);
}

.add-rule-button,
.add-reward-button {
  color: #fff;
  background: var(--leaf-dark);
}

.add-rule-button.danger-button {
  color: #fff;
  background: var(--danger);
}

/* 响应式：小屏幕改为单列 */
@media (max-width: 768px) {
  .rules-two-column {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .rule-row,
  .new-rule {
    grid-template-columns: minmax(0, 2fr) minmax(80px, 100px) 44px;
  }

  .penalty-modal-card {
    max-width: calc(100vw - 32px);
    border-radius: 20px;
  }

  .group-card-actions {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .add-points-button,
  .subtract-points-button,
  .shop-button,
  .history-button {
    font-size: 18px;
    padding: 8px;
  }
}


/* 魔法升级特效 */

/* 主标题样式 */
.main-title {
  text-align: center;
  margin: 0 0 16px 0;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  color: var(--leaf-dark);
  line-height: 1.1;
}

/* 调整topbar为居中布局 */
.topbar {
  justify-content: center;
}


/* 主标题样式 - 可编辑 */
.main-title {
  text-align: center;
  margin: 0 0 16px 0;
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 900;
  color: var(--leaf-dark);
  line-height: 1.1;
  cursor: text;
  padding: 8px 16px;
  border-radius: 12px;
  transition: all 200ms ease;
  outline: none;
}

.main-title:hover {
  background: rgba(47, 140, 85, 0.08);
  box-shadow: 0 0 0 2px rgba(47, 140, 85, 0.2);
}

.main-title:focus {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 2px var(--leaf-dark), 0 4px 12px rgba(47, 140, 85, 0.15);
}


/* 多选模式和批量操作 */
.batch-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 20px;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: slideDown 300ms ease-out;
}

.batch-actions.hidden {
  display: none;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.batch-info {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.batch-info span {
  color: var(--leaf-dark);
  font-size: 17px;
}

.batch-buttons {
  display: flex;
  gap: 10px;
}

/* 多选模式下的卡片样式 */
.group-garden-app.multi-select-mode .group-card {
  position: relative;
  cursor: pointer;
}

.group-garden-app.multi-select-mode .group-card::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
	  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  z-index: 10;
}

.group-garden-app.multi-select-mode .group-card.selected::before {
  background: var(--leaf);
  border-color: var(--leaf-dark);
}

.group-garden-app.multi-select-mode .group-card.selected::after {
  content: "✓";
  position: absolute;
  top: 10px;
  left: 50%;
		  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  color: white;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  z-index: 11;
  display: grid;
  place-items: center;
  justify-content: center;
}

.group-garden-app.multi-select-mode .group-card:hover {
  transform: translateY(-2px);
  border-color: var(--leaf);
}

/* 批量操作弹窗 */
.batch-modal {
  padding: 0;
  border: none;
  background: transparent;
}

.batch-modal::backdrop {
  background: rgba(32, 50, 42, 0.4);
  backdrop-filter: blur(8px);
}

.batch-modal-card {
  max-width: 480px;
  padding: 24px;
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.batch-modal-card .modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.batch-modal-card .modal-header h2 {
  margin: 0;
  font-size: 28px;
}

.batch-buttons-grid {
  display: grid;
  gap: 10px;
}

.batch-action-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  font-size: 15px;
  font-weight: 700;
  transition: all 160ms ease;
  text-align: left;
}

.batch-action-button:hover {
  border-color: var(--leaf);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(47, 140, 85, 0.12);
}

.batch-action-button span {
  font-size: 13px;
  color: var(--muted);
}

.batch-action-button strong {
  font-size: 16px;
}

/* 响应式 */
@media (max-width: 768px) {
  .batch-actions {
    flex-direction: column;
    gap: 12px;
  }

  .batch-buttons {
    width: 100%;
  }

  .batch-buttons button {
    flex: 1;
  }
}

/* 商城弹窗样式 */
.shop-dialog {
  padding: 0;
  border: none;
  background: transparent;
  max-height: 120vh !important;
}

.shop-dialog::backdrop {
  background: rgba(32, 50, 42, 0.4);
  backdrop-filter: blur(8px);
}

.shop-modal-card {
  max-width: 900px !important;
  height: 110vh !important;
  padding: 0;
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.shop-modal-card .modal-header {
  padding: 16px 24px;
}

.shop-modal-card .modal-header h2 {
  font-size: 24px;
}

/* 商城标签页 */
.shop-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 24px 0;
  background: linear-gradient(180deg, rgba(47, 140, 85, 0.06) 0%, transparent 100%);
  border-bottom: 2px solid var(--line);
  flex-shrink: 0;
}

.shop-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 12px 12px 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 200ms ease;
  position: relative;
}

.shop-tab:hover {
  background: rgba(47, 140, 85, 0.08);
  color: var(--text);
}

.shop-tab.active {
  background: var(--panel);
  color: var(--leaf-dark);
}

.shop-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--leaf);
  border-radius: 3px 3px 0 0;
}

.tab-icon {
  font-size: 20px;
}

.tab-text {
  font-size: 15px;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(47, 140, 85, 0.15);
  color: var(--leaf-dark);
  font-size: 13px;
  font-weight: 900;
}

.shop-tab.active .tab-badge {
  background: var(--leaf);
  color: #fff;
}

/* 商城面板 */
.shop-panel {
  display: none;
  padding: 16px 24px 20px;
  animation: fadeIn 300ms ease;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.shop-panel.active {
  display: block;
}

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

/* 商城信息 */
.shop-info {
  margin-bottom: 12px;
}

.shop-plants-balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px solid rgba(47, 140, 85, 0.2);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(47, 140, 85, 0.08) 0%, rgba(47, 140, 85, 0.04) 100%);
}

.balance-icon {
  font-size: 20px;
}

.balance-text {
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.balance-count {
  font-size: 20px;
  font-weight: 900;
  color: var(--leaf-dark);
}

.balance-unit {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

/* 商城奖励卡片 */
.shop-items-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.shop-item-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  transition: all 200ms ease;
}

.shop-item-card:hover {
  border-color: var(--leaf);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(47, 140, 85, 0.16);
}

.shop-item-card.is-just-redeemed {
  border-color: rgba(47, 140, 85, 0.72);
  background:
    linear-gradient(180deg, rgba(231, 246, 223, 0.92), rgba(255, 255, 255, 0.92)),
    var(--panel);
  animation: shopRedeemedPulse 680ms ease-out both;
}

.shop-item-icon {
  font-size: 32px;
  text-align: center;
  padding: 2px;
}

.shop-item-name {
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  line-height: 1.2;
}

.shop-item-cost {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 193, 7, 0.1);
}

.shop-item-cost-icon {
  font-size: 14px;
}

.shop-item-cost span:last-child {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.shop-item-redeem-button {
  min-height: 38px;
  padding: 10px 14px;
  border: 2px solid rgba(255, 193, 7, 0.3);
  border-radius: 12px;
  color: #f57c00;
  background: rgba(255, 241, 235, 0.9);
  font-size: 14px;
  font-weight: 900;
  transition: all 200ms ease;
  cursor: pointer;
}

.shop-item-redeem-button:hover:not(:disabled) {
  border-color: #ff9800;
  background: rgba(255, 193, 7, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.24);
}

.shop-item-redeem-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.shop-item-redeem-button.is-success,
.shop-item-redeem-button.is-success:disabled {
  opacity: 1;
  color: #fff;
  border-color: rgba(31, 111, 67, 0.34);
  background: linear-gradient(135deg, var(--leaf), var(--leaf-dark));
  box-shadow: 0 6px 14px rgba(47, 140, 85, 0.22);
}

.balance-count.is-bumping,
.tab-badge.is-bumping {
  animation: shopNumberBump 520ms ease-out both;
}

@keyframes shopRedeemedPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(47, 140, 85, 0);
  }
  45% {
    transform: scale(1.025);
    box-shadow: 0 12px 28px rgba(47, 140, 85, 0.22);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 8px 18px rgba(47, 140, 85, 0.14);
  }
}

@keyframes shopNumberBump {
  0% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.22);
  }
  100% {
    transform: scale(1);
  }
}

/* 兑换记录列表 */
/* 兑换记录表格 */
.shop-history-list {
  display: block;
  overflow-y: auto;
  max-height: calc(95vh - 240px);
  padding: 4px;
}

.shop-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.shop-history-table thead {
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 10;
  border-bottom: 2px solid var(--line);
}

.shop-history-table th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.shop-history-table th:first-child {
  width: 25%;
  border-top-left-radius: 12px;
}

.shop-history-table th:nth-child(2) {
  width: 40%;
}

.shop-history-table th:nth-child(3) {
  width: 20%;
  text-align: center;
}

.shop-history-table th:last-child {
  width: 15%;
  text-align: center;
  border-top-right-radius: 12px;
}

.shop-history-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.shop-history-table tr:last-child td {
  border-bottom: none;
}

.shop-history-table tbody tr:hover {
  background: rgba(47, 140, 85, 0.04);
}

.shop-history-date {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.shop-history-time {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.7;
  margin-top: 2px;
}

.shop-history-item-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.shop-history-item-icon {
  font-size: 24px;
}

.shop-history-cost {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: #f57c00;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.shop-history-delete-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid rgba(194, 65, 54, 0.2);
  border-radius: 10px;
  background: transparent;
  color: var(--danger);
  font-size: 18px;
  cursor: pointer;
  transition: all 160ms ease;
  margin: 0 auto;
}

.shop-history-delete-button:hover {
  border-color: var(--danger);
  background: rgba(194, 65, 54, 0.08);
  transform: scale(1.05);
}

.shop-history-delete-button:active {
  transform: scale(0.95);
}

/* 响应式 - 商城 */
@media (max-width: 768px) {
  .shop-modal-card {
    max-width: calc(100vw - 32px);
    height: 110vh !important;
    border-radius: 20px;
  }

  .shop-tabs {
    padding: 12px 16px 0;
  }

  .shop-tab {
    padding: 10px 16px;
    gap: 6px;
  }

  .tab-icon {
    font-size: 18px;
  }

  .tab-text {
    font-size: 14px;
  }

  .shop-panel {
    padding: 16px;
  }

  .shop-items-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .shop-item-card {
    padding: 12px;
    gap: 6px;
  }

  .shop-item-icon {
    font-size: 32px;
  }

  .shop-item-name {
    font-size: 13px;
  }

  .shop-item-redeem-button {
    min-height: 34px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .shop-history-table th,
  .shop-history-table td {
    padding: 10px 8px;
    font-size: 12px;
  }

  .shop-history-table th:first-child,
  .shop-history-table td:first-child {
    width: 20%;
  }

  .shop-history-table th:nth-child(2),
  .shop-history-table td:nth-child(2) {
    width: 45%;
  }

  .shop-history-table th:nth-child(3),
  .shop-history-table td:nth-child(3) {
    width: 20%;
  }

  .shop-history-table th:last-child,
  .shop-history-table td:last-child {
    width: 15%;
  }

  .shop-history-item-icon {
    font-size: 20px;
  }

  .shop-history-delete-button {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
}

/* Toast提示 */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  min-width: 300px;
  max-width: 90vw;
  padding: 20px 28px;
  border-radius: 16px;
  background: rgba(32, 50, 42, 0.98);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(16px);
  z-index: 999999;
  opacity: 0;
  transition: all 400ms cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

/* 商城弹窗内的Toast - 显示在中央 */
.shop-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  min-width: 300px;
  padding: 20px 32px;
  background: linear-gradient(135deg, rgba(47, 140, 85, 0.98) 0%, rgba(34, 100, 62, 0.98) 100%);
  box-shadow: 0 16px 48px rgba(47, 140, 85, 0.4);
  z-index: 1000;
  opacity: 0;
  transition: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.shop-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: linear-gradient(135deg, rgba(47, 140, 85, 0.95) 0%, rgba(34, 100, 62, 0.95) 100%);
}

.toast.error {
  background: linear-gradient(135deg, rgba(194, 65, 54, 0.95) 0%, rgba(158, 50, 42, 0.95) 100%);
}

.toast.info {
  background: linear-gradient(135deg, rgba(47, 140, 85, 0.95) 0%, rgba(34, 100, 62, 0.95) 100%);
}
