:root {
  --bg: #fff7f8;
  --bg-elevated: #ffffff;
  --bg-soft: #fff0f4;
  --accent: #ff87a5;
  --accent-soft: rgba(255, 135, 165, 0.16);
  --accent-strong: #ff5c8a;
  --text: #3b3240;
  --text-soft: #9b8a9b;
  --border-subtle: rgba(244, 200, 210, 0.9);
  --border-strong: rgba(235, 176, 194, 0.9);
  --shadow-soft: 0 18px 45px rgba(219, 164, 177, 0.35);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-pill: 999px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 0 0, rgba(255, 205, 226, 0.9), transparent 60%),
    radial-gradient(circle at 100% 0, rgba(196, 210, 255, 0.7), transparent 60%),
    radial-gradient(circle at 50% 100%, rgba(255, 234, 198, 0.75), transparent 60%),
    var(--bg);
}

.page {
  max-width: 1120px;
  margin: 28px auto 40px;
  padding: 0 20px 32px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-heart {
  width: 40px;
  height: 40px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  background: radial-gradient(circle at 25% 20%, #ffeef5, #ff9db8);
  box-shadow:
    0 10px 26px rgba(232, 140, 166, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.9);
}

.brand-en {
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(187, 157, 170, 0.9);
}

.brand-cn {
  font-size: 20px;
}

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

.site-nav button {
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-size: 13px;
  cursor: pointer;
  transition:
    background 0.16s ease,
    color 0.16s ease,
    border-color 0.16s ease,
    transform 0.05s ease;
}

.site-nav button:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(232, 174, 188, 0.9);
  color: var(--text);
  transform: translateY(-0.5px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.hero-left {
  padding: 22px 20px 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background:
    radial-gradient(circle at 0 0, rgba(255, 209, 225, 0.98), transparent 70%),
    radial-gradient(circle at 100% 100%, rgba(215, 230, 255, 0.85), transparent 70%),
    var(--bg-elevated);
  box-shadow: var(--shadow-soft);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(179, 147, 158, 0.9);
}

.hero-left h1 {
  margin: 0 0 8px;
  font-size: 32px;
  letter-spacing: 0.16em;
}

.hero-subtitle {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--text-soft);
}

.hero-body {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.8;
  color: rgba(85, 70, 82, 0.96);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-btn,
.ghost-btn,
.outline-btn {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 0;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.08s ease,
    opacity 0.18s ease,
    border-color 0.18s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow:
    0 10px 22px rgba(232, 135, 166, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.9);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 14px 30px rgba(232, 135, 166, 0.7),
    0 0 0 1px rgba(255, 255, 255, 1);
}

.primary-btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 4px 14px rgba(220, 129, 156, 0.6);
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-soft);
  border: 1px solid rgba(235, 176, 194, 0.9);
}

.ghost-btn:hover {
  background: #ffeef5;
  color: var(--text);
}

.outline-btn {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid rgba(235, 176, 194, 0.9);
}

.outline-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

.hero-right {
  display: flex;
  align-items: stretch;
}

.hero-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(245, 200, 214, 0.9);
  padding: 18px 18px 16px;
  background:
    radial-gradient(circle at 0 0, rgba(255, 207, 226, 0.96), transparent 70%),
    radial-gradient(circle at 100% 100%, rgba(220, 232, 255, 0.9), transparent 70%),
    var(--bg-elevated);
  box-shadow:
    0 14px 32px rgba(217, 173, 186, 0.55);
}

.hero-card-summary {
  cursor: pointer;
  transition:
    box-shadow 0.18s ease,
    transform 0.12s ease;
}

.hero-card-summary:hover {
  box-shadow: 0 18px 38px rgba(217, 173, 186, 0.7);
  transform: translateY(-2px);
}

.hero-card-summary:active {
  transform: translateY(0);
  box-shadow: 0 10px 22px rgba(217, 173, 186, 0.6);
}

.hero-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.hero-card-text {
  margin: 0 0 10px;
  font-size: 13px;
  color: rgba(94, 78, 90, 0.98);
  line-height: 1.7;
}

.hero-tags {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}

.hero-tags li {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(236, 182, 198, 0.85);
  background: rgba(255, 247, 250, 0.9);
  color: #b07a8f;
}

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

.section-header h2 {
  margin: 2px 0 4px;
  font-size: 20px;
}

.section-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-soft);
}

.metrics {
  margin-bottom: 30px;
  padding: 18px 18px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.9),
      rgba(255, 248, 252, 0.9)
    ),
    rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-soft);
}

.metrics-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  border-radius: 18px;
  padding: 14px 12px 12px;
  background: radial-gradient(circle at 0 0, rgba(255, 214, 229, 0.9), transparent 70%),
    #ffffff;
  border: 1px solid rgba(240, 191, 206, 0.9);
  text-align: center;
}

.metric-card-bday {
  grid-column: 1 / -1; /* 占满整行，让两个生日框上下对齐并拉长 */
}

.metric-label {
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 4px;
}

.metric-value {
  font-size: 26px;
  font-weight: 600;
}

/* 计时器动态进位效果（翻牌/滚动感） */
.metric-value.metric-odometer {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.metric-odometer .odometer-window {
  position: relative;
  display: inline-block;
  min-width: 3.2ch;
  height: 1.3em;
  overflow: hidden;
}

.metric-odometer .odometer-number {
  display: inline-block;
  transform: translateY(0);
  opacity: 1;
  filter: blur(0);
  transition:
    transform 260ms cubic-bezier(0.2, 0.9, 0.2, 1),
    opacity 260ms ease,
    filter 260ms ease;
}

.metric-odometer .odometer-number.is-old {
  position: absolute;
  left: 0;
  top: 0;
}

.metric-odometer.is-ticking .odometer-number.is-old {
  transform: translateY(-110%);
  opacity: 0;
  filter: blur(1px);
}

.metric-odometer.is-ticking .odometer-number.is-new {
  transform: translateY(0);
  opacity: 1;
}

.metric-odometer .odometer-number.is-new {
  transform: translateY(110%);
  opacity: 0;
}

/* 进位强调：上级单位轻微“心跳”一下 */
.metric-odometer.is-carry {
  animation: carryPulse 260ms ease;
}

@keyframes carryPulse {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-1px) scale(1.03); }
  100% { transform: translateY(0) scale(1); }
}

.metric-unit {
  font-size: 12px;
  color: rgba(139, 111, 126, 0.96);
}

.start-date-dialog {
  margin-top: 14px;
  border-radius: 16px;
  border: 1px dashed rgba(235, 176, 194, 0.9);
  padding: 12px 12px 10px;
  background: rgba(255, 255, 255, 0.96);
  display: none;
}

.start-date-dialog[aria-hidden="false"] {
  display: block;
}

.start-date-inner h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.dialog-desc {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-soft);
}

.form-row {
  margin-bottom: 12px;
}

.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
  color: var(--text-soft);
}

.label-hint {
  font-size: 11px;
  color: rgba(179, 182, 209, 0.9);
}

input,
textarea,
select {
  width: 100%;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1px solid rgba(235, 176, 194, 0.55);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    transform 0.05s ease;
}

input::placeholder,
textarea::placeholder {
  color: rgba(195, 163, 177, 0.9);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 135, 165, 0.5);
  transform: translateY(-0.5px);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.journal {
  margin-bottom: 30px;
}

.journal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.4fr);
  gap: 22px;
  align-items: flex-start;
}

.editor-card,
.timeline-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(240, 191, 206, 0.9);
  background: linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.96),
      rgba(255, 248, 252, 0.96)
    ),
    rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-soft);
  padding: 18px 18px 16px;
}

.editor-card h3,
.timeline-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.field-note {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.6;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

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

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

.filters input[type="search"] {
  min-width: 160px;
}

.filters select {
  min-width: 140px;
}

.entries-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  max-height: 560px;
  overflow: auto;
  padding-right: 6px;
}

.entries-list::-webkit-scrollbar {
  width: 6px;
}

.entries-list::-webkit-scrollbar-track {
  background: transparent;
}

.entries-list::-webkit-scrollbar-thumb {
  background: rgba(235, 176, 194, 0.9);
  border-radius: 999px;
}

.entry-item {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 18px;
}

.entry-item + .entry-item {
  margin-top: 14px;
}

.entry-timeline-dot {
  margin-top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #ffe7f3, #ff9db8);
  box-shadow:
    0 0 0 3px rgba(255, 135, 165, 0.4),
    0 0 14px rgba(232, 135, 166, 0.6);
}

.entry-item::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 32px;
  bottom: -18px;
  width: 1px;
  background: linear-gradient(
    to bottom,
    rgba(240, 191, 206, 0.95),
    rgba(255, 255, 255, 0)
  );
}

.entry-item:last-child::before {
  display: none;
}

.entry-card {
  border-radius: var(--radius-md);
  border: 1px solid rgba(240, 191, 206, 0.9);
  background:
    radial-gradient(circle at 0 0, rgba(255, 216, 231, 0.96), transparent 68%),
    #ffffff;
  padding: 13px 13px 10px;
  box-shadow: 0 12px 26px rgba(217, 173, 186, 0.55);
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.entry-date {
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 3px;
}

.entry-title {
  margin: 0;
  font-size: 15px;
}

.entry-meta {
  margin: 4px 0 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
}

.entry-mood {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 213, 230, 0.9);
  color: #a5597b;
  border: 1px solid rgba(240, 191, 206, 0.9);
}

.entry-tags {
  color: var(--text-soft);
}

.entry-tags span {
  margin-right: 6px;
}

.entry-content {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(85, 70, 82, 0.98);
  white-space: pre-wrap;
}

.entry-image-wrapper {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.entry-image-wrapper img {
  max-width: 100%;
  height: auto;
  /* 默认端（手机 / 普通屏）最大高度：约 220px，按图片原始比例缩放 */
  max-height: 220px;
  border-radius: 12px;
  border: 1px solid rgba(240, 191, 206, 0.9);
  box-shadow: 0 8px 20px rgba(217, 173, 186, 0.6);
}

@media (min-width: 1024px) {
  .entry-image-wrapper {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
  }
  .entry-image-wrapper img {
    /* 电脑端：最大高度稍小一点，保持原始比例的缩略图 */
    max-height: 160px;
  }
}

.entry-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  border: 0;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-soft);
  border: 1px solid rgba(235, 176, 194, 0.9);
  transition:
    background 0.16s ease,
    color 0.16s ease,
    transform 0.08s ease,
    box-shadow 0.16s ease;
}

.icon-btn:hover {
  background: #ffeef5;
  color: var(--text);
  box-shadow: 0 7px 16px rgba(217, 173, 186, 0.6);
  transform: translateY(-0.5px);
}

.icon-btn:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 4px 10px rgba(217, 173, 186, 0.6);
}

.empty-state {
  margin: 14px 0 6px;
  padding: 14px 13px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px dashed rgba(235, 176, 194, 0.9);
  text-align: center;
  color: var(--text-soft);
  font-size: 13px;
}


.site-footer {
  margin-top: 10px;
  text-align: center;
  color: var(--text-soft);
  font-size: 12px;
}

/* 启用页（start.html） */

.start-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 120px);
}

.start-card {
  max-width: 520px;
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(240, 191, 206, 0.9);
  background: linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.98),
      rgba(255, 247, 252, 0.96)
    ),
    rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-soft);
  padding: 22px 22px 18px;
  text-align: center;
}

.start-heart-big {
  width: 60px;
  height: 60px;
  margin: 0 auto 12px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: radial-gradient(circle at 25% 20%, #ffeef5, #ff9db8);
  box-shadow:
    0 12px 26px rgba(232, 140, 166, 0.7),
    0 0 0 1px rgba(255, 255, 255, 1);
}

.start-question {
  margin: 0 0 8px;
  font-size: 20px;
}

.start-subtitle {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-soft);
}

.start-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.start-note {
  margin: 0;
  font-size: 13px;
  color: rgba(94, 78, 90, 0.98);
  min-height: 40px;
  white-space: pre-wrap;
}

.start-counter {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-soft);
}

@media (max-width: 960px) {
  .page {
    margin-top: 18px;
  }

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

  .hero-right {
    order: -1;
  }

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

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

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

  .entries-list {
    max-height: 480px;
  }
}

@media (max-width: 560px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .section-header {
    flex-direction: column;
  }

  .filters {
    width: 100%;
    flex-wrap: wrap;
  }

  .filters input,
  .filters select {
    flex: 1 1 48%;
  }
}

