/* ============================================================
   首页 · 样式
   ============================================================ */

/* ============ 全局 ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', 'PingFang SC', Roboto, 'Helvetica Neue', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  background: linear-gradient(160deg, #1b2242 0%, #2a2f5e 40%, #3b3160 70%, #4a3a6b 100%);
  background-attachment: fixed;
  color: #e6e9ff;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0.9rem;
  padding-top: calc(0.9rem + env(safe-area-inset-top));
  padding-bottom: calc(0.9rem + env(safe-area-inset-bottom));
  position: relative;
  -webkit-font-smoothing: antialiased;
}

/* 星空 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 60% 15%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 80% 40%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 15% 70%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 45% 85%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 90% 80%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 35% 50%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 70% 65%, #fff 50%, transparent 51%);
  opacity: 0.7;
  animation: twinkle 6s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: 0;
}

/* 月亮 */
body::after {
  content: '';
  position: fixed;
  top: 4%;
  right: 5%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8e0, #f6e6b8 55%, #e6cd7a 100%);
  box-shadow:
    0 0 20px rgba(255, 240, 200, 0.55),
    0 0 50px rgba(255, 220, 160, 0.3),
    inset -6px -6px 12px rgba(180, 150, 90, 0.25);
  pointer-events: none;
  z-index: 0;
}

@keyframes twinkle {
  0%   { opacity: 0.5; }
  100% { opacity: 0.9; }
}

/* ============ 密码锁（默认隐藏，加 .show 才显示） ============ */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  padding-top: calc(1.2rem + env(safe-area-inset-top));
  padding-bottom: calc(1.2rem + env(safe-area-inset-bottom));
  background: linear-gradient(160deg, #1b2242 0%, #2a2f5e 40%, #3b3160 70%, #4a3a6b 100%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lock-screen.show {
  opacity: 1;
  visibility: visible;
}

.lock-card {
  width: 100%;
  max-width: 340px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 26px;
  padding: 2rem 1.6rem;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.lock-emoji {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 16px rgba(255, 220, 160, 0.45));
  animation: moonFloat 3.2s ease-in-out infinite;
}

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

.lock-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
  background: linear-gradient(120deg, #ffd9b3, #ffb3d9, #b3c7ff, #ffd9b3);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 6s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.lock-sub {
  font-size: 0.82rem;
  color: rgba(230, 235, 255, 0.6);
  margin-bottom: 1.3rem;
}

.lock-input {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #f0f3ff;
  font-size: 1.05rem;
  letter-spacing: 4px;
  text-align: center;
  outline: none;
  transition: all 0.25s;
  margin-bottom: 0.85rem;
}

.lock-input::placeholder {
  letter-spacing: 1px;
  color: rgba(230, 235, 255, 0.35);
}

.lock-input:focus {
  border-color: rgba(180, 200, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 4px rgba(140, 160, 220, 0.15);
}

.lock-btn {
  width: 100%;
  padding: 0.85rem;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #a0b4ff, #c7a0ff);
  color: #1b2242;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.22s;
  box-shadow: 0 8px 22px rgba(140, 160, 240, 0.45);
}

.lock-btn:active { transform: scale(0.97); }

.lock-error {
  margin-top: 0.85rem;
  font-size: 0.8rem;
  color: #ff9a9a;
  height: 1.2em;
  opacity: 0;
  transition: opacity 0.3s;
}

.lock-error.show { opacity: 1; }

.lock-card.shake { animation: shake 0.4s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-10px); }
  40%      { transform: translateX(10px); }
  60%      { transform: translateX(-6px); }
  80%      { transform: translateX(6px); }
}

/* ============ 首页内容（默认隐藏，加 .show 显示） ============ */
.home-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.9rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease 0.05s, visibility 0s linear 0.05s;
  min-height: calc(100vh - 1.8rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  min-height: calc(100dvh - 1.8rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

.home-wrap.show {
  opacity: 1;
  visibility: visible;
}

/* ============ 问候语区 ============ */
.greeting {
  text-align: center;
  padding: 0.4rem 0.6rem 0.2rem;
}

.greeting-title {
  font-size: clamp(1.5rem, 6vw, 2.3rem);
  font-weight: 700;
  letter-spacing: clamp(0.5px, 0.3vw, 2px);
  background: linear-gradient(120deg, #ffd9b3, #ffb3d9, #b3c7ff, #ffd9b3);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: shimmer 6s ease-in-out infinite;
  margin-bottom: 0.4rem;
  line-height: 1.2;
}

/* ============ 天气条 ============ */
.weather-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.2rem auto 0.3rem;
  padding: 0.45rem 1rem;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 40px;
  font-size: 0.85rem;
  color: #e6e9ff;
  transition: all 0.3s;
  white-space: nowrap;
}

.weather-bar.loading { opacity: 0.7; }

.weather-icon {
  font-size: 1.1rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(255, 220, 160, 0.4));
}

.weather-city {
  color: rgba(230, 235, 255, 0.85);
  font-weight: 500;
}

.weather-temp {
  color: #ffd9b3;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.weather-desc {
  color: rgba(230, 235, 255, 0.65);
}

.weather-desc::before {
  content: '·';
  margin-right: 0.4rem;
  opacity: 0.4;
}

.weather-care {
  font-size: 0.78rem;
  color: rgba(230, 235, 255, 0.6);
  letter-spacing: 0.3px;
  min-height: 1.2em;
  margin-bottom: 0.2rem;
  transition: all 0.3s;
}

.weather-care.show { opacity: 1; }

/* ============ 每日一句（内嵌） ============ */
.daily-inline {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.4rem auto 0.5rem;
  padding: 0.7rem 0.9rem 0.65rem;
  max-width: 100%;
  background: linear-gradient(135deg, rgba(255, 217, 179, 0.12), rgba(255, 179, 217, 0.12), rgba(179, 199, 255, 0.12));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 200, 220, 0.25);
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(200, 150, 200, 0.12);
  text-align: left;
}

.daily-inline-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
  filter: drop-shadow(0 0 6px rgba(255, 200, 180, 0.5));
}

.daily-inline-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.daily-inline-quote {
  font-size: clamp(0.85rem, 3.2vw, 0.98rem);
  line-height: 1.55;
  color: #f0f3ff;
  letter-spacing: 0.2px;
  word-break: break-word;
}

.daily-inline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: rgba(230, 235, 255, 0.55);
  letter-spacing: 0.3px;
}

.daily-inline-from {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-inline-date {
  flex-shrink: 0;
  color: rgba(230, 235, 255, 0.45);
}

.daily-inline-refresh {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #e6e9ff;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  margin-top: 2px;
}

.daily-inline-refresh:active {
  transform: scale(0.9) rotate(180deg);
  background: rgba(255, 255, 255, 0.2);
}

.greeting-sub {
  font-size: clamp(0.82rem, 3.2vw, 1rem);
  color: rgba(230, 235, 255, 0.72);
  letter-spacing: 0.3px;
  line-height: 1.5;
}

/* ============ 心情小瓶子（一行胶囊） ============ */
.bottle-section {
  display: flex;
  justify-content: center;
  padding: 0 0 0.3rem;
}

.bottle-wrap {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  padding: 0.35rem 1rem 0.35rem 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 40px;
  transition: all 0.2s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.bottle-wrap:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.1);
}

.bottle {
  position: relative;
  width: 32px;
  height: 38px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  filter: drop-shadow(0 2px 6px rgba(160, 130, 220, 0.35));
}

.bottle-wrap:hover .bottle {
  animation: bottleShake 1.4s ease-in-out infinite;
}

@keyframes bottleShake {
  0%, 100% { transform: rotate(-4deg); }
  50%      { transform: rotate(4deg); }
}

.bottle-neck {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 7px;
  border-radius: 2px 2px 3px 3px;
  background: linear-gradient(180deg, #c9b3ff, #a58bff);
  box-shadow: inset -2px 0 3px rgba(255, 255, 255, 0.4);
}

.bottle-body {
  position: absolute;
  top: 6px;
  left: 0;
  width: 100%;
  height: calc(100% - 6px);
  border-radius: 8px 8px 10px 10px;
  background: linear-gradient(160deg, rgba(255, 217, 240, 0.35), rgba(200, 180, 255, 0.35), rgba(180, 200, 255, 0.35));
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow:
    inset -3px -3px 7px rgba(255, 255, 255, 0.3),
    inset 3px 3px 7px rgba(180, 160, 230, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.bottle-paper {
  font-size: 0.9rem;
  animation: paperFloat 3s ease-in-out infinite;
  filter: drop-shadow(0 1px 3px rgba(255, 180, 220, 0.5));
}

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

.bottle-hint {
  font-size: 0.78rem;
  color: rgba(230, 235, 255, 0.6);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* ============ 入口卡片 ============ */
.entry-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  width: 100%;
  flex: 1;
  justify-content: center;
}

.entry-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.3rem 1.4rem;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  text-decoration: none;
  color: #e6e9ff;
  transition: all 0.28s ease;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.entry-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(160, 180, 255, 0.18), rgba(200, 160, 255, 0.18));
  opacity: 0;
  transition: opacity 0.3s;
}

.entry-card:hover {
  transform: translateY(-3px);
  border-color: rgba(180, 200, 255, 0.45);
  box-shadow: 0 12px 32px rgba(120, 140, 220, 0.3);
}

.entry-card:hover::before { opacity: 1; }
.entry-card:active { transform: scale(0.98); }

.entry-icon {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 12px rgba(255, 200, 180, 0.3));
  z-index: 1;
}

.entry-text {
  position: relative;
  flex: 1;
  min-width: 0;
  z-index: 1;
}

.entry-title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.entry-desc {
  font-size: 0.82rem;
  color: rgba(230, 235, 255, 0.6);
  letter-spacing: 0.3px;
  line-height: 1.45;
  word-break: break-word;
}

.entry-arrow {
  position: relative;
  font-size: 1.1rem;
  color: rgba(230, 235, 255, 0.4);
  z-index: 1;
  transition: transform 0.25s;
}

.entry-card:hover .entry-arrow {
  transform: translateX(4px);
  color: rgba(230, 235, 255, 0.85);
}

.footer-hint {
  text-align: center;
  font-size: 0.8rem;
  color: rgba(230, 235, 255, 0.45);
  letter-spacing: 0.5px;
  padding-bottom: 0.3rem;
}

/* ============ 加载动画 ============ */
.loading-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 4px;
  vertical-align: middle;
}

.loading-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: dotJump 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.loading-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dotJump {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40%           { transform: translateY(-4px); opacity: 1; }
}

/* ============ 心情小瓶子弹出层 ============ */
.bottle-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 30, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bottle-modal.show {
  opacity: 1;
  visibility: visible;
}

.bottle-note {
  position: relative;
  width: 100%;
  max-width: 340px;
  background: linear-gradient(160deg, #fff4e8, #ffe4ee, #f0e6ff);
  border-radius: 24px;
  padding: 2rem 1.6rem 1.6rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(255, 255, 255, 0.6) inset;
  transform: scale(0.7) rotate(-8deg);
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.3, 1.4);
  text-align: center;
}

.bottle-modal.show .bottle-note {
  transform: scale(1) rotate(0deg);
}

.bottle-note-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(120, 100, 140, 0.15);
  color: #6b5a80;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.bottle-note-close:active {
  transform: scale(0.9);
  background: rgba(120, 100, 140, 0.3);
}

.bottle-note-title {
  font-size: 0.85rem;
  color: #9a7fa8;
  letter-spacing: 2px;
  margin-bottom: 1rem;
}

.bottle-note-text {
  font-size: 1.15rem;
  line-height: 1.75;
  color: #5c4a6a;
  letter-spacing: 0.5px;
  font-weight: 500;
  padding: 0.5rem 0.3rem 1rem;
  word-break: break-word;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bottle-note-footer {
  padding-top: 1rem;
  border-top: 1px dashed rgba(150, 120, 170, 0.25);
}

.bottle-note-btn {
  padding: 0.65rem 1.6rem;
  border-radius: 40px;
  border: none;
  background: linear-gradient(135deg, #c7a0ff, #ffb3d9);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.22s;
  box-shadow: 0 6px 16px rgba(180, 140, 220, 0.4);
}

.bottle-note-btn:active { transform: scale(0.96); }

/* ============ 响应式 ============ */
@media (max-width: 480px) {
  body::after {
    width: 38px;
    height: 38px;
    top: 3.5%;
    right: 5%;
  }

  .entry-card {
    padding: 1.1rem 1.15rem;
    gap: 0.85rem;
    border-radius: 20px;
  }
  .entry-icon {
    width: 52px;
    height: 52px;
    font-size: 1.7rem;
    border-radius: 14px;
  }
  .entry-title { font-size: 1.05rem; }
  .entry-desc { font-size: 0.78rem; }

  .weather-bar {
    font-size: 0.78rem;
    padding: 0.4rem 0.85rem;
    gap: 0.4rem;
  }
  .weather-icon { font-size: 1rem; }
  .weather-care { font-size: 0.72rem; }

  .daily-inline {
    padding: 0.65rem 0.8rem 0.6rem;
    gap: 0.4rem;
    border-radius: 16px;
  }
  .daily-inline-quote {
    font-size: 0.82rem;
    line-height: 1.5;
  }
  .daily-inline-meta { font-size: 0.68rem; }
  .daily-inline-refresh {
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
  }

  .bottle { width: 28px; height: 34px; }
  .bottle-hint { font-size: 0.72rem; }

  .bottle-note {
    padding: 1.7rem 1.3rem 1.3rem;
    border-radius: 20px;
  }
  .bottle-note-text {
    font-size: 1rem;
    line-height: 1.65;
  }
}

@media (max-width: 360px) {
  .entry-icon {
    width: 46px;
    height: 46px;
    font-size: 1.5rem;
    border-radius: 12px;
  }
  .entry-title { font-size: 1rem; }
  .entry-desc { font-size: 0.74rem; }
  .entry-card { padding: 1rem; gap: 0.75rem; }
  .daily-inline-quote { font-size: 0.78rem; }
  .weather-bar { font-size: 0.72rem; padding: 0.35rem 0.7rem; }
}

@media (min-width: 1024px) {
  .home-wrap { max-width: 760px; }
  .entry-card { padding: 1.6rem 1.8rem; }
  .entry-icon { width: 66px; height: 66px; font-size: 2.1rem; }
  .entry-title { font-size: 1.3rem; }
  .entry-desc { font-size: 0.9rem; }
}

@media (max-height: 500px) and (orientation: landscape) {
  body::after { display: none; }
  .home-wrap { gap: 0.7rem; }
  .greeting-title { font-size: 1.3rem; }
  .greeting-sub { font-size: 0.8rem; }
  .entry-card { padding: 0.8rem 1rem; }
  .entry-icon { width: 44px; height: 44px; font-size: 1.4rem; }
  .entry-title { font-size: 0.95rem; }
  .entry-desc { font-size: 0.72rem; }
}