:root {
  --forest: #183c2c;
  --forest-deep: #0d241b;
  --moss: #5d7b5b;
  --cream: #fff8e9;
  --cream-soft: #fbf0d7;
  --paper: #fffdf7;
  --ink: #17251d;
  --muted: #667369;
  --gold: #c8a96b;
  --danger: #9b3f32;
  --shadow: 0 18px 42px rgba(20, 45, 33, 0.14);
  --soft-shadow: 0 10px 28px rgba(20, 45, 33, 0.1);
  color-scheme: light;
  font-family:
    "PingFang TC",
    "Noto Sans TC",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  font-weight: 400;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(200, 169, 107, 0.22), transparent 28rem),
    linear-gradient(180deg, var(--cream) 0%, #f6ecd6 100%);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 20px 16px 44px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 112px;
  gap: 12px;
  overflow: hidden;
  min-height: 242px;
  padding: 24px 20px;
  border: 1px solid rgba(24, 60, 44, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.93), rgba(255, 248, 233, 0.82)),
    linear-gradient(155deg, rgba(24, 60, 44, 0.13), transparent);
  box-shadow: var(--shadow);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid rgba(200, 169, 107, 0.34);
  border-radius: 6px;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.kicker {
  margin: 0 0 8px;
  color: var(--moss);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  font-family:
    "Kaiti TC",
    "STKaiti",
    "BiauKai",
    "Noto Serif TC",
    "Songti TC",
    serif;
  font-weight: 500;
}

h1 {
  color: var(--forest-deep);
  font-size: clamp(2.45rem, 14vw, 4rem);
  line-height: 0.96;
}

h2 {
  color: var(--forest);
  font-size: 1.25rem;
  line-height: 1.25;
}

.latin {
  max-width: 16rem;
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.water-chip {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  margin-top: auto;
  padding: 10px 12px;
  border: 1px solid rgba(24, 60, 44, 0.1);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.76);
  box-shadow: 0 8px 20px rgba(20, 45, 33, 0.08);
}

.water-chip small {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.72rem;
}

.water-chip small:empty {
  display: none;
}

.chip-label {
  color: var(--muted);
  font-size: 0.78rem;
}

.water-chip strong {
  color: var(--forest);
  font-size: 0.95rem;
}

.plant-shrine {
  position: relative;
  z-index: 1;
  align-self: end;
  justify-self: center;
  width: 108px;
  height: 190px;
}

.halo {
  position: absolute;
  top: 0;
  left: 18px;
  width: 74px;
  height: 74px;
  border: 1px solid rgba(200, 169, 107, 0.55);
  border-radius: 999px;
  background: rgba(255, 248, 233, 0.52);
}

.pot {
  position: absolute;
  bottom: 0;
  left: 10px;
  width: 88px;
  height: 62px;
  border-radius: 6px 6px 18px 18px;
  background: linear-gradient(180deg, #283f31, #13281e);
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, 0.04);
}

.pot::after {
  content: "";
  position: absolute;
  right: 13px;
  bottom: 15px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0a1712;
  box-shadow: 18px 0 0 #0a1712;
  opacity: 0.95;
}

.stem,
.leaf {
  position: absolute;
  background: var(--forest-deep);
}

.stem {
  bottom: 52px;
  width: 4px;
  border-radius: 999px;
  transform-origin: bottom;
}

.stem-a {
  left: 44px;
  height: 112px;
  transform: rotate(-10deg);
}

.stem-b {
  left: 52px;
  height: 126px;
  transform: rotate(13deg);
}

.leaf {
  width: 42px;
  height: 22px;
  border-radius: 999px 999px 999px 4px;
  background: linear-gradient(135deg, #07120e, #273e31);
  box-shadow: 0 4px 10px rgba(7, 18, 14, 0.16);
}

.leaf-a {
  left: 7px;
  top: -82px;
  transform: rotate(-33deg);
}

.leaf-b {
  right: 3px;
  top: -92px;
  transform: scaleX(-1) rotate(-32deg);
}

.leaf-c {
  left: 2px;
  top: -122px;
  transform: rotate(-42deg);
}

.leaf-d {
  right: -5px;
  top: -132px;
  transform: scaleX(-1) rotate(-43deg);
}

.leaf-e {
  left: 33px;
  top: -152px;
  transform: rotate(-75deg);
}

.notice-panel {
  display: none;
  margin: 16px 0 0;
  padding: 13px 14px;
  border: 1px solid rgba(93, 123, 91, 0.22);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
  box-shadow: var(--soft-shadow);
  color: var(--forest);
  font-weight: 500;
  line-height: 1.5;
}

.notice-panel.is-visible {
  display: block;
}

.notice-panel.is-wet {
  border-color: rgba(155, 63, 50, 0.24);
  color: var(--danger);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.stat-card,
.form-card,
.message-board,
.timeline-card,
.empty-state {
  border: 1px solid rgba(24, 60, 44, 0.09);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.9);
  box-shadow: var(--soft-shadow);
}

.stat-card {
  min-height: 96px;
  padding: 14px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  color: var(--forest-deep);
  font-family: "Songti TC", "Noto Serif TC", serif;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
}

.actions {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
  padding: 8px 0;
  backdrop-filter: blur(14px);
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}

button span {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.82rem;
}

.primary-button {
  background: var(--forest);
  color: #fffdf7;
  box-shadow: 0 12px 24px rgba(24, 60, 44, 0.2);
}

.secondary-button {
  border: 1px solid rgba(24, 60, 44, 0.16);
  background: var(--paper);
  color: var(--forest);
  box-shadow: var(--soft-shadow);
}

.ghost-button {
  display: none;
  grid-column: 1 / -1;
  min-height: 38px;
  border: 1px solid rgba(24, 60, 44, 0.12);
  background: rgba(255, 253, 247, 0.58);
  color: var(--muted);
  box-shadow: none;
  font-size: 0.86rem;
}

.ghost-button.is-visible {
  display: block;
}

.full-width {
  width: 100%;
  margin-top: 4px;
}

.form-card {
  display: none;
  padding: 18px;
}

.form-card.is-open {
  display: block;
}

.section-heading {
  margin-bottom: 14px;
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--forest);
  font-size: 0.9rem;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(24, 60, 44, 0.16);
  border-radius: 8px;
  background: #fffefa;
  color: var(--ink);
  outline: 0;
  padding: 11px 12px;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(93, 123, 91, 0.75);
  box-shadow: 0 0 0 4px rgba(93, 123, 91, 0.12);
}

.timeline-section {
  margin-top: 22px;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-card {
  overflow: hidden;
}

.timeline-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: var(--cream-soft);
}

.timeline-body {
  padding: 15px;
}

.timeline-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.timeline-title-row {
  min-width: 0;
}

.timeline-date {
  color: var(--forest-deep);
  font-weight: 600;
}

.badge {
  flex: 0 0 auto;
  max-width: 8rem;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(93, 123, 91, 0.12);
  color: var(--forest);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
}

.badge.warning {
  background: rgba(200, 169, 107, 0.18);
}

.badge.danger {
  background: rgba(155, 63, 50, 0.12);
  color: var(--danger);
}

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

.delete-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(155, 63, 50, 0.18);
  background: rgba(155, 63, 50, 0.08);
  color: var(--danger);
  box-shadow: none;
  font-size: 0.82rem;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.meta-pill {
  padding: 7px 9px;
  border-radius: 999px;
  background: rgba(255, 248, 233, 0.9);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.message-board {
  margin-top: 22px;
  padding: 18px;
}

.messages {
  display: grid;
  gap: 14px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 2px 12px;
}

.message-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 9px;
  align-items: end;
}

.message-row.is-mrgu {
  grid-template-columns: minmax(0, 1fr) 38px;
}

.message-avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(24, 60, 44, 0.12);
  border-radius: 50%;
  background: var(--cream-soft);
  font-size: 1.18rem;
  box-shadow: 0 5px 12px rgba(20, 45, 33, 0.09);
}

.message-row.is-mrgu .message-avatar {
  grid-column: 2;
  background: #e8efe8;
}

.message-content {
  min-width: 0;
  max-width: 86%;
}

.message-row.is-mrgu .message-content {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
}

.message-name {
  display: block;
  margin: 0 0 5px 7px;
  color: var(--muted);
  font-size: 0.74rem;
}

.message-row.is-mrgu .message-name {
  margin: 0 7px 5px 0;
  text-align: right;
}

.message-bubble {
  position: relative;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px 8px 8px 2px;
  background: #fff2cf;
  color: #39463e;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.message-row.is-mrgu .message-bubble {
  border-radius: 8px 8px 2px 8px;
  background: #e6efe8;
}

.message-time {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.68rem;
}

.message-row.is-mrgu .message-time {
  text-align: right;
}

.message-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(24, 60, 44, 0.09);
}

.speaker-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.speaker-picker legend {
  grid-column: 1 / -1;
  margin-bottom: 7px;
  color: var(--forest);
  font-size: 0.9rem;
  font-weight: 500;
}

.speaker-option {
  display: block;
}

.speaker-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.speaker-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid rgba(24, 60, 44, 0.13);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
}

.speaker-choice b {
  margin-right: 6px;
  font-size: 1rem;
}

.speaker-option input:checked + .speaker-choice {
  border-color: rgba(24, 60, 44, 0.44);
  background: var(--cream-soft);
  color: var(--forest-deep);
  box-shadow: 0 0 0 3px rgba(93, 123, 91, 0.08);
}

.watering-card {
  border-left: 3px solid #789a91;
  background: rgba(241, 248, 245, 0.94);
}

.watering-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #dcece7;
  color: var(--forest);
  font-size: 0.76rem;
}

.timeline-card p {
  margin: 8px 0 0;
  color: #334239;
  line-height: 1.55;
}

.empty-state {
  padding: 22px 18px;
  text-align: center;
}

.empty-state strong {
  color: var(--forest-deep);
}

.empty-state p {
  margin: 8px auto 0;
  max-width: 24rem;
  color: var(--muted);
  line-height: 1.55;
}

@media (min-width: 680px) {
  .app-shell {
    padding-top: 32px;
  }

  .hero {
    grid-template-columns: 1fr 160px;
    min-height: 280px;
    padding: 32px;
  }

  .plant-shrine {
    width: 140px;
    transform: scale(1.18);
  }

  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .form-card {
    padding: 22px;
  }
}
