:root {
  --bg: #f3e4cc;
  --bg-deep: #2a140c;
  --ink: #4a2c1a;
  --muted: #8a5a3a;
  --cream: #fff8ec;
  --paper: #fff3e0;
  --orange: #e8792b;
  --rust: #c4531f;
  --maple: #a4421a;
  --gold: #ffd59a;
  --gold-bright: #ffd166;
  --shadow: 0 10px 28px rgba(90, 35, 10, .18);
  --radius: 20px;
  --tab: 62px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; scroll-padding-bottom: calc(var(--tab) + 18px); }
body {
  margin: 0;
  font-family: "Noto Sans TC", "Noto Serif TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 50% -80px, rgba(232, 121, 43, .28), transparent 70%),
    linear-gradient(180deg, #f7e7cf 0%, var(--bg) 18%, #ead4b4 100%);
  line-height: 1.85;
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--maple); }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, .brand, .aka, blockquote {
  font-family: "Noto Serif TC", "Noto Sans TC", serif;
}

.leaves { position: fixed; inset: 0; pointer-events: none; z-index: 8; overflow: hidden; }
.leaf {
  position: absolute;
  top: -10vh;
  font-size: 18px;
  animation: fall var(--dur, 14s) linear var(--delay, 0s) infinite;
  opacity: .85;
  will-change: transform;
}
@keyframes fall {
  0% { transform: translate3d(0, -10vh, 0) rotate(0deg); opacity: 0; }
  8% { opacity: .85; }
  100% { transform: translate3d(var(--drift, 40px), 110vh, 0) rotate(360deg); opacity: 0; }
}

.top {
  position: sticky; top: 0; z-index: 6;
  display: flex; align-items: center; justify-content: center;
  padding: 10px 16px;
  background: rgba(243, 228, 204, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(164, 66, 26, .12);
}
.brand {
  text-decoration: none;
  color: var(--maple);
  font-weight: 700;
  letter-spacing: .28em;
  font-size: 14px;
}

.hero {
  position: relative;
  margin: 8px 16px 0;
  padding: 36px 22px 34px;
  border-radius: 28px;
  overflow: hidden;
  text-align: center;
  color: #fff8ec;
  background:
    radial-gradient(circle at 85% 8%, rgba(255, 214, 140, .5), transparent 42%),
    linear-gradient(180deg, #e8792b 0%, #c4531f 48%, #8a3416 100%);
  box-shadow: var(--shadow);
}
.hero .orb {
  position: absolute; inset: auto -40px -80px auto;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 209, 102, .45), transparent 70%);
  pointer-events: none;
}
.eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: .46em;
  color: #ffe2b8;
}
.avatar {
  width: 96px; height: 96px;
  margin: 16px auto 12px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(#ffd166, #f4a261, #e76f51, #b5432a, #ffd166);
  box-shadow: 0 0 26px rgba(255, 200, 110, .55);
}
.avatar span {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  border-radius: 50%;
  background: #fff3e0;
  font-size: 40px;
}
.hero h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: .08em;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(90, 30, 5, .45);
}
.aka {
  margin: 8px 0 0;
  font-size: 13px;
  letter-spacing: .12em;
  color: #ffe2b8;
}
.hero-lead {
  margin: 14px 0 0;
  font-size: 15px;
}
.tags {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-top: 16px;
}
.tags span {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(255, 248, 236, .18);
  border: 1px solid #ffd59a;
}

.sec { padding: 36px 20px 8px; }
.sec h2 {
  margin: 0 0 10px;
  font-size: 22px;
  letter-spacing: .2em;
  display: flex; align-items: center; gap: 8px;
}
.sec h2 i { font-style: normal; }
.sec-lead { margin: 0 0 18px; color: var(--muted); font-size: 14px; }

.paper, .world-card, .world-empty, .note, .board-list .item {
  background: linear-gradient(170deg, var(--cream), #fbe6c8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-top: 4px solid var(--orange);
}
.paper { padding: 18px 18px 8px; }
.paper p { margin: 0 0 12px; }
.wish { color: var(--maple); font-weight: 500; }

.links { display: grid; gap: 10px; margin-top: 16px; }
.btn {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 12px 16px;
  min-height: 48px;
  border-radius: 99px;
  background: linear-gradient(135deg, #e8792b, #b5432a);
  color: #fff8ec;
  font-weight: 700;
  letter-spacing: .08em;
  border: 0;
  cursor: pointer;
}
.btn.ghost {
  background: transparent;
  color: var(--maple);
  border: 1.5px solid #e0a36a;
}
.btn.solid { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.world-card { padding: 18px 18px 22px; }
.world-top {
  font-size: 12px;
  letter-spacing: .32em;
  color: var(--maple);
  font-weight: 700;
}
.world-card h3 { margin: 8px 0 10px; font-size: 18px; letter-spacing: .04em; line-height: 1.6; }
.world-card p { margin: 0 0 12px; }
.world-card blockquote {
  margin: 8px 0 18px;
  padding: 12px 14px;
  background: rgba(164, 66, 26, .08);
  border-radius: 14px;
  color: var(--maple);
  font-size: 14px;
}
.world-empty {
  margin-top: 14px;
  padding: 22px 18px;
  text-align: center;
  border: 1.5px dashed #e0a36a;
  border-top-style: dashed;
  background: rgba(255, 248, 236, .55);
  box-shadow: none;
}
.world-empty span { font-size: 26px; }
.world-empty p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.shot {
  margin: 0; padding: 0;
  border: 0;
  background: linear-gradient(170deg, var(--cream), #fbe6c8);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.shot img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
  background: #3a2218;
}
.shot.mt img { object-position: left center; }
.shot.wide img { object-position: center center; }
.shot span {
  display: block;
  padding: 8px 10px 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.shot b {
  display: block;
  font-family: "Noto Serif TC", serif;
  font-size: 14px;
  color: var(--maple);
  letter-spacing: .06em;
  font-weight: 700;
}

.board-form { padding: 18px; }
.board-form label, .board-form fieldset { display: block; margin: 0 0 14px; }
.board-form label { font-size: 13px; letter-spacing: .08em; font-weight: 700; color: var(--maple); }
.board-form input[type="text"],
.board-form input[type="password"],
.board-form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #e0a36a;
  background: #fffaf2;
  outline: none;
  font-weight: 400;
  letter-spacing: 0;
}
.board-form textarea { resize: vertical; min-height: 120px; }
.board-form input:focus, .board-form textarea:focus {
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(232, 121, 43, .25);
}
.board-form fieldset {
  border: 0;
  padding: 0;
}
.board-form legend {
  font-size: 13px;
  letter-spacing: .08em;
  font-weight: 700;
  color: var(--maple);
  margin-bottom: 8px;
}
.choice {
  display: flex; align-items: flex-start; gap: 8px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink);
  font-size: 15px;
  padding: 8px 0;
}
.choice input { margin-top: 5px; accent-color: var(--rust); width: 18px; height: 18px; }
.form-msg { min-height: 1.6em; margin: 10px 0 0; font-size: 14px; }
.form-msg.ok { color: #2d6a3e; }
.form-msg.err { color: #a42a1a; }

.board-list { margin-top: 20px; display: grid; gap: 12px; }
.board-list .item { padding: 14px 16px 12px; }
.board-list .who {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 13px; color: var(--maple); font-weight: 700;
}
.board-list .when { font-weight: 400; color: var(--muted); font-size: 12px; }
.board-list .item p {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.muted { color: var(--muted); text-align: center; }
.pill {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 99px;
  background: #fde3c4;
  color: var(--maple);
  font-weight: 700;
}
.pill.private { background: #ead7dc; color: #7a2e45; }

.foot {
  text-align: center;
  padding: 28px 20px calc(var(--tab) + 28px);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .12em;
}
.foot p { margin: 0 0 6px; }
.tiny { font-size: 11px; letter-spacing: .2em; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 248, 236, .94);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(164, 66, 26, .14);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 20px rgba(90, 35, 10, .08);
}
.tabbar a {
  text-decoration: none;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 12px 4px;
  min-height: 48px;
  border-radius: 12px;
}
.tabbar a.on, .tabbar a:active { color: var(--maple); background: rgba(232, 121, 43, .12); }

.lightbox {
  border: 0;
  padding: 0 0 16px;
  width: min(92vw, 420px);
  background: #1a100c;
  color: #fff8ec;
  border-radius: 18px;
}
.lightbox::backdrop { background: rgba(20, 10, 6, .78); }
.lightbox img { width: 100%; max-height: 72vh; object-fit: contain; background: #110a08; }
.lightbox p { margin: 10px 16px 0; text-align: center; letter-spacing: .08em; }
.lightbox .close {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,.55);
  color: #fff8ec;
  border: 0;
  border-radius: 99px;
  padding: 8px 12px;
  min-height: 40px;
  cursor: pointer;
}

.admin-body { padding-bottom: 40px; }
.admin-body .hero { margin-top: 16px; }
.admin-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0 12px; }
.admin-tools .count { color: var(--muted); font-size: 13px; }
.del {
  margin-top: 10px;
  background: transparent;
  color: #a42a1a;
  border: 1px solid #d6a09a;
  border-radius: 99px;
  padding: 8px 14px;
  min-height: 42px;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .leaf { animation: none; top: 12%; opacity: .35; }
  .leaves { display: none; }
}
@media (min-width: 720px) {
  main, .top, .foot { width: 430px; margin-left: auto; margin-right: auto; }
  .tabbar { width: 430px; left: 50%; right: auto; transform: translateX(-50%); border-radius: 18px 18px 0 0; }
  body { background-color: #e6d3b5; }
}
