/* styles.css — 养花小屋样式
 * 纯原创 CSS，零外部依赖（无外部字体 / 框架 / 图片）。
 * 字体使用系统字体栈，兼容各平台中文显示。
 */

:root {
  --pink: #ff8fb3;
  --pink-deep: #e75480;
  --green: #5fae7a;
  --green-deep: #3f8c5c;
  --amber: #e6a23c;
  --ink: #3a3a3a;
  --ink-soft: #6b6b6b;
  --line: #ecd9e2;
  --bg: #fff7fb;
  --card: #ffffff;
  --shadow: 0 6px 20px rgba(231, 84, 128, 0.12);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
          "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
}

/* ============ 顶部缓存提醒横幅 ============ */
#banner {
  background: linear-gradient(135deg, #ffd9e8 0%, #ffffff 100%);
  color: #8a1f3d;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
#banner strong { color: #b3143b; }

/* ============ 顶部导航 ============ */
#topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand {
  font-size: 20px;
  font-weight: 800;
  color: var(--pink-deep);
  white-space: nowrap;
}
.nav { display: flex; gap: 8px; flex: 1; }
.nav-btn {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 15px;
  font-family: var(--font);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
}
.nav-btn:hover { background: #fff0f5; color: var(--pink-deep); }
.nav-btn.active {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-deep) 100%);
  color: #fff;
  font-weight: 700;
}
.top-right { display: flex; gap: 8px; }

/* ============ 通用按钮 ============ */
.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 15px;
  font-family: var(--font);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease;
  background: #f1f1f1;
  color: var(--ink);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-deep) 100%);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow);
}
.btn-water {
  background: linear-gradient(135deg, #7ec8e3 0%, #4a9fc4 100%);
  color: #fff;
  font-weight: 700;
}
.btn-pest {
  background: linear-gradient(135deg, #f6c453 0%, #e08e0b 100%);
  color: #fff;
  font-weight: 700;
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: #fff0f5; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ============ 视图容器 ============ */
#view {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.page-title {
  margin: 0 0 4px;
  font-size: 26px;
  color: var(--pink-deep);
}
.page-sub {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 15px;
}

/* ============ 登录 / 注册 ============ */
.auth-wrap {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 26px;
  border: 1px solid var(--line);
}
.auth-title {
  margin: 0 0 18px;
  text-align: center;
  color: var(--pink-deep);
}
.field { margin-bottom: 14px; }
.input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  transition: border .15s ease, box-shadow .15s ease;
}
.input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(255, 143, 179, 0.18);
}
.remember {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}
.auth-msg {
  min-height: 20px;
  font-size: 13px;
  color: var(--green-deep);
  margin: 4px 2px 8px;
}
.auth-msg.err { color: #d23b3b; }
.switch { text-align: center; margin-top: 12px; }
.link {
  color: var(--pink-deep);
  text-decoration: none;
  font-size: 14px;
}
.link:hover { text-decoration: underline; }

/* ============ 种子库 / 收藏 网格 ============ */
.seed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.seed-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(231, 84, 128, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform .12s ease, box-shadow .15s ease;
}
.seed-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.seed-emoji { font-size: 46px; line-height: 1; }
.seed-name { font-size: 18px; font-weight: 700; color: var(--ink); }
.seed-desc { font-size: 13px; color: var(--ink-soft); min-height: 38px; }
.seed-card .btn { margin-top: 4px; }
.collected { background: linear-gradient(135deg, #fff7e6 0%, #ffffff 100%); }
.collected-badge {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--green-deep);
  background: #eafaf0;
  border-radius: 999px;
  padding: 3px 12px;
}

/* ============ 我的花园 — 花朵卡片 ============ */
.flower-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.flower-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 0 2px 10px rgba(231, 84, 128, 0.07);
  transition: transform .12s ease, box-shadow .15s ease;
}
.flower-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.flower-card.mature {
  background: linear-gradient(135deg, #fff0f6 0%, #fffaf0 100%);
  border-color: #ffd2e4;
}
.flower-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.flower-emoji { font-size: 34px; line-height: 1; }
.flower-name { font-size: 18px; font-weight: 700; flex: 1; }
.flower-level {
  font-size: 13px;
  font-weight: 700;
  color: var(--pink-deep);
  background: #fff0f5;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}
.flower-card.mature .flower-level { color: var(--green-deep); background: #eafaf0; }

.bar {
  width: 100%;
  height: 12px;
  background: #f3e7ed;
  border-radius: 999px;
  overflow: hidden;
}
.bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--pink) 0%, var(--green) 100%);
  border-radius: 999px;
  transition: width .35s ease;
}
.bar-label { font-size: 12px; color: var(--ink-soft); margin: 5px 0 10px; }

.counters {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.counter {
  flex: 1;
  background: #faf2f6;
  border-radius: 8px;
  padding: 6px 8px;
  text-align: center;
}
.counter.zero { color: #c0392b; font-weight: 700; }

.flower-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.flower-actions .btn { flex: 1; min-width: 110px; }

/* ============ 空状态 ============ */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}
.empty-emoji { font-size: 56px; margin-bottom: 12px; }
.empty-text { font-size: 16px; margin-bottom: 18px; }

/* ============ 首访提醒弹窗 ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(80, 20, 40, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-box {
  background: #fff;
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  padding: 28px 26px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: pop .2s ease;
}
@keyframes pop {
  from { transform: scale(.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-icon { font-size: 44px; margin-bottom: 8px; }
.modal-title { margin: 0 0 10px; color: var(--pink-deep); }
.modal-text { font-size: 14px; color: var(--ink); margin: 0 0 20px; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(58, 58, 58, 0.94);
  color: #fff;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 200;
  max-width: 86%;
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ 导入进度遮罩 ============ */
.import-overlay {
  position: fixed;
  inset: 0;
  background: rgba(80, 20, 40, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  padding: 20px;
}
.import-box {
  background: #fff;
  border-radius: 16px;
  max-width: 380px;
  width: 100%;
  padding: 26px 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  animation: pop .2s ease;
}
.import-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--pink-deep);
  margin-bottom: 16px;
}
.import-bar { height: 14px; margin-bottom: 10px; }
.import-label {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
  word-break: break-all;
}

/* ============ 生长速度选择框 ============ */
.speed-select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: var(--font);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  outline: none;
}
.speed-select:focus { border-color: var(--pink); }

/* ============ 响应式 ============ */
@media (max-width: 600px) {
  #topbar { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .nav { order: 3; width: 100%; justify-content: center; }
  .top-right { order: 2; margin-left: auto; }
  .brand { order: 1; }
  .page-title { font-size: 22px; }
}
