/* =========================================================
   我的漂流瓶 · Monument Valley 风主题
   清新 / 可爱 / 简约 · 粉彩渐变天空 + 几何浮岛
   ========================================================= */

:root {
  /* 纪念碑谷粉彩色板 */
  --sky-a: #f9e7e0;         /* 淡杏粉（天顶） */
  --sky-b: #fdf0e3;         /* 暖杏白 */
  --sky-c: #dceff5;         /* 淡青蓝（海平线） */
  --surface: #ffffff;
  --surface-2: #faf6f1;
  --primary: #e8837e;       /* 珊瑚粉 */
  --primary-strong: #d66560;
  --accent: #f2c078;        /* 鹅黄 */
  --mint: #a8d8c8;          /* 薄荷绿 */
  --lavender: #c9b8e8;      /* 淡紫 */
  --text: #4a4a68;
  --muted: #9b9bb0;
  --border: #f0e6dd;
  --danger: #e8828b;
  --ok: #58c89a;
  --shadow: 0 10px 30px rgba(212, 131, 126, 0.18);
  --shadow-soft: 0 4px 16px rgba(74, 74, 104, 0.07);
  --radius: 22px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Nunito", -apple-system, sans-serif;
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--sky-a) 0%, var(--sky-b) 42%, var(--sky-c) 100%);
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

/* ---- 几何浮岛装饰（纪念碑谷式低饱和色块，纯 CSS） ---- */
.deco { position: fixed; pointer-events: none; z-index: 0; }
.deco.island {
  width: 0; height: 0;
  border-left: 70px solid transparent;
  border-right: 70px solid transparent;
  border-bottom: 44px solid rgba(168, 216, 200, 0.35);
  left: -46px; top: 22%;
  animation: floaty 9s ease-in-out infinite;
}
.deco.circle {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(201, 184, 232, 0.30);
  right: 8%; top: 12%;
  animation: floaty 11s ease-in-out infinite reverse;
}
.deco.diamond {
  width: 40px; height: 40px;
  background: rgba(242, 192, 120, 0.35);
  transform: rotate(45deg);
  right: 14%; bottom: 16%;
  animation: spinFloat 14s ease-in-out infinite;
}
.deco.dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(232, 131, 126, 0.4);
  left: 10%; bottom: 10%;
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@keyframes spinFloat {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(-10px); }
}
@media (max-width: 768px) {
  .deco.island, .deco.diamond { display: none; }
  .deco.circle { width: 44px; height: 44px; }
}

/* 内容层抬到装饰之上 */
header, .container, .fab { position: relative; z-index: 1; }

/* ---- 顶部导航 ---- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(240, 230, 221, 0.9);
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 40;
}

header .logo {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}
header .logo svg { width: 26px; height: 26px; flex: none; }
header .logo span { color: var(--primary); }
header a.logo { color: inherit; text-decoration: none; cursor: pointer; }
header a.logo:hover { opacity: 0.78; }
header a.logo:active { opacity: 0.6; }

header nav { display: flex; gap: 10px; flex-wrap: wrap; }

/* 汉堡按钮（仅移动端显示） */
.menu-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.menu-toggle svg { width: 20px; height: 20px; }
.menu-toggle .icon-close { display: none; }
.menu-toggle.open .icon-burger { display: none; }
.menu-toggle.open .icon-close { display: block; }

@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  header { padding: 12px 16px; }
  header nav {
    display: none;
    position: fixed;
    top: 63px; left: 0; right: 0;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 18px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    z-index: 39;
  }
  header nav.open { display: flex; animation: navDrop 0.22s ease; }
  header nav .btn { text-align: center; }
}
@keyframes navDrop {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- 药丸按钮 ---- */
.btn {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  box-shadow: 0 4px 12px rgba(232, 131, 126, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(232, 131, 126, 0.42); filter: brightness(1.03); }
.btn:active { transform: translateY(0); }
.btn.ghost {
  background: var(--surface);
  color: var(--primary-strong);
  border: 1.5px solid var(--border);
  box-shadow: none;
}
.btn.ghost:hover { border-color: var(--primary); background: #fde2dd; color: var(--primary-strong); }
.btn.active {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(232, 131, 126, 0.35);
}
.btn.danger { background: linear-gradient(180deg, #f09aa2 0%, var(--danger) 100%); }

/* ---- 悬浮动作按钮（FAB）：扔瓶子 ---- */
.fab {
  position: fixed;
  right: 20px; bottom: 26px;
  display: flex;
  align-items: center;
  gap: 9px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff;
  border-radius: 999px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(214, 101, 96, 0.45);
  z-index: 50;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.fab:hover { transform: translateY(-3px) scale(1.03); }
.fab svg { width: 22px; height: 22px; flex: none; }
@media (max-width: 768px) {
  .fab { right: 16px; bottom: 20px; padding: 15px; }
  .fab .fab-text { display: none; }
  .fab svg { width: 24px; height: 24px; }
}

/* ---- 主容器 ---- */
/* 关键：width 固定 1080px + max-width 100% —— PC 端无论视窗多宽（1280/1920/2560）
 * 容器始终 1080px，居中显示，左右留白吸收多余视窗。移动端靠 max-width 兜底成 100%。 */
.container {
  width: 1080px;
  max-width: 100%;
  margin: 0 auto;
  padding: 28px 24px 110px;
}
@media (max-width: 768px) {
  .container { padding: 20px 14px 120px; }
}

.title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 18px;
  text-align: center;
  justify-content: center;
}
.title svg { width: 24px; height: 24px; flex: none; }
@media (max-width: 768px) {
  .title { font-size: 17px; margin-bottom: 14px; line-height: 1.5; }
}

/* ---- 顶部统计（总数 / 已销毁） ---- */
.stats {
  text-align: center;
  font-size: 14px;
  color: var(--text-soft, #8a7e76);
  margin: -8px 0 18px;
}
.stats b {
  font-weight: 800;
  color: var(--primary, #E8837E);
  font-size: 16px;
  margin: 0 2px;
}
@media (max-width: 768px) {
  .stats { font-size: 13px; margin: -6px 0 14px; }
  .stats b { font-size: 15px; }
}

/* ---- 卡片网格 ---- */
/* PC 端固定 4 列 × 200px = 848px，居中在 1080 容器内（左右各 92px 留白）。
 * 卡片不会被视窗宽度撑开，也不会因为列数变化被拉伸。 */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 200px);
  gap: 16px;
  justify-content: center;
}
@media (max-width: 900px)  { .grid { grid-template-columns: repeat(3, 180px); gap: 14px; } }
@media (max-width: 600px)  { .grid { grid-template-columns: repeat(3, 150px); gap: 12px; } }
@media (max-width: 400px)  { .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
}
.card:hover { transform: translateY(-4px) scale(1.01); box-shadow: var(--shadow); }
.card .thumb {
  flex: 1;
  background-color: var(--surface-2);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card .thumb svg { width: 44%; height: 44%; opacity: 0.85; }
.card .meta {
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- 筛选 / 分页 ---- */
.toolbar { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; justify-content: center; }
.pager { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; justify-content: center; }
.pager button {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 6px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.pager button:disabled { opacity: 0.45; cursor: default; }
.pager button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-strong); }
.pager button.active {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-strong) 100%);
  color: #fff;
  border-color: transparent;
}

/* ---- 表单 ---- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 7px; }
.field .req { color: var(--danger); margin-left: 2px; }
.field input[type=text], .field textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}
.field input[type=text]:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(232, 131, 126, 0.18);
}
.field textarea { resize: vertical; min-height: 120px; }
.field input[type=file] {
  font-size: 13px; color: var(--muted);
}
.hint { font-size: 12px; color: var(--muted); margin-top: 5px; }

/* ---- 二维码白底框 ---- */
.qr-box {
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  display: inline-block;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border);
}
.qr-box canvas { display: block; border-radius: 8px; }

/* ---- 详情页 ---- */
.detail-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.8;
  box-shadow: var(--shadow-soft);
}
.detail-img {
  max-width: 100%;
  border-radius: 18px;
  margin-top: 12px;
  box-shadow: var(--shadow-soft);
}

/* 未打开态：玻璃瓶插画居中 */
.bottle-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 34px 0 26px;
  gap: 18px;
}
.bottle-hero .bottle-svg {
  width: 150px; height: auto;
  animation: heroFloat 4.5s ease-in-out infinite;
  filter: drop-shadow(0 14px 22px rgba(74, 74, 104, 0.14));
}
@keyframes heroFloat {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-12px) rotate(1.5deg); }
}
.bottle-hero .meta-line { color: var(--muted); font-size: 13.5px; }
.bottle-hero .hero-text { font-size: 15.5px; max-width: 300px; line-height: 1.9; }
.bottle-hero .btn { font-size: 16px; padding: 13px 34px; margin-top: 4px; }

@media (max-width: 768px) {
  .bottle-hero { padding: 22px 0 18px; }
  .bottle-hero .bottle-svg { width: 118px; }
}

/* 空态 / 加载态 */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 70px 20px;
  font-size: 15px;
  grid-column: 1 / -1;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: linear-gradient(180deg, var(--ok) 0%, #43b585 100%);
  color: #fff;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 200;
  pointer-events: none;
  max-width: 88vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- 弹窗（玩法说明） ---- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(74, 74, 104, 0.45);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 26px;
  padding: 28px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  animation: pop 0.2s ease;
}
/* 玩法说明编号列表 */
.modal ol.rules {
  margin: 0 0 20px;
  padding-left: 22px;
  color: var(--text, #4a3f3a);
  font-size: 15px;
  line-height: 1.8;
}
.modal ol.rules li { padding-left: 4px; }
.modal ol.rules li::marker {
  color: var(--primary, #E8837E);
  font-weight: 800;
}
.modal ol.rules em {
  font-style: normal;
  font-weight: 600;
  color: var(--primary, #E8837E);
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { margin-bottom: 14px; font-size: 19px; display: flex; align-items: center; gap: 10px; }
.modal h3 svg { width: 22px; height: 22px; }
.modal p { color: var(--muted); font-size: 14px; margin-bottom: 18px; line-height: 1.8; }

/* 成功态结果块 */
.result-ok { color: var(--primary-strong); font-weight: 700; }

/* 移动端通用微调 */
@media (max-width: 768px) {
  .detail-content { padding: 18px; font-size: 15px; }
  .btn { padding: 10px 18px; }
  .detail-actions { display: flex; flex-wrap: wrap; }
}

/* ---- 底部 footer ---- */
.site-footer {
  margin-top: 36px;
  padding: 22px 16px 32px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.3px;
  background: rgba(255, 255, 255, 0.55);
  border-top: 1px solid rgba(240, 230, 221, 0.7);
}
.site-footer .sep { margin: 0 8px; color: var(--border); }
.site-footer a { color: var(--primary); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
