:root {
  --pink: #f4c6d8;
  --rose: #e89ab5;
  --lilac: #d5c6f0;
  --cream: #fff7f2;
  --ink: #3d3340;
  --muted: #8a7380;
  --card: rgba(255, 255, 255, 0.86);
  --shadow: 0 12px 40px rgba(180, 120, 140, 0.18);
  --radius: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 10% -10%, #ffe4ef 0%, transparent 55%),
    radial-gradient(900px 700px at 110% 10%, #e8ddff 0%, transparent 50%),
    linear-gradient(180deg, #fff5f8 0%, #f7f1ff 100%);
}

body {
  padding-bottom: 0;
}

button, input, textarea {
  font-family: inherit;
}

h1, h2, h3, h4, p {
  margin: 0;
}

.view, .page {
  min-height: 100dvh;
}

.view[hidden], .page[hidden], [hidden] {
  display: none !important;
}

.card {
  background: var(--card);
  backdrop-filter: blur(14px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, #f08ab0, #c9a6f2);
  color: white;
}

.btn-secondary {
  background: #ffe8f0;
  color: #7a4060;
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-text {
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
}

.btn-tiny {
  padding: 6px 12px;
  font-size: 13px;
  background: #fff;
  color: #7a4060;
}

.btn-song {
  font-size: 18px;
  padding: 16px 28px;
  background: linear-gradient(135deg, #ff8fb3, #ffc38b);
  color: white;
  box-shadow: 0 10px 24px rgba(255, 120, 150, 0.35);
}

.hint, .muted {
  color: var(--muted);
  font-size: 13px;
}

label {
  display: block;
  margin: 12px 0 6px;
  font-size: 13px;
  color: var(--muted);
}

input, textarea {
  width: 100%;
  border: 1px solid #f0d6e2;
  border-radius: 14px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

textarea {
  resize: vertical;
}

/* 登录 */
.view-login {
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
}

.login-kicker, .birthday-kicker, .hello, .quote-tag {
  color: var(--rose);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.login-card h1, .birthday-content h1 {
  margin: 8px 0 12px;
  font-size: 32px;
}

.login-desc {
  color: var(--muted);
  margin-bottom: 8px;
}

#login-form .btn {
  width: 100%;
  margin-top: 16px;
}

#login-hint {
  margin-top: 12px;
}

/* 生日页 */
.view-birthday {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 20%, #fff 0%, #ffe4f0 45%, #ead9ff 100%);
}

.birthday-content {
  position: relative;
  z-index: 2;
}

.birthday-sub {
  color: var(--muted);
  margin-bottom: 24px;
}

#enter-site-btn {
  display: block;
  margin: 28px auto 0;
}

.party-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.balloons span,
.confetti i,
.stars b {
  position: absolute;
  display: block;
}

.balloons span {
  width: 34px;
  height: 44px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: float 6s ease-in-out infinite;
}

.balloons span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 44px;
  width: 1px;
  height: 28px;
  background: #c9a0b0;
}

.confetti i {
  width: 8px;
  height: 14px;
  border-radius: 2px;
  animation: fall 4.5s linear infinite;
}

.stars b {
  width: 6px;
  height: 6px;
  background: #fff6b5;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  animation: twinkle 2.2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

@keyframes fall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(240deg); opacity: 0.2; }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* 主壳 */
.app-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px calc(88px + var(--safe-bottom));
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.topbar h2 {
  font-size: 24px;
}

.topbar-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.status-grid {
  display: grid;
  gap: 16px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.preset {
  border: 1px solid #f0d6e2;
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.preset.active {
  background: #ffd6e7;
  border-color: transparent;
}

.schedule-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0 8px;
}

.schedule-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.schedule-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #f6e4ec;
}

.schedule-actions {
  display: flex;
  gap: 6px;
}

.linkish {
  border: 0;
  background: none;
  color: var(--rose);
  cursor: pointer;
  padding: 0;
}

.partner-status {
  font-size: 22px;
  margin: 12px 0 8px;
}

.partner-note {
  color: var(--muted);
  margin-bottom: 16px;
}

/* 纸条 */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab {
  flex: 1;
  border: 0;
  background: #fff;
  border-radius: 999px;
  padding: 10px;
  color: var(--muted);
}

.tab.active {
  background: #ffd6e7;
  color: var(--ink);
  font-weight: 600;
}

.note-form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.note-list {
  list-style: none;
  padding: 0;
}

.note-item {
  background: #fffdf8;
  border-radius: 16px;
  padding: 14px 16px;
  margin: 12px 0;
  box-shadow: var(--shadow);
  transform: rotate(-0.4deg);
}

.note-item:nth-child(even) {
  transform: rotate(0.5deg);
  background: #fff7fb;
}

.note-item.unread {
  outline: 2px solid #f08ab0;
}

.note-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
}

/* 番茄钟 */
.pomodoro-card, .wheel-card, .quote-card {
  text-align: center;
}

.timer-ring {
  width: 210px;
  height: 210px;
  transform: rotate(-90deg);
}

.ring-bg, .ring-fg {
  fill: none;
  stroke-width: 10;
}

.ring-bg {
  stroke: #ffe8f0;
}

.ring-fg {
  stroke: #e89ab5;
  stroke-linecap: round;
  stroke-dasharray: 326.7;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.4s linear;
}

.timer-display {
  margin-top: -24px;
  font-size: 48px;
  font-weight: 700;
}

.timer-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

/* 转盘 */
.wheel-wrap {
  position: relative;
  width: min(260px, 100%);
  aspect-ratio: 1 / 1;
  margin: 20px auto;
}

.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 8px solid #fff;
  box-shadow: var(--shadow);
  transition: transform 4s cubic-bezier(0.12, 0.7, 0.08, 1);
}

/* 扇区文字：沿半径方向朝外排布，永远不会倒着显示 */
.wheel-label {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 18px;
  line-height: 18px;
  margin-top: -9px;
  text-align: center;
  border-radius: 999px;
  color: #6b4a5a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform-origin: 50% 50%;
  pointer-events: none;
  transition: background 0.25s, color 0.25s, box-shadow 0.25s;
}

/* 中奖扇区文字高亮 */
.wheel-label.win {
  background: rgba(255, 255, 255, 0.92);
  color: #c0392b;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.wheel-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, #f08ab0, #c9a6f2);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(180, 120, 140, 0.35);
  z-index: 3;
}

.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid #e89ab5;
  z-index: 4;
}

.wheel-result {
  font-size: 30px;
  font-weight: 700;
  margin: 10px 0 20px;
  word-break: break-all;
}

.quote-text {
  font-size: 22px;
  line-height: 1.6;
  margin: 18px 0 24px;
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  padding: 8px 8px calc(8px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 -8px 24px rgba(180, 120, 140, 0.12);
}

.nav-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 0;
}

.nav-btn.active {
  color: #c45d84;
  font-weight: 700;
}

/* 弹窗 */
.dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;
  width: min(420px, calc(100% - 24px));
}

.dialog::backdrop {
  background: rgba(50, 30, 40, 0.35);
}

.dialog-inner {
  padding: 20px;
}

.dialog-center {
  text-align: center;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

@media (min-width: 720px) {
  .status-grid {
    grid-template-columns: 1fr 1fr;
  }

  body {
    padding-bottom: 0;
  }

  .app-shell {
    padding-bottom: 24px;
  }

  .bottom-nav {
    position: sticky;
    margin-top: 24px;
    border-radius: 20px;
  }
}
