:root {
  --bg: #071522;
  --bg-deep: #091a2c;
  --surface: #0e2237;
  --surface-2: #132b43;
  --surface-3: #1a3652;
  --text: #f5f9ff;
  --text-2: #c9d8e7;
  --text-3: #9db1c5;
  --line: #29465f;
  --line-strong: #3e607c;
  --cyan: #69e7d2;
  --cyan-strong: #28cdb8;
  --cyan-dark: #073d42;
  --blue: #79baff;
  --violet: #ab96ff;
  --coral: #ff8196;
  --green: #78dda3;
  --danger: #ff788d;
  --radius: 8px;
  --header-height: 70px;
  --nav-height: calc(74px + env(safe-area-inset-bottom));
  color: var(--text);
  background: var(--bg);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--bg); color-scheme: dark; }
body { min-width: 320px; min-height: 100%; margin: 0; overflow-x: hidden; color: var(--text); background: var(--bg); }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
svg.icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
::selection { color: #041a22; background: var(--cyan); }

.skip-link { position: fixed; z-index: 200; top: 10px; left: 10px; padding: 10px 14px; color: #041a22; background: var(--cyan); border-radius: 6px; transform: translateY(-160%); transition: transform .18s ease; }
.skip-link:focus { transform: translateY(0); }
.splash { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--text); background: var(--bg); animation: splash-out .3s ease 1s forwards; }
.splash img { width: 72px; height: 72px; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .32)); animation: splash-in .45s cubic-bezier(.2, .8, .2, 1) both; }
.splash strong { font-size: 18px; letter-spacing: 0; animation: splash-in .45s .06s cubic-bezier(.2, .8, .2, 1) both; }
.splash-line { display: block; width: 86px; height: 3px; overflow: hidden; background: var(--surface-3); border-radius: 3px; }
.splash-line i { display: block; width: 34px; height: 100%; background: var(--cyan); animation: splash-line 1s ease-in-out infinite; }
@keyframes splash-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes splash-out { to { opacity: 0; visibility: hidden; pointer-events: none; } }
@keyframes splash-line { 0% { transform: translateX(-100%); } 50%, 100% { transform: translateX(270%); } }
@keyframes spin { to { transform: rotate(360deg); } }

.app-shell { min-height: 100svh; padding-bottom: var(--nav-height); }
.app-bar { position: sticky; z-index: 30; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: var(--header-height); padding: 8px clamp(14px, 4vw, 42px); background: rgba(7, 21, 34, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(16px); }
.brand-button, .connection-button { display: inline-flex; align-items: center; min-height: 48px; border: 0; background: transparent; }
.brand-button { min-width: 0; gap: 10px; padding: 4px 8px 4px 0; text-align: left; }
.brand-button img { width: 38px; height: 38px; flex: 0 0 38px; }
.brand-button span { display: grid; min-width: 0; gap: 2px; }
.brand-button strong { overflow: hidden; font-size: 14px; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.brand-button small { color: var(--text-3); font-size: 10px; line-height: 1.2; }
.connection-button { max-width: 132px; gap: 8px; padding: 7px 3px 7px 12px; color: var(--text-3); border-left: 1px solid var(--line); font-size: 11px; }
.connection-button > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-button .icon { width: 16px; height: 16px; }
.connection-dot { width: 8px; height: 8px; flex: 0 0 8px; background: var(--text-3); border-radius: 50%; box-shadow: 0 0 0 4px rgba(157, 177, 197, .12); }
.connection-button.is-online { color: var(--cyan); }
.connection-button.is-online .connection-dot { background: var(--cyan); box-shadow: 0 0 0 4px rgba(105, 231, 210, .13); }
.connection-button.is-error { color: var(--coral); }
.connection-button.is-error .connection-dot { background: var(--coral); box-shadow: 0 0 0 4px rgba(255, 129, 150, .14); }
.network-banner { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 8px 16px; color: #ffd9df; background: #52263a; border-bottom: 1px solid #7d3b51; font-size: 12px; }
.network-banner .icon { width: 16px; height: 16px; }

main { min-height: calc(100svh - var(--header-height)); }
main:focus { outline: none; }
.page { width: min(100%, 1040px); margin: 0 auto; padding: 24px clamp(16px, 4vw, 44px) 48px; animation: page-in .24s ease both; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
.home-page { padding-top: 18px; }
.overview-heading, .page-heading { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 152px; margin: 0 calc(clamp(16px, 4vw, 44px) * -1) 26px; padding: 26px clamp(18px, 5vw, 48px); overflow: hidden; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.overview-heading::after, .page-heading::after { position: absolute; top: 0; right: 0; width: 84px; height: 100%; background: var(--surface-2); border-left: 1px solid var(--line); opacity: .38; content: ""; }
.overview-heading > div, .page-heading > div { position: relative; z-index: 1; min-width: 0; }
.eyebrow, .page-heading > div > span, .account-hero > div > span, .auth-intro > span { display: inline-flex; align-items: center; gap: 8px; color: var(--cyan); font-size: 11px; font-weight: 750; letter-spacing: 0; }
.eyebrow i { width: 7px; height: 7px; background: var(--coral); border-radius: 50%; box-shadow: 0 0 0 4px rgba(255, 129, 150, .12); }
.overview-heading h1, .page-heading h1 { margin: 10px 0 7px; color: var(--text); font-size: 34px; line-height: 1.15; letter-spacing: 0; }
.overview-heading p, .page-heading p { max-width: 620px; margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.6; }

.dashboard-section { margin-top: 28px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-heading > div > span { display: block; color: var(--cyan); font-size: 10px; font-weight: 700; }
.section-heading h2 { margin: 5px 0 0; font-size: 22px; line-height: 1.2; }
.overview-count { flex: 0 0 auto; color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.dashboard-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.dashboard-card { display: grid; grid-template-columns: 54px minmax(0, 1fr) 18px; align-items: center; gap: 14px; min-height: 94px; padding: 14px 16px; color: var(--text); text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: background-color .16s ease, border-color .16s ease; }
.dashboard-card::after { grid-column: 3; grid-row: 1; color: var(--text-3); font-size: 24px; line-height: 1; content: "›"; }
.dashboard-card:hover { background: var(--surface-2); border-color: var(--line-strong); }
.dashboard-card:active { background: var(--surface-3); }
.dashboard-card > div { grid-column: 2; grid-row: 1; min-width: 0; }
.dashboard-card strong { display: block; font-size: 16px; }
.dashboard-card small { display: block; margin-top: 5px; overflow-wrap: anywhere; color: var(--text-3); font-size: 11px; line-height: 1.45; }
.dashboard-card .card-icon { grid-column: 1; grid-row: 1; display: grid; place-items: center; width: 52px; height: 52px; color: var(--violet); background: #2e2858; border: 1px solid #4c447e; border-radius: var(--radius); }
.dashboard-card:nth-child(2) .card-icon { color: var(--cyan); background: #123e45; border-color: #27606a; }
.dashboard-card:nth-child(3) .card-icon { color: var(--blue); background: #1d355a; border-color: #36577e; }
.dashboard-card .card-icon .icon { width: 24px; height: 24px; stroke-width: 2; }

.icon-button { position: relative; z-index: 2; display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; padding: 0; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius); transition: color .16s ease, background-color .16s ease, border-color .16s ease; }
.icon-button:hover { color: var(--cyan); background: var(--surface-3); border-color: var(--cyan-strong); }
.icon-button:active { background: #20415f; }
.icon-button-accent { color: #06242d; background: var(--cyan); border-color: var(--cyan); }
.icon-button-accent:hover { color: #041b22; background: #8cf1df; border-color: #8cf1df; }
.segmented { display: flex; width: 100%; min-height: 58px; margin-bottom: 18px; padding: 4px; background: #081827; border: 1px solid var(--line); border-radius: var(--radius); }
.segmented button { min-width: 0; min-height: 48px; flex: 1; padding: 8px 14px; color: var(--text-3); background: transparent; border: 0; border-radius: 6px; font-size: 13px; transition: color .16s ease, background-color .16s ease; }
.segmented button[aria-selected="true"] { color: #05222a; background: var(--cyan); font-weight: 750; }
.content-region { min-height: 160px; }

.empty-state { display: grid; justify-items: start; gap: 10px; min-height: 172px; padding: 22px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty-state .empty-icon { display: grid; place-items: center; width: 46px; height: 46px; color: var(--cyan); background: #123e45; border: 1px solid #27606a; border-radius: var(--radius); }
.empty-state h2 { margin: 2px 0 0; font-size: 17px; }
.empty-state p { max-width: 560px; margin: 0; color: var(--text-3); font-size: 12px; line-height: 1.6; }
.empty-state .button { margin-top: 4px; }
.empty-state .empty-icon.is-loading .icon { animation: spin .8s linear infinite; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 17px; border: 1px solid transparent; border-radius: var(--radius); font-size: 13px; font-weight: 750; transition: color .16s ease, background-color .16s ease, border-color .16s ease, opacity .16s ease; }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button-primary { color: #05242c; background: var(--cyan); border-color: var(--cyan); }
.button-primary:hover { background: #8cf1df; border-color: #8cf1df; }
.button-primary:active { background: var(--cyan-strong); border-color: var(--cyan-strong); }
.button-secondary { color: var(--text-2); background: var(--surface-2); border-color: var(--line-strong); }
.button-secondary:hover { color: var(--text); background: var(--surface-3); border-color: var(--cyan-strong); }
.button-danger { color: #fff; background: #a73a53; border-color: #c94e67; }
.button-danger:hover { background: #bc425c; }
.button-wide { width: 100%; }
.button .icon { width: 18px; height: 18px; }
.is-loading .icon { animation: spin .8s linear infinite; }
.is-loading { pointer-events: none; }

.merchant-list { display: grid; grid-template-columns: 1fr; gap: 10px; }
.merchant-card { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 14px; min-height: 122px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.item-art { display: grid; place-items: center; width: 62px; height: 62px; overflow: hidden; color: var(--cyan); background: #0a1b2b; border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: 18px; font-weight: 800; }
.item-art img { width: 100%; height: 100%; object-fit: contain; }
.merchant-main { min-width: 0; }
.merchant-main strong { display: block; overflow-wrap: anywhere; font-size: 15px; }
.merchant-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; color: var(--text-3); font-size: 10px; }
.status-tag { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 7px; color: var(--cyan); background: #123e45; border: 1px solid #27606a; border-radius: 5px; font-size: 10px; font-weight: 700; }
.status-tag.is-muted { color: var(--text-3); background: #172b3e; border-color: var(--line); }
.merchant-price { margin-top: 12px; color: var(--text-3); font-size: 11px; }
.merchant-price b { color: var(--violet); font-size: 17px; font-variant-numeric: tabular-nums; }
.history-list { display: grid; gap: 10px; }
.history-day { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.history-day header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.history-day h2 { margin: 0; font-size: 15px; }
.history-day header span { color: var(--text-3); font-size: 11px; }
.history-items { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 12px; }
.history-items span { padding: 6px 8px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; font-size: 11px; }

.uid-switcher { display: flex; gap: 8px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: thin; }
.uid-chip { display: inline-flex; align-items: center; gap: 7px; min-width: max-content; min-height: 48px; padding: 8px 12px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: 12px; }
.uid-chip[aria-selected="true"] { color: #05242c; background: var(--cyan); border-color: var(--cyan); font-weight: 750; }
.uid-chip small { color: inherit; opacity: .72; font-size: 10px; }
.garden-overview { display: grid; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.garden-identity { display: grid; align-content: center; min-height: 104px; padding: 16px; border-bottom: 1px solid var(--line); }
.garden-identity h2 { margin: 0 0 7px; overflow-wrap: anywhere; font-size: 22px; }
.garden-levels { margin: 0; color: var(--text-3); font-size: 11px; line-height: 1.6; }
.garden-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.garden-metric { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 78px; padding: 12px; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.garden-metric:nth-child(odd) { border-left: 0; }
.garden-metric:nth-child(-n+2) { border-top: 0; }
.garden-metric-icon { display: grid; place-items: center; width: 36px; height: 36px; color: var(--cyan); background: #123e45; border-radius: 6px; }
.garden-metric-accent .garden-metric-icon { color: var(--violet); background: #2e2858; }
.garden-metric-warm .garden-metric-icon { color: var(--coral); background: #4b2639; }
.garden-metric-muted .garden-metric-icon { color: var(--blue); background: #1d355a; }
.garden-metric-icon .icon { width: 18px; height: 18px; }
.garden-metric > span:last-child { display: grid; min-width: 0; gap: 3px; }
.garden-metric small { color: var(--text-3); font-size: 9px; }
.garden-metric strong { font-size: 18px; font-variant-numeric: tabular-nums; }
.garden-alert { display: flex; align-items: flex-start; gap: 11px; min-height: 64px; margin-top: 10px; padding: 13px 14px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.garden-alert > .icon { width: 21px; height: 21px; color: var(--green); }
.garden-alert.is-ready { border-color: #39755d; background: #15382f; }
.garden-alert > div { display: grid; min-width: 0; gap: 3px; }
.garden-alert strong { font-size: 13px; }
.garden-alert span { overflow-wrap: anywhere; color: var(--text-3); font-size: 11px; line-height: 1.45; }
.garden-tabs { margin-top: 18px; }
.data-section { margin-top: 20px; }
.data-section > header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 11px; }
.data-section h2 { margin: 0; font-size: 16px; }
.data-section > header > span { color: var(--text-3); font-size: 11px; }
.guard-section { padding-top: 18px; border-top: 1px solid var(--line); }
.empty-copy { margin: 0; color: var(--text-3); font-size: 12px; }

.pet-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pet-card { display: grid; justify-items: center; align-content: start; gap: 7px; min-width: 0; min-height: 216px; padding: 12px 8px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pet-card.is-guard { border-color: #446d8e; }
.pet-visual { position: relative; display: grid; justify-items: center; width: 92px; min-height: 94px; }
.pet-slot { display: grid; place-items: center; width: 82px; height: 82px; overflow: hidden; color: var(--cyan); background: #091b2b; border: 2px solid #365a76; border-radius: 50%; font-size: 20px; font-weight: 800; }
.pet-slot img, .plant-art img { width: 100%; height: 100%; object-fit: contain; }
.image-fallback { display: grid; place-items: center; width: 100%; height: 100%; }
.pet-number { position: relative; z-index: 2; min-height: 20px; margin-top: -7px; padding: 3px 7px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
.egg-badge { position: absolute; z-index: 3; top: -2px; right: 0; display: grid; place-items: center; width: 28px; height: 28px; color: #fff; background: #bc4762; border: 3px solid var(--surface); border-radius: 7px; box-shadow: 0 4px 10px rgba(0, 0, 0, .28); }
.egg-badge .icon { width: 14px; height: 14px; stroke-width: 2; }
.pet-main { width: 100%; min-width: 0; }
.pet-card h3 { margin: 0; overflow-wrap: anywhere; font-size: 13px; line-height: 1.35; }
.pet-card p { margin: 4px 0 0; color: var(--text-3); font-size: 10px; }
.pet-note { display: block; margin-top: 6px; color: var(--text-3); font-size: 9px; line-height: 1.4; }
.production-track { position: relative; display: grid; place-items: center; min-height: 30px; margin-top: 8px; overflow: hidden; color: var(--text-2); background: #091a2a; border: 1px solid var(--line); border-radius: 6px; }
.production-track i { position: absolute; inset: 0 auto 0 0; width: 0; background: #203a55; transition: width .3s ease; }
.production-track strong { position: relative; z-index: 1; max-width: 100%; padding: 4px 6px; overflow: hidden; font-size: 9px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.production-track.is-active { color: #c9fff6; border-color: #2f6b70; }
.production-track.is-active i { background: #185258; }
.production-track.is-ready { color: #d7ffe8; border-color: #39755d; }
.production-track.is-ready i { background: #20523d; }

.plot-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.plant-card { display: grid; justify-items: center; align-content: start; min-width: 0; min-height: 222px; padding: 12px 8px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.plant-card.is-ready { border-color: #39755d; background: #102d29; }
.plant-visual { position: relative; display: grid; justify-items: center; width: 88px; min-height: 94px; }
.plant-art { display: grid; place-items: center; width: 80px; height: 80px; overflow: hidden; background: #091b2b; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.plot-badge { min-height: 20px; margin-top: -6px; padding: 3px 7px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; font-size: 9px; font-weight: 700; }
.plant-main { width: 100%; min-width: 0; }
.plant-card h3 { margin: 5px 0 0; overflow-wrap: anywhere; font-size: 13px; }
.plant-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-top: 7px; }
.plant-action { min-width: 0; padding: 4px; overflow: hidden; color: var(--text-3); background: #172b3e; border-radius: 4px; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.plant-action.is-needed { color: #c8fff5; background: #174a4f; }
.plant-action.is-unknown { color: #d7cfff; background: #302b50; }
.plant-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 7px; }
.data-pill { padding: 4px 6px; color: var(--text-3); background: var(--surface-2); border-radius: 4px; font-size: 8px; }
.data-pill.is-ready { color: var(--green); background: #173b2e; }
.data-pill.is-active { color: var(--cyan); background: #153e45; }
.data-pill.is-warn { color: var(--coral); background: #482638; }
.source-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 22px; padding: 14px 0 0; color: var(--text-3); border-top: 1px solid var(--line); }
.source-note .icon { width: 17px; height: 17px; color: var(--violet); }
.source-note p { margin: 0; font-size: 10px; line-height: 1.55; }

.account-hero { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: 13px; padding: 4px 0 24px; border-bottom: 1px solid var(--line); }
.account-avatar { display: grid; place-items: center; width: 62px; height: 62px; overflow: hidden; color: var(--cyan); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 50%; }
.account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-avatar .icon { width: 28px; height: 28px; }
.account-hero h1 { margin: 6px 0 3px; overflow-wrap: anywhere; font-size: 22px; }
.account-hero p { margin: 0; color: var(--text-3); font-size: 11px; }
.account-login { grid-column: 1 / -1; width: 100%; }
.account-section { margin-top: 24px; }
.uid-list { display: grid; grid-template-columns: 1fr; gap: 9px; }
.uid-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 78px; padding: 12px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.uid-card > div { min-width: 0; }
.uid-card strong { display: block; overflow-wrap: anywhere; font-size: 14px; font-variant-numeric: tabular-nums; }
.uid-card small { display: block; margin-top: 4px; overflow: hidden; color: var(--text-3); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.uid-remove { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; padding: 0; color: var(--text-3); background: transparent; border: 0; border-radius: var(--radius); }
.uid-remove:hover { color: var(--danger); background: #432335; }
.account-menu { display: grid; margin-top: 26px; border-top: 1px solid var(--line); }
.account-menu button { display: grid; grid-template-columns: 44px minmax(0, 1fr) 20px; align-items: center; gap: 12px; min-height: 76px; padding: 10px 4px; color: var(--text); text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); }
.account-menu button:hover { background: var(--surface); }
.account-menu button:active { background: var(--surface-2); }
.account-menu button > span:nth-child(2) { display: grid; gap: 4px; }
.account-menu strong { font-size: 13px; }
.account-menu small { color: var(--text-3); font-size: 10px; }
.menu-icon { display: grid; place-items: center; width: 44px; height: 44px; color: var(--cyan); background: #123e45; border: 1px solid #27606a; border-radius: 7px; }
.menu-icon-danger { color: var(--danger); background: #482638; border-color: #74384e; }
.menu-icon-safe { color: var(--green); background: #173b2e; border-color: #32604a; }
.menu-chevron { width: 17px !important; height: 17px !important; color: var(--text-3); }

.account-detail-list { display: grid; gap: 12px; }
.account-detail-card { padding: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.account-detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-detail-heading > div { min-width: 0; }
.account-detail-heading h2 { margin: 0; overflow-wrap: anywhere; font-size: 17px; }
.account-detail-heading p { margin: 5px 0 0; color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.account-status-refresh { width: 48px; min-width: 48px; height: 48px; padding: 0; }
.account-status-refresh span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.account-status-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 15px 0 0; }
.account-status-item { min-width: 0; padding: 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; }
.account-status-item dt { color: var(--text-3); font-size: 10px; }
.account-status-item dd { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--text); font-size: 14px; font-weight: 750; font-variant-numeric: tabular-nums; }
.account-status-item dd.is-ok { color: var(--green); }
.account-status-item dd.is-danger { color: var(--danger); }
.account-status-item dd.is-accent { color: var(--violet); }
.account-status-footnote { margin: 10px 0 0; color: var(--text-3); font-size: 10px; }

.back-control { display: inline-flex; align-items: center; gap: 4px; min-height: 48px; padding: 5px 10px 5px 0; color: var(--text-2); background: transparent; border: 0; font-size: 13px; }
.back-control .icon { width: 18px; height: 18px; transform: rotate(180deg); }
.back-control:hover { color: var(--cyan); }
.auth-page, .settings-page { max-width: 880px; }
.auth-layout { display: grid; gap: 26px; padding-top: 16px; }
.auth-intro img { width: 62px; height: 62px; margin-bottom: 20px; }
.auth-intro h1 { margin: 10px 0 12px; font-size: 31px; }
.auth-intro p { max-width: 430px; margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.7; }
.auth-form { display: grid; gap: 15px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.auth-tabs { margin-bottom: 2px; }
.field { display: grid; gap: 8px; color: var(--text-2); font-size: 12px; font-weight: 700; }
.field input { width: 100%; min-height: 50px; padding: 0 13px; color: var(--text); background: #081827; border: 1px solid var(--line-strong); border-radius: 6px; outline: none; transition: border-color .16s ease, box-shadow .16s ease; }
.field input:hover { border-color: #59809e; }
.field input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(105, 231, 210, .15); }
.field input::placeholder { color: #7890a7; }
.field small { color: var(--text-3); font-size: 10px; font-weight: 400; line-height: 1.5; }
.field em { color: var(--text-3); font-style: normal; font-weight: 400; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 54px; }
.password-field button { position: absolute; top: 1px; right: 1px; display: grid; place-items: center; width: 48px; height: 48px; color: var(--text-3); background: transparent; border: 0; border-radius: 5px; }
.password-field button:hover { color: var(--cyan); background: var(--surface-2); }
.field-error { color: #ff9aac !important; }
.form-error { padding: 11px 12px; color: #ffd6dd; background: #482638; border: 1px solid #74384e; border-radius: 6px; font-size: 12px; line-height: 1.5; }
.form-footnote { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--text-3); font-size: 10px; }
.form-footnote .icon { width: 15px; height: 15px; color: var(--cyan); }

.settings-heading { margin-top: 12px; }
.settings-form { max-width: 720px; }
.settings-group { padding: 22px 0 26px; border-top: 1px solid var(--line); }
.settings-group-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.settings-group-heading h2 { margin: 1px 0 5px; font-size: 17px; }
.settings-group-heading p { margin: 0; color: var(--text-3); font-size: 10px; line-height: 1.5; }
.settings-group-heading .menu-icon { flex: 0 0 44px; }
.settings-group .field > small code { color: var(--violet); font-family: Consolas, monospace; }
.server-preview { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 54px; margin-top: 15px; padding: 11px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.server-preview span { color: var(--text-3); font-size: 10px; }
.server-preview strong { max-width: 70%; overflow-wrap: anywhere; color: var(--text-2); font-family: Consolas, monospace; font-size: 10px; text-align: right; }
.settings-actions { display: grid; grid-template-columns: 1fr; gap: 9px; margin-top: 14px; }
.connection-result { margin-top: 13px; padding: 11px 12px; border-radius: 6px; font-size: 11px; line-height: 1.5; }
.connection-result.is-success { color: #c9f9dc; background: #173b2e; border: 1px solid #39755d; }
.connection-result.is-error { color: #ffd6dd; background: #482638; border: 1px solid #74384e; }
.security-list { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.security-list li { display: flex; align-items: flex-start; gap: 10px; }
.security-list > li > .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--green); }
.security-list span { display: grid; gap: 3px; }
.security-list strong { font-size: 12px; }
.security-list small { color: var(--text-3); font-size: 10px; line-height: 1.5; }
.text-button { min-height: 48px; padding: 6px 0; color: var(--text-3); background: transparent; border: 0; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.text-button:hover { color: var(--danger); }

.modal-layer { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(2, 9, 16, .74); backdrop-filter: blur(8px); }
.modal-card { width: min(100%, 430px); max-height: min(90svh, 620px); overflow-y: auto; padding: 19px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 24px 70px rgba(0, 0, 0, .42); }
.modal-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-card header > div > span { color: var(--cyan); font-size: 10px; font-weight: 700; }
.modal-card h2 { margin: 6px 0 0; font-size: 21px; }
.modal-card form { display: grid; gap: 15px; }
.confirm-card { text-align: center; }
.confirm-icon { display: grid; place-items: center; width: 50px; height: 50px; margin: 0 auto 15px; color: var(--coral); background: #482638; border-radius: 50%; }
.confirm-card h2 { margin: 0; font-size: 20px; }
.confirm-card p { margin: 10px 0 20px; color: var(--text-2); font-size: 12px; line-height: 1.6; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.toast { position: fixed; z-index: 90; right: 16px; bottom: calc(var(--nav-height) + 14px); left: 16px; width: min(420px, calc(100% - 32px)); margin: 0 auto; padding: 12px 14px; color: var(--text); background: #162d44; border: 1px solid var(--line-strong); border-radius: 6px; box-shadow: 0 12px 30px rgba(0, 0, 0, .36); font-size: 11px; line-height: 1.5; }
.bottom-nav { position: fixed; z-index: 40; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); min-height: var(--nav-height); padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); background: rgba(7, 21, 34, .97); border-top: 1px solid var(--line); box-shadow: 0 -10px 26px rgba(0, 0, 0, .28); backdrop-filter: blur(16px); }
.bottom-nav button { display: grid; place-items: center; align-content: center; gap: 4px; min-height: 54px; padding: 4px 8px; color: var(--text-3); background: transparent; border: 0; border-radius: 6px; font-size: 10px; font-weight: 650; transition: color .16s ease, background-color .16s ease; }
.bottom-nav button:hover { color: var(--text); background: var(--surface); }
.bottom-nav button:active { background: var(--surface-2); }
.bottom-nav button[aria-current="page"] { color: var(--cyan); background: #123e45; }
.bottom-nav .icon { width: 21px; height: 21px; }

@media (min-width: 560px) {
  .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .merchant-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plot-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .uid-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-hero { grid-template-columns: 74px minmax(0, 1fr) auto; }
  .account-avatar { width: 74px; height: 74px; }
  .account-login { grid-column: auto; width: auto; min-width: 126px; }
  .settings-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-form { padding: 22px; }
}

@media (min-width: 760px) {
  .page { padding-top: 32px; }
  .home-page { padding-top: 24px; }
  .overview-heading, .page-heading { margin-inline: 0; padding: 28px; border: 1px solid var(--line); border-left: 3px solid var(--cyan-strong); border-radius: var(--radius); }
  .dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .garden-overview { grid-template-columns: minmax(220px, .9fr) minmax(0, 1.6fr); }
  .garden-identity { border-right: 1px solid var(--line); border-bottom: 0; }
  .garden-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .garden-metric { grid-template-columns: 1fr; align-content: center; min-height: 112px; border-top: 0; }
  .garden-metric:nth-child(odd) { border-left: 1px solid var(--line); }
  .garden-metric:first-child { border-left: 0; }
  .pet-card { grid-template-columns: 98px minmax(0, 1fr); align-items: center; justify-items: stretch; min-height: 138px; padding: 13px; text-align: left; }
  .pet-main { width: auto; }
  .pet-visual { width: 98px; }
  .plant-card { grid-template-columns: 88px minmax(0, 1fr); align-items: center; justify-items: stretch; min-height: 154px; padding: 13px; text-align: left; }
  .plant-main { width: auto; }
  .plant-facts { justify-content: flex-start; }
  .auth-layout { grid-template-columns: minmax(0, 1fr) minmax(330px, 420px); align-items: center; gap: clamp(44px, 8vw, 90px); min-height: 520px; }
  .auth-intro h1 { font-size: 42px; }
  .account-status-refresh { width: auto; min-width: 126px; padding: 10px 15px; }
  .account-status-refresh span { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .account-status-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (orientation: landscape) and (max-height: 560px) {
  :root { --nav-height: calc(62px + env(safe-area-inset-bottom)); --header-height: 60px; }
  .page { padding-top: 18px; padding-bottom: 30px; }
  .overview-heading, .page-heading { min-height: 116px; padding-block: 18px; }
  .bottom-nav button { min-height: 48px; }
  .dashboard-section { margin-top: 20px; }
}

@media (max-width: 370px) {
  .overview-heading h1, .page-heading h1 { font-size: 29px; }
  .pet-list, .plot-grid { gap: 6px; }
  .pet-card, .plant-card { padding-inline: 6px; }
  .pet-slot { width: 76px; height: 76px; }
  .pet-visual { width: 84px; }
  .bottom-nav button { padding-inline: 3px; font-size: 9px; }
}

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

/* 备案信息页脚 */
.beian-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  justify-content: center;
  padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  font-size: 12px;
}

.beian-footer a {
  color: var(--text-muted, #8ba3b8);
  text-decoration: none;
}

.beian-footer a:hover,
.beian-footer a:focus-visible {
  text-decoration: underline;
}
