/**
 * 开心农场 · 界面样式（PC / H5 共用）
 * 只作用于 .lfarm 作用域，避免污染主题其它页面。
 */

.lfarm {
    --lf-green: #2f9e44;
    --lf-green-2: #63c74d;
    --lf-green-soft: #eaf7e6;
    --lf-gold: #f0b429;
    --lf-gold-soft: #fff6db;
    --lf-ink: #1e2b22;
    --lf-muted: #7c8b80;
    --lf-line: #e6eee7;
    --lf-card: #ffffff;
    --lf-shadow: 0 12px 34px rgba(31, 72, 40, .10);
    --lf-radius: 18px;
    max-width: 1220px;
    margin: 0 auto;
    padding: 18px 16px 48px;
    color: var(--lf-ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.lfarm *,
.lfarm *::before,
.lfarm *::after { box-sizing: border-box; }

/* 桌面端为右侧固定工具条（.jinsom-right-bar）留出安全区，避免盖住侧栏按钮 */
@media (min-width: 1001px) {
    .lfarm { max-width: 1180px; padding-right: 58px; }
}

.lfarm button { font-family: inherit; }

/* ---------------- HUD ---------------- */
.lfarm-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 16px;
    border-radius: var(--lf-radius);
    background: linear-gradient(135deg, rgba(255, 255, 255, .96), rgba(244, 251, 240, .9));
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: var(--lf-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.lfarm-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.lfarm-brand-ico {
    width: 44px; height: 44px; flex: 0 0 auto;
    display: grid; place-items: center;
    font-size: 23px; border-radius: 14px;
    background: radial-gradient(circle at 30% 25%, #b6ef8d, #4bb13a 62%, #2f8a2b);
    box-shadow: 0 6px 14px rgba(58, 145, 52, .32), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.lfarm-brand-txt { min-width: 0; }
.lfarm-brand-txt b {
    display: block; font-size: 17px; letter-spacing: .3px; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lfarm-brand-txt small { display: block; font-size: 11px; color: var(--lf-muted); margin-top: 2px; }

.lfarm-stats { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.lfarm-lv { min-width: 176px; padding: 7px 12px; border-radius: 13px; background: #f2f8ef; border: 1px solid #e2f0dc; }
.lfarm-lv-top { display: flex; align-items: center; gap: 8px; }
.lfarm-lv-badge {
    font-size: 12px; font-weight: 800; color: #fff; letter-spacing: .2px;
    padding: 3px 8px; border-radius: 8px;
    background: linear-gradient(135deg, #6fd05a, #2f9e44);
    box-shadow: 0 3px 8px rgba(47, 158, 68, .28);
    white-space: nowrap;
}
.lfarm-exp { flex: 1; min-width: 90px; height: 8px; border-radius: 6px; background: #d8e6d3; overflow: hidden; box-shadow: inset 0 1px 2px rgba(30, 70, 35, .12); }
.lfarm-exp i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #9ce36f, #43b04f); box-shadow: 0 0 6px rgba(90, 200, 90, .5); transition: width .45s cubic-bezier(.22, .9, .3, 1); }
.lfarm-lv-text { display: block; margin-top: 4px; font-size: 10px; color: var(--lf-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lfarm-coin {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 13px; border-radius: 13px;
    background: linear-gradient(135deg, #fff8e2, #ffefc4);
    border: 1px solid #ffe6a8;
    color: #8a5b00; font-size: 12px; white-space: nowrap;
}
.lfarm-coin > span { font-size: 15px; }
.lfarm-coin b { font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.lfarm-coin small { font-size: 11px; opacity: .78; }

.lfarm-iconbtn {
    display: inline-flex; align-items: center; gap: 5px;
    height: 38px; padding: 0 11px;
    border-radius: 12px; border: 1px solid var(--lf-line);
    background: #fff; color: #4f6255; font-size: 13px; cursor: pointer;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.lfarm-iconbtn em { font-style: normal; font-size: 12px; }
.lfarm-iconbtn:hover { transform: translateY(-1px); border-color: #bfe3b2; box-shadow: 0 5px 12px rgba(47, 120, 50, .12); }
.lfarm-iconbtn:active { transform: translateY(0); }
.lfarm-iconbtn:focus-visible { outline: 2px solid #7cc46a; outline-offset: 2px; }

/* ---------------- 布局 ---------------- */
.lfarm-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 18px;
    margin-top: 16px;
    align-items: stretch;
}
.lfarm-main { min-width: 0; }
.lfarm .lfarm-side { min-width: 0; }

/* ---------------- 场景 ---------------- */
.lfarm-stage {
    position: relative;
    height: clamp(360px, 54vh, 560px);
    border-radius: 22px;
    overflow: hidden;
    background: #b6e3f5;
    box-shadow: 0 18px 44px rgba(24, 66, 34, .18), inset 0 0 0 1px rgba(255, 255, 255, .5);
    isolation: isolate;
}
.lfarm-stage canvas { display: block; width: 100%; height: 100%; max-width: 100%; touch-action: manipulation; }

.lfarm-stage-top {
    position: absolute; left: 14px; top: 14px;
    display: flex; gap: 8px; flex-wrap: wrap;
    pointer-events: none; z-index: 3;
}
.lfarm-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 11px; border-radius: 11px;
    background: rgba(255, 255, 255, .82);
    border: 1px solid rgba(255, 255, 255, .9);
    color: #2f4a36; font-size: 12px; font-weight: 600;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 3px 10px rgba(20, 60, 30, .12);
}

.lfarm-stage-actions {
    position: absolute; right: 14px; bottom: 14px;
    display: flex; gap: 8px; z-index: 4;
}

.lfarm-cta {
    position: relative;
    display: inline-flex; align-items: center; gap: 7px;
    height: 44px; padding: 0 18px;
    border: 0; border-radius: 14px;
    background: linear-gradient(135deg, #7dd85c, #2f9e44);
    color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .3px;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(39, 137, 55, .38);
    transition: transform .15s, box-shadow .15s, opacity .2s;
}
.lfarm-cta span {
    min-width: 22px; height: 22px; padding: 0 6px;
    display: inline-grid; place-items: center;
    border-radius: 11px; background: rgba(255, 255, 255, .26); font-size: 12px;
}
.lfarm-cta:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 26px rgba(39, 137, 55, .44); }
.lfarm-cta:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.lfarm-cta.has-ready::after {
    content: ''; position: absolute; inset: -4px;
    border-radius: 18px; border: 2px solid rgba(140, 240, 120, .75);
    animation: lfarmRing 1.8s ease-out infinite;
    pointer-events: none;
}
@keyframes lfarmRing { 0% { opacity: .9; transform: scale(.98); } 100% { opacity: 0; transform: scale(1.12); } }
.lfarm-cta.is-busy { opacity: .8; }
.lfarm-cta.is-busy span::after { content: '…'; }

.lfarm-tooltip {
    position: absolute; left: 0; top: 0;
    max-width: 230px; padding: 9px 12px;
    border-radius: 12px;
    background: rgba(24, 38, 27, .88);
    color: #fff; font-size: 12px; line-height: 1.45;
    pointer-events: none; opacity: 0;
    transition: opacity .14s;
    z-index: 6;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
    white-space: normal;
}
.lfarm-tooltip.is-show { opacity: 1; }
.lfarm-tooltip b { display: block; font-size: 13px; margin-bottom: 2px; }
.lfarm-tooltip small { color: rgba(255, 255, 255, .76); }

.lfarm-visitbar {
    position: absolute; left: 0; right: 0; top: 0;
    display: none; align-items: center; gap: 12px;
    padding: 12px 14px;
    background: linear-gradient(180deg, rgba(20, 34, 24, .78), rgba(20, 34, 24, 0));
    color: #fff; z-index: 5;
}
.lfarm-visitbar.is-show { display: flex; }
.lfarm-visitbar .lfarm-visit-info { display: flex; flex-direction: column; min-width: 0; }
.lfarm-visitbar .lfarm-visit-info b { font-size: 14px; }
.lfarm-visitbar .lfarm-visit-info small { font-size: 11px; opacity: .8; }

.lfarm-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    height: 36px; padding: 0 14px;
    border: 1px solid transparent; border-radius: 11px;
    background: var(--lf-green); color: #fff;
    font-size: 13px; cursor: pointer;
    transition: filter .15s, transform .15s, background .15s;
}
.lfarm-btn:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.lfarm-btn:disabled { opacity: .45; cursor: not-allowed; }
.lfarm-btn--ghost { background: rgba(255, 255, 255, .92); color: #34503c; border-color: rgba(255, 255, 255, .8); }
.lfarm-btn--ghost:hover { background: #fff; }
.lfarm-btn--sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: 9px; }

.lfarm-loading {
    position: absolute; inset: 0; display: none;
    align-items: center; justify-content: center;
    background: linear-gradient(135deg, #cdeaf6, #e8f7dd);
    color: #3d6b4a; font-size: 13px; z-index: 8;
}
.lfarm-loading.is-show { display: flex; }
.lfarm-loading::before {
    content: ''; width: 22px; height: 22px; margin-right: 10px;
    border-radius: 50%; border: 3px solid rgba(47, 158, 68, .22);
    border-top-color: #2f9e44; animation: lfarmSpin .8s linear infinite;
}
@keyframes lfarmSpin { to { transform: rotate(360deg); } }

.lfarm-error {
    position: absolute; inset: 0; display: none;
    flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    background: rgba(247, 251, 245, .96); color: #4b5d50; font-size: 13px; z-index: 9;
    text-align: center; padding: 20px;
}
.lfarm-error.is-show { display: flex; }
.lfarm-error span { font-size: 30px; }

.lfarm-login {
    position: absolute; inset: 0; display: none;
    align-items: center; justify-content: center; flex-direction: column; gap: 12px;
    background: rgba(18, 30, 22, .62); color: #fff; z-index: 10; text-align: center;
}
.lfarm-login.is-open { display: flex; }
.lfarm-login a {
    display: inline-flex; align-items: center; height: 40px; padding: 0 20px;
    border-radius: 12px; background: #7dd85c; color: #14351c; font-weight: 700; text-decoration: none;
}

/* ---------------- 种子商店 ---------------- */
.lfarm-dock {
    min-width: 0;
    margin-top: 14px; padding: 14px 16px 16px;
    border-radius: var(--lf-radius);
    background: var(--lf-card);
    border: 1px solid var(--lf-line);
    box-shadow: var(--lf-shadow);
}
.lfarm-dock-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.lfarm-dock-head h2 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.lfarm-dock-head h2::before { content: '🛒'; font-size: 15px; }
.lfarm-dock-head span { display: block; font-size: 11.5px; color: var(--lf-muted); max-width: 62%; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lfarm-seeds {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px;
    max-height: 232px;
    overflow-y: auto;
    padding: 2px;
    scrollbar-width: thin;
}
.lfarm-seeds::-webkit-scrollbar { width: 6px; }
.lfarm-seeds::-webkit-scrollbar-thumb { background: #d7e3d5; border-radius: 6px; }

.lfarm-seed {
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 12px 8px 9px;
    border-radius: 14px;
    border: 1.5px solid #e8efe6;
    background: linear-gradient(180deg, #ffffff, #f8fbf6);
    cursor: pointer; text-align: center;
    transition: transform .16s, box-shadow .16s, border-color .16s;
    overflow: hidden;
}
.lfarm-seed::before {
    content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
    background: linear-gradient(90deg, #a7d98e, #6fbf4f);
    opacity: .65;
}
.lfarm-seed--t2::before { background: linear-gradient(90deg, #9ad6ff, #4f9ff0); }
.lfarm-seed--t3::before { background: linear-gradient(90deg, #d2b6ff, #8a63e8); }
.lfarm-seed--t4::before { background: linear-gradient(90deg, #ffcf87, #f08c2e); }
.lfarm-seed--t5::before { background: linear-gradient(90deg, #ffa9c0, #e5456f); }
.lfarm-seed:hover { transform: translateY(-3px); border-color: #b7e0a6; box-shadow: 0 10px 20px rgba(47, 120, 50, .14); }
.lfarm-seed.is-sel {
    border-color: #4caf50;
    background: linear-gradient(180deg, #f4fdef, #e8f8df);
    box-shadow: 0 8px 18px rgba(56, 142, 60, .22), inset 0 0 0 1px rgba(76, 175, 80, .35);
}
.lfarm-seed.is-sel::after {
    content: '✓'; position: absolute; right: 6px; top: 6px;
    width: 17px; height: 17px; border-radius: 50%;
    display: grid; place-items: center;
    background: #4caf50; color: #fff; font-size: 10px; font-weight: 700;
}
.lfarm-seed.is-lock { filter: grayscale(.72); opacity: .7; cursor: not-allowed; }
.lfarm-seed.is-lock:hover { transform: none; box-shadow: none; border-color: #e8efe6; }
.lfarm-seed-lock {
    position: absolute; right: 5px; top: 5px;
    font-size: 9px; color: #fff; background: rgba(90, 100, 94, .82);
    padding: 2px 5px; border-radius: 6px; letter-spacing: .2px;
}
.lfarm-seed-lock:empty { display: none; }
.lfarm-seed-emoji { font-size: 27px; line-height: 1.2; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .14)); }
.lfarm-seed-name { font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lfarm-seed-meta { font-size: 10.5px; color: #9a7b4a; display: flex; gap: 4px; align-items: baseline; }
.lfarm-seed-meta b { color: #c06a12; font-size: 11.5px; }
.lfarm-seed-meta i { font-style: normal; color: #4d9a45; }
.lfarm-seed-foot { display: flex; gap: 6px; align-items: center; font-size: 10px; color: #93a096; }
.lfarm-seed-exp { color: #b07f16; }

/* ---------------- 侧栏 ---------------- */
.lfarm-side { display: flex; flex-direction: column; gap: 14px; }
.lfarm-card {
    border-radius: var(--lf-radius);
    background: var(--lf-card);
    border: 1px solid var(--lf-line);
    box-shadow: var(--lf-shadow);
    overflow: hidden;
}
.lfarm-guide { flex: 1; display: flex; flex-direction: column; padding: 14px 15px 15px; }
.lfarm-guide h3 { margin: 0 0 10px; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.lfarm-guide-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.lfarm-guide-list li { display: flex; gap: 8px; align-items: flex-start; }
.lfarm-guide-list li b {
    flex: 0 0 auto; padding: 2px 7px; border-radius: 7px;
    background: #eef8ea; color: #2f7d3c; font-size: 11px; font-weight: 700; line-height: 1.5;
}
.lfarm-guide-list li span { font-size: 11.5px; line-height: 1.55; color: #5d6f60; }
.lfarm-guide-meta {
    margin-top: auto; padding-top: 12px; border-top: 1px dashed #e8f0e6;
    font-size: 10.5px; color: #93a096; line-height: 1.6;
}
.lfarm-tabs { display: flex; padding: 8px; gap: 6px; background: #f6faf4; border-bottom: 1px solid var(--lf-line); }
.lfarm-tab {
    flex: 1; height: 34px; border: 0; border-radius: 10px;
    background: transparent; color: #617465; font-size: 13px; cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}
.lfarm-tab.is-active { background: #fff; color: #2f7d3c; font-weight: 700; box-shadow: 0 3px 10px rgba(40, 100, 45, .12); }

.lfarm-panel { display: none; padding: 12px 14px 14px; }
.lfarm-panel.is-active { display: block; }
.lfarm-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.lfarm-panel-head h3 { margin: 0; font-size: 13px; }
.lfarm-panel-head small { font-size: 10.5px; color: var(--lf-muted); }

.lfarm-friends { display: flex; flex-direction: column; gap: 8px; max-height: 330px; overflow-y: auto; padding-right: 2px; }
.lfarm-friend {
    display: flex; align-items: center; gap: 9px;
    padding: 8px; border-radius: 12px; background: #f8fbf6;
    border: 1px solid #edf3ea;
}
.lfarm-friend img, .lfarm-friend-ph {
    width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%; object-fit: cover;
    background: #e6f0e2; display: grid; place-items: center; font-size: 17px;
}
.lfarm-friend-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lfarm-friend-info b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lfarm-friend-info small { font-size: 10.5px; color: var(--lf-muted); }
.lfarm-friend-info .is-ready { color: #e07b1a; }

/* ---------------- 土地开垦 / 黑土地 ---------------- */
.lfarm-land { display: flex; flex-direction: column; gap: 6px; max-height: 318px; overflow-y: auto; padding-right: 2px; }
.lfarm-land-row {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 9px; border-radius: 11px;
    background: #f8fbf6; border: 1px solid #edf3ea;
}
.lfarm-land-no {
    width: 20px; height: 20px; flex: 0 0 auto; border-radius: 6px;
    display: grid; place-items: center;
    background: #e8f2e3; color: #4a7a52; font-size: 11px; font-weight: 700;
}
.lfarm-land-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lfarm-land-main b { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lfarm-land-main small { font-size: 10.5px; color: var(--lf-muted); }
.lfarm-land-row.is-soil {
    background: linear-gradient(180deg, #f7f3ec, #fdfbf7);
    border-color: #e6ddcd;
}
.lfarm-land-row.is-soil .lfarm-land-no { background: #3b2c1e; color: #f4e8d2; }
.lfarm-land-row.is-lock { opacity: .6; }
.lfarm-land-row.is-lock .lfarm-land-no { background: #eef1ee; color: #9aa79d; }
.lfarm-soil-tag {
    flex: 0 0 auto; padding: 2px 8px; border-radius: 7px;
    background: #3b2c1e; color: #f4e8d2; font-size: 10.5px; font-weight: 700; line-height: 1.6;
}
.lfarm-soil-tag.is-off { background: #eef1ee; color: #93a096; }
.lfarm-soil-note {
    margin-top: 10px; padding: 9px 11px; border-radius: 11px;
    background: #fbf7f0; border: 1px dashed #e6ddcd;
    display: flex; flex-direction: column; gap: 3px;
}
.lfarm-soil-note b { font-size: 11.5px; color: #6b5540; }
.lfarm-soil-note span { font-size: 11px; line-height: 1.6; color: #8b7a66; }
.lfarm-tip-soil {
    display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px;
    background: #3b2c1e; color: #f4e8d2; font-size: 9.5px; font-style: normal; font-weight: 700;
    vertical-align: 1px;
}
.lfarm-unlock-plot { font-size: 12.5px; color: #6b5540; }

.lfarm-logs { display: flex; flex-direction: column; gap: 2px; max-height: 352px; overflow-y: auto; }
.lfarm-log { display: flex; align-items: center; gap: 8px; padding: 8px 2px; border-bottom: 1px dashed #eef3ec; }
.lfarm-log:last-child { border-bottom: 0; }
.lfarm-log-ico { font-size: 15px; }
.lfarm-log-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lfarm-log-main b { font-size: 12.5px; font-weight: 600; }
.lfarm-log-main small { font-size: 10.5px; color: var(--lf-muted); }
.lfarm-log-side { text-align: right; display: flex; flex-direction: column; }
.lfarm-log-side b { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.lfarm-log-side b.is-plus { color: #d98218; }
.lfarm-log-side b.is-minus { color: #3f9a4b; }
.lfarm-log-side small { font-size: 9.5px; color: #a9b5ab; }

.lfarm-empty {
    font-size: 12px; color: #93a096; line-height: 1.7;
    padding: 18px 12px; text-align: center;
    background: #f8fbf6; border-radius: 12px; border: 1px dashed #e3ece0;
}

/* ---------------- 未开启 ---------------- */
.lfarm-disabled { padding: 46px 0 60px; }
.lfarm-disabled-card {
    max-width: 520px; margin: 0 auto; padding: 44px 28px;
    text-align: center; border-radius: 24px;
    background: radial-gradient(120% 100% at 50% 0%, #f2fbeb, #ffffff 60%);
    border: 1px solid #e6f0e0;
    box-shadow: 0 20px 50px rgba(40, 90, 45, .10);
}
.lfarm-disabled-ico { font-size: 52px; display: block; margin-bottom: 12px; }
.lfarm-disabled-card h1 { margin: 0 0 10px; font-size: 21px; color: #2f5d3a; }
.lfarm-disabled-card p { margin: 0; font-size: 13px; line-height: 1.8; color: #7b8b7f; }

/* ---------------- 提示 / 弹窗 ---------------- */
.lfarm-toast {
    position: fixed; left: 50%; bottom: 34px;
    transform: translate(-50%, 14px);
    max-width: min(86vw, 420px);
    padding: 11px 18px;
    border-radius: 14px;
    background: rgba(24, 38, 27, .93);
    color: #fff; font-size: 13px; line-height: 1.45;
    opacity: 0; pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 99999;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .28);
    text-align: center;
}
.lfarm-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.lfarm-toast--error { background: rgba(150, 42, 34, .95); }

.lfarm-modal {
    position: fixed; inset: 0;
    display: none; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(15, 28, 18, .55);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    z-index: 99998;
}
.lfarm-modal.is-open { display: flex; animation: lfarmFade .22s ease-out; }
@keyframes lfarmFade { from { opacity: 0; } to { opacity: 1; } }
.lfarm-modal-card {
    width: min(420px, 100%);
    border-radius: 22px;
    background: linear-gradient(160deg, #ffffff, #f4fbef);
    padding: 26px 24px 22px;
    text-align: center;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .3);
    animation: lfarmPop .34s cubic-bezier(.2, 1.2, .4, 1);
    position: relative;
    overflow: hidden;
}
.lfarm-modal-card::before {
    content: ''; position: absolute; inset: -40% -20% auto; height: 60%;
    background: radial-gradient(ellipse at center, rgba(255, 219, 130, .55), transparent 68%);
    pointer-events: none;
}
@keyframes lfarmPop { from { transform: translateY(16px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.lfarm-modal-ico { font-size: 46px; line-height: 1; margin-bottom: 6px; position: relative; }
.lfarm-modal-card h3 { margin: 0 0 8px; font-size: 20px; letter-spacing: .4px; color: #2a6b35; }
.lfarm-modal-card p { margin: 0 0 6px; font-size: 13px; color: #56685b; line-height: 1.7; }
.lfarm-modal-card p b { color: #c07a12; }
.lfarm-unlock { margin-top: 14px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .7); border: 1px dashed #d8ead0; }
.lfarm-unlock > span { font-size: 11px; color: #8aa08d; }
.lfarm-unlock > div { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.lfarm-unlock-item {
    display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
    min-width: 62px; padding: 8px 6px; border-radius: 12px;
    background: #fff; border: 1px solid #e8f1e4; font-size: 22px;
}
.lfarm-unlock-item i { font-style: normal; font-size: 10.5px; color: #5f7264; }
.lfarm-modal-actions { margin-top: 18px; }
.lfarm-modal-actions .lfarm-btn { height: 40px; padding: 0 26px; border-radius: 12px; font-weight: 600; }

/* ---------------- 状态修饰 ---------------- */
.lfarm.is-visiting .lfarm-dock { opacity: .55; pointer-events: none; filter: saturate(.7); }
.lfarm.is-visiting .lfarm-stage-actions { display: none; }
.lfarm.is-visiting .lfarm-stage-top { opacity: 0; pointer-events: none; }
.lfarm[data-daypart="night"] .lfarm-chip { background: rgba(30, 44, 66, .58); color: #e9f2ff; border-color: rgba(255, 255, 255, .18); }

/* ---------------- H5 ---------------- */
.lfarm[data-mode="h5"] { padding: 10px 10px 30px; }
.lfarm[data-mode="h5"] .lfarm-hud { padding: 10px 12px; border-radius: 16px; gap: 8px; }
.lfarm[data-mode="h5"] .lfarm-brand-ico { width: 38px; height: 38px; font-size: 20px; border-radius: 12px; }
.lfarm[data-mode="h5"] .lfarm-brand-txt b { font-size: 15px; }
.lfarm[data-mode="h5"] .lfarm-brand-txt small { display: none; }
.lfarm[data-mode="h5"] .lfarm-stats { gap: 6px; flex-wrap: nowrap; }
.lfarm[data-mode="h5"] .lfarm-lv { min-width: 0; flex: 1 1 108px; padding: 6px 9px; }
.lfarm[data-mode="h5"] .lfarm-exp { min-width: 36px; height: 7px; }
.lfarm[data-mode="h5"] .lfarm-lv-text { display: none; }
.lfarm[data-mode="h5"] .lfarm-coin { padding: 7px 10px; }
.lfarm[data-mode="h5"] .lfarm-coin b { font-size: 15px; }
.lfarm[data-mode="h5"] .lfarm-coin small { display: none; }
.lfarm[data-mode="h5"] .lfarm-iconbtn { height: 34px; padding: 0 8px; font-size: 12px; }
.lfarm[data-mode="h5"] .lfarm-iconbtn em { display: none; }
.lfarm[data-mode="h5"] .lfarm-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 10px; }
.lfarm[data-mode="h5"] .lfarm-stage { height: 56vh; min-height: 330px; border-radius: 18px; }
.lfarm[data-mode="h5"] .lfarm-stage-top { left: 10px; top: 10px; gap: 6px; }
.lfarm[data-mode="h5"] .lfarm-chip { padding: 5px 9px; font-size: 11px; }
.lfarm[data-mode="h5"] .lfarm-stage-actions { right: 10px; bottom: 10px; }
.lfarm[data-mode="h5"] .lfarm-cta { height: 40px; padding: 0 14px; font-size: 13px; border-radius: 12px; }
.lfarm[data-mode="h5"] .lfarm-dock { padding: 12px 12px 14px; margin-top: 0; }
.lfarm[data-mode="h5"] .lfarm-seeds {
    display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden;
    max-height: none; padding-bottom: 6px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
.lfarm[data-mode="h5"] .lfarm-seed { flex: 0 0 96px; scroll-snap-align: start; padding: 10px 7px 8px; }
.lfarm[data-mode="h5"] .lfarm-seed-emoji { font-size: 24px; }
.lfarm[data-mode="h5"] .lfarm-card { border-radius: 16px; }
.lfarm[data-mode="h5"] .lfarm-friends { max-height: none; }
.lfarm[data-mode="h5"] .lfarm-logs { max-height: none; }
.lfarm[data-mode="h5"] .lfarm-tooltip { font-size: 11px; max-width: 190px; }
.lfarm[data-mode="h5"] .lfarm-toast { bottom: 22px; }

@media (max-width: 1000px) {
    .lfarm-layout { grid-template-columns: minmax(0, 1fr); }
    .lfarm-side { order: 3; }
    .lfarm-friends, .lfarm-logs, .lfarm-land { max-height: 300px; }
}

@media (max-width: 720px) {
    .lfarm { padding: 12px 10px 36px; }
    .lfarm-hud { flex-wrap: wrap; }
    .lfarm-brand { flex: 1 1 auto; }
    .lfarm-stats { flex: 1 1 100%; justify-content: space-between; }
    .lfarm-lv { flex: 1 1 auto; min-width: 0; }
    .lfarm-coin { flex: 0 0 auto; }
    .lfarm-stage { height: 56vh; min-height: 320px; }
    .lfarm-seeds { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); max-height: 250px; }
    .lfarm-tooltip { max-width: 180px; }
    .lfarm-tab { font-size: 12px; height: 32px; }
    .lfarm-chip { font-size: 11px; padding: 5px 9px; }
    .lfarm-land { max-height: 280px; }
}

@media (prefers-reduced-motion: reduce) {
    .lfarm *, .lfarm *::before, .lfarm *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ---------------- 3D 引擎叠加层（徽标 / 浮字） ---------------- */
.lfarm-badges3d {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
    overflow: hidden;
}
.lfarm-badge3d {
    position: absolute;
    transform: translate(-50%, -100%);
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
    color: #6b4300;
    background: linear-gradient(180deg, #ffe07a, #f0a318);
    box-shadow: 0 2px 6px rgba(80, 50, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .62);
    will-change: left, top;
}
.lfarm-badge3d.is-steal {
    color: #632f00;
    background: linear-gradient(180deg, #ffd08a, #ef8a2c);
}
.lfarm-float3d {
    position: absolute;
    transform: translate(-50%, -100%);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    pointer-events: none;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .45), 0 0 12px rgba(255, 210, 90, .8);
    animation: lfarm-float3d-up 1.4s cubic-bezier(.2, .8, .3, 1) forwards;
}
@keyframes lfarm-float3d-up {
    0% { opacity: 0; transform: translate(-50%, -100%) scale(.72); }
    18% { opacity: 1; transform: translate(-50%, -132%) scale(1.06); }
    100% { opacity: 0; transform: translate(-50%, -250%) scale(1); }
}
.lfarm[data-mode="h5"] .lfarm-badge3d { font-size: 10px; padding: 1px 6px; }
/* 地块越多格子越小，徽标按密度降级，防止相邻地块的“可收”压叠 */
.lfarm-badges3d.is-dense .lfarm-badge3d { font-size: 10px; padding: 1px 5px; }
.lfarm-badges3d.is-tight .lfarm-badge3d {
    font-size: 9px;
    padding: 0 4px;
    line-height: 1.35;
    box-shadow: 0 1px 4px rgba(80, 50, 0, .28);
}
