/* 好二熊之家 — the home page's look carried into the inner pages (臭臭记账 and the three investing pages):
   sky-blue morning above, a strip of the bears' grass at the bottom, soft white cards with round corners,
   pill buttons and the same navy ink as the home page. Loaded last, so it only re-tunes each page's own colors. */

/* ---------- light ---------- */
:root{
  --bt-sky:#a8cefe; --bt-ink:#10283f; --bt-ink2:#4d6278; --bt-ink3:#6a7d90;
  --bt-card:#fff; --bt-card2:#f4f8fd; --bt-card3:#e7f0fb; --bt-line:#dfe8f2; --bt-line2:#e9f0f7;
  --bt-accent:#2f74c0; --bt-accent-soft:#e2eefb;
  --bt-shadow:0 1px 2px rgba(16,40,63,.05),0 6px 18px rgba(16,40,63,.07);
  /* 臭臭记账's palette */
  --ground:#f2f7fd; --surface:var(--bt-card); --surface-2:var(--bt-card2); --surface-3:var(--bt-card3);
  --line:var(--bt-line); --line-soft:var(--bt-line2); --grid:#e6edf5;
  --ink:var(--bt-ink); --ink-2:var(--bt-ink2); --ink-3:var(--bt-ink3);
  --accent:var(--bt-accent); --accent-soft:var(--bt-accent-soft); --accent-ink:#235d9e;
  --r:16px; --r-sm:12px; --r-lg:20px;
  /* the investing pages' palette */
  --bg:#f2f7fd; --card:var(--bt-card); --text:var(--bt-ink); --dim:var(--bt-ink3);
}
/* ---------- dark: the home page's night sky ---------- */
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bt-sky:#0b1430; --bt-ink:#e6edf3; --bt-ink2:#b3c0cc; --bt-ink3:#9aa7b4;
  --bt-card:#1a2444; --bt-card2:#202b4e; --bt-card3:#263258; --bt-line:#2c3858; --bt-line2:#26314f;
  --bt-accent:#8cc0f5; --bt-accent-soft:#1f3347; --bt-shadow:0 1px 2px rgba(0,0,0,.25),0 6px 18px rgba(0,0,0,.22);
  --ground:#0f1938; --surface:var(--bt-card); --surface-2:var(--bt-card2); --surface-3:var(--bt-card3);
  --line:var(--bt-line); --line-soft:var(--bt-line2); --grid:#2b3742;
  --ink:var(--bt-ink); --ink-2:var(--bt-ink2); --ink-3:var(--bt-ink3); --accent:var(--bt-accent); --accent-soft:var(--bt-accent-soft); --accent-ink:#a9d0f8;
  --bg:#0f1938; --card:var(--bt-card); --text:var(--bt-ink); --dim:var(--bt-ink3);
}}
:root[data-theme="dark"]{
  --bt-sky:#0b1430; --bt-ink:#e6edf3; --bt-ink2:#b3c0cc; --bt-ink3:#9aa7b4;
  --bt-card:#1a2444; --bt-card2:#202b4e; --bt-card3:#263258; --bt-line:#2c3858; --bt-line2:#26314f;
  --bt-accent:#8cc0f5; --bt-accent-soft:#1f3347; --bt-shadow:0 1px 2px rgba(0,0,0,.25),0 6px 18px rgba(0,0,0,.22);
  --ground:#0f1938; --surface:var(--bt-card); --surface-2:var(--bt-card2); --surface-3:var(--bt-card3);
  --line:var(--bt-line); --line-soft:var(--bt-line2); --grid:#2b3742;
  --ink:var(--bt-ink); --ink-2:var(--bt-ink2); --ink-3:var(--bt-ink3); --accent:var(--bt-accent); --accent-soft:var(--bt-accent-soft); --accent-ink:#a9d0f8;
  --bg:#0f1938; --card:var(--bt-card); --text:var(--bt-ink); --dim:var(--bt-ink3);
}
/* investing uses --accent for the trend line: keep it the page ink there */
body.inv{--accent:var(--bt-ink)}

/* ---------- pulling the page past its top: on a computer (mouse / trackpad) it simply stops there — Chrome on a Mac could
   otherwise leave the page stuck partway down with a white gap above the market strip. Phones keep their pull-to-refresh.
   The canvas behind the page is sky-coloured either way, so a bounce never shows white. ---------- */
html{background:var(--bt-sky)}
html.dark{background:#0b1430}
@media (hover:hover) and (pointer:fine){html,body{overscroll-behavior-y:none}}

/* ---------- the scene: sky fading to pale, the bears' grass along the bottom ---------- */
body{background:linear-gradient(180deg,var(--bt-sky) 0,#d3e6ff 220px,#eaf3ff 520px,#f2f7fd 100%) fixed!important;min-height:100vh}
body::before{content:"";position:fixed;left:0;right:0;bottom:0;height:150px;z-index:-1;pointer-events:none;
  background:url(/bg-land2.jpg) center bottom/auto 420px repeat-x;
  -webkit-mask-image:linear-gradient(180deg,transparent 0,#000 55%);mask-image:linear-gradient(180deg,transparent 0,#000 55%);opacity:.9}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) body{background:linear-gradient(180deg,#0b1430 0%,#142352 50%,#1b2d5c 100%) fixed!important}
  :root:not([data-theme="light"]) body::before{filter:none;background-image:url(/bg-land2-night.webp)}}
:root[data-theme="dark"] body{background:linear-gradient(180deg,#0b1430 0%,#142352 50%,#1b2d5c 100%) fixed!important}
:root[data-theme="dark"] body::before{filter:none;background-image:url(/bg-land2-night.webp)}
@media print{body::before{display:none}}

/* ---------- top bar: the bears instead of a house on the home button ---------- */
.apphdr{--h-text:var(--bt-ink);--h-dim:var(--bt-ink2);--h-line:transparent;--h-btn:rgba(255,255,255,.85);--h-btn-hover:#fff}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .apphdr{--h-line:transparent;--h-btn:rgba(255,255,255,.08);--h-btn-hover:rgba(255,255,255,.14)}}
:root[data-theme="dark"] .apphdr{--h-line:transparent;--h-btn:rgba(255,255,255,.08);--h-btn-hover:rgba(255,255,255,.14)}
.apphdr .home,.apphdr .hb{box-shadow:0 1px 2px rgba(16,40,63,.08);transition:transform .12s,background .15s}
.apphdr .home:active,.apphdr .hb:active:not(:disabled){transform:scale(.96)}
/* the bears stand on the same line as the word 首页 (feet on its baseline) */
.apphdr .home{align-items:center;padding:0 10px;min-width:56px}
.apphdr .home span{display:none}   /* just the bears, on every screen size */
/* the picture has a heart above the bears: lift it so the bears themselves sit in the middle of the bubble
   (bears span 52–194 of the 194px-tall picture; their middle is 13.4% below the picture's middle) */
.apphdr .home .bear{height:32px;width:auto;flex:none;margin:0;position:relative;top:-4.3px;transform-origin:50% 100%;transition:transform .25s cubic-bezier(.34,1.56,.64,1)}
@media (hover:hover){.apphdr .home:hover .bear{transform:scale(1.1) rotate(-6deg)}}
.apphdr h1{font-weight:600;letter-spacing:.02em}
@media (max-width:520px){.apphdr .home{width:auto;min-width:52px;padding:0 8px}.apphdr .home .bear{height:30px;top:-4px}}

/* ---------- cards: soft, round, no hard outline ---------- */
.card,.panel,.wiz,.kpis{border-color:transparent!important;box-shadow:var(--bt-shadow)}
.card{border-radius:16px!important;background:var(--bt-card)}
.panel,.wiz{border-radius:16px}
.modal .box{border-radius:20px}
.tbl-scroll{border-color:var(--bt-line2)!important;border-radius:12px}
h2{color:var(--bt-ink);font-weight:600;letter-spacing:.02em}

/* ---------- buttons, tabs, segmented controls: pills ---------- */
nav.tabs,.seg{border-radius:999px!important;background:rgba(255,255,255,.6)!important;box-shadow:inset 0 0 0 1px rgba(16,40,63,.06)}
nav.tabs button,.seg button{border-radius:999px!important}
nav.tabs button[aria-selected="true"],.seg button[aria-pressed="true"]{background:var(--bt-card)!important;box-shadow:0 1px 3px rgba(16,40,63,.14)!important;color:var(--bt-ink)!important}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) nav.tabs,:root:not([data-theme="light"]) .seg{background:rgba(255,255,255,.06)!important}
  :root:not([data-theme="light"]) nav.tabs button[aria-selected="true"],:root:not([data-theme="light"]) .seg button[aria-pressed="true"]{background:#2c3a63!important}}
:root[data-theme="dark"] nav.tabs,:root[data-theme="dark"] .seg{background:rgba(255,255,255,.06)!important}
:root[data-theme="dark"] nav.tabs button[aria-selected="true"],:root[data-theme="dark"] .seg button[aria-pressed="true"]{background:#2c3a63!important}
[data-range].btn{border-radius:999px}
select{border-radius:999px}

/* ---------- investing: the market strip floats on the sky ---------- */
.strip{background:rgba(255,255,255,.55)!important;border-bottom:0!important;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .strip{background:rgba(22,32,64,.72)!important}}
:root[data-theme="dark"] .strip{background:rgba(22,32,64,.72)!important}

/* ---------- fonts (option D): Fredoka for English and numbers (equal-width digits), 站酷快乐体 for headings, 苹方 for Chinese text ---------- */
:root{
  --bt-sys:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Segoe UI",Roboto,"Noto Sans SC","Helvetica Neue",Arial,sans-serif;
  --bt-body:"Fredoka Bear",var(--bt-sys);
  --bt-head:"Fredoka Bear","ZCOOL KuaiLe",var(--bt-sys);
  --f-display:var(--bt-body); --f-sans:var(--bt-body); --f-num:var(--bt-body); --display:var(--bt-body);
}
body,button,input,select,textarea{font-family:var(--bt-body)}
.apphdr h1,h1,h2,h3,nav.tabs button,.bt-head{font-family:var(--bt-head)!important;font-weight:600;font-synthesis-weight:none;letter-spacing:.03em}
nav.tabs button{font-weight:500}
