/* Farm manager console — same visual language as the mini program (miniapp/miniprogram/app.wxss):
   warm farm paper, white cards with warm shadows, leaf-green actions, sun-orange highlights,
   the game's quality plates and outlined item names. */
:root {
  color-scheme: light;
  --bg: #f6f0e4;
  --bg-2: #efe5d2;
  --card: #ffffff;
  --card-2: #fcf8f0;
  --line: #f0e5d2;
  --line-2: #e6d8bf;
  --ink: #2e2316;
  --ink-2: #786754;
  --ink-3: #b2a28b;
  --leaf: #2c9f57;
  --leaf-2: #46c171;
  --leaf-ink: #1f7a42;
  --leaf-soft: #e6f6ec;
  --sun: #f39a1e;
  --sun-ink: #b05f00;
  --sun-soft: #fff2db;
  --rose: #e5533d;
  --rose-soft: #fdebe6;
  --sky: #3f92dc;
  --sky-soft: #e6f1fc;
  --sand: #f4eee3;
  --sand-edge: #ebe2d2;
  --panel: #fdf0d6;
  --panel-edge: #e8b675;
  --grid: #f1e8d8;
  --series-1: #2c9f57;
  --series-1-wash: rgba(44, 159, 87, 0.12);
  --series-2: #ec8a17;
  --series-3: #3f92dc;
  --shadow: 0 3px 12px rgba(120, 90, 40, 0.07);
  --shadow-lg: 0 10px 30px rgba(120, 90, 40, 0.12);
  --radius: 16px;
  --sidebar: 236px;
  --num: "DIN Alternate", "Bahnschrift", "DIN Pro", "Roboto Condensed", "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --outline: 1.5px 0 0 #1c1a22, -1.5px 0 0 #1c1a22, 0 1.5px 0 #1c1a22, 0 -1.5px 0 #1c1a22,
    1px 1px 0 #1c1a22, -1px 1px 0 #1c1a22, 1px -1px 0 #1c1a22, -1px -1px 0 #1c1a22;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #17130e; --bg-2: #1d1812; --card: #221c15; --card-2: #2a231a; --line: #342b1f; --line-2: #42372a;
    --ink: #f4ecdf; --ink-2: #c9b99f; --ink-3: #8c7d66;
    --leaf: #46c171; --leaf-2: #5fd486; --leaf-ink: #7fdba0; --leaf-soft: #1b3323;
    --sun: #f5a742; --sun-ink: #f7b75e; --sun-soft: #3a2a12; --rose: #f07a66; --rose-soft: #3d1f1a;
    --sky: #6aaef0; --sky-soft: #1a2a3b; --sand: #2c251c; --sand-edge: #3a3125; --panel: #33281a; --panel-edge: #6b5333;
    --grid: #2e271d; --series-1: #46c171; --series-1-wash: rgba(70, 193, 113, 0.14); --series-2: #f0a03a; --series-3: #6aaef0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3); --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17130e; --bg-2: #1d1812; --card: #221c15; --card-2: #2a231a; --line: #342b1f; --line-2: #42372a;
  --ink: #f4ecdf; --ink-2: #c9b99f; --ink-3: #8c7d66;
  --leaf: #46c171; --leaf-2: #5fd486; --leaf-ink: #7fdba0; --leaf-soft: #1b3323;
  --sun: #f5a742; --sun-ink: #f7b75e; --sun-soft: #3a2a12; --rose: #f07a66; --rose-soft: #3d1f1a;
  --sky: #6aaef0; --sky-soft: #1a2a3b; --sand: #2c251c; --sand-edge: #3a3125; --panel: #33281a; --panel-edge: #6b5333;
  --grid: #2e271d; --series-1: #46c171; --series-1-wash: rgba(70, 193, 113, 0.14); --series-2: #f0a03a; --series-3: #6aaef0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.3); --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI",
    "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--leaf-ink); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; letter-spacing: .5px; }
h1 { font-size: 22px; font-weight: 800; }
h2 { font-size: 16px; font-weight: 800; }
h3 { font-size: 14px; font-weight: 700; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
img.ico { width: 22px; height: 22px; object-fit: contain; vertical-align: -6px; }

/* ---------------------------------------------------------------- layout */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: none; background: var(--card); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
}
/* Brand: a small sky over rolling hills, like the mini program home hero */
.brand {
  position: relative; overflow: hidden; margin: 12px; border-radius: 18px; padding: 16px 16px 30px; min-height: 92px;
  background: linear-gradient(180deg, #74c4f0 0%, #a9def6 55%, #d4f1f7 100%);
}
.brand::before, .brand::after { content: ""; position: absolute; bottom: -42px; border-radius: 50%; }
.brand::before { left: -20%; width: 90%; height: 70px; background: #9bd76f; }
.brand::after { right: -25%; width: 95%; height: 64px; background: #7cc95c; }
.brand-name {
  position: relative; z-index: 1; font-size: 18px; font-weight: 900; letter-spacing: 1px; color: #fff; line-height: 1.25;
  text-shadow: 2px 0 0 #2a5a86, -2px 0 0 #2a5a86, 0 2px 0 #2a5a86, 0 -2px 0 #2a5a86, 1.5px 1.5px 0 #2a5a86,
    -1.5px 1.5px 0 #2a5a86, 1.5px -1.5px 0 #2a5a86, -1.5px -1.5px 0 #2a5a86, 0 4px 0 rgba(42, 90, 134, .4);
}
.brand-sub { position: relative; z-index: 1; font-size: 11.5px; font-weight: 700; color: #24506f; margin-top: 3px; }
.brand-art { position: absolute; right: 8px; bottom: 6px; width: 50px; height: 50px; z-index: 2; animation: bob 3.2s ease-in-out infinite; filter: drop-shadow(0 4px 4px rgba(30, 50, 80, .3)); }
.nav { padding: 4px 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.nav-title { padding: 14px 10px 6px; font-size: 12px; font-weight: 700; color: var(--ink-3); letter-spacing: 1px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; color: var(--ink-2);
  text-decoration: none; font-weight: 600; transition: background .15s, color .15s;
}
.nav a:hover { background: var(--sand); color: var(--ink); }
.nav a.active { background: var(--leaf-soft); color: var(--leaf-ink); font-weight: 800; }
.nav a.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 4px; border-radius: 4px; background: linear-gradient(180deg, var(--leaf-2), var(--leaf)); }
.nav svg { width: 17px; height: 17px; flex: none; }
.sidebar-foot { margin-top: auto; padding: 12px 14px 16px; border-top: 1px dashed var(--line-2); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 900; color: #fff;
  background: linear-gradient(180deg, #4fca78, #2c9f57); box-shadow: 0 0 0 3px var(--leaf-soft);
}
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 28px; position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .title { font-weight: 800; font-size: 15px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-btn { display: none; }
.content { padding: 24px 28px 48px; max-width: 1380px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head .sub { color: var(--ink-2); margin-top: 4px; font-size: 13px; }
.crumb { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 8px; }
.spacer { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.tiles { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--card); border: 1px solid color-mix(in srgb, var(--line) 75%, transparent); border-radius: var(--radius);
  box-shadow: var(--shadow); animation: rise .45s cubic-bezier(.2, .8, .2, 1) both;
}
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; flex-wrap: wrap; }
.card-head h2 { flex: 1; display: flex; align-items: center; min-width: 0; }
.card-head h2::before { content: ""; width: 5px; height: 16px; border-radius: 3px; background: linear-gradient(180deg, var(--leaf-2), var(--leaf)); margin-right: 9px; flex: none; }
.card-body { padding: 14px 18px 18px; }
.card-body.flush { padding: 8px 0 0; }

.tile { position: relative; overflow: hidden; padding: 15px 16px 14px; }
.tile .label { color: var(--ink-2); font-size: 12.5px; font-weight: 600; position: relative; z-index: 1; }
.tile .value { font-family: var(--num); font-size: 26px; font-weight: 700; margin-top: 2px; letter-spacing: .3px; position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.tile .hint { color: var(--ink-3); font-size: 12px; margin-top: 1px; position: relative; z-index: 1; }
.tile .tile-art { position: absolute; right: -6px; bottom: -8px; width: 62px; height: 62px; opacity: .9; transform: rotate(-8deg); filter: drop-shadow(0 4px 4px rgba(60, 40, 10, .18)); }
.tile.has-art .value, .tile.has-art .hint { padding-right: 44px; }
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.tile.mini { padding: 10px 12px; box-shadow: none; animation: none; background: var(--card-2); }
.tile.mini .value { font-size: 19px; }
.tile.hero { background: linear-gradient(135deg, #46c578 0%, #28995a 60%, #1d8466 100%); border-color: transparent; color: #fff; box-shadow: 0 10px 26px rgba(35, 146, 85, .26); }
.tile.hero .label, .tile.hero .hint { color: rgba(255, 255, 255, .86); }
.tile.hero .value { font-size: 30px; }
.tile.sun { background: linear-gradient(160deg, #fff4dc 0%, #ffe1ae 100%); border-color: transparent; }
.tile.sky { background: linear-gradient(160deg, #e6f3ff 0%, #c6e2ff 100%); border-color: transparent; }
.tile.mint { background: linear-gradient(160deg, #e9f8ee 0%, #c9efd6 100%); border-color: transparent; }
.tile.lilac { background: linear-gradient(160deg, #f3ecff 0%, #ddd0ff 100%); border-color: transparent; }
.tile.peach { background: linear-gradient(160deg, #fff0e6 0%, #ffd3b3 100%); border-color: transparent; }
:root[data-theme="dark"] .tile.sun, :root[data-theme="dark"] .tile.sky, :root[data-theme="dark"] .tile.mint,
:root[data-theme="dark"] .tile.lilac, :root[data-theme="dark"] .tile.peach { background: var(--card-2); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tile.sun, :root:not([data-theme="light"]) .tile.sky, :root:not([data-theme="light"]) .tile.mint,
  :root:not([data-theme="light"]) .tile.lilac, :root:not([data-theme="light"]) .tile.peach { background: var(--card-2); }
}

/* Overview / detail hero: the green farm card of the mini program "我的" page */
.farm-hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 22px 24px; color: #fff;
  background: linear-gradient(135deg, #46c578 0%, #28995a 60%, #1d8466 100%); box-shadow: 0 14px 34px rgba(35, 146, 85, .26);
  animation: rise .45s cubic-bezier(.2, .8, .2, 1) both;
}
.farm-hero::after { content: ""; position: absolute; right: -60px; bottom: -120px; width: 460px; height: 230px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.farm-hero .greet { position: relative; z-index: 1; font-size: 24px; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 60, 30, .25); }
.farm-hero .hero-sub { position: relative; z-index: 1; font-size: 13px; opacity: .92; margin-top: 4px; max-width: min(560px, calc(100% - 250px)); }
.farm-hero .hero-stats { position: relative; z-index: 1; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hero-stat { background: rgba(255, 255, 255, .18); border-radius: 14px; padding: 8px 14px; min-width: 112px; backdrop-filter: blur(2px); }
.hero-stat .k { font-size: 12px; opacity: .9; font-weight: 600; }
.hero-stat .v { font-family: var(--num); font-size: 20px; font-weight: 700; }
.farm-hero .hero-actions { position: relative; z-index: 2; display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.hero-deco { position: absolute; right: 0; top: 0; bottom: 0; width: 300px; pointer-events: none; z-index: 1; }
.hero-deco img { position: absolute; width: 74px; height: 74px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .2)); opacity: .95; }
.hero-deco .d0 { right: 170px; top: 18px; transform: rotate(-12deg); animation: bob 3.6s ease-in-out infinite; }
.hero-deco .d1 { right: 40px; top: 26px; width: 96px; height: 96px; animation: bob 3.2s ease-in-out .4s infinite; }
.hero-deco .d2 { right: 110px; bottom: 10px; transform: rotate(-4deg); animation: bob 4s ease-in-out .8s infinite; }
.farm-hero .btn-glass { background: rgba(255, 255, 255, .22); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.farm-hero .btn-glass:hover { background: rgba(255, 255, 255, .32); }

.detail-head { display: flex; align-items: center; gap: 14px; padding: 16px 18px; flex-wrap: wrap; }
.detail-head .emblem { width: 58px; height: 58px; }
.pill img.ico { width: 18px; height: 18px; margin: -3px 0; }
.pill.plain { background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-2); }
/* Refreshing pages repaint every few seconds: only the first paint animates. */
.settled .card, .settled .farm-hero, .settled .disc-item { animation: none; }

/* ---------------------------------------------------------------- controls */
button, .btn {
  font: inherit; font-weight: 700; border: 0; background: var(--sand); color: var(--ink); border-radius: 999px;
  padding: 7px 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; line-height: 1.4;
  text-decoration: none; white-space: nowrap; letter-spacing: .5px; transition: transform .12s, filter .12s, background .15s;
  box-shadow: inset 0 0 0 1px var(--sand-edge);
}
button:hover, .btn:hover { filter: brightness(.97); text-decoration: none; }
button:active, .btn:active { transform: scale(.97); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
button svg, .btn svg { width: 15px; height: 15px; }
button.primary, .btn.primary {
  color: #fff; background: linear-gradient(180deg, #4fca78 0%, #2c9f57 100%);
  box-shadow: 0 4px 12px rgba(44, 159, 87, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
}
button.primary:hover, .btn.primary:hover { filter: brightness(1.05); }
button.sun, .btn.sun {
  color: #fff; background: linear-gradient(180deg, #ffbf4d 0%, #f08a12 100%);
  box-shadow: 0 4px 12px rgba(240, 138, 18, .28), inset 0 1px 0 rgba(255, 255, 255, .4);
}
button.danger { color: var(--rose); background: var(--rose-soft); box-shadow: none; }
button.danger.solid { color: #fff; background: linear-gradient(180deg, #f27560, #d9452f); box-shadow: 0 4px 12px rgba(217, 69, 47, .25); }
button.ghost { background: transparent; box-shadow: none; }
button.ghost:hover { background: var(--sand); }
button.small, .btn.small { padding: 4px 12px; font-size: 12.5px; }
button.icon-btn { padding: 6px; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--card-2); border: 1px solid var(--line-2); border-radius: 12px;
  padding: 7px 12px; min-width: 0; transition: border-color .15s, box-shadow .15s;
}
select { padding-right: 28px; }
textarea { width: 100%; min-height: 120px; font-family: var(--mono); font-size: 12.5px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px color-mix(in srgb, var(--leaf) 18%, transparent); }
button:focus-visible, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--leaf); padding: 0; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
label.field input, label.field select { color: var(--ink); font-weight: 400; }
label.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.check-grid label.check { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.seg { display: inline-flex; background: var(--sand); border-radius: 999px; padding: 3px; gap: 2px; box-shadow: inset 0 0 0 1px var(--sand-edge); }
.seg button { box-shadow: none; background: transparent; padding: 4px 12px; font-size: 12.5px; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--leaf-ink); box-shadow: 0 1px 4px rgba(120, 90, 40, .15); }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; overflow-x: auto; padding: 2px; }
.tabs a {
  padding: 7px 16px; color: var(--ink-2); border-radius: 999px; white-space: nowrap; text-decoration: none; font-weight: 700;
  background: var(--card); box-shadow: inset 0 0 0 1px var(--line-2);
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: #fff; background: linear-gradient(180deg, #4fca78, #2c9f57); box-shadow: 0 4px 10px rgba(44, 159, 87, .25); }

/* ---------------------------------------------------------------- badges and plates */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; font-size: 12px;
  font-weight: 700; white-space: nowrap; background: var(--sand); color: var(--ink-2);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none; }
.pill.good { background: var(--leaf-soft); color: var(--leaf-ink); }
.pill.good::before { background: #2cc36b; animation: ping 1.8s ease-out infinite; }
.pill.warn { background: var(--sun-soft); color: var(--sun-ink); }
.pill.warn::before { background: var(--sun); }
.pill.bad { background: var(--rose-soft); color: var(--rose); }
.pill.bad::before { background: var(--rose); }
.pill.plain::before { display: none; }
.lvl { display: inline-block; min-width: 40px; text-align: center; border-radius: 8px; padding: 0 7px; font-size: 12px; font-weight: 700; }
.lvl-debug { color: var(--ink-3); background: var(--sand); }
.lvl-info { color: var(--sky); background: var(--sky-soft); }
.lvl-success { color: #fff; background: linear-gradient(180deg, #4fca78, #2c9f57); }
.lvl-warn { color: var(--sun-ink); background: var(--sun-soft); }
.lvl-error { color: #fff; background: linear-gradient(180deg, #f27560, #d9452f); }
.tag { display: inline-block; padding: 0 8px; border-radius: 8px; font-size: 12px; font-weight: 600; background: var(--sand); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--sand-edge); }

/* Quality capsules, after the game's mutation name plates */
.q {
  display: inline-flex; align-items: center; height: 22px; padding: 0 10px; margin: 2px 4px 2px 0; border-radius: 999px;
  font-size: 12px; font-weight: 900; letter-spacing: .5px; color: #fff; background: var(--g2);
  box-shadow: inset 0 -2px 0 var(--g3), 0 2px 5px var(--gs); text-shadow: var(--outline); white-space: nowrap;
}
.t0, .t1 { --g2: #8faccb; --g3: #7593b4; --gs: rgba(103, 136, 168, .22); }
.t2 { --g2: #22b978; --g3: #179660; --gs: rgba(23, 146, 92, .22); }
.t3 { --g2: #5eb1fc; --g3: #3f92dc; --gs: rgba(58, 142, 214, .22); }
.t4 { --g2: #c97af8; --g3: #a75bd6; --gs: rgba(162, 89, 214, .24); }
.t5 { --g2: #e8994e; --g3: #c8662e; --gs: rgba(220, 106, 18, .26); }
.t6, .t7 { --g2: #5cbafa; --g3: #3d8fd0; --gs: rgba(90, 150, 230, .3); }
.q.t6, .q.t7, .bar-row.t6 .track > i, .bar-row.t7 .track > i { background-image: linear-gradient(90deg, #ff9db0, #ffd36e, #8be3a6, #7cc6ff, #c6a2ff); }

/* Item discs: the game's round quality backdrop with the item icon and an outlined count */
.discs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px 8px; }
.disc-item { display: flex; flex-direction: column; align-items: center; min-width: 0; animation: pop .42s cubic-bezier(.2, .9, .3, 1.25) both; }
.disc { position: relative; width: 76px; height: 76px; background-size: 100% 100%; background-repeat: no-repeat; }
.disc img { position: absolute; left: 13%; top: 11%; width: 74%; height: 74%; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(40, 40, 60, .25)); }
.disc .glyph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; }
.disc .qty { position: absolute; right: 0; bottom: 0; font-family: var(--num); font-size: 17px; font-weight: 900; color: #fff; text-shadow: var(--outline), 0 2px 0 rgba(28, 26, 34, .4); }
.disc-name { margin-top: 5px; max-width: 100%; font-size: 12.5px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.disc-sub { font-size: 11.5px; color: var(--ink-3); }
.disc-item.dim { opacity: .45; filter: saturate(.4); }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 14px; vertical-align: middle; }
td { border-top: 1px dashed var(--line); }
th { font-weight: 700; color: var(--ink-3); font-size: 12px; background: var(--card); white-space: nowrap; letter-spacing: .5px; }
td.r, th.r { text-align: right; }
td.num { font-family: var(--num); font-size: 14px; }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--card-2); }
tr.clickable { cursor: pointer; }
td .sub { color: var(--ink-3); font-size: 12px; }
td .mono { white-space: nowrap; }
.cell-item { display: flex; align-items: center; gap: 9px; }
.cell-item img { width: 30px; height: 30px; object-fit: contain; flex: none; }
.empty { padding: 34px 16px; text-align: center; color: var(--ink-3); font-size: 13px; }
.empty img { display: block; width: 64px; height: 64px; margin: 0 auto 8px; opacity: .55; filter: saturate(.3); }

/* ---------------------------------------------------------------- account cards */
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.acc-card { padding: 0; overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.acc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.acc-top { display: flex; align-items: center; gap: 12px; padding: 16px 16px 12px; }
.emblem {
  position: relative; width: 50px; height: 50px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 40% 35%, #fffdf6 0%, #f6ead2 70%); box-shadow: 0 0 0 3px var(--panel), 0 4px 10px rgba(120, 90, 40, .15);
}
.emblem img { position: absolute; left: 12%; top: 10%; width: 76%; height: 76%; object-fit: contain; }
.emblem.online::after { content: ""; position: absolute; right: 0; bottom: 1px; width: 12px; height: 12px; border-radius: 50%; background: #2cc36b; box-shadow: 0 0 0 2px var(--card); }
.acc-card .name { font-weight: 900; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.acc-kv > div { background: var(--card); padding: 9px 14px; }
.kv .k { color: var(--ink-3); font-size: 11.5px; font-weight: 600; }
.kv .v { font-family: var(--num); font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.acc-foot { display: flex; align-items: center; gap: 8px; padding: 10px 16px 12px; }

.meter { height: 8px; border-radius: 999px; background: var(--leaf-soft); overflow: hidden; min-width: 80px; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, var(--leaf-2), var(--leaf)); border-radius: 999px; }
.meter.sun { background: var(--sun-soft); }
.meter.sun > i { background: linear-gradient(90deg, #ffbf4d, #f08a12); }

/* ---------------------------------------------------------------- events / logs */
.ev-list { display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: 124px 50px 1fr; gap: 10px; padding: 9px 18px; border-top: 1px dashed var(--line); align-items: center; cursor: pointer; }
.ev:first-child { border-top: 0; }
.ev:hover { background: var(--card-2); }
.ev .t { color: var(--ink-3); font-size: 12.5px; font-family: var(--num); font-variant-numeric: tabular-nums; }
.ev .title { min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ev .title img { width: 22px; height: 22px; object-fit: contain; }
.ev .acc { color: var(--ink-2); font-weight: 700; }
.ev.open { background: var(--card-2); }
.ev pre { grid-column: 3; margin: 4px 0 0; }
pre.json {
  background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; overflow: auto;
  max-height: 420px; font-family: var(--mono); font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-all;
}
.log-line { font-family: var(--mono); font-size: 12px; padding: 6px 18px; border-top: 1px dashed var(--line); cursor: pointer; display: grid; grid-template-columns: 120px 200px 1fr; gap: 10px; }
.log-line:hover { background: var(--card-2); }
.log-line .k { color: var(--leaf-ink); font-weight: 600; }
.log-line .s { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 18px; border-bottom: 1px dashed var(--line); }
.filters .label { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border-radius: 999px; padding: 3px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; user-select: none;
  background: var(--sand); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--sand-edge); transition: transform .12s;
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--leaf-soft); color: var(--leaf-ink); box-shadow: inset 0 0 0 1.5px var(--leaf); }
.load-more { display: flex; justify-content: center; padding: 14px; }

/* ---------------------------------------------------------------- charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; max-width: 100%; overflow: visible; }
.chart .axis text { fill: var(--ink-3); font-size: 11px; font-family: var(--num); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--line-2); stroke-width: 1; }
.chart .line { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--ink-3); stroke-width: 1; }
.chart .dot { stroke: var(--card); stroke-width: 2; }
.chart .bar { transition: filter .12s; }
.chart .bar:hover { filter: brightness(1.1); }
.chart-empty { height: 180px; display: grid; place-items: center; color: var(--ink-3); }
.tooltip {
  position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--line-2); border-radius: 10px;
  padding: 6px 10px; font-size: 12px; box-shadow: var(--shadow-lg); white-space: nowrap; z-index: 5; transform: translate(-50%, -100%);
}
.tooltip .tv { font-weight: 800; font-family: var(--num); font-size: 14px; }

.bar-row { display: grid; grid-template-columns: 54px 1fr 48px; gap: 10px; align-items: center; padding: 4px 0; }
.bar-row .track { height: 12px; background: var(--sand); border-radius: 6px; overflow: hidden; }
.bar-row .track > i { display: block; height: 100%; background: var(--g2, var(--series-1)); border-radius: 0 6px 6px 0; }

/* Fruit card (bag treasures), as in the mini program */
.fruit-list { display: flex; flex-direction: column; gap: 8px; }
.fruit-card { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 14px; background: linear-gradient(180deg, #fff6e6, #ffefd6); border: 1px solid #f0d6a6; }
:root[data-theme="dark"] .fruit-card { background: var(--panel); border-color: var(--panel-edge); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fruit-card { background: var(--panel); border-color: var(--panel-edge); } }
.fruit-card img { width: 42px; height: 42px; object-fit: contain; flex: none; }
.fruit-card .fn { font-weight: 900; color: #6b4a1a; }
:root[data-theme="dark"] .fruit-card .fn { color: var(--ink); }
.fruit-card .fm { font-size: 12px; color: #a07c4a; }
.fruit-card .fp { margin-left: auto; font-family: var(--num); font-size: 18px; font-weight: 800; color: #c46a00; white-space: nowrap; }

/* ---------------------------------------------------------------- auth */
.auth {
  position: relative; min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; overflow: hidden;
  background: linear-gradient(180deg, #74c4f0 0%, #a9def6 45%, #d4f1f7 75%, #e6f7e4 100%);
}
.auth::before, .auth::after { content: ""; position: fixed; bottom: -160px; border-radius: 50%; }
.auth::before { left: -20%; width: 90%; height: 320px; background: #9bd76f; }
.auth::after { right: -25%; width: 95%; height: 290px; background: #7cc95c; }
.auth .sun-fx { position: fixed; right: 12%; top: 10%; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, #fffbe0 0%, #ffe680 45%, rgba(255, 220, 90, 0) 72%); box-shadow: 0 0 90px 36px rgba(255, 236, 150, .5); animation: glow 4s ease-in-out infinite; }
.auth .card { position: relative; z-index: 2; width: 100%; max-width: 400px; padding: 28px 28px 24px; border-radius: 24px; box-shadow: 0 20px 50px rgba(40, 80, 120, .22); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.auth-brand img { width: 56px; height: 56px; animation: bob 3.2s ease-in-out infinite; }
.auth .switch { margin-top: 16px; text-align: center; color: var(--ink-2); }
.auth button.primary { justify-content: center; padding: 10px 16px; font-size: 15px; }

/* ---------------------------------------------------------------- misc */
.toast-box { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 100; }
.toast { background: rgba(46, 35, 22, .92); color: #fff; padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow-lg); max-width: 90vw; font-size: 13px; font-weight: 600; animation: pop .35s cubic-bezier(.2, .9, .3, 1.25) both; }
.toast.err { background: linear-gradient(180deg, #f27560, #d9452f); }
.modal-back { position: fixed; inset: 0; background: rgba(30, 20, 5, .42); display: grid; place-items: center; z-index: 90; padding: 16px; animation: fade .2s ease both; }
.modal { background: var(--bg); border-radius: 22px; width: 100%; max-width: 540px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(30, 20, 5, .3); animation: pop .35s cubic-bezier(.2, .9, .3, 1.15) both; }
.modal-head { padding: 18px 20px 0; display: flex; align-items: center; }
.modal-head h2 { flex: 1; font-size: 18px; }
.modal-body { padding: 14px 20px; }
.modal-foot { padding: 4px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.notice { padding: 11px 14px; border-radius: 14px; background: var(--sky-soft); color: var(--sky); font-size: 13px; font-weight: 600; }
.notice.warn { background: var(--sun-soft); color: var(--sun-ink); }
.notice.bad { background: var(--rose-soft); color: var(--rose); }
.notice.good { background: var(--leaf-soft); color: var(--leaf-ink); }
.notice a { color: inherit; text-decoration: underline; }
.codes { font-family: var(--mono); font-size: 13px; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; max-height: 260px; overflow: auto; white-space: pre; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line-2); border-top-color: var(--leaf); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: -3px; }
.loading { padding: 60px; text-align: center; color: var(--ink-3); }
.backdrop { display: none; }
.product { display: flex; flex-direction: column; gap: 8px; padding: 16px; position: relative; overflow: hidden; }
.product .price { font-family: var(--num); font-size: 26px; font-weight: 700; color: var(--sun-ink); }
.product .price small { font-size: 14px; margin-right: 2px; }
.product .p-art { position: absolute; right: -8px; top: -6px; width: 64px; height: 64px; opacity: .9; transform: rotate(10deg); }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.85); } 70% { opacity: 1; transform: scale(1.03); } 100% { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-5px) rotate(3deg); } }
@keyframes glow { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(44, 195, 107, .55); } 100% { box-shadow: 0 0 0 7px rgba(44, 195, 107, 0); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 1100px) {
  .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-deco { width: 200px; opacity: .5; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 30px rgba(0, 0, 0, .2); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .backdrop { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(30, 20, 5, .35); }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px 16px 40px; }
  .grid.cols-2, .grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .grid.tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile .value { font-size: 21px; }
  .ev { grid-template-columns: 1fr auto; gap: 2px 8px; }
  .ev .title { grid-column: 1 / -1; }
  .ev pre { grid-column: 1 / -1; }
  .log-line { grid-template-columns: 1fr; gap: 0; }
  .acc-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-deco { display: none; }
  .farm-hero { padding: 18px; }
  .farm-hero .hero-sub { max-width: none; }
}
