:root {
  --paper: #f5eddf;
  --paper-deep: #ecdfc8;
  --paper-line: #e3d5bd;
  --ink: #3a342e;
  --ink-soft: #6f6457;
  --ink-faint: #9a8d7b;
  --green: #5b7a63;
  --green-deep: #3f5a47;
  --green-soft: #dbe5d8;
  --tomato: #c25e4a;
  --tomato-soft: #f2d7d0;
  --mustard: #e0ae4a;
  --mustard-soft: #f6e6bf;
  --blue: #7c93a6;
  --blue-soft: #dde6ec;
  --pink: #d98e8e;
  --white: #fffdf8;
  --c-happy: #e0ae4a;
  --c-sad: #7c93a6;
  --c-angry: #c25e4a;
  --c-neutral: #8fa57f;
  --hand: "LXGW WenKai", "LXGW WenKai Screen", "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --shadow-card: 0 1px 0 #fff inset, 0 14px 28px -18px rgba(92, 70, 40, 0.5), 0 3px 8px rgba(92, 70, 40, 0.1);
  --shadow-soft: 0 8px 20px -14px rgba(92, 70, 40, 0.55);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.75), transparent 46%),
    radial-gradient(circle at 88% 4%, rgba(224, 174, 74, 0.12), transparent 40%),
    linear-gradient(0deg, rgba(150, 125, 90, 0.055) 1px, transparent 1px);
  background-size: auto, auto, 100% 30px;
  -webkit-font-smoothing: antialiased;
}

.file-warning {
  position: relative;
  z-index: 2;
  padding: 24px 18px;
}

.file-warning-card {
  max-width: 640px;
  margin: 40px auto;
  background: var(--white);
  border: 1px solid var(--paper-line);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  padding: 28px 30px;
  line-height: 1.9;
}

.file-warning-card h2 {
  margin: 0 0 10px;
  font-family: var(--hand);
  font-size: 24px;
  color: var(--green-deep);
}

.file-warning-card p {
  margin: 0 0 10px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.file-warning-card ul {
  margin: 0 0 12px;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.file-warning-card code {
  background: var(--paper-deep);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 12.5px;
  color: #7a5713;
}

.paper-texture {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.42;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
}

.doodle {
  position: fixed;
  z-index: 0;
  color: rgba(91, 122, 99, 0.28);
  font-size: 28px;
  pointer-events: none;
  user-select: none;
}

.doodle-1 {
  top: 120px;
  left: 3vw;
  transform: rotate(-12deg);
}

.doodle-2 {
  bottom: 15vh;
  right: 3vw;
  font-size: 38px;
  color: rgba(194, 94, 74, 0.22);
  transform: rotate(8deg);
}

.topbar,
.tabbar,
.view,
.site-foot {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 22px 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  font-size: 24px;
  background: var(--white);
  border-radius: 14px;
  border: 1px solid var(--paper-line);
  box-shadow: var(--shadow-soft);
  transform: rotate(-3deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text strong {
  font-family: var(--hand);
  font-size: 25px;
  letter-spacing: 1px;
}

.brand-text small {
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.5px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, color 0.16s ease;
  min-height: 40px;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn:focus-visible {
  outline: 3px solid rgba(91, 122, 99, 0.35);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--green-deep);
  color: #fff;
  box-shadow: 0 6px 14px -8px rgba(63, 90, 71, 0.9);
}

.btn-primary:hover {
  background: #496a55;
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(255, 253, 248, 0.7);
  border-color: var(--paper-line);
  color: var(--ink-soft);
}

.btn-ghost:hover {
  background: var(--white);
  color: var(--ink);
}

.btn-tomato {
  background: var(--tomato);
  color: #fff;
}

.btn-mustard {
  background: var(--mustard);
  color: #5a4315;
}

.btn-outline {
  background: transparent;
  border-color: var(--green);
  color: var(--green-deep);
}

.btn-lg {
  padding: 13px 26px;
  font-size: 15px;
  min-height: 48px;
}

.btn-sm {
  padding: 6px 13px;
  font-size: 12.5px;
  min-height: 32px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.tabbar {
  display: flex;
  gap: 4px;
  max-width: 1180px;
  margin: 4px auto 0;
  padding: 8px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(255, 253, 248, 0.62);
  border: 1px solid rgba(217, 203, 179, 0.85);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(6px);
}

.tabbar::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 8px 15px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease;
}

.tab:hover {
  background: rgba(91, 122, 99, 0.1);
  color: var(--green-deep);
}

.tab.active {
  background: var(--green-deep);
  color: #fff;
  box-shadow: 0 4px 10px -6px rgba(63, 90, 71, 0.9);
}

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

.view {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 22px 132px;
  outline: none;
  animation: viewIn 0.28s ease both;
}

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

.site-foot {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 22px 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  color: var(--ink-faint);
  font-size: 12px;
}

.foot-sep {
  opacity: 0.6;
}

.card {
  position: relative;
  overflow-wrap: break-word;
  background: var(--white);
  border: 1px solid rgba(160, 140, 110, 0.2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.card::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 0 20px 20px;
  border-color: transparent transparent var(--paper-deep) transparent;
  border-radius: 0 0 var(--radius) 0;
}

.card--flat::after {
  display: none;
}

.card--green {
  background: linear-gradient(160deg, #fffdf8 0%, #f2f6ef 100%);
}

.card--mustard {
  background: linear-gradient(160deg, #fffdf8 0%, #fbf1d8 100%);
}

.card--tomato {
  background: linear-gradient(160deg, #fffdf8 0%, #f9e7e2 100%);
}

.card--blue {
  background: linear-gradient(160deg, #fffdf8 0%, #eef3f6 100%);
}

.tape {
  position: absolute;
  opacity: 0.92;
  mix-blend-mode: multiply;
  top: -12px;
  left: 50%;
  width: 108px;
  height: 24px;
  margin-left: -54px;
  background: rgba(224, 174, 74, 0.55);
  transform: rotate(-3.5deg);
  box-shadow: 0 2px 4px rgba(120, 95, 50, 0.12);
  border-left: 1px dashed rgba(255, 255, 255, 0.65);
  border-right: 1px dashed rgba(255, 255, 255, 0.65);
  pointer-events: none;
}

.tape--green {
  background: rgba(143, 165, 127, 0.5);
  transform: rotate(2.5deg);
}

.tape--blue {
  background: rgba(124, 147, 166, 0.45);
  transform: rotate(-2deg);
}

.tape--tomato {
  background: rgba(194, 94, 74, 0.4);
  transform: rotate(3deg);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 6px;
}

.page-title {
  margin: 0;
  font-family: var(--hand);
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.2;
  letter-spacing: 1px;
}

.page-sub {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  max-width: 62ch;
}

.section-title {
  font-family: var(--hand);
  font-size: 22px;
  margin: 0 0 4px;
  letter-spacing: 0.5px;
}

.section-sub {
  margin: 0 0 16px;
  color: var(--ink-faint);
  font-size: 12.5px;
}

.muted {
  color: var(--ink-soft);
}

.faint {
  color: var(--ink-faint);
}

.hand {
  font-family: var(--hand);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wrap {
  flex-wrap: wrap;
}

.between {
  justify-content: space-between;
}

.grid {
  display: grid;
  gap: 20px;
}

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

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

.grid-side {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.divider {
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--paper-line) 0 6px, transparent 6px 12px);
  margin: 18px 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.pill--mustard {
  background: var(--mustard-soft);
  color: #7a5713;
}

.pill--tomato {
  background: var(--tomato-soft);
  color: #8f3a2b;
}

.pill--blue {
  background: var(--blue-soft);
  color: #4b6274;
}

.pill--ghost {
  background: rgba(255, 253, 248, 0.7);
  border: 1px dashed var(--paper-line);
  color: var(--ink-soft);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.date-block {
  display: flex;
  align-items: center;
  gap: 18px;
}

.date-day {
  font-family: var(--hand);
  font-size: clamp(56px, 9vw, 86px);
  line-height: 0.9;
  color: var(--green-deep);
}

.date-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.date-meta .month {
  font-family: var(--hand);
  font-size: 21px;
}

.date-meta .weekday {
  color: var(--ink-soft);
  font-size: 13px;
}

.date-meta .lunar {
  color: var(--ink-faint);
  font-size: 12px;
}

.weather-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 0;
}

.weather-emoji {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  font-size: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  border: 2px dashed rgba(160, 140, 110, 0.35);
  flex: 0 0 auto;
}

.weather-name {
  font-family: var(--hand);
  font-size: 24px;
  margin: 0 0 2px;
}

.weather-note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.greet {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.greet-bubble {
  position: relative;
  background: var(--green-soft);
  border-radius: 14px 14px 14px 4px;
  padding: 14px 18px;
  font-size: 14px;
  color: #35462f;
  flex: 1;
}

.greet-bubble::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 18px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 10px 8px 0;
  border-color: transparent var(--green-soft) transparent transparent;
}

.greet-bubble strong {
  font-family: var(--hand);
  font-size: 16px;
  display: block;
  margin-bottom: 2px;
}

.panda {
  width: 84px;
  flex: 0 0 auto;
  animation: floaty 4.2s ease-in-out infinite;
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-6px) rotate(1deg);
  }
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat {
  background: rgba(255, 253, 248, 0.72);
  border: 1px dashed var(--paper-line);
  border-radius: 12px;
  padding: 12px 14px;
}

.stat-label {
  display: block;
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.5px;
}

.stat-num {
  font-family: var(--hand);
  font-size: 26px;
  line-height: 1.25;
  color: var(--green-deep);
}

.stat-num small {
  font-size: 12px;
  color: var(--ink-faint);
  margin-left: 3px;
  font-family: var(--sans);
}

.quote {
  font-family: var(--hand);
  font-size: 19px;
  line-height: 1.75;
  color: #4a4136;
  padding-left: 16px;
  border-left: 3px solid var(--mustard);
  margin: 0;
}

.quote small {
  display: block;
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-faint);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 31px;
  top: 10px;
  bottom: 10px;
  border-left: 2px dashed var(--paper-line);
}

.tl-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  position: relative;
}

.tl-time {
  flex: 0 0 42px;
  font-size: 12px;
  color: var(--ink-faint);
  padding-top: 9px;
  text-align: right;
}

.tl-dot {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: var(--white);
  border: 2px solid var(--ec, var(--paper-line));
  z-index: 1;
}

.tl-body {
  flex: 1;
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(217, 203, 179, 0.7);
  border-radius: 12px;
  padding: 10px 14px;
}

.tl-body .tl-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.tl-body p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 12.5px;
}

.empty-note {
  text-align: center;
  padding: 26px 12px;
  color: var(--ink-faint);
  font-size: 13px;
  border: 1px dashed var(--paper-line);
  border-radius: 12px;
}

.record-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.cam-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #2a2622;
  border-radius: 14px;
  overflow: hidden;
  border: 6px solid var(--white);
  box-shadow: var(--shadow-soft);
}

.cam-stage video,
.cam-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cam-stage video {
  transform: scaleX(-1);
}

.cam-stage canvas {
  pointer-events: none;
}

.cam-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: #d8cbb6;
  text-align: center;
  padding: 24px;
}

.cam-empty .big {
  font-size: 44px;
}

.cam-empty p {
  margin: 0;
  font-size: 13px;
  max-width: 28ch;
  line-height: 1.7;
}

.cam-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  background: rgba(255, 253, 248, 0.9);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--green-deep);
  display: none;
  align-items: center;
  gap: 6px;
}

.cam-badge.on {
  display: inline-flex;
}

.cam-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.upload-zone {
  display: grid;
  place-items: center;
  gap: 6px;
  text-align: center;
  padding: 26px 16px;
  border: 2px dashed var(--paper-line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.55);
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--green);
  background: rgba(219, 229, 216, 0.55);
  transform: translateY(-1px);
}

.upload-zone .up-icon {
  font-size: 30px;
}

.upload-zone p {
  margin: 0;
  font-size: 13px;
}

.upload-zone small {
  color: var(--ink-faint);
  font-size: 11.5px;
}

.result-card {
  flex: 1;
  min-height: 100%;
}

.result-empty {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  text-align: center;
  padding: 30px 16px;
  color: var(--ink-faint);
}

.result-empty .big {
  font-size: 42px;
  opacity: 0.7;
}

.emoji-big {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 4px;
  animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.5, 1) both;
}

@keyframes pop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.emotion-title {
  font-family: var(--hand);
  font-size: 30px;
  margin: 0;
  color: var(--ec, var(--ink));
}

.conf-bar {
  height: 12px;
  border-radius: 999px;
  background: var(--paper-deep);
  overflow: hidden;
  margin: 14px 0 6px;
}

.conf-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mustard), var(--ec, var(--green)));
  transition: width 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.conf-label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-faint);
}

.manual-block {
  margin-top: 20px;
}

.emotion-pick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}

.emotion-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  border-radius: 12px;
  border: 2px solid transparent;
  background: rgba(255, 253, 248, 0.75);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-soft);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.emotion-btn span {
  font-size: 26px;
  line-height: 1.1;
}

.emotion-btn:hover {
  transform: translateY(-2px);
}

.emotion-btn.selected {
  border-color: var(--ec);
  background: color-mix(in srgb, var(--ec) 14%, #fffdf8);
  color: var(--ink);
  font-weight: 700;
}

.emotion-btn:focus-visible {
  outline: 3px solid rgba(91, 122, 99, 0.3);
  outline-offset: 2px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field > label,
.field-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.3px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
  cursor: pointer;
}

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(219, 229, 216, 0.45);
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.input,
textarea.input,
select.input {
  width: 100%;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  padding: 10px 13px;
  border-radius: 10px;
  border: 1px solid var(--paper-line);
  background: rgba(255, 253, 248, 0.86);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(91, 122, 99, 0.14);
}

textarea.input {
  resize: vertical;
  min-height: 96px;
  line-height: 1.7;
}

.range {
  width: 100%;
  accent-color: var(--green);
  cursor: pointer;
}

.range-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-val {
  min-width: 44px;
  text-align: center;
  font-family: var(--hand);
  font-size: 18px;
  color: var(--green-deep);
}

.tag-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-opt {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px dashed var(--paper-line);
  background: rgba(255, 253, 248, 0.7);
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tag-opt:hover {
  border-color: var(--green);
}

.tag-opt.on {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: #fff;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 8px;
  background: rgba(224, 174, 74, 0.16);
  border: 1px solid rgba(224, 174, 74, 0.3);
  color: #7a5713;
  font-size: 11.5px;
}

.garden-stage {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #f3f7ee 0%, #e8f0e2 55%, #efe6d3 55%, #e8dcc5 100%);
  border: 1px solid var(--paper-line);
  box-shadow: var(--shadow-card);
}

.garden-svg {
  display: block;
  width: 100%;
  height: auto;
}

.garden-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.mini-stat {
  background: rgba(255, 253, 248, 0.76);
  border: 1px dashed var(--paper-line);
  border-radius: 12px;
  padding: 10px 13px;
}

.mini-stat b {
  display: block;
  font-family: var(--hand);
  font-size: 21px;
  color: var(--green-deep);
  line-height: 1.3;
}

.mini-stat span {
  font-size: 11.5px;
  color: var(--ink-faint);
}

.water-log {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow: auto;
}

.water-log li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid rgba(217, 203, 179, 0.7);
  font-size: 12.5px;
}

.diary-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.day-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

.day-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 253, 248, 0.6);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 12.5px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.day-chip:hover {
  background: var(--white);
  border-color: var(--paper-line);
}

.day-chip.active {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: #fff;
}

.day-chip .d-week {
  font-size: 10.5px;
  opacity: 0.75;
}

.diary-paper {
  position: relative;
  background: var(--white);
  background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(160, 140, 110, 0.16) 31px 32px);
  border: 1px solid var(--paper-line);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 30px 30px 24px;
}

.diary-paper::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(194, 94, 74, 0.25);
}

.diary-paper textarea {
  width: 100%;
  min-height: 260px;
  border: none;
  background: transparent;
  resize: vertical;
  font-family: var(--hand);
  font-size: 16px;
  line-height: 32px;
  color: var(--ink);
  outline: none;
  padding: 6px 0 0 20px;
}

.diary-date {
  font-family: var(--hand);
  font-size: 20px;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.story-sec {
  background: rgba(255, 253, 248, 0.74);
  border-left: 3px solid var(--mustard);
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
}

.story-sec h4 {
  margin: 0 0 4px;
  font-family: var(--hand);
  font-size: 17px;
  color: var(--green-deep);
}

.story-sec p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.8;
}

.rescue-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card), 0 18px 26px -20px rgba(92, 70, 40, 0.6);
}

.tool-card .tool-icon {
  font-size: 36px;
}

.tool-card h3 {
  font-family: var(--hand);
  font-size: 21px;
  margin: 0;
}

.tool-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.7;
}

.tool-card .tool-meta {
  margin-top: auto;
  padding-top: 8px;
  font-size: 11.5px;
  color: var(--ink-faint);
}

.breath-stage {
  display: grid;
  place-items: center;
  gap: 18px;
  padding: 12px 0 4px;
}

.breath-ring {
  position: relative;
  width: 220px;
  height: 220px;
  display: grid;
  place-items: center;
}

.breath-ring .ring-bg,
.breath-ring .ring-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.breath-ring .ring-bg {
  border: 1px dashed var(--paper-line);
}

.breath-ring .ring-fill {
  background: radial-gradient(circle at 50% 45%, rgba(143, 165, 127, 0.32), rgba(143, 165, 127, 0.08) 70%);
  border: 2px solid rgba(91, 122, 99, 0.5);
  transform: scale(0.6);
  transition: transform 4s linear;
}

.breath-ring.inhale .ring-fill {
  transform: scale(1);
  transition-duration: 4s;
}

.breath-ring.hold .ring-fill {
  transform: scale(1);
  transition-duration: 0.4s;
}

.breath-ring.exhale .ring-fill {
  transform: scale(0.6);
  transition-duration: 7s;
}

.breath-center {
  position: relative;
  text-align: center;
  z-index: 1;
}

.breath-phase {
  font-family: var(--hand);
  font-size: 27px;
  color: var(--green-deep);
  line-height: 1.2;
}

.breath-count {
  font-size: 13px;
  color: var(--ink-faint);
}

.breath-rounds {
  font-size: 12px;
  color: var(--ink-soft);
}

.grounding-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ground-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(217, 203, 179, 0.7);
}

.ground-step.done {
  background: var(--green-soft);
  border-color: rgba(91, 122, 99, 0.35);
}

.ground-step .gs-num {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--white);
  border: 2px solid var(--mustard);
  font-family: var(--hand);
  font-size: 16px;
  color: #7a5713;
}

.ground-step.done .gs-num {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: #fff;
}

.ground-step .gs-body {
  flex: 1;
}

.ground-step .gs-body b {
  display: block;
  font-size: 13.5px;
}

.ground-step .gs-body small {
  color: var(--ink-faint);
  font-size: 11.5px;
}

.ground-step .input {
  margin-top: 6px;
  font-size: 12.5px;
  padding: 7px 10px;
}

.scan-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: scan;
}

.scan-steps li {
  padding: 10px 14px 10px 42px;
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid rgba(217, 203, 179, 0.6);
  font-size: 12.5px;
  color: var(--ink-soft);
  position: relative;
  counter-increment: scan;
}

.scan-steps li::before {
  content: counter(scan);
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--mustard-soft);
  color: #7a5713;
  font-size: 11px;
  font-weight: 700;
}

.scan-steps li.active {
  background: var(--green-soft);
  color: var(--green-deep);
  font-weight: 600;
}

.heatmap-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.heatmap {
  display: grid;
  grid-template-columns: 48px repeat(31, 16px);
  gap: 3px;
  min-width: 640px;
  align-items: center;
}

.hm-label {
  font-size: 10.5px;
  color: var(--ink-faint);
  text-align: right;
  padding-right: 4px;
  white-space: nowrap;
}

.hm-col {
  font-size: 9.5px;
  color: var(--ink-faint);
  text-align: center;
  line-height: 1;
}

.hm-cell {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: rgba(217, 203, 179, 0.35);
  transition: transform 0.12s ease;
}

.hm-cell[data-level="1"] {
  background: #dce7d8;
}

.hm-cell[data-level="2"] {
  background: #b9cfb2;
}

.hm-cell[data-level="3"] {
  background: #8bb08f;
}

.hm-cell[data-level="4"] {
  background: #5b7a63;
}

.hm-cell:hover {
  transform: scale(1.25);
  outline: 2px solid rgba(91, 122, 99, 0.4);
}

.hm-cell.today {
  position: relative;
}

.hm-cell.today::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -1px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-deep);
  box-shadow: 0 0 0 1px #fffdf8;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 10px;
  flex-wrap: wrap;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.weekday-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  height: 150px;
  padding-top: 8px;
}

.wd {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 100%;
}

.wd-bar {
  width: 100%;
  max-width: 34px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--mustard), #d99b2f);
  min-height: 4px;
  position: relative;
  transition: height 0.5s ease;
}

.wd-bar span {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--ink-faint);
  white-space: nowrap;
}

.wd-name {
  font-size: 11px;
  color: var(--ink-faint);
}

.insight-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.insight-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 14px;
  border-radius: 11px;
  background: rgba(255, 253, 248, 0.72);
  border: 1px dashed var(--paper-line);
  font-size: 13px;
  color: var(--ink-soft);
}

.insight-list .ii-icon {
  flex: 0 0 auto;
  font-size: 17px;
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.donut {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  flex: 0 0 auto;
  position: relative;
  display: grid;
  place-items: center;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: inset 0 0 0 1px rgba(217, 203, 179, 0.6);
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
  font-family: var(--hand);
  font-size: 17px;
  line-height: 1.25;
}

.donut-center small {
  display: block;
  font-family: var(--sans);
  font-size: 10.5px;
  color: var(--ink-faint);
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.donut-legend .dl-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dl-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.badge-progress {
  height: 14px;
  border-radius: 999px;
  background: var(--paper-deep);
  overflow: hidden;
  margin: 10px 0 6px;
}

.badge-progress .bp-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mustard), var(--green));
  transition: width 0.6s ease;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(182px, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.badge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-align: center;
  padding: 22px 14px 16px;
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.82);
  border: 1px solid rgba(217, 203, 179, 0.8);
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease;
}

.badge:hover {
  transform: translateY(-3px) rotate(-1deg);
}

.badge-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 26px;
  background: var(--mustard-soft);
  border: 2px solid rgba(224, 174, 74, 0.6);
  box-shadow: inset 0 -3px 0 rgba(160, 120, 30, 0.12);
}

.badge-name {
  font-family: var(--hand);
  font-size: 16px;
  line-height: 1.3;
}

.badge-desc {
  font-size: 11px;
  color: var(--ink-faint);
  line-height: 1.65;
}

.badge-time {
  font-size: 10px;
  color: var(--green);
  margin-top: 2px;
}

.badge.locked {
  opacity: 0.62;
  filter: grayscale(0.7);
  background: rgba(245, 237, 223, 0.7);
}

.badge.locked .badge-icon {
  background: var(--paper-deep);
  border-color: rgba(160, 140, 110, 0.35);
}

.poster-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 22px;
  align-items: start;
}

.poster-preview {
  display: grid;
  place-items: center;
  padding: 18px;
  background: repeating-linear-gradient(45deg, rgba(160, 140, 110, 0.06) 0 10px, transparent 10px 20px);
  border-radius: 14px;
  border: 1px dashed var(--paper-line);
}

.poster-preview canvas {
  width: 100%;
  max-width: 330px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 18px 30px -20px rgba(60, 45, 25, 0.75);
  background: #fffdf8;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(217, 203, 179, 0.5);
  gap: 3px;
}

.seg button {
  border: none;
  background: transparent;
  padding: 7px 16px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}

.seg button.on {
  background: var(--white);
  color: var(--green-deep);
  box-shadow: 0 2px 5px rgba(90, 70, 40, 0.16);
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.checklist .tick {
  color: var(--green);
  font-weight: 700;
}

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 420px);
}

.toast {
  background: #3a342e;
  color: #fff8ea;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 10px 22px -12px rgba(0, 0, 0, 0.7);
  animation: toastIn 0.24s ease both;
  max-width: 100%;
  text-align: center;
}

.toast.out {
  animation: toastOut 0.24s ease both;
}

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

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
}

.modal-root {
  position: relative;
  z-index: 90;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(58, 52, 46, 0.55);
  backdrop-filter: blur(5px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.2s ease both;
  overflow-y: auto;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-card {
  width: min(560px, 100%);
  background: var(--white);
  border-radius: 18px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
  padding: 26px;
  position: relative;
  animation: modalIn 0.26s cubic-bezier(0.2, 1.2, 0.4, 1) both;
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.modal-card.wide {
  width: min(760px, 100%);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.modal-head h3 {
  margin: 0;
  font-family: var(--hand);
  font-size: 23px;
}

.modal-close {
  border: none;
  background: rgba(217, 203, 179, 0.4);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  color: var(--ink-soft);
  flex: 0 0 auto;
}

.modal-close:hover {
  background: rgba(217, 203, 179, 0.75);
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 18px;
}

.badge-pop {
  text-align: center;
}

.badge-pop .big-icon {
  font-size: 64px;
  animation: pop 0.5s cubic-bezier(0.2, 1.4, 0.5, 1) both;
}

.badge-pop h3 {
  font-family: var(--hand);
  font-size: 25px;
  margin: 6px 0 2px;
  color: var(--green-deep);
}

.badge-pop p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 95;
  overflow: hidden;
}

.confetti {
  position: absolute;
  top: -16px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  animation: confFall linear forwards;
}

@keyframes confFall {
  to {
    transform: translateY(105vh) rotate(720deg);
    opacity: 0.85;
  }
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(58, 52, 46, 0.38);
  backdrop-filter: blur(2px);
  z-index: 88;
  animation: fadeIn 0.2s ease both;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 92vw);
  background: var(--paper);
  z-index: 89;
  box-shadow: -20px 0 50px -30px rgba(0, 0, 0, 0.6);
  animation: drawerIn 0.28s cubic-bezier(0.2, 1, 0.3, 1) both;
  overflow-y: auto;
  border-left: 1px solid var(--paper-line);
}

@keyframes drawerIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.drawer-inner {
  padding: 26px 22px calc(40px + env(safe-area-inset-bottom, 0px));
}

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

.drawer-head h3 {
  margin: 0;
  font-family: var(--hand);
  font-size: 24px;
}

.panel {
  background: var(--white);
  border: 1px solid rgba(217, 203, 179, 0.8);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
}

.panel h4 {
  margin: 0 0 10px;
  font-family: var(--hand);
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.panel .hint {
  margin: 0 0 10px;
  font-size: 11.5px;
  color: var(--ink-faint);
  line-height: 1.6;
}

.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.danger-zone {
  border: 1px dashed rgba(194, 94, 74, 0.5);
  background: rgba(242, 215, 208, 0.35);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.loading-dots::after {
  content: "";
  animation: dots 1.2s steps(4, end) infinite;
}

@keyframes dots {
  0% {
    content: "";
  }
  25% {
    content: "·";
  }
  50% {
    content: "··";
  }
  75% {
    content: "···";
  }
}

.spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .home-hero,
  .record-grid,
  .diary-layout,
  .poster-layout,
  .grid-side,
  .grid-3,
  .rescue-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .diary-layout {
    gap: 16px;
  }

  .day-list {
    flex-direction: row;
    overflow-x: auto;
    max-height: none;
    padding-bottom: 6px;
  }

  .day-chip {
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 14px;
  }

  .topbar {
    padding: 16px 14px 8px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    font-size: 21px;
  }

  .brand-text strong {
    font-size: 21px;
  }

  .brand-text small {
    display: none;
  }

  .top-actions #btn-export {
    display: none;
  }

  .tabbar {
    margin: 6px 10px 0;
    padding: 8px;
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 20px;
    overflow: visible;
  }

  .tab {
    padding: 9px 16px;
  }

  .cam-actions .btn {
    flex: 1 1 auto;
  }

  .input,
  textarea.input,
  select.input {
    font-size: 16px;
  }

  .tl-time {
    flex-basis: 34px;
    font-size: 10.5px;
  }

  .tl-dot {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
    font-size: 15px;
  }

  .timeline::before {
    left: 26px;
  }

  .view {
    padding: 16px 14px calc(132px + env(safe-area-inset-bottom, 0px));
  }

  .card {
    padding: 18px;
  }

  .page-head {
    margin-bottom: 16px;
  }

  .stat-strip {
    gap: 8px;
  }

  .emotion-pick {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .garden-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .poster-preview canvas {
    max-width: 100%;
  }

  .site-foot {
    padding: 18px 14px calc(34px + env(safe-area-inset-bottom, 0px));
    font-size: 11px;
  }

  .modal-card {
    padding: 20px;
  }

  .breath-ring {
    width: 180px;
    height: 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.task-card {
  margin-bottom: 20px;
}

.task-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--paper-line);
  background: rgba(255, 253, 248, 0.72);
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
  color: var(--ink);
  transition: transform 0.16s ease, background 0.16s ease;
}

.task-row:hover {
  transform: translateY(-1px);
  background: var(--white);
}

.task-row.done {
  opacity: 0.68;
  background: var(--green-soft);
}

.task-icon {
  font-size: 20px;
  line-height: 1;
}

.task-body {
  flex: 1;
  min-width: 0;
}

.task-body b {
  display: block;
  font-size: 13px;
  line-height: 1.4;
}

.task-body small {
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.4;
}

.task-reward {
  margin-left: auto;
  font-size: 11.5px;
  color: #7a5713;
  background: var(--mustard-soft);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.sun-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--mustard-soft);
  color: #7a5713;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
}

.photo-upload {
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 24px 16px;
  border: 2px dashed var(--paper-line);
  border-radius: 14px;
  background: rgba(255, 253, 248, 0.55);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.photo-upload:hover,
.photo-upload.dragover {
  border-color: var(--mustard);
  background: rgba(246, 230, 191, 0.6);
  transform: translateY(-1px);
}

.photo-upload .pu-icon {
  font-size: 34px;
}

.photo-upload p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.photo-upload small {
  font-size: 11px;
  color: var(--ink-faint);
}

.photo-preview {
  margin-top: 12px;
}

.photo-draft {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  background: var(--green-soft);
}

.photo-draft img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 10px;
  flex: 0 0 auto;
}

.photo-draft strong {
  display: block;
  font-size: 12.5px;
  word-break: break-all;
}

.photo-draft small {
  display: block;
  color: var(--ink-soft);
  font-size: 11px;
  margin-top: 4px;
}

.photo-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.photo-card {
  margin: 0;
  background: var(--white);
  border: 1px solid rgba(217, 203, 179, 0.8);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.16s ease;
}

.photo-card:hover {
  transform: translateY(-3px) rotate(-0.6deg);
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.photo-card figcaption {
  padding: 9px 11px 11px;
  font-size: 11px;
}

.photo-card figcaption p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.75;
}

.scene-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}

.home-photo {
  margin: 0;
}

.home-photo img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--paper-line);
}

.home-photo figcaption {
  margin-top: 6px;
  color: var(--ink-faint);
  font-size: 11.5px;
}

.photo-full {
  display: block;
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border-radius: 12px;
  background: var(--paper-deep);
}

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

.shop-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 15px 12px;
  min-height: 148px;
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.76);
  border: 1px solid var(--paper-line);
  text-align: center;
}

.shop-item.owned {
  background: rgba(219, 229, 216, 0.5);
  border-color: rgba(91, 122, 99, 0.3);
}

.shop-item .si-icon {
  font-size: 26px;
  line-height: 1.1;
}

.shop-item b {
  font-size: 12.5px;
}

.shop-item small {
  color: var(--ink-faint);
  font-size: 10.5px;
  line-height: 1.6;
}

.shop-item .btn {
  margin-top: 5px;
}

.rarity {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.series-block {
  padding: 22px;
}

.series-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 19px;
  flex: 0 0 auto;
}

.series-block .badge-grid {
  margin-top: 14px;
}

.badge .rarity {
  position: absolute;
  top: 8px;
  right: 8px;
}

.player-fab {
  display: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--paper-line);
  background: var(--white);
  box-shadow: 0 10px 22px -12px rgba(60, 45, 25, 0.7);
  font-size: 20px;
  cursor: pointer;
  place-items: center;
}

.player-bar.collapsed {
  width: auto;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

.player-bar.collapsed .player-fab {
  display: grid;
}

.player-bar.collapsed .player-main {
  display: none;
}

.player-main {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.player-bar {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(380px, calc(100vw - 24px));
  padding: 10px 12px;
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid var(--paper-line);
  border-radius: 16px;
  box-shadow: 0 18px 36px -22px rgba(60, 45, 25, 0.75);
  backdrop-filter: blur(8px);
}

.player-cover {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--mustard-soft);
  font-size: 20px;
  flex: 0 0 auto;
}

.player-info {
  flex: 1;
  min-width: 0;
}

.player-info strong {
  display: block;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-info small {
  display: block;
  font-size: 10.5px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-track {
  height: 4px;
  border-radius: 999px;
  background: var(--paper-deep);
  overflow: hidden;
  margin-top: 5px;
}

.player-track span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--green);
  transition: width 0.3s linear;
}

.player-time {
  font-size: 9.5px;
  color: var(--ink-faint);
}

.player-actions {
  display: flex;
  gap: 4px;
}

.pb-btn {
  border: none;
  background: var(--paper-deep);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink);
}

.pb-btn:hover {
  background: var(--mustard-soft);
}

.pb-volume {
  width: 56px;
  accent-color: var(--green);
  cursor: pointer;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green-deep);
  color: #fff;
  font-family: var(--hand);
  font-size: 18px;
  flex: 0 0 auto;
}

.avatar.small {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.invite-code {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--mustard-soft);
  font-family: var(--hand);
  font-size: 22px;
  letter-spacing: 3px;
}

.friend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.friend-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.7);
  border: 1px solid var(--paper-line);
}

.friend-list small {
  display: block;
  color: var(--ink-faint);
  font-size: 10.5px;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.feed-card {
  border: 1px solid var(--paper-line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 253, 248, 0.82);
}

.feed-card header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.feed-head {
  flex: 1;
  min-width: 0;
}

.feed-head b {
  display: block;
  font-size: 13px;
}

.feed-head small {
  color: var(--ink-faint);
  font-size: 10.5px;
}

.feed-mood {
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.feed-text {
  margin: 10px 0 0;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ink);
}

.feed-photo {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 10px;
  margin-top: 10px;
  border: 1px solid var(--paper-line);
}

.music-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(124, 147, 166, 0.12);
  border: 1px dashed rgba(124, 147, 166, 0.4);
  font-size: 12.5px;
}

.music-card small {
  flex-basis: 100%;
  color: var(--ink-soft);
  font-size: 11.5px;
}

.feed-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.like-btn {
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 4px 9px;
  border-radius: 8px;
}

.like-btn.liked {
  color: var(--tomato);
  background: var(--tomato-soft);
}

@media (max-width: 900px) {
  .task-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .photo-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .player-bar {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
  }

  .player-bar.collapsed {
    left: auto;
    right: 12px;
    bottom: 12px;
    width: auto;
  }

  .pb-volume {
    display: none;
  }

  .feed-card {
    padding: 12px;
  }
}

.cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cal-week,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.cal-weekday {
  text-align: center;
  font-size: 11px;
  color: var(--ink-faint);
  padding: 4px 0;
}

.cal-day {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px solid rgba(217, 203, 179, 0.35);
  background: var(--dcolor, rgba(217, 203, 179, 0.25));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  font-family: var(--sans);
  position: relative;
  transition: transform 0.15s ease;
}

.cal-day.has-mood {
  border-color: transparent;
}

.cal-day.blank {
  background: transparent;
  border: none;
  cursor: default;
}

.cal-day:hover:not(.blank) {
  transform: translateY(-1px);
}

.cal-day.today {
  border-color: var(--tomato);
  box-shadow: 0 0 0 2px rgba(194, 94, 74, 0.18);
}

.cal-num {
  font-size: 12px;
  color: var(--dtone, var(--ink-soft));
  font-weight: 600;
  line-height: 1.1;
}

.cal-emoji {
  font-size: 14px;
  line-height: 1;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  font-size: 11px;
  color: var(--ink-faint);
}

.cal-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 4px;
}

.melody {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 160px;
  margin-top: 16px;
  padding: 0 4px;
}

.melody-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.melody-bar {
  width: 100%;
  max-width: 34px;
  border-radius: 8px 8px 3px 3px;
  min-height: 8px;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.melody-bar.rest {
  opacity: 0.35;
}

.melody-bar.playing {
  filter: brightness(1.3);
  transform: scaleY(1.05);
  box-shadow: 0 0 12px rgba(224, 174, 74, 0.6);
}

.melody-col small {
  font-size: 10.5px;
  color: var(--ink-faint);
}

.melody-note {
  font-size: 10px;
  color: var(--ink-faint);
}

.capsule-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.capsule {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--paper-line);
  background: rgba(255, 253, 248, 0.7);
  font-size: 12.5px;
}

.capsule small {
  display: block;
  color: var(--ink-faint);
  font-size: 10.5px;
}

.capsule.ready {
  background: var(--mustard-soft);
  border-color: rgba(224, 174, 74, 0.5);
}

.capsule.opened {
  display: block;
  background: rgba(219, 229, 216, 0.55);
}

.capsule.opened p {
  margin: 6px 0 8px;
  font-family: var(--hand);
  font-size: 15px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.capsule.opened b {
  font-size: 12.5px;
}

.capsule.locked {
  opacity: 0.85;
}

.capsule-lock {
  font-size: 18px;
}

.capsule .btn {
  margin-left: auto;
}

.capsule.opened .btn {
  margin-left: 0;
}

.sign-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed var(--paper-line);
  background: linear-gradient(160deg, #fffdf8, #f6e6bf);
  cursor: pointer;
}

.sign-cover:hover {
  border-color: var(--mustard);
}

.sign-title {
  font-family: var(--hand);
  font-size: 29px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--green-deep);
}

.sign-hint {
  font-size: 11px;
  color: var(--ink-faint);
}

.sign-open {
  margin-top: 10px;
}

.sign-q {
  margin: 0 0 8px;
  font-family: var(--hand);
  font-size: 17px;
  line-height: 1.95;
  color: var(--ink);
}

.sign-action {
  margin: 0;
  font-size: 12.5px;
  color: var(--green-deep);
  font-weight: 600;
}

[data-decor] {
  cursor: pointer;
}

[data-decor]:hover {
  opacity: 0.82;
}

.decor-new {
  animation: decorPulse 1.1s ease-in-out 3;
}

@keyframes decorPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (max-width: 620px) {
  .cal-num {
    font-size: 11px;
  }

  .cal-emoji {
    font-size: 12px;
  }

  .cal-day {
    border-radius: 8px;
  }

  .melody {
    height: 132px;
    gap: 5px;
  }

  .cal-nav {
    width: 100%;
    justify-content: space-between;
  }
}


#capsule-text {
  min-height: 110px;
}

#capsule-text::placeholder {
  color: var(--ink-faint);
}

.decor-tip {
  color: var(--green) !important;
  font-size: 10px !important;
}
