/* =========================================================
   宠物养成激励 · 学生端 UI
   灵感：学习激励 / 圆润组件 / 立体按钮 / 明确进度
   品牌：项目自有蓝紫品牌色 + 五宠强调色（非 Duo 绿）
   ========================================================= */

:root {
  /* Spacing — 4px base */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --space-10: 56px;

  /* Radius */
  --radius-tile: 12px;
  --radius-card: 16px;
  --radius-hero: 20px;
  --radius-pill: 999px;

  /* Brand (project) */
  --brand: #5b6cff;
  --brand-soft: #8b97ff;
  --brand-mist: #eef0ff;
  --brand-deep: #3f4fd6;
  --brand-ledge: #3a49c4;

  /* Semantic accents (gamified but not Duo mechanisms) */
  --success: #2ecc71;
  --success-ledge: #27ae60;
  --success-soft: #e8fbf0;
  --warn: #f5a623;
  --warn-soft: #fff6e5;
  --info: #3db5f2;
  --info-soft: #e8f7fe;
  --danger: #ff5a5f;
  --danger-soft: #ffe8e9;

  /* Canvas & text */
  --snow: #ffffff;
  --polar: #f7f8fc;
  --swan: #e8eaf2;
  --swan-shadow: #c9cddc;
  --ink: #3d3d4a;
  --muted: #8b8fa3;
  --muted-2: #a8adc0;
  --line: #e6e8f2;

  /* Compat aliases used by existing markup */
  --warm: var(--warn);
  --cream: #fbfbfe;
  --radius: var(--radius-card);
  --radius-sm: var(--radius-tile);

  --page-x: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --tab-h: 64px;
  --hit: 44px;
  --btn-h: 56px;
  --font: 'Nunito', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    'Noto Sans SC', sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: #12131a;
  overflow: hidden;
}

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

.hidden {
  display: none !important;
}

/* ========== Shell ========== */
.phone-frame {
  height: 100%;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.app-shell {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--snow);
  overflow: hidden;
}

@media (min-width: 480px) {
  .phone-frame {
    padding: 16px 0;
    align-items: center;
  }
  .app-shell {
    height: min(100%, 860px);
    border-radius: 28px;
    box-shadow:
      0 0 0 10px #0e0f14,
      0 24px 60px rgba(0, 0, 0, 0.45);
  }
}

.app-root {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 12px);
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(120% 70% at 0% -10%, rgba(91, 108, 255, 0.1), transparent 55%),
    radial-gradient(90% 50% at 100% 0%, rgba(245, 166, 35, 0.08), transparent 50%),
    var(--snow);
}

.mock-badge {
  position: absolute;
  top: calc(8px + var(--safe-top));
  right: 12px;
  z-index: 40;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: var(--warn);
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  box-shadow: 0 3px 0 var(--swan-shadow);
}

/* ========== Page layout ========== */
.page {
  padding: calc(16px + var(--safe-top)) var(--page-x) 8px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.page-header {
  margin-bottom: var(--space-4);
}

.page-header h1 {
  margin: 4px 0 6px;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}

.page-header.compact h1 {
  font-size: 1.35rem;
}

.page-header .eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-header .sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  font-weight: 600;
}

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

.page-footer,
.entry-actions {
  margin-top: auto;
  padding-top: var(--space-5);
  padding-bottom: calc(var(--space-4) + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  text-align: center;
}

.page-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  min-height: var(--hit);
}

/* ========== Cards ========== */
.entry-card,
.info-card,
.quick-stats,
.score-overview,
.panel,
.student-notice,
.hatch-panel,
.form-preview,
.acc-card,
.score-row,
.diary-card,
.weekly-report-item,
.ov-card {
  background: var(--snow);
  border: 2px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: 0 2px 0 var(--swan);
}

.entry-card,
.info-card,
.panel,
.student-notice,
.hatch-panel,
.form-preview {
  padding: var(--space-4);
  margin-top: var(--space-4);
}

.entry-page,
.identity-page,
.adoption-guide-page {
  padding-top: calc(20px + var(--safe-top));
}

.entry-illus {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  margin-bottom: var(--space-3);
  background: var(--brand-mist);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--brand) 25%, white);
}

.entry-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
}

.entry-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-weight: 600;
  font-size: 0.92rem;
}

.entry-muted {
  margin: 0;
  color: var(--muted-2);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
}

.identity-hint {
  margin: 12px 0 0;
  padding: 12px;
  border-radius: var(--radius-tile);
  background: var(--warn-soft);
  border: 2px solid #ffe0a3;
  color: #9a6700;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
}

.guide-rules {
  margin: 0;
  padding-left: 1.15em;
  color: var(--ink);
  line-height: 1.75;
  font-size: 0.92rem;
  font-weight: 700;
}

.guide-rules li + li {
  margin-top: 6px;
}

.guide-rules strong {
  color: var(--brand-deep);
}

/* ========== Buttons (ledge / 3D press) ========== */
.btn-primary,
.btn-ghost,
.btn-back,
.btn-load-more,
.carousel-nav,
.form-btn,
.tab-item,
.home-sub-action,
.growth-collapse-toggle,
.nickname-btn {
  min-height: var(--hit);
  min-width: var(--hit);
}

.btn-primary {
  appearance: none;
  border: none;
  width: 100%;
  min-height: var(--btn-h);
  padding: 14px 22px;
  border-radius: var(--radius-card);
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--brand-ledge);
  transition: transform 80ms linear, box-shadow 80ms linear, filter 0.15s ease;
}

.btn-primary:hover {
  filter: brightness(1.03);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--brand-ledge);
}

.btn-primary:disabled,
.btn-primary.is-loading {
  background: var(--swan);
  color: var(--muted);
  box-shadow: 0 4px 0 var(--swan-shadow);
  cursor: not-allowed;
  filter: none;
}

.btn-primary.is-success {
  background: var(--success);
  box-shadow: 0 4px 0 var(--success-ledge);
  color: #fff;
}

.btn-primary.is-loading {
  position: relative;
}

.btn-entry,
.btn-claim {
  width: 100%;
}

.btn-ghost {
  appearance: none;
  width: 100%;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: var(--radius-card);
  border: 2px solid var(--line);
  background: var(--snow);
  color: var(--ink);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--swan);
  transition: transform 80ms linear, box-shadow 80ms linear;
}

.btn-ghost:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--swan);
}

.btn-ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost.sm,
.mock-reset-btn {
  width: auto;
  min-height: 36px;
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 0 var(--swan);
}

.mock-reset-btn {
  margin-left: auto;
  opacity: 0.9;
}

.btn-back {
  appearance: none;
  border: 2px solid var(--line);
  background: var(--snow);
  color: var(--brand-deep);
  font-weight: 800;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 2px 0 var(--swan);
  min-width: auto;
}

.btn-back:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 var(--swan);
}

.btn-load-more,
.btn-save-card {
  display: block;
  width: 100%;
  margin: 8px 0 16px;
  padding: 12px;
  border: 2px solid var(--brand-mist);
  border-radius: var(--radius-tile);
  background: var(--brand-mist);
  color: var(--brand-deep);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 color-mix(in srgb, var(--brand) 22%, white);
}

.btn-load-more:active,
.btn-save-card:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 transparent;
}

/* ========== Forms ========== */
.field {
  display: block;
  margin-bottom: 12px;
}

.field span,
.identity-form-card .field span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink);
}

.input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border-radius: var(--radius-tile);
  border: 2px solid var(--line);
  background: var(--snow);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input::placeholder {
  color: var(--muted-2);
  font-weight: 600;
}

.input:focus {
  border-color: var(--brand-soft);
  box-shadow: 0 0 0 3px var(--brand-mist);
}

.form-error {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-tile);
  background: var(--danger-soft);
  color: #c0392b;
  font-size: 0.84rem;
  font-weight: 700;
}

/* ========== Loading / empty / error ========== */
.loading-page,
.error-page,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 55vh;
  color: var(--muted);
  text-align: center;
  gap: 12px;
  padding: 40px 16px;
}

.loading-page::before {
  content: '';
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--swan);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}

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

.empty-hint {
  text-align: center;
  color: var(--muted);
  padding: 24px 16px;
  font-size: 0.92rem;
  font-weight: 600;
}

.empty-illus {
  font-size: 3rem;
  margin-bottom: 10px;
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.04));
}

.error-page .sub {
  max-width: 280px;
}

/* ========== Demo banners ========== */
.demo-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--info-soft);
  border: 2px solid #c8ebfb;
  border-radius: var(--radius-tile);
  padding: 10px 12px;
  margin: 12px 0 2px;
  font-size: 0.8rem;
  color: #0b6e99;
  font-weight: 700;
}

.demo-banner-desc {
  flex: 1;
  color: #1780ad;
  font-weight: 600;
}

.demo-banner-close {
  background: none;
  border: none;
  color: #7ebed9;
  font-size: 1.2rem;
  cursor: pointer;
  min-width: 32px;
  min-height: 32px;
}

.demo-tip {
  background: var(--warn-soft);
  border-left: 4px solid var(--warn);
  border-radius: 0 12px 12px 0;
  padding: 10px 12px;
  font-size: 0.8rem;
  color: #9a6700;
  margin: 10px 0 4px;
  line-height: 1.5;
  font-weight: 600;
}

/* ========== Tab bar ========== */
.tab-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tab-h) + var(--safe-bottom));
  padding: 6px 10px var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: var(--snow);
  border-top: 1px solid var(--line);
  z-index: 30;
}

.tab-item {
  appearance: none;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--muted-2);
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
  border-radius: var(--radius-pill);
  transition: color 0.15s ease, background 0.15s ease;
}

.tab-item .tab-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.tab-item.active {
  color: var(--brand-deep);
  background: var(--brand-mist);
}

/* ========== Select pet ========== */
.select-page .pet-carousel {
  position: relative;
  margin: 12px 0 10px;
}

.carousel-track {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 270px;
  touch-action: pan-y;
  padding: 8px 0;
}

.pet-card {
  display: none;
  width: 100%;
  animation: fadeSlide 0.28s ease;
}

.pet-card.active {
  display: block;
}

@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--snow);
  color: var(--brand);
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--swan);
  z-index: 2;
}

.carousel-nav:active {
  transform: translateY(calc(-50% + 3px));
  box-shadow: 0 0 0 var(--swan);
}

.carousel-nav.prev {
  left: 0;
}
.carousel-nav.next {
  right: 0;
}

.select-pager {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 8px 0 12px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
  padding: 0 4px;
}

.dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  min-height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--swan);
  padding: 0;
  margin: 6px 2px; /* expand hit area without growing visible dot */
  cursor: pointer;
  box-shadow: 0 0 0 6px transparent;
}

.dot.active {
  width: 18px;
  border-radius: var(--radius-pill);
  background: var(--brand);
}

.select-index {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
}

@media (max-width: 375px) {
  .carousel-dots {
    gap: 5px;
  }
  .dot {
    width: 7px;
    height: 7px;
    min-width: 7px;
    min-height: 7px;
  }
  .dot.active {
    width: 16px;
  }
}

.select-info {
  text-align: center;
  padding: 4px 8px 8px;
}

.select-info h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
}

.select-info p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  font-weight: 600;
}

.btn-claim {
  margin-top: 8px;
  margin-bottom: calc(8px + var(--safe-bottom));
}

/* Modal */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 35, 0.45);
  display: grid;
  place-items: end center;
  z-index: 50;
  padding: 16px;
}

.modal-sheet {
  width: min(100%, 398px);
  background: var(--snow);
  border-radius: 24px 24px 20px 20px;
  padding: 20px 16px calc(16px + var(--safe-bottom));
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
  animation: sheetUp 0.28s ease;
}

@keyframes sheetUp {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.modal-egg-host,
.modal-incubator-host {
  width: 140px;
  height: 140px;
  margin: 0 auto 10px;
}

.modal-sheet h2 {
  margin: 0;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
}

.modal-desc {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 8px 0 16px;
  line-height: 1.55;
  font-weight: 600;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 10px;
}

/* ========== Home ========== */
.week-summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 12px;
  margin-top: 4px;
  background: var(--polar);
  border: 2px solid var(--line);
  border-radius: var(--radius-card);
}

.ws-part {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--snow);
  border: 1.5px solid var(--line);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}

.ws-sep {
  display: none;
}

.mood-chip {
  background: var(--success-soft) !important;
  border-color: #b8efcd !important;
  color: #1e8a4c !important;
}

.pet-stage {
  position: relative;
  padding: 20px 0 8px;
  text-align: center;
}

.pet-entity-host {
  position: relative;
  z-index: 1;
  width: 228px;
  height: 228px;
  margin: 0 auto;
}

.hatch-panel {
  margin: 16px auto 0;
  max-width: 320px;
}

.hatch-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.stable-chip {
  margin-top: 10px;
  display: inline-block;
  background: var(--warn-soft);
  color: #b86e00;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
}

.nickname-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.nickname-btn {
  appearance: none;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  padding: 4px 0;
  box-shadow: none;
}

.edit-icon {
  font-size: 0.85rem;
  color: var(--brand-soft);
}

.level-pill {
  background: var(--brand-mist);
  color: var(--brand-deep);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.stat-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.stat-line strong {
  color: var(--brand);
  font-size: 1.45rem;
  font-weight: 800;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
}

.progress-bar {
  height: 12px;
  border-radius: var(--radius-pill);
  background: var(--swan);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.progress-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-soft), var(--brand));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: width 0.45s ease;
}

.progress-hint {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.45;
}

.home-sub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.home-sub-action {
  width: 100%;
}

.form-preview {
  margin-top: 12px;
  border-style: dashed;
}

.form-preview-label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--brand);
}

.form-preview-btns {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.form-btn {
  appearance: none;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: var(--radius-tile);
  padding: 8px 2px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 2px 0 var(--swan);
  min-height: 52px;
}

.form-btn span {
  font-size: 0.58rem;
  font-weight: 700;
}

.form-btn.active {
  border-color: var(--brand);
  background: var(--brand-mist);
  color: var(--brand-deep);
  box-shadow: 0 2px 0 var(--brand-ledge);
}

.student-notice-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--brand-deep);
  margin-bottom: 8px;
}

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

.student-notice-item {
  background: var(--polar);
  border-radius: var(--radius-tile);
  padding: 10px 12px;
}

.student-notice-head {
  margin: 0 0 4px;
  font-size: 0.82rem;
  font-weight: 800;
}

.student-notice-body {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 600;
}

/* ========== Scores / learning ========== */
.score-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.ov-item .label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.ov-item strong {
  font-size: 1.4rem;
  color: var(--brand);
  font-weight: 800;
}

.score-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.score-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
}

.score-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--brand-mist);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
}

.score-title {
  font-weight: 800;
  font-size: 0.95rem;
}

.score-time {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 600;
}

.score-value {
  font-weight: 800;
  color: var(--success);
  font-size: 1.05rem;
}

.section-head {
  margin-bottom: 10px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
}

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

.ov-card {
  padding: 12px 8px;
  text-align: center;
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.ov-card-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
}

.ov-card-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
  word-break: break-word;
}

.mini-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}

.highlights-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.h-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--polar);
  border-radius: var(--radius-tile);
  font-weight: 700;
  font-size: 0.88rem;
}

.h-item.small {
  font-size: 0.82rem;
}

.h-emoji {
  font-size: 1.2rem;
}

.h-type {
  flex: 1;
}

.h-count {
  color: var(--brand);
  font-weight: 800;
}

.vs-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vs-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  background: var(--polar);
  border-radius: var(--radius-tile);
  font-weight: 700;
  font-size: 0.86rem;
}

.vs-label {
  color: var(--muted);
}
.vs-value {
  color: var(--ink);
  font-weight: 800;
}
.vs-delta.up {
  color: var(--success);
}
.vs-delta.down {
  color: var(--warn);
}
.vs-delta.flat {
  color: var(--muted);
}

.weekly-report-item {
  padding: 14px;
  margin-bottom: 12px;
}

.wr-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.wr-range {
  margin: 4px 0 10px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 700;
}

.wr-metrics,
.wr-highlights,
.wr-pet-status {
  margin-top: 10px;
}

.wr-section-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand-deep);
  margin-bottom: 6px;
}

.wr-highlights-list {
  margin: 0;
  padding-left: 1.1em;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink);
}

.wr-pet-status-text {
  font-weight: 800;
  color: var(--ink);
}

.wr-actions {
  margin-top: 12px;
}

.report-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--brand-mist);
  color: var(--brand-deep);
  font-size: 0.72rem;
  font-weight: 800;
}

.growth-collapse {
  padding: 0 !important;
  overflow: hidden;
}

.growth-collapse-toggle {
  width: 100%;
  appearance: none;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
}

.growth-collapse-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.growth-collapse-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--line);
}

.growth-count {
  font-size: 0.78rem;
  font-weight: 700;
}

/* ========== Diary / accessories ========== */
.diary-timeline {
  position: relative;
  margin-top: 8px;
  padding-left: 18px;
}

.diary-timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--brand-soft), transparent);
}

.diary-card {
  position: relative;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.diary-card::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 4px #ffe8d0;
}

.diary-date {
  font-size: 0.78rem;
  font-weight: 800;
  color: #b86e00;
  margin-bottom: 8px;
}

.diary-content {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink);
  font-weight: 600;
}

.diary-score {
  margin-top: 10px;
  display: inline-block;
  background: var(--warn-soft);
  color: #b86e00;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

.acc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.acc-card {
  position: relative;
  padding: 18px 12px 14px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.acc-card:active {
  transform: translateY(2px);
}

.acc-card.locked {
  cursor: default;
  opacity: 0.72;
  filter: grayscale(0.85);
}

.acc-card.equipped {
  border-color: var(--brand-soft);
  box-shadow: 0 0 0 2px var(--brand-mist), 0 2px 0 var(--brand-ledge);
}

.acc-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
}

.acc-icon.muted {
  opacity: 0.7;
}

.acc-name {
  font-weight: 800;
  font-size: 0.92rem;
}

.acc-cond,
.acc-hint {
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}

.equip-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: var(--radius-pill);
}

/* ========== Motion ========== */
@keyframes floatY {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@keyframes incubatorFloat {
  0%,
  100% {
    transform: translateY(0);
    filter: drop-shadow(0 0 0 rgba(91, 108, 255, 0));
  }
  50% {
    transform: translateY(-4px);
    filter: drop-shadow(0 0 12px rgba(91, 108, 255, 0.22));
  }
}

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

@keyframes confettiBurst {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.6);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-40px) scale(1.1);
  }
}

.float-anim {
  animation: floatY 2.8s ease-in-out infinite;
}
.breathe-anim {
  animation: breathe 3.2s ease-in-out infinite;
}
.egg-shake,
.incubator-float {
  animation: incubatorFloat 2.8s ease-in-out infinite;
}

.reward-pop {
  animation: popIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

/* ========== Pet entity ========== */
.pet-entity {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  isolation: isolate;
}

.pet-entity__stage {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.8), transparent 45%),
    linear-gradient(155deg, var(--pet-color, #c4b5fd), var(--pet-deep, #5b6cff));
  z-index: 0;
}

.pet-entity[data-has-art='1'] .pet-entity__stage {
  background:
    radial-gradient(circle at 50% 42%, #ffffff 0%, #f7f8fc 68%, color-mix(in srgb, var(--pet-color) 28%, white) 100%);
}

.pet-entity[data-has-art='1'] .pet-entity__sprite {
  width: 90%;
  height: 90%;
}

.pet-entity__media {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.pet-entity__sprite,
.pet-entity__lottie {
  width: 86%;
  height: 86%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.pet-entity__lottie svg {
  width: 100% !important;
  height: 100% !important;
}

.pet-entity__placeholder {
  display: grid;
  place-items: center;
  gap: 4px;
}

.pet-entity__place-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--brand-deep);
  letter-spacing: 0.06em;
}

.pet-entity__emoji {
  font-size: 5rem;
  line-height: 1;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.1));
}

.pet-entity__badge {
  position: absolute;
  z-index: 2;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand-deep);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  box-shadow: 0 2px 0 var(--swan);
}

.pet-entity__art-hint {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(45, 52, 54, 0.28);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  pointer-events: none;
}

.pet-entity.is-alive .pet-entity__media {
  animation: breathe 3.4s ease-in-out infinite;
}

.pet-entity.is-incubating .pet-entity__media,
.pet-entity.is-egg .pet-entity__media {
  animation: incubatorFloat 2.8s ease-in-out infinite;
}

.pet-entity.is-alive .pet-entity__emoji {
  animation: floatY 2.8s ease-in-out infinite;
}

.pet-entity[data-silhouette='wide'][data-has-art='1'] .pet-entity__sprite {
  width: 80%;
  height: 80%;
}

.pet-entity[data-silhouette='tall'][data-has-art='1'] .pet-entity__sprite {
  width: 84%;
  height: 84%;
  object-position: center 40%;
}

.pet-entity.is-incubating[data-has-art='1'] .pet-entity__sprite,
.pet-entity[data-form='incubator'][data-has-art='1'] .pet-entity__sprite {
  width: 94%;
  height: 94%;
}

.pet-entity--home {
  width: 228px;
  height: 228px;
  margin: 0 auto;
  border-radius: 28px;
  border: 2px solid var(--line);
  box-shadow: 0 4px 0 var(--swan);
}

.pet-entity--home[data-silhouette='tall'] {
  width: 208px;
  height: 240px;
}

.pet-entity--select {
  width: min(70vw, 280px);
  height: min(70vw, 280px);
  margin: 0 auto;
  border-radius: 28px;
  border: 2px solid var(--line);
  box-shadow: 0 5px 0 var(--swan);
}

.pet-entity--select[data-silhouette='wide'] {
  width: min(76vw, 300px);
  height: min(68vw, 268px);
}

.pet-entity--select[data-silhouette='tall'] {
  width: min(64vw, 250px);
  height: min(76vw, 300px);
}

.pet-entity--select .pet-entity__emoji {
  font-size: 6.2rem;
}

.pet-entity--modal {
  width: 140px;
  height: 140px;
  margin: 0 auto;
  border-radius: 24px;
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--swan);
  overflow: hidden;
}

.pet-entity--modal .pet-entity__stage {
  background:
    radial-gradient(circle at 50% 40%, #ffffff 0%, #f7f8fc 72%, color-mix(in srgb, var(--pet-color) 28%, white) 100%);
}

.pet-entity--modal .pet-entity__emoji {
  font-size: 2.6rem;
}

.pet-entity--thumb {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

.pet-entity--thumb .pet-entity__emoji {
  font-size: 1.8rem;
}

/* ========== Responsive ========== */
@media (max-width: 390px) {
  .page-header h1 {
    font-size: 1.4rem;
  }
  .pet-entity--home,
  .pet-entity-host {
    width: 200px;
    height: 200px;
  }
  .weekly-overview-grid {
    gap: 6px;
  }
  .ov-card-value {
    font-size: 0.95rem;
  }
}

@media (max-width: 360px) {
  .pet-entity--select .pet-entity__emoji {
    font-size: 5.2rem;
  }
  .pet-entity--home,
  .pet-entity-host {
    width: 176px;
    height: 176px;
  }
  .form-preview-btns {
    gap: 4px;
  }
  .ws-part {
    font-size: 0.7rem;
  }
}

@media (min-width: 430px) {
  .pet-entity--home,
  .pet-entity-host {
    width: 240px;
    height: 240px;
  }
}

/* Reduce motion */
@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;
  }

  .btn-primary:active:not(:disabled),
  .btn-ghost:active:not(:disabled) {
    transform: none;
  }

  .loading-page::before {
    animation: none;
    border-top-color: var(--brand);
    opacity: 0.7;
  }
}
