/* 航海的猫 · 许愿板
   只用同源资源：字体、插画都从本站加载，不请求任何第三方。 */

@font-face {
  font-family: "ZCOOL KuaiLe";
  src: url("/fonts/zcool-kuaile-subset.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --cream: #FFF8EE;
  --paper: #FFFDFA;
  --sand: #F3E4D0;
  --sand-deep: #EBD9C1;
  --ink: #5C4433;
  --input-ink: #261C16;
  --muted: #927B65;
  --accent: #E9A15F;
  --accent-deep: #B9733B;
  --sage: #A9C4A2;
  --sage-light: #E8F0E3;
  --honey: #F6D98D;
  --blush: #F7B8C7;
  --sea: #9CC3C6;
  --line: #E9DCC8;
  --shadow: 0 10px 24px rgba(92, 68, 51, 0.08);
  --shadow-lift: 0 16px 32px rgba(92, 68, 51, 0.14);
  --display: "ZCOOL KuaiLe", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --cream: #241C17;
    --paper: #2E241D;
    --sand: #352A21;
    --sand-deep: #3F3227;
    --ink: #F6E9D8;
    --input-ink: #FFF6EA;
    --muted: #B9A38D;
    --accent-deep: #F0B47A;
    --sage: #8FAE88;
    --sage-light: #35402F;
    --honey: #D8B968;
    --blush: #D89AA8;
    --sea: #4E6F73;
    --line: #4A3A2D;
    --shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    --shadow-lift: 0 16px 32px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--cream);
  background-image: radial-gradient(rgba(92, 68, 51, 0.045) 1px, transparent 1px);
  background-size: 18px 18px;
  padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
}

@media (prefers-color-scheme: dark) {
  body { background-image: radial-gradient(rgba(246, 233, 216, 0.04) 1px, transparent 1px); }
}

.wrap {
  max-width: 912px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

a { color: inherit; }

/* ---------- 页头 ---------- */

header.hero {
  position: relative;
  margin: 0;
  padding: calc(26px + env(safe-area-inset-top, 0px))
           max(16px, env(safe-area-inset-right, 0px))
           0
           max(16px, env(safe-area-inset-left, 0px));
  background:
    radial-gradient(120% 90% at 88% 6%, rgba(246, 217, 141, 0.5) 0%, rgba(246, 217, 141, 0) 55%),
    linear-gradient(180deg, #F9EDDC 0%, var(--sand) 78%);
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  header.hero {
    background:
      radial-gradient(120% 90% at 88% 6%, rgba(216, 185, 104, 0.22) 0%, rgba(216, 185, 104, 0) 55%),
      linear-gradient(180deg, #2E231B 0%, var(--sand) 78%);
  }
}

.hero-inner {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 28px;
  padding-bottom: 54px;
}

.hero-copy { flex: 1 1 300px; min-width: 0; }

.hero-art {
  position: relative;
  flex: 0 0 auto;
  align-self: flex-end;
  padding-bottom: 4px;
}

.hero-cat {
  display: block;
  width: clamp(120px, 30vw, 168px);
  height: auto;
  filter: drop-shadow(0 12px 18px rgba(92, 68, 51, 0.18));
  animation: bob 5.2s ease-in-out infinite;
  transform-origin: 50% 92%;
}

.fish-jump {
  position: absolute;
  width: clamp(46px, 12vw, 64px);
  height: auto;
  opacity: 0.9;
  pointer-events: none;
}

.fish-jump.one {
  top: 6%;
  left: -34px;
  transform: rotate(-16deg);
  animation: leap 6.5s ease-in-out infinite;
}

.fish-jump.two {
  top: 22%;
  left: -8px;
  width: clamp(34px, 9vw, 48px);
  transform: rotate(12deg) scaleX(-1);
  animation: leap 6.5s ease-in-out infinite 1.4s;
  opacity: 0.7;
}

@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(-1.2deg); }
  50% { transform: translateY(-7px) rotate(1.2deg); }
}

@keyframes leap {
  0%, 60%, 100% { translate: 0 0; opacity: 0.9; }
  30% { translate: 0 -12px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-cat, .fish-jump.one, .fish-jump.two { animation: none; }
}

.kicker {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 7.4vw, 50px);
  line-height: 1.16;
  letter-spacing: 0.02em;
  text-wrap: balance;
}

.tagline {
  margin: 12px 0 0;
  max-width: 32em;
  color: var(--ink);
  opacity: 0.86;
  text-wrap: pretty;
}

.lang {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  min-width: 48px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
  z-index: 2;
}

.lang:hover { border-color: var(--accent); }

/* 语言菜单：右上角一个小胶囊，点开列出全部七种语言。
   用 <details>，不需要脚本也能展开，键盘和读屏都能用。 */
.lang-menu {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  z-index: 3;
}

.lang-menu > summary.lang {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  list-style: none;
}

.lang-menu > summary.lang::-webkit-details-marker { display: none; }
.lang-menu > summary.lang::after { content: "▾"; font-size: 10px; color: var(--muted); }
.lang-menu[open] > summary.lang { border-color: var(--accent); }

.lang-menu ul {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  margin: 0;
  padding: 6px;
  min-width: 184px;
  max-width: calc(100vw - 32px);
  list-style: none;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lift);
}

.lang-menu li { margin: 0; }

.lang-menu li button {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.lang-menu li button:hover { background: var(--sand); }

.lang-menu li button[aria-current="page"] {
  background: var(--sand);
  color: var(--accent-deep);
  font-weight: 600;
}

.wave {
  display: block;
  width: 100%;
  height: 30px;
  margin-top: -1px;
  color: var(--cream);
}

/* ---------- 表单 ---------- */

form.wish {
  position: relative;
  margin-top: 28px;
  padding: 24px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

form.wish::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 34px;
  width: 96px;
  height: 16px;
  background: var(--blush);
  opacity: 0.5;
  border-radius: 2px;
  transform: rotate(-1.6deg);
}

form.wish::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: -10px;
  width: 74px;
  height: 20px;
  background: var(--sage);
  opacity: 0.35;
  border-radius: 2px 2px 3px 3px;
  transform: rotate(2.4deg);
}

.field { display: grid; gap: 6px; }

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

input[type="text"], textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
  color: var(--input-ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
}

textarea { min-height: 96px; resize: vertical; }

input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2.5px solid var(--accent-deep);
  outline-offset: 2px;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
}

button.submit {
  min-height: 48px;
  padding: 12px 26px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #3A2413;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--accent-deep);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

button.submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 0 var(--accent-deep); }
button.submit:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-deep); }
button.submit:disabled { opacity: 0.55; cursor: progress; }

.form-note { font-size: 13px; color: var(--muted); max-width: 34em; }

.notice { font-size: 14px; color: var(--accent-deep); }
.notice:empty { display: none; }
.notice[data-tone="error"] { color: #B4443B; }

@media (prefers-color-scheme: dark) {
  .notice[data-tone="error"] { color: #F09A90; }
}

/* ---------- 板子 ---------- */

.board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 42px 0 14px;
}

h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 26px;
  letter-spacing: 0.03em;
}

.sorts { display: flex; gap: 8px; }

.sort {
  min-height: 36px;
  padding: 6px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.sort[aria-pressed="true"] {
  background: var(--sand);
  border-color: var(--sand-deep);
  color: var(--ink);
  font-weight: 600;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

@media (min-width: 680px) {
  .list { grid-template-columns: 1fr 1fr; align-items: start; }
}

.wish-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 20px 16px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.wish-card:nth-child(odd) { transform: rotate(-0.35deg); }
.wish-card:nth-child(even) { transform: rotate(0.3deg); }
.wish-card:hover { box-shadow: var(--shadow-lift); }

.wish-card::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 54px;
  height: 12px;
  margin-left: -27px;
  background: var(--honey);
  opacity: 0.6;
  border-radius: 2px;
  transform: rotate(-2deg);
}

.wish-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.wish-detail {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
  opacity: 0.82;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.wish-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.chip {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.chip[data-status="open"] { background: var(--blush); color: #5C2A36; }
.chip[data-status="planned"] { background: var(--honey); color: #5A4413; }
.chip[data-status="done"] { background: var(--sage); color: #253A20; }

.wish-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 4px;
}

.vote {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 7px 14px 7px 10px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.vote:hover:not(:disabled) { border-color: var(--accent); background: var(--cream); }
.vote:active:not(:disabled) { transform: scale(0.98); }

.vote[aria-pressed="true"] {
  background: var(--sage-light);
  border-color: var(--sage);
  color: var(--ink);
  cursor: default;
}

.vote img {
  display: block;
  width: 24px;
  height: auto;
  flex: 0 0 auto;
}

.vote[aria-pressed="true"] img { opacity: 0.75; }

.vote-count { font-weight: 700; }

.empty, .loading {
  padding: 30px 22px 34px;
  text-align: center;
  color: var(--muted);
  background: var(--paper);
  border: 1.5px dashed var(--line);
  border-radius: 16px;
}

.empty-boat {
  display: block;
  width: min(190px, 52vw);
  height: auto;
  margin: 0 auto 14px;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-5px) rotate(1deg); }
}

@media (prefers-reduced-motion: reduce) {
  .empty-boat { animation: none; }
}

.empty p { margin: 0; }

.empty button {
  margin-top: 14px;
  min-height: 40px;
  padding: 8px 18px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

/* ---------- 页脚 ---------- */

footer {
  margin-top: 52px;
  padding-top: 20px;
  border-top: 1.5px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}

footer a {
  color: var(--accent-deep);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }

@media (max-width: 560px) {
  .hero-inner { padding-bottom: 38px; gap: 4px; }
  /* 手机上文字占满一行，猫猫跟在下面居中——不要被 margin-left:auto 推到右边 */
  .hero-art { margin: 4px auto 0; align-self: center; }
  .hero-cat { width: clamp(128px, 38vw, 156px); }
  .fish-jump.one { top: 2%; left: -18px; }
  .fish-jump.two { display: none; }
}
