:root {
  --bg: #0f1216;
  --bg-soft: #161b22;
  --card: #1a212b;
  --card-2: #202833;
  --line: #2b3440;
  --text: #e8edf2;
  --text-dim: #8b96a3;
  --accent: #f6c453;   /* 金色，点券 */
  --accent-2: #5fd08a; /* 绿色，羊币 */
  --danger: #f07b7b;
  --info: #6db3f2;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* ============ 认证页 ============ */
.auth {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 20px 60px;
}
.auth .logo { font-size: 72px; margin-bottom: 4px; filter: drop-shadow(0 8px 20px rgba(246,196,83,.25)); }
.auth h1 { margin: 0 0 4px; font-size: 26px; letter-spacing: 1px; }
.auth .sub { color: var(--text-dim); margin: 0 0 28px; font-size: 13px; }
.auth .card { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: var(--shadow); }
.auth .tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth .tabs button { flex: 1; padding: 10px; background: transparent; border: 1px solid var(--line); color: var(--text-dim); border-radius: 10px; font-size: 14px; cursor: pointer; }
.auth .tabs button.active { background: var(--accent); color: #1a1400; border-color: var(--accent); font-weight: 600; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.server-chips { display: flex; gap: 8px; }
.server-chip {
  flex: 1; min-width: 0; padding: 10px 4px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--text-dim);
  font-size: 13px; transition: all .15s;
}
.server-chip.active { border-color: var(--accent); color: var(--accent); background: rgba(246,196,83,.12); font-weight: 600; }
.server-chip:active { transform: scale(.96); }
.field input {
  width: 100%; padding: 12px 14px; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 10px; color: var(--text); font-size: 15px; outline: none;
}
.field input:focus { border-color: var(--accent); }
.btn { display: block; width: 100%; padding: 13px; border: none; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--accent); color: #1a1400; }
.btn-gold { background: linear-gradient(135deg, #f6c453, #e39c2e); color: #241a00; }
.btn-danger { background: linear-gradient(135deg, #f07b7b, #e04a4a); color: #fff; }
.btn-danger:disabled { opacity: .4; cursor: not-allowed; }
#disband_sheet input { width: 100%; box-sizing: border-box; padding: 12px 14px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 15px; outline: none; margin-bottom: 12px; }
#disband_sheet input:focus { border-color: var(--danger, #e04a4a); }
.disband-warn { font-size: 13px; color: var(--danger, #e04a4a); margin: 0 0 10px; }
.btn-gold:active { opacity: .85; }
.btn-primary:active { opacity: .85; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.auth .hint { text-align: center; color: var(--text-dim); font-size: 12px; margin-top: 14px; }
.err { color: var(--danger); font-size: 13px; margin: 8px 0 0; min-height: 18px; }

/* ============ 外壳 ============ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; padding-top: calc(12px + env(safe-area-inset-top));
  background: linear-gradient(180deg, var(--bg) 60%, rgba(15,18,22,0));
}
.topbar .who { font-weight: 600; font-size: 15px; }
.topbar .uid { color: var(--text-dim); font-size: 11px; }
.who-ava .ava { width: 34px; height: 34px; font-size: 18px; }
.ava {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 22px; flex: none; overflow: hidden;
  border: 2px solid rgba(255,255,255,.35); box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reg-preview {
  margin: 4px 0 12px; padding: 10px 12px; border-radius: 12px;
  background: var(--card-2); border: 1px dashed var(--line);
}
.reg-preview-head { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.reg-preview-body { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.reg-preview-body .ava { width: 36px; height: 36px; font-size: 18px; }
.reg-preview-body b { flex: 1; }
.mini-btn {
  background: var(--card-2); color: var(--accent); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px; font-size: 12px; cursor: pointer; flex: none;
}
.mini-btn:active { transform: scale(.95); }
.profile-head { display: flex; align-items: center; gap: 12px; }
.profile-head .pinfo { flex: 1; min-width: 0; }
.profile-head .pname { font-size: 17px; font-weight: 700; }
.edit-sec { margin-top: 12px; }
.edit-sec-title { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.avatar-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
}
.ava-cell {
  aspect-ratio: 1; border-radius: 50%; border: 2px solid transparent;
  font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  padding: 0; width: 100%;
}
.ava-cell.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(246,196,83,.25); }
.ava-upload-btn {
  margin-top: 10px; width: 100%; text-align: center;
  border-style: dashed !important; background: var(--card-2) !important;
}
.ava-upload-btn.active { border-color: var(--accent) !important; color: var(--accent); }
.edit-preview { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.balances { display: flex; gap: 6px; }
.balance { display: flex; flex-direction: column; align-items: center; gap: 1px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 3px 10px; font-size: 13px; line-height: 1.15; }
.balance .res-top { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.balance b { font-variant-numeric: tabular-nums; }
.res-label { font-style: normal; font-size: 9px; line-height: 1.2; color: var(--text-dim); }
.balance.diamond b { color: var(--accent); }
.balance.coin b { color: var(--accent-2); }

main { flex: 1; padding: 4px 14px 96px; }
.page-title { font-size: 16px; font-weight: 700; margin: 10px 2px 12px; display: flex; align-items: center; justify-content: space-between; }
.page-title .dim { font-weight: 400; font-size: 12px; color: var(--text-dim); }

/* ============ 羊圈 ============ */
.pen-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 13px; color: var(--text-dim); }
.sheep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sheep-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 8px;
}
.sheep-card.dead { opacity: .55; filter: grayscale(.7); }
.sheep-card .head { display: flex; align-items: center; justify-content: space-between; }
.sheep-card .emoji { font-size: 44px; line-height: 1; }
.sheep-card .type { font-weight: 700; font-size: 15px; }
.sheep-card .type .sub { display: block; font-weight: 400; font-size: 11px; color: var(--text-dim); }
.stage-badge { font-size: 11px; padding: 3px 8px; border-radius: 999px; font-weight: 600; }
.stage-lamb { background: rgba(109,179,242,.16); color: var(--info); }
.stage-youth { background: rgba(95,208,138,.16); color: var(--accent-2); }
.stage-adult { background: rgba(246,196,83,.16); color: var(--accent); }
.stage-dead { background: rgba(240,123,123,.16); color: var(--danger); }

.rate-line { font-size: 12px; color: var(--text-dim); display: flex; justify-content: space-between; }
.rate-line b { color: var(--accent-2); }

.progress { height: 7px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--info), var(--accent-2)); transition: width .5s; }
.progress.dead > i { background: var(--danger); }
.progress-label { font-size: 11px; color: var(--text-dim); display: flex; justify-content: space-between; }

.sheep-actions { display: flex; gap: 8px; margin-top: 2px; }
.sheep-actions button {
  flex: 1; padding: 8px 6px; border-radius: 10px; font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
}
.sheep-actions button.primary { background: rgba(246,196,83,.14); border-color: rgba(246,196,83,.4); color: var(--accent); }
.sheep-actions button.danger { background: rgba(240,123,123,.12); border-color: rgba(240,123,123,.4); color: var(--danger); }
.sheep-actions button:disabled { opacity: .4; cursor: not-allowed; }

.empty { text-align: center; color: var(--text-dim); padding: 60px 20px; font-size: 14px; }
.empty .big { font-size: 56px; display: block; margin-bottom: 12px; }

/* ============ 商城 / 列表卡片 ============ */
.list { display: flex; flex-direction: column; gap: 12px; }
.item {
  display: flex; align-items: center; gap: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 16px; padding: 14px;
}
.item .emoji { font-size: 40px; line-height: 1; }
.item .emoji img.sheep-ico-img { width: 58px; height: 58px; object-fit: contain; display: block; }
.item .info { flex: 1; min-width: 0; }
.item .info .name { font-weight: 700; font-size: 15px; }
.item .info .desc { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.item .price { color: var(--accent); font-weight: 700; font-size: 14px; white-space: nowrap; }
.item button { padding: 9px 14px; border-radius: 10px; border: none; background: var(--accent); color: #1a1400; font-weight: 700; font-size: 13px; cursor: pointer; }
.item button:disabled { background: var(--card-2); color: var(--text-dim); cursor: not-allowed; }
.item button.outline { background: transparent; border: 1px solid var(--line); color: var(--text-dim); }

/* ============ 充值 ============ */
.recharge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.recharge-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 14px; text-align: center; cursor: pointer;
}
.recharge-card .pts { font-size: 22px; font-weight: 800; color: var(--accent); }
.recharge-card .pts .u { font-size: 13px; font-weight: 400; color: var(--text-dim); }
.recharge-card .usdt { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.recharge-card:active { transform: scale(.97); }
.demo-note { margin-top: 18px; padding: 12px 14px; background: rgba(109,179,242,.08); border: 1px solid rgba(109,179,242,.25); border-radius: 12px; font-size: 12px; color: var(--info); }

/* ============ 提现 ============ */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 14px; }
.kv { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: none; }
.kv .v { font-variant-numeric: tabular-nums; }
.kv .v.green { color: var(--accent-2); }
.kv .v.gold { color: var(--accent); }
.seg { display: flex; gap: 8px; margin-bottom: 12px; }
.seg button { flex: 1; padding: 9px; background: var(--bg-soft); border: 1px solid var(--line); color: var(--text-dim); border-radius: 10px; font-size: 13px; cursor: pointer; }
.seg button.active { background: rgba(246,196,83,.14); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.wd-history { margin-top: 16px; }
.wd-item { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.wd-item:last-child { border-bottom: none; }
.wd-item .status { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.wd-item .status.pending { background: rgba(246,196,83,.16); color: var(--accent); }
.wd-item .status.paid { background: rgba(95,208,138,.16); color: var(--accent-2); }
.wd-item .status.rejected { background: rgba(240,123,123,.16); color: var(--danger); }
.wd-item .addr { color: var(--text-dim); font-size: 11px; word-break: break-all; }

/* ============ 底部导航 ============ */
.bottomnav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; z-index: 30;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav button {
  flex: 1; padding: 10px 4px 12px; background: transparent; border: none; color: var(--text-dim);
  font-size: 11px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.bottomnav button .ic { font-size: 22px; line-height: 1; }
.bottomnav button.active { color: var(--accent); }
.bottomnav button.active .ic { filter: drop-shadow(0 0 6px rgba(246,196,83,.4)); }

/* ============ Toast ============ */
#toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%) translateY(-8px);
  background: var(--card-2); color: var(--text); border: 1px solid var(--line);
  padding: 10px 18px; border-radius: 999px; font-size: 13px; z-index: 50;
  opacity: 0; pointer-events: none; transition: .25s; box-shadow: var(--shadow);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { border-color: rgba(240,123,123,.5); color: var(--danger); }
#toast.ok { border-color: rgba(95,208,138,.5); color: var(--accent-2); }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 40;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  width: 100%; max-width: 560px; background: var(--card); border-top: 1px solid var(--line);
  border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  animation: slideup .25s;
}
@keyframes slideup { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { margin: 0 0 14px; font-size: 16px; }
.modal .close { float: right; background: none; border: none; color: var(--text-dim); font-size: 20px; cursor: pointer; }

/* ============ 羊动画 ============ */
.sheep-card .emoji {
  display: inline-block;
  transform-origin: 50% 100%;
  animation: sheep-hop 2.4s ease-in-out infinite;
}
.sheep-card.stage-lamb .emoji  { animation-duration: 3.2s; }
.sheep-card.stage-youth .emoji { animation-duration: 2.4s; }
.sheep-card.stage-adult .emoji { animation-duration: 1.9s; }
.sheep-card.dead .emoji {
  animation: none;
  transform: rotate(95deg) translateY(2px);
  filter: grayscale(1);
  opacity: .8;
}
@keyframes sheep-hop {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-9px) rotate(-7deg); }
  50% { transform: translateY(0) rotate(0deg); }
  75% { transform: translateY(-6px) rotate(7deg); }
}
.sheep-card.producing {
  box-shadow: 0 0 0 1px rgba(95,208,138,.35), 0 6px 24px rgba(95,208,138,.14);
}
.coin-fly {
  position: absolute; top: 12px; right: 14px; font-size: 15px;
  pointer-events: none; animation: coin-up 2.2s ease-in-out infinite; opacity: 0;
}
@keyframes coin-up {
  0% { transform: translateY(8px) scale(.8); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translateY(-26px) scale(1); opacity: 0; }
}
.music-btn {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 4px 9px; font-size: 14px; line-height: 1.15; cursor: pointer;
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
}
.mail-btn { position: relative; }
.mail-dot {
  position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px;
  background: var(--danger); color: #fff; border-radius: 999px;
  font-size: 10px; font-weight: 700; font-style: normal; line-height: 16px;
  text-align: center; padding: 0 4px;
  border: 2px solid var(--bg);
}

/* ============ 全服通告飘屏 ============ */
#ann_zone {
  position: fixed; top: calc(64px + env(safe-area-inset-top)); left: 10px; right: 10px;
  z-index: 40; display: flex; flex-direction: column; gap: 6px;
  pointer-events: none;
}
.ann-bar {
  background: linear-gradient(90deg, #b8860b, #ffd700 40%, #fff3b0 50%, #ffd700 60%, #b8860b);
  color: #4a2c00; font-weight: 700; font-size: 13px;
  padding: 9px 14px; border-radius: 999px; text-align: center;
  box-shadow: 0 4px 16px rgba(255, 215, 0, .4), inset 0 1px 0 rgba(255,255,255,.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  animation: ann-in .45s ease-out, ann-float 2.4s ease-in-out .45s infinite;
}
@keyframes ann-in { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes ann-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* ============ 签到 ============ */
.signin-panel { margin-bottom: 14px; }
.sign-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.sign-head .dim { font-weight: 400; font-size: 12px; color: var(--text-dim); }
.sign-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 12px; }
.sign-slot {
  position: relative; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 2px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; color: var(--text-dim); text-align: center;
}
.sign-slot .ic { font-size: 18px; line-height: 1; }
.sign-slot .d { font-size: 10px; }
.sign-slot .r { font-weight: 600; color: var(--text); }
.sign-slot.done { border-color: rgba(95,208,138,.4); background: rgba(95,208,138,.08); }
.sign-slot.today { border-color: var(--accent); background: rgba(246,196,83,.1); box-shadow: 0 0 0 1px var(--accent); }
.sign-slot .ck { position: absolute; top: 2px; right: 3px; color: var(--accent-2); font-size: 11px; }

/* ============ 2.5D 牧场 ============ */
.ranch {
  position: relative; height: 52vh; min-height: 360px; max-height: 480px;
  border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: linear-gradient(#8ecbf5 0%, #cde9fb 46%, #d7e6b8 60%, #79b75f 78%, #5a9c4e 100%);
}
.sky { position: absolute; inset: 0 0 42% 0; }
.sun {
  position: absolute; top: 12%; right: 11%; width: 46px; height: 46px;
  background: radial-gradient(circle, #fff3c4, #ffd34d 70%, transparent 72%);
  border-radius: 50%; box-shadow: 0 0 44px 14px rgba(255,211,77,.32);
}
.cloud {
  position: absolute; background: #fff; border-radius: 999px; opacity: .9;
  animation: cloud-drift linear infinite;
}
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud.c1 { width: 70px; height: 22px; top: 13%; left: -20%; animation-duration: 46s; }
.cloud.c1::before { width: 26px; height: 26px; left: 14px; top: -12px; }
.cloud.c1::after { width: 20px; height: 20px; left: 36px; top: -8px; }
.cloud.c2 { width: 54px; height: 18px; top: 25%; left: -20%; animation-duration: 60s; animation-delay: -18s; opacity: .72; }
.cloud.c2::before { width: 20px; height: 20px; left: 10px; top: -9px; }
.cloud.c3 { width: 60px; height: 20px; top: 7%; left: -20%; animation-duration: 52s; animation-delay: -30s; opacity: .8; }
.cloud.c3::before { width: 22px; height: 22px; left: 16px; top: -10px; }
@keyframes cloud-drift { 0% { transform: translateX(0); } 100% { transform: translateX(112vw); } }
.hills {
  position: absolute; top: 37%; left: -10%; right: -10%; height: 36%;
  background:
    radial-gradient(120% 90% at 20% 100%, #a7cf8a 0 62%, transparent 63%),
    radial-gradient(130% 100% at 82% 100%, #8fbf74 0 60%, transparent 61%);
}
.ground {
  position: absolute; top: 58%; bottom: 0; left: 0; right: 0;
  background: linear-gradient(#83bf66 0%, #6fae5c 30%, #8ec66f 72%, #9dd27a 100%);
}
.ground::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.045) 0 2px, transparent 2px 28px);
}
.tree { position: absolute; font-size: 34px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.22)); }
.tree.t1 { top: 42%; left: 7%; font-size: 40px; }
.tree.t2 { top: 45%; right: 9%; font-size: 30px; }
.grass { position: absolute; font-size: 15px; opacity: .85; }
.grass.g1 { bottom: 12%; left: 10%; }
.grass.g2 { bottom: 26%; left: 64%; }
.grass.g3 { bottom: 7%; left: 42%; }
.flower { position: absolute; font-size: 15px; }
.flower.f1 { bottom: 19%; left: 24%; }
.flower.f2 { bottom: 9%; right: 22%; }
.fence {
  position: absolute; top: 55%; left: 0; right: 0; height: 8%;
  background: repeating-linear-gradient(90deg, #a9743f 0 10px, transparent 10px 78px);
}
.fence::before {
  content: ''; position: absolute; left: 0; right: 0; top: 38%; height: 5px;
  background: linear-gradient(#b57f47, #8f5f2c);
}
.fence::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 6%; height: 5px;
  background: linear-gradient(#b57f47, #8f5f2c);
}
.sheep-layer { position: absolute; inset: 0; }
.sheep-actor { position: absolute; cursor: pointer; will-change: transform, left, top; }
.sheep-shadow {
  position: absolute; left: 50%; bottom: -2px; width: 42px; height: 11px;
  transform: translateX(-50%); background: rgba(0,0,0,.18); border-radius: 50%; filter: blur(2px);
}
.sheep-flip { display: inline-block; }
.sheep-body { display: block; line-height: 0; }
.sheep-body svg { display: block; height: auto; overflow: visible; }
.sheep-actor.producing .sheep-body { filter: drop-shadow(0 0 7px rgba(95,208,138,.5)); }
.sheep-actor.dead .sheep-body { filter: grayscale(1); }
.sheep-actor.dead .sheep-body svg { transform: rotate(90deg); transform-box: fill-box; transform-origin: 50% 72%; }
.sheep-actor.dead .sheep-inner, .sheep-actor.dead .leg { animation: none !important; }
.sheep-badge { position: absolute; top: -4px; right: -10px; font-size: 15px; line-height: 1; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }

/* 羊 SVG 配色 */
.sheep-svg.t-normal { --wool-back:#d8cdbd; --wool:#f7f1e6; --wool-shade:#ebe0cf; --face:#ecb295; --face-line:#c78b70; --ear-in:#d99a84; --horn:#c9a06a; --horn-hi:#e7c99b; --leg:#b08a5e; }
.sheep-svg.t-adult  { --wool-back:#c8b493; --wool:#efe2c8; --wool-shade:#e0cfb0; --face:#d69f78; --face-line:#ae7757; --ear-in:#c2846a; --horn:#b98a4a; --horn-hi:#d9b06a; --leg:#a3744a; }
.sheep-svg.t-elite  { --wool-back:#d7b565; --wool:#f8e3a7; --wool-shade:#ecd087; --face:#f1c49a; --face-line:#c69468; --ear-in:#dda573; --horn:#e9bd5f; --horn-hi:#f8dc8f; --leg:#c5944c; }
.wool-back { fill: var(--wool-back); }
.wool-front { fill: var(--wool); }
.puffs circle { fill: var(--wool-shade); }
.tail { fill: var(--wool-shade); }
.wool-hi { fill: rgba(255,255,255,.5); }
/* 高级感：高光渐变 + 闪闪星星 + 投影 */
.sheep-svg { filter: drop-shadow(0 5px 10px rgba(0,0,0,.28)); }
.sheep-svg .spark { fill: #ffe9a8; animation: twinkle 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.sheep-svg .spark.s2 { animation-delay: .55s; }
.sheep-svg .spark.s3 { animation-delay: 1.05s; }
@keyframes twinkle { 0%,100% { opacity:.25; transform: scale(.7); } 50% { opacity:1; transform: scale(1.2); } }
.face { fill: var(--face); }
.ear { fill: var(--face); }
.ear-in { fill: var(--ear-in); }
.leg { fill: var(--leg); }
.eye { fill: #33251c; }
.eye-hi { fill: #fff; }
.nose { fill: var(--face-line); }
.mouth { stroke: var(--face-line); }

/* 走路动画：四腿交替摆动 + 身体轻微起伏 */
.leg { transform-box: fill-box; transform-origin: 50% 0%; }
.legs .l1 .leg, .legs .l4 .leg { animation: leg-a .5s ease-in-out infinite; }
.legs .l2 .leg, .legs .l3 .leg { animation: leg-b .5s ease-in-out infinite; }
@keyframes leg-a { 0%, 100% { transform: rotate(14deg); } 50% { transform: rotate(-14deg); } }
@keyframes leg-b { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
.sheep-inner { animation: body-sway .5s ease-in-out infinite; }
@keyframes body-sway { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6px); } }
.emoji svg { width: 60px; height: auto; }
/* 饲料图标：麦穗标识饲料袋 */
.ico-feed { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -0.18em; }
.item .emoji svg.ico-feed { width: 40px; height: 40px; }
.sign-slot .ic svg.ico-feed { width: 19px; height: 19px; vertical-align: -0.22em; }
.ranch-bar .ico-feed { width: 17px; height: 17px; vertical-align: -0.3em; }
.sheet-head .big-emoji svg { width: 78px; height: auto; }
.sheet-head .big-emoji img.sheep-ico-img { width: 78px; height: 78px; object-fit: contain; display: block; }
.ranch-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: rgba(255,255,255,.92); font-size: 15px; text-shadow: 0 2px 6px rgba(0,0,0,.35); pointer-events: none;
}
.ranch-empty span { font-size: 64px; }
.ranch-label {
  position: absolute; top: 10px; left: 12px; font-size: 12px; color: rgba(255,255,255,.95);
  background: rgba(0,0,0,.24); padding: 3px 10px; border-radius: 999px; backdrop-filter: blur(4px);
}
.ranch-bar {
  display: flex; justify-content: space-between; margin: 10px 2px 0;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 12px; font-size: 13px;
}
.ranch-bar b { color: var(--accent-2); }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sheet-head .big-emoji { font-size: 48px; line-height: 1; }
.sheet-head h3 { margin: 0 0 4px; }
.sheet-actions { display: flex; gap: 10px; margin-top: 14px; }
.sheet-actions .btn { flex: 1; }

/* ============ 3D 牧场 ============ */
.ranch-3d {
  position: relative; height: 52vh; min-height: 380px; max-height: 500px;
  border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
  box-shadow: var(--shadow); cursor: grab; touch-action: none;
  background: #a8d8f5;
}
.ranch-3d canvas { display: block; }
/* 大场景内的面板（收益明细等） */
.world-panels { padding: 10px 0 20px; }
.ranch-3d:active { cursor: grabbing; }
.ranch-3d .ranch-label { z-index: 5; pointer-events: none; }
.ranch-hint {
  position: absolute; bottom: 10px; right: 12px; z-index: 5;
  font-size: 11px; color: rgba(255,255,255,.9);
  background: rgba(0,0,0,.26); padding: 3px 9px; border-radius: 999px; backdrop-filter: blur(4px);
  pointer-events: none;
}

/* 背包入口按钮（羊圈右上角） */
.bag-fab {
  position: absolute; top: 10px; right: 12px; z-index: 6;
  width: 46px; height: 46px; border-radius: 50%; padding: 0;
  background: rgba(255,255,255,.94); border: 2px solid #C08544;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.28); cursor: pointer;
}
.bag-fab:active { transform: scale(.93); }
.bag-fab .ico-bag { width: 27px; height: 27px; }
.bag-badge {
  position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px;
  background: var(--danger); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid #fff; box-sizing: border-box;
}

/* 背包弹层 */
.bag-sec-title { margin: 14px 2px 4px; font-size: 12px; font-weight: 700; color: var(--text-dim); }
.bag-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.bag-row:last-child { border-bottom: none; }
.bag-row .bag-ico svg { width: 46px; height: auto; display: block; }
.bag-row .bag-ico img.sheep-ico-img { width: 46px; height: 46px; object-fit: contain; display: block; }
.bag-row .bag-info { flex: 1; min-width: 0; }
.bag-row .name { font-size: 14px; font-weight: 600; }
.bag-row .dim { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

/* 观战：好友/工会成员羊圈（只读） */
button.spec-ava { position: relative; cursor: pointer; background: none; border: none; padding: 0; line-height: 1; }
.spec-dot { position: absolute; right: -4px; bottom: -4px; font-size: 11px; font-style: normal; background: rgba(255,255,255,.92); border-radius: 50%; padding: 1px; box-shadow: 0 0 4px rgba(0,0,0,.18); }
button.m-ava.spec-ava { background: var(--bg-soft); }
.spectate-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--card, #fff); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.spectate-bar .ava { width: 40px; height: 40px; font-size: 22px; }
.spectate-bar .spec-info { flex: 1; min-width: 0; }
.spectate-bar .spec-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.spectate-bar #spec_exit { flex: none; width: auto; padding: 8px 16px; font-size: 13px; }
/* 观战统计面板（牧场主观战成员时展示） */
.spec-panel { margin-top: 10px; }
.spec-panel h3 { margin: 0 0 10px; }
.spec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.spec-cell { background: var(--bg-soft, #f6f9f3); border-radius: 12px; padding: 9px 12px; }
.spec-cell-lbl { font-size: 11px; color: var(--text-dim); margin-bottom: 3px; }
.spec-cell-val { font-size: 13px; font-weight: 700; }
.spec-cell-val .dim { font-size: 11px; font-weight: 400; }
.stage-bag { background: rgba(244,67,54,.14); color: #e53935; }
.spec-panel .bag-ico { width: 40px; height: 40px; flex: none; display: flex; align-items: center; justify-content: center; }
.spec-panel .bag-ico .sheep-ico-img { width: 40px; height: 40px; }
/* 观战 HUD：总产速 + 羊群横条，叠加在 3D 画面上，观看时不用滚动就能看到 */
.spec-hud {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; pointer-events: none;
  padding: 30px 10px 8px;
  background: linear-gradient(to top, rgba(20, 24, 28, .55), rgba(20, 24, 28, 0));
}
.spec-hud .spec-stats { display: flex; justify-content: center; gap: 7px; flex-wrap: wrap; margin-bottom: 7px; }
.spec-hud .spec-stat {
  font-size: 11px; color: #fff; background: rgba(0, 0, 0, .35); border-radius: 999px;
  padding: 3px 10px; text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}
.spec-hud .spec-stat b { color: #ffe066; font-size: 12px; }
.spec-hud .spec-strip {
  display: flex; gap: 7px; overflow-x: auto; pointer-events: auto;
  touch-action: pan-x; -webkit-overflow-scrolling: touch; padding: 2px 2px 5px;
}
.spec-chip {
  flex: 0 0 auto; display: flex; align-items: center; gap: 5px;
  background: rgba(255, 255, 255, .94); border-radius: 11px; padding: 5px 9px 5px 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .28);
}
.spec-chip-ico { width: 26px; height: 26px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 20px; line-height: 1; }
.spec-chip-ico img, .spec-chip-ico svg { width: 26px; height: 26px; object-fit: contain; display: block; }
.spec-chip-name { font-size: 11px; font-weight: 700; color: #3a3a3a; max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spec-chip-rate { font-size: 10px; color: #1e8e3e; font-weight: 700; white-space: nowrap; }
.spec-chip.hungry { border: 1.5px solid #ff9d2e; }
.spec-hungry { font-style: normal; font-size: 9px; font-weight: 700; color: #fff; background: #ff8a1e; border-radius: 6px; padding: 1px 4px; }
.ranch-hint.spec-hint-top { top: 10px; bottom: auto; }
.bag-row .bag-btn { flex: 0 0 auto; width: auto; padding: 7px 13px; font-size: 12px; }
.bag-hint { font-size: 11px; color: var(--warn, #c98a2b); margin-bottom: 6px; }

/* ============ 抽奖 ============ */
.stage-legend { background: rgba(246,196,83,.22); color: #f6c453; }
.sheep-svg.t-legend {
  --wool-back:#e8c778; --wool:#fdf0c8; --wool-shade:#f5e3a0;
  --face:#f2c99a; --face-line:#c69468; --ear-in:#ddb073;
  --horn:#f2d478; --horn-hi:#fff2b8; --leg:#cfa45c; --gem:#e8382a;
}
.jackpot-panel {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, rgba(246,196,83,.16), rgba(232,120,42,.10));
  border-color: rgba(246,196,83,.45);
}
.jackpot-emoji { font-size: 52px; line-height: 1; animation: floaty 2.4s ease-in-out infinite; filter: drop-shadow(0 4px 12px rgba(246,196,83,.5)); }
.jackpot-name { font-weight: 700; font-size: 15px; color: var(--accent); }
.jackpot-desc { font-size: 12px; color: var(--text-dim); margin-top: 4px; line-height: 1.5; }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

.lot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.lot-cell {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.lot-cell .ic { font-size: 26px; line-height: 1; }
.lot-cell .lb { font-size: 11px; text-align: center; }
.lot-cell .od { font-size: 10px; color: var(--text-dim); }
.lot-cell.rare { border-color: rgba(95,208,138,.4); }
.lot-cell.jackpot {
  border-color: rgba(246,196,83,.7);
  background: linear-gradient(160deg, rgba(246,196,83,.22), rgba(232,120,42,.12));
  animation: jackpop 2s ease-in-out infinite;
}
@keyframes jackpop {
  0%,100% { box-shadow: 0 0 0 rgba(246,196,83,0); transform: scale(1); }
  50% { box-shadow: 0 0 14px rgba(246,196,83,.45); transform: scale(1.03); }
}

.lot-btns { display: flex; gap: 10px; margin-top: 12px; }
.lot-btns .btn { flex: 1; }
.btn-cta {
  background: linear-gradient(135deg, #f6c453, #e8782a); color: #2a1800;
  box-shadow: 0 4px 14px rgba(246,196,83,.35);
}
.btn-cta:active { opacity: .88; }

.lot-results { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.lot-result {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  animation: slideup .3s;
}
.lot-result .ic { font-size: 26px; line-height: 1; }
.lot-result .lb { font-size: 10px; text-align: center; line-height: 1.3; }
.lot-result.jackpot {
  border-color: rgba(246,196,83,.8);
  background: linear-gradient(160deg, rgba(246,196,83,.3), rgba(232,120,42,.16));
  animation: jackpop 1.6s ease-in-out infinite;
}
.lot-result.jackpot.hero {
  grid-column: 1 / -1;
  padding: 16px 6px;
  background: linear-gradient(160deg, rgba(246,196,83,.45), rgba(232,120,42,.22));
  box-shadow: 0 0 22px rgba(246,196,83,.45);
}
.lot-result.jackpot.hero .ic { font-size: 46px; filter: drop-shadow(0 0 10px rgba(255,215,0,.9)); }
.lot-result.jackpot.hero .lb { font-size: 13px; font-weight: 700; color: var(--accent); }
.modal.pop { animation: pop-in .38s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes pop-in { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.jackpot-flash {
  position: fixed; inset: 0; z-index: 95; pointer-events: none;
  background: radial-gradient(circle, rgba(255,215,0,.8), rgba(255,215,0,.18) 55%, transparent);
  animation: jackflash 1.35s ease-out forwards;
}
@keyframes jackflash {
  0% { opacity: 0; } 12% { opacity: 1; } 30% { opacity: .2; } 45% { opacity: .85; } 60% { opacity: .15; } 80% { opacity: .5; } 100% { opacity: 0; }
}
.spin-modal { text-align: center; }
.spin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 246px; margin: 16px auto 4px; }
.spin-cell {
  background: var(--card-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 4px; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 58px; justify-content: center;
  transition: transform .07s, box-shadow .07s, border-color .07s, background .07s;
}
.spin-cell .ic { font-size: 20px; line-height: 1; }
.spin-cell .lb { font-size: 10px; color: var(--text-dim); }
.spin-cell.active {
  background: linear-gradient(135deg, rgba(246,196,83,.4), rgba(246,196,83,.14));
  border-color: var(--accent); transform: scale(1.14);
  box-shadow: 0 0 14px rgba(246,196,83,.55);
}
.spin-cell.active .lb { color: var(--accent); }
.spin-core { background: var(--card); font-size: 26px; }
.spin-deco { opacity: .55; }
@media (max-width: 420px) { .lot-results { grid-template-columns: repeat(3, 1fr); } }
.lot-cell.butler { border-color: rgba(109,179,242,.45); background: rgba(109,179,242,.08); }
.lot-cell.goodluck { border-color: rgba(150,150,150,.35); background: rgba(150,150,150,.06); }
.lot-cell.goodluck .lb { color: var(--text-dim); }

/* ============ 羊管家 ============ */
.butler-bar {
  display: flex; align-items: center; gap: 6px; margin: 10px 2px 0;
  background: linear-gradient(135deg, rgba(109,179,242,.14), rgba(246,196,83,.10));
  border: 1px solid rgba(109,179,242,.35); border-radius: 12px;
  padding: 8px 12px; font-size: 12px; color: var(--text);
}

/* ============ 邮件 ============ */
.mail-item { cursor: pointer; }
.mail-item.unread { border-color: rgba(246,196,83,.4); }
.mail-item.unread .name { font-weight: 700; }
.mail-item .emoji { font-size: 34px; }
.mail-time { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; }
.mail-body {
  font-size: 14px; line-height: 1.7; color: var(--text); background: var(--bg-soft);
  border-radius: 10px; padding: 12px; margin-bottom: 12px; word-break: break-all;
}
.mail-attach {
  font-size: 13px; margin-bottom: 12px; background: rgba(246,196,83,.1);
  border: 1px dashed rgba(246,196,83,.4); border-radius: 10px; padding: 10px 12px; color: var(--accent);
}
.btn-ghost { background: var(--card-2); color: var(--text-dim); }

/* ============ 好友 ============ */
.friend-search { display: flex; gap: 8px; }
.friend-search input {
  flex: 1; min-width: 0; padding: 11px 14px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 10px; color: var(--text); font-size: 14px; outline: none;
}
.friend-search input:focus { border-color: var(--accent); }
.friend-search .btn { width: auto; padding: 11px 16px; }
.friend-item .emoji { font-size: 32px; }
.friend-item button { padding: 8px 12px; }
.friend-item button.danger { background: var(--card-2); color: var(--danger); border: 1px solid rgba(240,123,123,.35); }

/* ============ 工会 ============ */
.guild-head .guild-name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.guild-notice {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; margin: 10px 0; line-height: 1.6; word-break: break-all;
}
.guild-notice textarea {
  width: 100%; box-sizing: border-box; background: var(--card); border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 8px 10px; font-size: 13px; font-family: inherit; resize: vertical;
}
.guild-actions { display: flex; gap: 8px; margin-top: 4px; }
.guild-actions .btn { flex: 1; }
/* 工会神兽投喂面板（高端暗金风） */
.guild-beast-panel {
  position: relative; overflow: hidden;
  background: linear-gradient(155deg, #17162a 0%, #241f3d 55%, #2b2138 100%);
  border: 1px solid rgba(201,162,39,.55);
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(20,14,40,.45), inset 0 1px 0 rgba(255,220,140,.25);
}
.guild-beast-panel::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(340px 130px at 50% -40px, rgba(255,196,80,.30), transparent 70%),
    radial-gradient(240px 200px at 88% 18%, rgba(255,170,60,.14), transparent 70%);
  pointer-events: none;
}
.guild-beast-panel::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 60px; left: -90px;
  background: linear-gradient(105deg, transparent, rgba(255,230,160,.16), transparent);
  transform: skewX(-18deg);
  animation: beast-shine 5.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes beast-shine { 0% { left: -90px; } 55% { left: 110%; } 100% { left: 110%; } }
.beast-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; position: relative; }
.beast-ico {
  width: 74px; height: 74px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 38% 30%, #3a2f5e, #17142c 72%);
  border: 1px solid rgba(201,162,39,.6);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 22px rgba(255,196,80,.28), inset 0 0 14px rgba(255,196,80,.12);
  position: relative;
}
.beast-ico svg { width: 62px; height: 62px; }
.beast-ico .bstar { animation: beast-star 2.4s ease-in-out infinite; }
.beast-ico .bstar2 { animation-delay: .7s; }
.beast-ico .bstar3 { animation-delay: 1.3s; }
@keyframes beast-star { 0%,100% { opacity: .25; } 50% { opacity: 1; } }
.beast-info { flex: 1; min-width: 0; }
.beast-name {
  font-size: 17px; font-weight: 800; letter-spacing: 1px; color: #f4d47c;
  text-shadow: 0 0 12px rgba(255,200,90,.35);
}
.beast-desc { font-size: 12px; color: #b8aed6; margin-top: 4px; }
.beast-status { display: inline-block; margin-top: 7px; font-size: 11px; padding: 3px 10px; border-radius: 999px; font-weight: 600; }
.beast-status.on {
  color: #ffe9a8; background: linear-gradient(90deg, rgba(255,180,60,.25), rgba(255,220,120,.12));
  border: 1px solid rgba(255,200,90,.5);
  animation: beast-pulse 2.2s ease-in-out infinite;
}
.beast-status.off { color: #9a93b8; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); }
@keyframes beast-pulse { 0%,100% { box-shadow: 0 0 6px rgba(255,190,70,.25); } 50% { box-shadow: 0 0 16px rgba(255,190,70,.55); } }
.guild-beast-panel .kv { color: #cfc7e8; border-bottom: 1px dashed rgba(255,255,255,.09); }
.guild-beast-panel .kv .v { color: #efe6c8; }
.guild-beast-panel .kv .v.gold { color: #ffd977; font-weight: 700; }
.beast-btn {
  background: linear-gradient(135deg, #f7c948, #d99a1b); color: #3a2404; font-weight: 800;
  border: none; box-shadow: 0 4px 14px rgba(240,180,60,.35);
}
.beast-btn:disabled { background: rgba(255,255,255,.08); color: #8d86a8; box-shadow: none; }
.beast-btn.beast-btn-fed {
  background: rgba(255,214,120,.14); color: #d8cfa8; font-weight: 700;
  border: 1px solid rgba(255,214,120,.38); box-shadow: none; opacity: 1;
}
/* 工会商城手动手展开/收起 */
.guild-shop-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: none; border: none; padding: 2px 0; cursor: pointer;
  font-size: 15px; font-weight: 700; color: var(--text); font-family: inherit;
}
.gshop-arrow { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.guild-shop-body { margin-top: 4px; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.member-row:last-child { border-bottom: none; }
.member-row .m-ava {
  width: 34px; height: 34px; border-radius: 50%; background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none;
}
.member-row .m-info { flex: 1; min-width: 0; }
.member-row .m-name { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.role-badge { font-size: 10px; padding: 2px 7px; border-radius: 999px; font-weight: 600; flex: none; }
.role-badge.leader { background: rgba(246,196,83,.16); color: var(--accent); }
.role-badge.member { background: var(--bg-soft); color: var(--text-dim); }
.mini-btn.danger { background: rgba(240,123,123,.12); color: var(--danger); border: 1px solid rgba(240,123,123,.35); }
.field textarea {
  width: 100%; box-sizing: border-box; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 12px; color: var(--text); padding: 10px 12px; font-size: 14px; font-family: inherit; resize: vertical;
}
.field textarea:focus { outline: none; border-color: var(--accent); }

/* ============ 工会商城 & 排行榜 ============ */
.gold { color: var(--accent); }
.guild-rank-panel {
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, #1c1830, #261e38 55%, #1a1726);
  border: 1px solid rgba(246,196,83,.35);
}
.guild-rank-panel::before {
  content: ''; position: absolute; top: -40%; left: -30%; width: 55%; height: 180%;
  background: linear-gradient(105deg, transparent, rgba(246,196,83,.12), transparent);
  transform: rotate(18deg); animation: rank-shine 3.6s linear infinite; pointer-events: none;
}
@keyframes rank-shine { 0% { left: -30%; } 55%, 100% { left: 130%; } }
.guild-rank-panel h3 { position: relative; z-index: 1; color: var(--accent); }
.rank-top3 { position: relative; z-index: 1; display: flex; gap: 10px; align-items: flex-end; justify-content: center; padding: 8px 0 2px; }
.rank-card {
  flex: 1; min-width: 0; text-align: center; position: relative;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px; padding: 12px 6px 10px;
}
.rank-card.rank-1 {
  background: linear-gradient(165deg, rgba(246,196,83,.24), rgba(246,196,83,.05));
  border-color: rgba(246,196,83,.6); box-shadow: 0 0 20px rgba(246,196,83,.28);
  padding-top: 18px;
}
.rank-card.rank-2 { background: linear-gradient(165deg, rgba(198,210,224,.16), rgba(198,210,224,.04)); border-color: rgba(198,210,224,.42); }
.rank-card.rank-3 { background: linear-gradient(165deg, rgba(214,147,88,.20), rgba(214,147,88,.05)); border-color: rgba(214,147,88,.42); }
.rank-card.rank-me { box-shadow: inset 0 0 0 1.5px var(--accent-2), 0 0 14px rgba(95,208,138,.25); }
.rank-crown {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  font-size: 22px; line-height: 1; animation: rank-bounce 2s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(246,196,83,.9));
}
@keyframes rank-bounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-4px); } }
.rank-medal { font-size: 26px; line-height: 1; }
.rank-card.rank-1 .rank-medal { font-size: 32px; }
.rank-nick { font-weight: 700; font-size: 13px; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-num { font-size: 16px; font-weight: 800; color: var(--accent); margin-top: 4px; font-variant-numeric: tabular-nums; text-shadow: 0 0 12px rgba(246,196,83,.4); }
.rank-card.rank-1 .rank-num { font-size: 19px; }
.rank-sub { font-size: 10px; color: var(--text-dim); margin-top: 1px; }
.rank-contrib { font-size: 10px; color: var(--accent-2); margin-top: 3px; font-variant-numeric: tabular-nums; }
.rank-rest { position: relative; z-index: 1; margin-top: 10px; }
.rank-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 10px; font-size: 13px;
}
.rank-row.rank-me { background: rgba(95,208,138,.10); }
.rank-no {
  width: 24px; height: 24px; border-radius: 8px; background: var(--bg-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-dim); flex: none;
}
.rank-row .rank-nick2 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.rank-row .rank-contrib2 { font-size: 11px; color: var(--accent-2); font-variant-numeric: tabular-nums; flex: none; }
.rank-row .rank-val { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); flex: none; }
.rank-row .rank-val i { font-style: normal; font-size: 10px; color: var(--text-dim); font-weight: 400; }

/* ===== 牧场主收益明细 ===== */
.earn-table { margin-top: 10px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.earn-row {
  display: flex; align-items: center; gap: 6px; padding: 8px 10px;
  font-size: 12px; background: var(--bg-soft);
}
.earn-row + .earn-row { border-top: 1px solid var(--border); }
.earn-row > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.earn-row > span:first-child { flex: 1.4; font-weight: 600; }
.earn-row > span:last-child { text-align: right; font-weight: 700; }
.earn-row.earn-head { background: rgba(246,200,95,.10); font-size: 11px; color: var(--text-dim); font-weight: 600; }
.earn-row .gold { color: var(--accent); }
.earn-log { display: flex; flex-direction: column; gap: 4px; }
.earn-log-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  background: var(--bg-soft); border-radius: 8px; font-size: 12px;
}
.earn-log-row > span:first-child { color: var(--text-dim); font-size: 11px; flex: none; font-variant-numeric: tabular-nums; }
.earn-log-row > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); }
.earn-log-row b { flex: none; font-variant-numeric: tabular-nums; color: var(--accent); }

/* ===== 邀请制 ===== */
.gjoin-lock {
  flex: none; font-size: 11px; color: var(--text-dim);
  background: var(--bg-soft); padding: 4px 8px; border-radius: 8px;
}
.invite-card {
  background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px; margin-bottom: 10px;
}
.invite-card:last-child { margin-bottom: 0; }
.invite-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
