:root {
  --green: #6abf4b;
  --green-dark: #4e9e33;
  --green-light: #d9f0c8;
  --brown: #8b5a2b;
  --dirt: #c8a165;
  --dirt-dark: #b08d52;
  --sky: #87ceeb;
  --card: #fffdf5;
  --text: #3d3a2e;
  --gold: #ffb300;
  --radius: 14px;
  --cell: clamp(64px, 11vw, 92px);
  --shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #8ecdf0 0%, #bfe8f7 30%, #d9f4d4 62%, #f3ecd3 100%);
  min-height: 100vh;
  background-attachment: fixed;
  overflow-x: hidden;
}
/* 天上飘的云 */
.cloud { position: fixed; top: 40px; font-size: 54px; opacity: .55; z-index: 0; pointer-events: none; filter: drop-shadow(0 6px 10px rgba(0,0,0,.06)); }
.cloud.c1 { animation: drift 90s linear infinite; }
.cloud.c2 { top: 130px; font-size: 38px; opacity: .4; animation: drift 130s linear infinite; animation-delay: -50s; }
@keyframes drift { from { transform: translateX(-15vw); } to { transform: translateX(115vw); } }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; }
input { font-family: inherit; }

/* ---------- 登录页 ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; position: relative; }
.auth-deco { font-size: 30px; letter-spacing: 14px; margin-bottom: 14px; animation: sway 3.2s ease-in-out infinite; }
@keyframes sway { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
.auth-card {
  background: var(--card); border-radius: 22px; box-shadow: var(--shadow);
  padding: 34px 36px; width: 100%; max-width: 380px; text-align: center;
  border: 3px solid #fff; outline: 1px solid rgba(0,0,0,.06);
  position: relative; z-index: 1;
}
.auth-logo { font-size: 56px; animation: logoBounce 2.6s ease-in-out infinite; display: inline-block; }
@keyframes logoBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.auth-card h1 { font-size: 26px; margin: 6px 0 2px; color: var(--green-dark); }
.auth-sub { color: #99906f; font-size: 13px; margin-bottom: 18px; }
.auth-tabs { display: flex; background: #f1f0e4; border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.auth-tab { flex: 1; padding: 9px 0; border-radius: 9px; background: transparent; color: #8a8468; font-size: 15px; }
.auth-tab.active { background: #fff; color: var(--green-dark); font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.field { text-align: left; margin-bottom: 14px; }
.field label { font-size: 13px; color: #7d765e; display: block; margin-bottom: 5px; }
.field input {
  width: 100%; padding: 11px 13px; border: 2px solid #e4e2d2; border-radius: 10px;
  font-size: 15px; background: #fff; outline: none; transition: border .15s;
}
.field input:focus { border-color: var(--green); }
.auth-error { color: #d33; font-size: 13px; min-height: 20px; margin-bottom: 6px; }
.btn-primary {
  background: linear-gradient(180deg, #7ecf5c, var(--green)); color: #fff;
  padding: 10px 18px; border-radius: 10px; font-size: 15px; font-weight: 700;
  box-shadow: 0 3px 0 var(--green-dark); transition: transform .06s;
}
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--green-dark); }
.btn-primary.big { width: 100%; padding: 13px; font-size: 16px; }
.btn-primary.small { padding: 6px 12px; font-size: 13px; }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost { background: rgba(255,255,255,.75); border-radius: 9px; padding: 5px 9px; font-size: 16px; }
.btn-ghost:hover { background: #fff; }

/* ---------- 顶栏 ---------- */
#topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; background: linear-gradient(90deg, var(--green-dark), var(--green));
  color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15); flex-wrap: wrap;
}
.logo { font-size: 20px; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.2); }
.hud { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hud-item {
  background: rgba(255,255,255,.18); padding: 5px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.exp-wrap { display: flex; align-items: center; gap: 6px; }
.exp-bar { width: 90px; height: 12px; background: rgba(0,0,0,.25); border-radius: 999px; overflow: hidden; }
#exp-fill { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #ffe259, #ffa751); transition: width .4s; }
#exp-text { font-size: 11px; }

/* ---------- 标签页 ---------- */
#tabs { display: flex; gap: 6px; padding: 10px 16px 0; flex-wrap: wrap; }
.tab {
  padding: 9px 20px; border-radius: 12px 12px 0 0; font-size: 15px; font-weight: 700;
  background: rgba(255,255,255,.45); color: #5f5a45;
}
.tab.active { background: #fffdf5; color: var(--green-dark); box-shadow: 0 -2px 8px rgba(0,0,0,.06); }
#main { padding: 14px 16px 90px; max-width: 1100px; margin: 0 auto; position: relative; z-index: 1; }
.tab-pane { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* ---------- 农场 ---------- */
.visit-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: #fff8e1; border: 2px solid #ffd54f; border-radius: 12px;
  padding: 10px 14px; margin-bottom: 14px; font-weight: 700; color: #8d6e00;
  box-shadow: var(--shadow);
}
.farm-title {
  font-size: 17px; font-weight: 900; color: var(--green-dark); margin: 4px 0 10px;
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}
.farm-frame {
  display: inline-block; max-width: 100%; padding: 12px;
  background: repeating-linear-gradient(90deg, #a4763f 0 18px, #8b5a2b 18px 22px);
  border-radius: 22px; box-shadow: var(--shadow);
  border: 2px solid #6d4420;
}
.farm-frame::before, .farm-frame::after {
  content: ''; position: absolute; pointer-events: none;
}
#farm-area {
  position: relative; display: inline-block;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.08) 0 6px, transparent 7px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.07) 0 5px, transparent 6px),
    linear-gradient(135deg, #8fd468, #74c04e);
  border-radius: 14px; padding: 20px;
  border: 3px solid #5da33c; max-width: 100%; overflow: auto;
}
#farm-grid {
  position: relative; display: grid; gap: 8px; width: max-content;
}
.plot {
  width: var(--cell); height: var(--cell); border-radius: 12px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.18) 0 3px, transparent 4px),
    radial-gradient(circle at 65% 70%, rgba(0,0,0,.08) 0 4px, transparent 5px),
    radial-gradient(circle at 50% 40%, var(--dirt), var(--dirt-dark));
  border: 2px solid rgba(0,0,0,.14);
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.16), inset 0 3px 0 rgba(255,255,255,.14);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; user-select: none; position: relative;
  transition: transform .08s, box-shadow .12s;
}
.plot:hover { transform: scale(1.05); box-shadow: inset 0 -5px 0 rgba(0,0,0,.16), inset 0 3px 0 rgba(255,255,255,.14), 0 5px 14px rgba(0,0,0,.3); z-index: 3; }
.plot .crop-emoji { font-size: calc(var(--cell) * .52); line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.plot .crop-emoji.small { font-size: calc(var(--cell) * .34); filter: saturate(.85); animation: sprout 2.4s ease-in-out infinite; }
@keyframes sprout { 0%,100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.08) rotate(3deg); } }
.plot .plot-label { font-size: 11px; color: #5b4320; font-weight: 700; text-shadow: 0 1px 0 rgba(255,255,255,.4); }
.plot .countdown { font-size: 10.5px; color: #3c2f16; font-weight: 700; background: rgba(255,255,255,.55); padding: 1px 6px; border-radius: 999px; margin-top: 2px; }
.plot .countdown.warn { background: #fff3e0; color: #e65100; }
.plot .badges { position: absolute; top: 2px; right: 3px; font-size: 10px; }
.plot .act-row { display: flex; gap: 4px; margin-top: 3px; }
.plot .act-row button { font-size: 11px; padding: 2px 6px; border-radius: 6px; box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.btn-water { background: #4fc3f7; color: #fff; }
.btn-fert { background: #ba68c8; color: #fff; }
.btn-harvest { background: #ffb300; color: #fff; font-weight: 700; }
.btn-clear { background: #9e9e9e; color: #fff; }
.btn-steal { background: #e53935; color: #fff; font-weight: 700; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.plot.mature { border-color: #ffd54f; box-shadow: inset 0 -5px 0 rgba(0,0,0,.16), 0 0 14px rgba(255,213,79,.75); }
.plot.mature .crop-emoji { animation: ripeBounce 2s ease-in-out infinite; }
@keyframes ripeBounce { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-4px) scale(1.07); } }
.plot.withered { filter: grayscale(.9); }
.plot.deco-cell { background: linear-gradient(135deg, #a8d97e, #8ccb63); box-shadow: inset 0 -4px 0 rgba(0,0,0,.1); }
.plot.deco-cell .crop-emoji { font-size: calc(var(--cell) * .5); }
.farm-tip { margin-top: 10px; font-size: 13px; color: #6d684f; background: rgba(255,255,255,.6); padding: 8px 12px; border-radius: 10px; display: inline-block; }
.farm-tools { display: flex; gap: 8px; margin: 0 0 10px; }
.deco-mode-bar { margin-top: 10px; background: #fff8e1; border-radius: 10px; padding: 8px 12px; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.seed-opt.sel { border-color: var(--green); background: #e8f5e9; }
/* 钱包 */
.wallet-total {
  background: linear-gradient(135deg, #fff8e1, #ffe9b8); border: 2px solid #ffd54f;
  border-radius: 14px; padding: 16px; text-align: center; margin-bottom: 12px;
}
.wt-num { font-size: 28px; font-weight: 900; color: #c77700; }
.wt-lbl { font-size: 12px; color: #8d6e00; margin-top: 4px; }
.wallet-rows { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.wallet-row {
  display: flex; justify-content: space-between; align-items: center;
  background: #faf8ec; border-radius: 10px; padding: 9px 12px; font-size: 13.5px;
}
.wallet-row b { color: var(--green-dark); }
.wallet-note { font-size: 12px; color: #99906f; padding: 4px 2px; }
.batch-qty { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; flex-wrap: wrap; font-size: 14px; }
.batch-qty b { font-size: 17px; color: var(--green-dark); margin-left: auto; }

/* ---------- 餐厅 ---------- */
.rest-head {
  font-size: 14.5px; font-weight: 700; background: #fff8e1; border: 2px solid #ffd54f;
  border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; color: #8d6e00; box-shadow: var(--shadow);
}
.rest-layout { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .rest-layout { grid-template-columns: 1fr; } }
.rest-scene {
  border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); border: 3px solid #7a5230;
  background: linear-gradient(180deg, #f7e7c8 0%, #f0d9ae 100%);
}
.rest-wall {
  background: linear-gradient(180deg, #d9a05b, #c9883f); color: #fff; text-align: center;
  padding: 10px; font-weight: 900; letter-spacing: 3px; font-size: 15px;
  border-bottom: 4px solid #8b5a2b; text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.rest-floor {
  position: relative; padding: 16px; min-height: 320px;
  background:
    radial-gradient(circle at 20% 15%, rgba(0,0,0,.05) 0 8px, transparent 9px),
    repeating-linear-gradient(0deg, #e9cfa0 0 34px, #e3c693 34px 35px);
}
.rest-counter {
  background: linear-gradient(180deg, #8b6f47, #6f5638); color: #ffe9c9; border-radius: 10px;
  padding: 8px 14px; display: inline-block; font-weight: 800; font-size: 13px;
  margin-bottom: 14px; box-shadow: inset 0 2px 0 rgba(255,255,255,.2);
}
.rest-tables { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 700px) { .rest-tables { grid-template-columns: repeat(2, 1fr); } }
.rest-table {
  background: rgba(255,255,255,.55); border: 2px dashed #c9b283; border-radius: 14px;
  min-height: 128px; padding: 10px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; position: relative;
}
.rest-table.busy { border-style: solid; border-color: #b98a2f; background: rgba(255,252,240,.85); box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.table-emoji { font-size: 30px; }
.table-state.empty { color: #b0a076; font-size: 12.5px; }
.npc-avatar { font-size: 38px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.npc-name { font-size: 12.5px; font-weight: 800; color: #6d4c1d; }
.npc-bubble {
  background: #fff; border-radius: 10px; padding: 3px 9px; font-size: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.12); position: relative; max-width: 100%;
}
.npc-bubble::before {
  content: ''; position: absolute; top: -5px; left: 18px; width: 9px; height: 9px;
  background: #fff; transform: rotate(45deg);
}
.npc-timer { font-size: 11px; color: #c2571a; font-weight: 700; }
.bar { width: 80%; height: 6px; background: #eee; border-radius: 999px; overflow: hidden; margin-top: 2px; }
.bar > div { height: 100%; border-radius: 999px; transition: width 1s linear; }
.bar-patience > div { background: #ff9800; }
.bar-eating > div { background: #66bb6a; }
.btn-serve { background: #ffb300; color: #fff; font-weight: 800; padding: 5px 12px; border-radius: 8px; font-size: 12.5px; margin-top: 3px; box-shadow: 0 2px 0 #c68a00; }
.btn-collect { background: #4caf50; color: #fff; font-weight: 800; padding: 5px 12px; border-radius: 8px; font-size: 12.5px; margin-top: 3px; box-shadow: 0 2px 0 #388e3c; }
.rest-side { display: flex; flex-direction: column; gap: 14px; }
.rest-panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; border: 2px solid #f0e8d0; }
.rest-panel h3 { font-size: 15px; margin-bottom: 8px; }
.rest-sub { font-size: 11px; color: #b0a988; font-weight: 400; }
.cook-idle { color: #9a9378; font-size: 13px; padding: 6px 0; }
.cook-busy { background: #fff3e0; border-radius: 10px; padding: 9px 12px; font-size: 13px; color: #8d4e00; font-weight: 700; }
.menu-title { font-weight: 900; font-size: 13px; color: #8d6e00; margin: 10px 0 6px; }
.dish-card {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px;
  background: #faf8ec; margin-bottom: 7px; border: 2px solid transparent;
}
.dish-card:hover { border-color: #e3d9b0; }
.dish-card.locked { opacity: .55; }
.dc-emoji { font-size: 28px; }
.dc-main { flex: 1; min-width: 0; }
.dc-name { font-weight: 800; font-size: 13.5px; }
.dc-price { color: #e6a700; margin-left: 4px; }
.dc-ing { font-size: 11.5px; color: #8a8468; margin-top: 2px; }
.dc-ing .lack { color: #e53935; }
.dc-time { font-size: 11px; color: #b0a988; }
.dc-lock { font-size: 11px; color: #99906f; }
.btn-cook {
  background: linear-gradient(180deg, #ffb347, #ff8c00); color: #fff; font-weight: 800;
  padding: 6px 12px; border-radius: 8px; font-size: 12.5px; box-shadow: 0 2px 0 #cc7000;
}
.btn-cook:disabled { background: #ddd; box-shadow: none; cursor: not-allowed; color: #999; }
.stock-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px dashed #e8e4d2; font-size: 13.5px;
}
.stock-row:last-child { border-bottom: none; }
.sr-emoji { font-size: 20px; }
.sr-name { font-weight: 700; }
.sr-qty { margin-left: auto; font-weight: 800; color: var(--green-dark); }
.sr-note { font-size: 11px; color: #b0a988; }

/* ---------- 牧场 ---------- */
#pasture-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.animal-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 8px; border: 2px solid #f0e8d0;
  transition: transform .12s, box-shadow .15s;
}
.animal-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.14); }
.animal-top { display: flex; align-items: center; gap: 12px; }
.animal-emoji { font-size: 46px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.15)); }
.animal-name { font-weight: 800; font-size: 16px; }
.animal-status { font-size: 13px; color: #8a8468; }
.animal-status .ok { color: var(--green-dark); font-weight: 700; }
.animal-status .warn { color: #e65100; font-weight: 700; }
.animal-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.animal-btns button { font-size: 12.5px; padding: 6px 10px; border-radius: 8px; font-weight: 700; }
.btn-feed { background: #ffe0b2; color: #bf360c; }
.btn-collect { background: #c8e6c9; color: #1b5e20; }
.btn-sell { background: #ffcdd2; color: #b71c1c; }
.slot-empty {
  border: 2px dashed #b8b294; border-radius: var(--radius); min-height: 110px;
  display: flex; align-items: center; justify-content: center; color: #9a9378;
  font-size: 14px; cursor: pointer; background: rgba(255,255,255,.4);
}
.slot-empty:hover { background: rgba(255,255,255,.7); }

/* ---------- 商店 ---------- */
.shop-cats { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.shop-cat {
  padding: 7px 14px; border-radius: 999px; background: rgba(255,255,255,.6);
  font-size: 13.5px; font-weight: 700; color: #6d684f;
}
.shop-cat.active { background: var(--green); color: #fff; }
.shop-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
@media (max-width: 800px) { .shop-layout { grid-template-columns: 1fr; } }
.shop-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.shop-item {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; display: flex; flex-direction: column; gap: 7px; border: 2px solid #f0e8d0;
  transition: transform .12s, box-shadow .15s;
}
.shop-item:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.14); }
.shop-item .si-emoji { font-size: 40px; }
.shop-item .si-name { font-weight: 800; }
.shop-item .si-desc { font-size: 12px; color: #99906f; }
.shop-item .si-price { font-size: 14px; font-weight: 800; color: #e6a700; }
.shop-item .si-owned { font-size: 12px; color: var(--green-dark); font-weight: 700; }
.shop-item.locked { opacity: .55; }
.si-btns { display: flex; gap: 6px; }
.si-btns button { font-size: 12px; padding: 6px 10px; border-radius: 8px; font-weight: 700; background: #e8f5e9; color: #2e7d32; }
.si-btns button:hover { background: #c8e6c9; }
.bag-panel { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.bag-panel h3 { margin-bottom: 10px; font-size: 16px; }
.bag-item { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px dashed #e8e4d2; font-size: 13.5px; }
.bag-item:last-child { border-bottom: none; }
.bag-item .bi-emoji { font-size: 22px; }
.bag-item .bi-qty { margin-left: auto; font-weight: 800; color: var(--green-dark); }
.bag-item .bi-sell { background: #fff3e0; color: #e65100; padding: 3px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; }
.bag-empty { color: #b0a988; font-size: 13px; padding: 10px 0; }

/* ---------- 好友 ---------- */
.friends-toolbar { display: flex; gap: 8px; margin-bottom: 14px; max-width: 420px; }
.input {
  flex: 1; padding: 9px 13px; border: 2px solid #e4e2d2; border-radius: 10px;
  font-size: 14px; background: #fff; outline: none;
}
.input:focus { border-color: var(--green); }
.friend-row {
  display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,.75);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; box-shadow: 0 1px 5px rgba(0,0,0,.05);
  max-width: 560px; transition: transform .1s, box-shadow .12s;
}
.friend-row:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.friend-avatar { font-size: 30px; }
.friend-name { font-weight: 800; }
.friend-meta { font-size: 12px; color: #99906f; }
.online-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; }
.online-dot.on { background: #4caf50; box-shadow: 0 0 5px #4caf50; }
.online-dot.off { background: #bdbdbd; }
.friend-actions { margin-left: auto; display: flex; gap: 6px; }

/* 排行榜 */
.rank-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-top: 18px; max-width: 560px; border: 2px solid #f0e8d0;
}
.rank-card h3 { margin-bottom: 10px; font-size: 16px; color: var(--green-dark); }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; font-size: 14px; }
.rank-row:nth-child(odd) { background: #faf8ec; }
.rank-row.me { background: #fff3e0; box-shadow: inset 0 0 0 2px #ffd54f; }
.rank-no { width: 26px; text-align: center; font-weight: 900; }
.rank-avatar { font-size: 22px; }
.rank-name { font-weight: 800; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-meta { font-size: 12px; color: #99906f; }
.rank-online { width: 8px; height: 8px; border-radius: 50%; }
.rank-online.on { background: #4caf50; }
.rank-online:not(.on) { background: #e0e0e0; }

/* ---------- 聊天 ---------- */
.chat-panel {
  position: fixed; right: 14px; bottom: 14px; width: 320px; max-width: calc(100vw - 28px);
  background: #fff; border-radius: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.25);
  display: flex; flex-direction: column; z-index: 50; overflow: hidden;
}
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--green); color: #fff; font-weight: 800; font-size: 14px; }
.chat-head span { font-size: 12px; font-weight: 400; opacity: .85; }
.chat-head .btn-ghost { margin-left: auto; color: #fff; background: rgba(255,255,255,.2); }
#chat-msgs { height: 300px; overflow-y: auto; padding: 10px; background: #faf9f2; display: flex; flex-direction: column; gap: 7px; }
#chat-msgs::-webkit-scrollbar { width: 6px; }
#chat-msgs::-webkit-scrollbar-thumb { background: #d8d4be; border-radius: 3px; }
.chat-msg { font-size: 13px; line-height: 1.45; display: flex; align-items: baseline; gap: 4px; }
.chat-msg .cm-avatar { font-size: 14px; }
.chat-msg .cm-name { font-weight: 800; color: var(--green-dark); }
.chat-msg.sys { color: #9a9378; font-style: italic; }
.chat-msg .cm-time { color: #c5bfa4; font-size: 11px; margin-left: auto; white-space: nowrap; }
.chat-input-row { display: flex; gap: 6px; padding: 9px; border-top: 1px solid #eee; }

/* ---------- 弹窗 / Toast ---------- */
#modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
#modal-box {
  background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  padding: 22px; width: 100%; max-width: 420px; max-height: 80vh; overflow-y: auto;
}
#modal-box h3 { margin-bottom: 12px; color: var(--green-dark); }
.seed-opt {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px;
  background: #f4f2e4; margin-bottom: 8px; cursor: pointer; border: 2px solid transparent;
}
.seed-opt:hover { border-color: var(--green); }
.seed-opt .so-emoji { font-size: 26px; }
.seed-opt .so-name { font-weight: 800; font-size: 14px; }
.seed-opt .so-meta { font-size: 12px; color: #99906f; }
.seed-opt .so-qty { margin-left: auto; font-weight: 800; color: var(--green-dark); }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; }
.btn-plain { background: #eee; padding: 8px 14px; border-radius: 9px; font-size: 13.5px; color: #555; }
#toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(40,40,40,.88); color: #fff; padding: 9px 18px; border-radius: 999px;
  font-size: 14px; box-shadow: var(--shadow); animation: toastIn .2s ease; white-space: nowrap;
}
.toast.good { background: rgba(46,125,50,.92); }
.toast.bad { background: rgba(211,47,47,.92); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; } }

/* 升级特效 */
.confetti { position: fixed; width: 10px; height: 14px; z-index: 300; pointer-events: none; animation: confettiFall 1.6s ease forwards; }
@keyframes confettiFall { from { transform: translateY(-10px) rotate(0); opacity: 1; } to { transform: translateY(60vh) rotate(720deg); opacity: 0; } }
