:root {
  color-scheme: dark;
  --sky: #070b24;
  --sky-soft: #11183b;
  --moon: #ffe9a6;
  --green: #72d49b;
  --soil: #744f3a;
  --ink: #eef1ff;
  --muted: #aab1d3;
  --line: #4d5260;
  --danger: #ff8197;
  --dirt: #635d5d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background-color: #000;
  background-image: url('/static/images/header_background.jpg');
  background-position: right top;
  background-repeat: no-repeat;
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
        'Microsoft YaHei', system-ui, sans-serif;
  font-synthesis-weight: none;
}
body.home {
  padding-bottom: 500px;
  background-image: url('/static/images/footer_background.jpg');
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: contain;
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, 'PingFang SC
}
a { color: var(--moon); }
nav {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  padding: .9rem max(1.5rem, calc((100vw - 1400px) / 2));
  position: sticky;
  top: 0;
  backdrop-filter: blur(12px);
  z-index: 3;
}
nav .brand { margin-right: auto; text-decoration: none; font-weight: 800; font-family: Georgia, 'Times New Roman', Times, serif; max-width: 50%;}
nav .brand img { max-width: 90%;}
main { 
  width: min(1400px, calc(100% - 3rem)); 
  margin: 0 auto; 
  background-image: url('/static/images/footer_background.jpg');
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: contain;
  padding: 2rem 0 300px 0;
}
.hero { 
  text-align: center; 
  padding: 0 0 1rem;
  background-image: url('/static/images/home.jpg');
  background-position: top center;
  background-repeat: no-repeat;
  padding: 500px 20px 20px;
}
.moon { font-size: clamp(4rem, 12vw, 8rem); filter: drop-shadow(0 0 28px rgba(255,233,166,.45)); }
h1 { margin: 0 0 .35rem; font-size: clamp(1.9rem, 4vw, 2.9rem); color: var(--moon); letter-spacing: -.05em; }
h2 { color: var(--moon); }
.tagline, .muted { color: var(--muted); }
.panel, .farm-card, .event {
  background: rgba(17,24,59,.45);
  border: 1px solid var(--dirt);
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0,0,0,.2);
}
.panel { padding: 1.35rem 1.5rem; margin: 1.25rem 0; }
.key-panel { display: flex; justify-content: center; align-items: center; gap: 16px; margin-bottom: 44px;  }
button {
  border: 0;
  color: #101426;
  background: var(--moon);
  padding: .8rem 1.1rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
button:hover { transform: translateY(-1px); filter: brightness(1.04); }
button:disabled { opacity: .55; cursor: wait; }
.secret {
  margin: 1rem 0;
  padding: 1rem;
  overflow-wrap: anywhere;
  background: #050818;
  border: 1px dashed var(--moon);
  color: var(--green);
}
.key-panel button,
.key-panel a {
  border: 1px solid var(--moon);
  padding: 0.4rem 3rem;
  text-decoration: none;
}

.warning { color: var(--danger); }
.stats, .grid { display: grid; gap: 1rem; }
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { padding: 1rem; text-align: center; }
.stat strong { display: block; color: var(--moon); font-size: 2.5rem; font-family: Georgia, 'Times New Roman', Times, serif; font-weight: 600;}
.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.farm-card { padding: 1.25rem 1.4rem; text-decoration: none; color: var(--ink); transition: .18s ease; }
.farm-card:hover { transform: translateY(-3px); border-color: var(--moon); }
.event { padding: 1rem; margin: .75rem 0; }
.caught { border-color: var(--danger); }
.empty { padding: 3rem; text-align: center; color: var(--muted); }
code { color: var(--green); }
footer { padding: 2rem; text-align: center; color: var(--muted); }
@media (max-width: 820px) {
  main,
  body.home { background-size: unset; }
  .hero img {max-width: 150%; transform: translateX(-25%);}
}
@media (max-width: 600px) {
  nav { flex-wrap: wrap; }
  main { padding-top: 1.5rem; }
}

/* ── 头部与统计条 ───────────────────────────────────────────────────── */
.page-head { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-end; justify-content: space-between; margin-bottom: 2rem; }
.page-head h1 { margin: 0 0 .3rem; }
.page-head .tagline { margin: 0; }
.statbar { display: flex; gap: 1.75rem; flex-wrap: wrap; }
.statcell { display: flex; align-items: baseline; gap: .5rem; }
.statcell strong { color: var(--moon); font-size: 1.8rem; letter-spacing: .04em; font-family: Georgia, 'Times New Roman', Times, serif; font-weight: 600;}
.back { display: inline-block; margin-bottom: 1.5rem; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; }
.back:hover { border-color: var(--moon); }

/* ── 形象 ─────────────────────────────────────────────────────────── */
.card-head { display: flex; gap: .85rem; align-items: center; margin-bottom: 1rem; }
.card-head-text { min-width: 0; }
.card-head h1, .card-head h3, .card-head-text h1, .card-head-text h3 { margin: 0; }
.card-head-text p { margin: .25rem 0 0; }
.avatar { border-radius: 50%; flex: none; background: #0d1430; box-shadow: 0 2px 10px rgb(0 0 0 / .35); border-radius: 50%;
    border: 1px solid var(--line);}
.avatar-emoji { font-size: 2.2rem; line-height: 1; flex: none; }
.pill {
  display: inline-block; margin-top: .5rem; padding: .28rem .8rem;
  border: 1px solid var(--moon); border-radius: 999px;
  color: var(--moon); font-size: .82rem; white-space: nowrap;
}
@media (max-width: 600px) {
  .statcell { flex-direction: column; align-items: center; }
  .statcell:not(:last-child) {border-right: 1px solid var(--line); padding-right:10px; gap: 0}
}

/* ── 玩家页 ───────────────────────────────────────────────────────── */
.player-top { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.5rem; }
.player-top > .panel { margin: 0; }
.profile-head { display: flex; gap: 1.25rem; align-items: center; }
.profile-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.bio { margin: 1.25rem 0; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.fact { display: flex; flex-direction: column; gap: .3rem; }
.fact strong { color: var(--ink); font-size: 1.05rem; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.panel-head h2 { margin: 0; }
.house-card h2 + p { margin-top: .75rem; }
.house-card h2 { margin: 0 0 .75rem; }
.house-card p { margin: .35rem 0; }
.built { margin-top: 1rem !important; font-size: .85rem; }

/* ── 地块 ─────────────────────────────────────────────────────────── */
.plots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.plot-card { padding: .8rem; border: 1px solid var(--line); border-radius: 4px; background: rgba(9,14,38,.6); }
.plot-card strong { display: block; margin-top: .6rem; }
.plot-thumb {
  height: 76px; display: grid; place-items: center; border-radius: 4px;
  border: 1px solid #8d684f66;
  background: repeating-linear-gradient(135deg, #4a3526, #4a3526 7px, #3d2b1f 7px, #3d2b1f 14px);
}
.plot-thumb .emoji { font-size: 2rem; }
.plot-status { font-size: .85rem; color: var(--muted); }
.status-mature { color: var(--moon); }
.status-growing { color: var(--green); }
.bar { height: 4px; margin-top: .55rem; border-radius: 99px; background: #ffffff14; overflow: hidden; }
.fill { display: block; height: 100%; border-radius: 99px; }
.fill-mature { width: 100%; background: var(--moon); }
.fill-growing { width: 8%; background: var(--green); }
.state-wilted .plot-thumb { filter: grayscale(1); opacity: .5; }
.state-house .plot-thumb { border-color: var(--moon); }

/* ── 花园动态 ─────────────────────────────────────────────────────── */
.feed {
  max-height: 400px;
  overflow: auto;
}
.feed-row { display: flex; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.feed-row:last-child { border-bottom: 0; }
.feed-row time { color: var(--muted); flex: none; }
.feed-text { min-width: 0; }
.feed h2 {
  margin: 0;
}
.feed-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 820px) {
  .player-top { grid-template-columns: 1fr; }
  .house-card { flex-direction: column; }
}

/* ── 总览卡：左右分栏 ─────────────────────────────────────────────── */
.card-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 1.4rem; }
.card-right { padding-left: 1.4rem; border-left: 1px solid var(--line); }
.card-intro { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 0.6rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line);}
.card-title { display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; }
.card-title h3 { margin: 0; font-size: 1.05rem; }
.card-emoji { font-size: 1rem; }
.sep { font-size: .85rem; }
.home-line { margin: .6rem 0 0; font-size: .88rem; }
.card-right h4 { margin: 0 0 .5rem; font-size: .82rem; font-weight: 600; color: var(--muted); letter-spacing: .05em; border-bottom: 1px solid var(--line); }
.card-right h4 + p { margin: 0 0 1.2rem; font-size: .86rem; }
.card-right p:last-child { margin-bottom: 0; }
.empty-slot { font-style: italic; opacity: .65; }

/* 地块小方块：设计稿里是深色薄边的方片，不是那种厚土块 */
.chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.plot-chip {
  display: grid; place-items: center; gap: .3rem;
  padding: .6rem .3rem;
  border: 1px solid var(--line); border-radius: 4px;
  background: rgba(9, 14, 38, .55);
  text-align: center;
}
.plot-chip .emoji { font-size: 1.35rem; line-height: 1; }
.chip-label { font-size: .78rem; color: var(--muted); }
.plot-chip.state-mature { border-color: var(--moon); }
.plot-chip.state-mature .chip-label { color: var(--moon); }
.plot-chip.state-wilted { opacity: .45; }
.plot-chip.state-house { border-color: var(--moon); }

/* ── 数字用等宽，正文用无衬线 ─────────────────────────────────────── */
.feed-row time, .fact strong, code, .secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.statbar { gap: 1.6rem; }
.statcell strong { font-size: 1.6rem; }
nav .brand { letter-spacing: .02em; font-size: 23px; font-weight: 600;}
nav a { text-decoration: none; }
nav a:not(.brand) { color: var(--muted); padding-bottom: .2rem; }
nav a:not(.brand):hover { color: var(--ink); }

@media (max-width: 1100px) {
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .card-body { grid-template-columns: 1fr; }
  .card-right { padding-left: 0; padding-top: 1.2rem; border-left: 0; border-top: 1px solid var(--line); }
}

.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.plot-chip.state-empty .emoji { opacity: .25; }
.farm-card { align-content: start; }

/* ── 小屋卡片：房子图按主人的物种走 ──────────────────────────────── */
.house-card { display: flex; gap: 1.5rem; align-items: flex-start; }
.house-text { min-width: 0; }
.house-img { flex: none; filter: drop-shadow(0 8px 22px rgb(0 0 0 / .45)); }

/* 动态流里名字前面的小头像 */
.feed-row { align-items: center; }
.feed-row .avatar { width: 22px; height: 22px; }
.feed-row .avatar-emoji { font-size: 1rem; }

/* ── 底部三栏：月光池 / 花园动态 / 漂流瓶 ─────────────────────────── */
.bottom-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.25rem; margin-top: 20px;
    align-items: stretch; }
.bottom-row > .panel { margin: 0; }
.tag { font-size: .72rem; letter-spacing: .12em; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.side-card h4 { margin: 1.4rem 0 .6rem; font-size: .82rem; font-weight: 600; color: var(--muted); }
.big-stat { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .9rem; }
.big-stat strong { font-size: 3rem; line-height: 1; color: var(--moon); font-family: Georgia, 'Times New Roman', Times, serif; font-weight: 600; }
.big-stat span { font-size: .86rem; }
.bar.tall { height: 6px; }
.line-row { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); }
.line-row:last-child { border-bottom: 0; }
.num { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.sealed { margin-top: 1.4rem; padding: 1rem; border: 1px dashed var(--line); border-radius: 6px; text-align: center; color: var(--muted); font-size: .86rem; }
.sealed p { margin: .15rem 0; }

/* 注册页 */
.key-form { max-width: 560px; }
.key-form label { display: block; margin-bottom: .5rem; font-size: .86rem; color: var(--muted); }
.key-form input {
  width: 100%; padding: .7rem .9rem; margin-bottom: .6rem;
  background: rgba(9,14,38,.6); border: 1px solid var(--line); border-radius: 4px;
  color: var(--ink); font: inherit;
}
.key-form input:focus { outline: none; border-color: var(--moon); }
.key-form button { margin-top: .8rem; }
.key-panel .primary { background: var(--moon); color: #101426; font-weight: 800; }

@media (max-width: 1100px) {
  .bottom-row { grid-template-columns: 1fr; }
}
.recover-hint { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .86rem; }
