/* ==================== 澜梦界花园 · 全局样式 ==================== */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-serif);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* 移动端优先，最大600px居中 */
#app {
  width: 100%;
  max-width: 600px;
  height: 100%;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
}

/* ==================== 页面层 ==================== */
.page {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--safe-top) var(--page-pad) var(--safe-bottom);
  opacity: 0;
  transition: opacity 200ms ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.page.active {
  display: flex;
  opacity: 1;
}

/* ==================== 入口页 #/ ==================== */
.page-cover {
  background: var(--bg);
}

.page-cover .logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 40px;
}

.page-cover .logo-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  opacity: 0.9;
}

.page-cover .brand-title {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
}

.page-cover .brand-sub {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.3em;
  color: var(--text-soft);
  text-transform: uppercase;
}

.page-cover .slogan {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 48px;
  opacity: 0.9;
}

.btn-primary {
  padding: 14px 48px;
  border-radius: 24px;
  border: none;
  background: var(--text);
  color: var(--fog);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.btn-primary:active {
  transform: scale(0.97);
  opacity: 0.8;
}

.bottom-hint {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.8;
  white-space: nowrap;
}

/* ==================== 选状态页 #/choose ==================== */
.page-choose {
  background: var(--bg);
  justify-content: flex-start;
  padding-top: 80px;
}

.back-btn {
  position: absolute;
  top: var(--safe-top);
  left: var(--page-pad);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-soft);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 10;
}

.choose-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 40px;
  text-align: center;
}

.state-options {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 360px;
}

.state-option {
  width: 100%;
  height: 56px;
  padding-left: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(250, 247, 240, 0.08);
  border: 1px solid rgba(250, 247, 240, 0.15);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition-base), border-color var(--transition-base), transform var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.state-option:active {
  transform: scale(0.97);
}

.state-option:hover {
  background: rgba(250, 247, 240, 0.12);
}

.state-option.selected {
  background: rgba(250, 247, 240, 0.15);
}

.state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-soft);
  flex-shrink: 0;
  transition: background var(--transition-base);
}

.state-option.selected .state-dot {
  background: var(--flower-color, var(--text));
}

.state-label {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.03em;
}

.choose-hint {
  margin-top: 32px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  color: var(--text-soft);
  letter-spacing: 0.1em;
}

/* ==================== 花生长页 #/growing ==================== */
.page-growing {
  background: var(--bg);
}

.growing-area {
  position: relative;
  width: 200px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flower-stem {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 0;
  background: linear-gradient(180deg, rgba(250,247,240,0.4), rgba(250,247,240,0.1));
  transition: height 900ms ease;
}

.flower-stem.grown {
  height: 160px;
}

.flower-bud {
  position: absolute;
  top: 160px;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--flower-color, var(--text));
  opacity: 0.6;
  transition: transform 600ms ease, opacity 600ms ease;
}

.flower-bud.swell {
  transform: translate(-50%, -50%) scale(1);
}

.flower-petals {
  position: absolute;
  top: 160px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
}

.petal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 70px;
  background: var(--flower-color, var(--text));
  border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%;
  opacity: 0;
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) scale(0.3) rotate(var(--angle));
  transition: transform 600ms ease, opacity 600ms ease;
  filter: url(#fur);
}

.petal.open {
  opacity: 0.7;
  transform: translate(-50%, -100%) scale(0.7) rotate(var(--angle));
}

.petal.full {
  opacity: 0.85;
  transform: translate(-50%, -100%) scale(1) rotate(var(--angle));
}

.flower-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  transition: transform 600ms ease, opacity 600ms ease;
}

.flower-center.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 0.8;
}

.growing-text {
  position: absolute;
  bottom: 100px;
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--text-soft);
  animation: breathe 1.5s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ==================== 花盛开页 #/bloomed ==================== */
.page-bloomed {
  background: var(--bg);
}

.bloomed-flower-wrap {
  width: 200px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.bloomed-text {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.8;
  color: var(--text);
  text-align: center;
  margin-bottom: 40px;
  max-width: 280px;
}

.bloom-options {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bloom-option {
  width: 100%;
  padding: 14px 0;
  border-radius: 24px;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 400;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.03em;
}

.bloom-option.outline {
  background: transparent;
  border: 1px solid var(--text);
  color: var(--text);
}

.bloom-option.outline:active {
  background: rgba(250, 247, 240, 0.1);
}

.bloom-option.solid {
  background: var(--text);
  border: 1px solid var(--text);
  color: var(--fog);
}

.bloom-option.solid:active {
  opacity: 0.85;
  transform: scale(0.97);
}

.word-toggle {
  margin-top: 20px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-soft);
  cursor: pointer;
  background: none;
  border: none;
}

.word-input-area {
  display: none;
  margin-top: 12px;
  width: 100%;
  max-width: 300px;
}

.word-input-area.show {
  display: block;
}

.word-input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(250, 247, 240, 0.2);
  background: rgba(250, 247, 240, 0.06);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 15px;
  outline: none;
  resize: none;
}

.word-input::placeholder {
  color: var(--text-soft);
}

/* ==================== 花园页 #/garden ==================== */
.page-garden {
  background: var(--bg);
  justify-content: flex-start;
  padding-top: 60px;
  align-items: stretch;
}

.garden-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4px;
  margin-bottom: 24px;
}

.garden-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

.garden-settings {
  font-size: 20px;
  color: var(--text-soft);
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.flower-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex: 1;
  padding-bottom: 20px;
}

.flower-card {
  background: rgba(250, 247, 240, 0.06);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: background var(--transition-base);
}

.flower-card:hover {
  background: rgba(250, 247, 240, 0.1);
}

.flower-card-icon {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flower-card-icon svg {
  width: 50px;
  height: 50px;
}

.flower-card-info {
  flex: 1;
}

.flower-card-label {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--text);
  margin-bottom: 4px;
}

.flower-card-date {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-soft);
}

.flower-card-status {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 4px;
}

.garden-stats {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(250, 247, 240, 0.1);
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.8;
}

/* 空状态 */
.garden-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.empty-flower-outline {
  width: 80px;
  height: 80px;
  opacity: 0.15;
}

.empty-text {
  font-family: var(--font-serif);
  font-size: 16px;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.8;
}

/* ==================== 糯糯页 #/nuonuo ==================== */
.page-nuonuo {
  background: var(--bg);
}

.nuonuo-svg-wrap {
  width: 120px;
  height: 120px;
  margin-bottom: 40px;
}

.nuonuo-text {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 400;
  line-height: 2;
  color: var(--text);
  text-align: center;
  max-width: 280px;
  margin-bottom: 40px;
}

/* ==================== 关于页 #/about ==================== */
.page-about {
  background: var(--bg);
  justify-content: flex-start;
  padding-top: 80px;
  align-items: center;
}

.about-content {
  max-width: 320px;
  text-align: center;
}

.about-brand {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-bottom: 4px;
}

.about-brand-sub {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.3em;
  color: var(--text-soft);
  margin-bottom: 32px;
}

.about-soul {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 400;
  line-height: 2.2;
  color: var(--text);
  opacity: 0.9;
  margin-bottom: 24px;
}

.about-divider {
  width: 40px;
  height: 1px;
  background: var(--text-soft);
  margin: 24px auto;
}

.about-body {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 2.2;
  color: var(--text);
  opacity: 0.85;
  margin-bottom: 16px;
}

.about-copyright {
  margin-top: 40px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.8;
}

/* ==================== 隐私页 #/privacy ==================== */
.page-privacy {
  background: var(--bg);
  justify-content: flex-start;
  padding-top: 80px;
  align-items: stretch;
}

.privacy-content {
  max-width: 340px;
  margin: 0 auto;
}

.privacy-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 32px;
}

.privacy-body {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 400;
  line-height: 2.2;
  color: var(--text);
  opacity: 0.85;
  margin-bottom: 24px;
}

.privacy-list {
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 2.4;
  color: var(--text);
  opacity: 0.75;
  margin-bottom: 24px;
  padding-left: 0;
  list-style: none;
}

.privacy-list li::before {
  content: '· ';
  color: var(--text-soft);
}

.privacy-btn {
  width: 100%;
  padding: 12px 0;
  border-radius: 24px;
  border: 1px solid var(--text);
  background: transparent;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 15px;
  cursor: pointer;
  margin-bottom: 12px;
  transition: all var(--transition-fast);
}

.privacy-btn:active {
  background: rgba(250, 247, 240, 0.1);
}

.privacy-btn.danger {
  border-color: rgba(250, 247, 240, 0.3);
  color: var(--text-soft);
}

/* ==================== 设置抽屉 ==================== */
.settings-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 360px;
  height: 100%;
  background: var(--fog-dark);
  z-index: 100;
  padding: 60px 24px;
  transition: right var(--transition-base);
  overflow-y: auto;
}

.settings-drawer.open {
  right: 0;
}

.settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 99;
  display: none;
}

.settings-overlay.show {
  display: block;
}

.settings-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 32px;
}

.settings-item {
  padding: 16px 0;
  border-bottom: 1px solid rgba(250, 247, 240, 0.1);
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.settings-item:hover {
  opacity: 0.7;
}

/* ==================== 淡入动画 ==================== */
.fade-in {
  animation: fadeIn 600ms ease forwards;
}

.fade-in-d1 { animation-delay: 400ms; opacity: 0; }
.fade-in-d2 { animation-delay: 800ms; opacity: 0; }

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