:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --text: #1f2330;
  --muted: #6b7080;
  --line: #e8e3da;
  --a: #ff7a59;      /* 你 */
  --b: #5b7cfa;      /* TA */
  --ok: #1fa67a;
  --warn: #d9534f;
  --shadow: 0 6px 24px rgba(30, 30, 50, .07);
  --radius: 16px;
  --grass: #7cc576;
  --grass-d: #3f8f45;
  --face: #3b3442;
  --fluff-a: #fff1e9; --fluff-a-s: #f3c3ad;
  --fluff-b: #edf1ff; --fluff-b-s: #b9c6f5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161c;
    --card: #1d2029;
    --text: #eceef3;
    --muted: #9aa0b0;
    --line: #2c303b;
    --shadow: 0 6px 24px rgba(0, 0, 0, .35);
    --grass: #4f8f4f;
    --grass-d: #8fd68a;
    --face: #2a2530;
    --fluff-a: #f6dccf; --fluff-a-s: #c98f77;
    --fluff-b: #d9e0fb; --fluff-b-s: #8496d6;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 90px; }
header.brand { display: flex; align-items: center; gap: 12px; margin: 8px 0 20px; }
.logo { display: flex; flex: none; }
.logo svg { width: 40px; height: 40px; }
.logo svg + svg { margin-left: -12px; }
.logo:hover svg:first-child { animation: hop .5s ease; }
.logo:hover svg:last-child { animation: hop .5s ease .1s; }
@keyframes hop { 40% { transform: translateY(-6px) } }
h1 { font-size: 22px; margin: 0; letter-spacing: 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { font-size: 11px; letter-spacing: 1px; font-weight: 700; padding: 2px 9px; border-radius: 99px; color: var(--grass-d); background: color-mix(in srgb, var(--grass) 22%, transparent); }
.sub { color: var(--muted); font-size: 13px; margin: 0; }

/* 小羊 */
.sheep { display: inline-block; vertical-align: middle; }
.sheep .fluff { stroke-width: 1.2; }
.sheep.a .fluff { fill: var(--fluff-a); stroke: var(--fluff-a-s); }
.sheep.b .fluff { fill: var(--fluff-b); stroke: var(--fluff-b-s); }
.sheep.ghost .fluff { fill: var(--line); stroke: none; }
.sheep.ghost .face { fill: var(--muted); opacity: .3; }
.sheep.ghost .eye, .sheep.ghost .cheek { display: none; }
.sheep .face { fill: var(--face); }
.sheep .flip { transform-origin: center; }
.pair { display: flex; justify-content: center; align-items: flex-end; gap: 4px; margin: 4px 0 8px; position: relative; }
.pair svg { width: 72px; height: 72px; }
.pair.wait svg:first-child { animation: bob 2.2s ease-in-out infinite; }
.pair.wait svg:last-child { opacity: .7; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-3deg) } }
.pair.meet svg:first-child { animation: meetL .7s cubic-bezier(.3,1.6,.5,1) both; }
.pair.meet svg:last-child { animation: meetR .7s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes meetL { from { transform: translateX(-40px) } to { transform: translateX(6px) } }
@keyframes meetR { from { transform: translateX(40px) } to { transform: translateX(-6px) } }
.pair .heart { position: absolute; top: -6px; left: 50%; font-size: 22px; transform: translateX(-50%); animation: pop .6s .55s both; }
@keyframes pop { from { transform: translate(-50%, 10px) scale(0); opacity: 0 } to { transform: translate(-50%, 0) scale(1); opacity: 1 } }
.pair.lost svg:first-child { transform: translateX(-14px) rotate(-8deg); }
.pair.lost svg:last-child { transform: translateX(14px) rotate(8deg); }
.baa { font-size: 13px; color: var(--muted); font-style: italic; }

.meadow { position: fixed; left: 0; right: 0; bottom: 0; height: 70px; pointer-events: none; z-index: -1; }
.meadow svg { width: 100%; height: 100%; display: block; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; border: 1px solid var(--line); }
.card h2 { font-size: 15px; margin: 0 0 12px; color: var(--muted); font-weight: 600; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=text] {
  width: 100%; font-size: 17px; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--text); outline: none;
  transition: border-color .15s;
}
input[type=text]:focus { border-color: var(--b); }
.row { display: flex; gap: 10px; }
.row > input { flex: 1; min-width: 0; }
button {
  font: inherit; font-size: 16px; font-weight: 600; border: 0; border-radius: 12px;
  padding: 12px 18px; cursor: pointer; background: var(--text); color: var(--bg);
  transition: transform .08s, opacity .15s; white-space: nowrap;
}
button:active { transform: scale(.97); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: linear-gradient(135deg, var(--a), var(--b)); color: #fff; }
button.ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line); }
button.small { font-size: 13px; padding: 7px 12px; border-radius: 10px; }
.full { width: 100%; }
.gap { height: 12px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s; max-width: calc(100% - 32px); text-align: center; z-index: 6; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.hidden { display: none !important; }
footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 24px; }
/* 顶部导航 */
.nav { display: flex; gap: 6px; padding: 4px; margin: -6px 0 18px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.nav a { flex: 1; text-align: center; text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 600; padding: 8px 4px; border-radius: 10px; white-space: nowrap; transition: background .15s, color .15s; }
.nav a:hover { color: var(--text); }
.nav a.on { color: var(--text); background: color-mix(in srgb, var(--grass) 20%, transparent); }
a { color: var(--b); }
