/* site_extra.css - shared dashboard polish */
:root{
  --surface:var(--bb-theme-surface, #111820);
  --surface-2:var(--bb-theme-surface, #151c26);
  --line:var(--bb-theme-line, rgba(255,255,255,.10));
  --line-strong:var(--bb-theme-line, rgba(255,255,255,.15));
}
.sidebar{width:232px;padding:22px 14px}
.main{margin-left:232px;padding:24px}
.brand{margin-bottom:28px}
.brand-mark{width:42px;height:42px;border-radius:10px;font-size:23px}
.brand-title{font-size:19px}
.brand-subtitle{font-size:12px}
.nav{gap:7px}
.nav-item{
  min-height:auto;
  padding:11px 14px;
  border-radius:9px;
  gap:11px;
  font-size:15px;
  border:1px solid var(--bb-theme-line, transparent);
}
.nav-item.active{
  background:linear-gradient(90deg,rgba(var(--bb-theme-accent-rgb, 245,200,76), 0.18),rgba(var(--bb-theme-accent-rgb, 245,200,76), 0.04));
  border-color:var(--bb-theme-accent-text, rgba(245,200,76,.55));
  color:var(--gold);
}
.sidebar-status{
  border-radius:10px;
  padding:12px 13px;
  bottom:58px;
  background:rgba(var(--bb-theme-surface-rgb, 255,255,255), 0.04);
}
.status-title{margin-bottom:10px}
.version{bottom:22px}
.topbar{
  display:grid;
  grid-template-columns:minmax(260px,1fr) auto auto;
  gap:14px;
  align-items:start;
}
.page-title{font-size:28px;line-height:1.15}
.title-icon{display:none}
.last-updated{font-size:13px}
.page-hint{
  max-width:340px;
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
  border:1px solid var(--bb-theme-line, rgba(255,255,255,.08));
  border-radius:8px;
  padding:8px 10px;
  background:rgba(var(--bb-theme-surface-rgb, 255,255,255), 0.02);
}
.main > h2{
  margin:0 0 12px;
  font-size:24px;
  font-weight:900;
}
.main > p,
.main > ul{
  color:var(--bb-theme-muted, #cbd3df);
}
.panel,
.page-panel{
  border:1px solid var(--line-strong);
  border-radius:10px;
  background:linear-gradient(180deg,rgba(var(--bb-theme-surface-rgb, 255,255,255), 0.045),rgba(var(--bb-theme-surface-rgb, 255,255,255), 0.022));
  box-shadow:0 16px 32px rgba(var(--bb-theme-shadow-rgb, 0,0,0), 0.22);
  margin-bottom:14px;
}
.page-panel{padding:16px}
.panel h3,
.page-panel h3{margin-top:0}
table{
  border:1px solid var(--bb-theme-line, rgba(255,255,255,.10));
  border-radius:10px;
  overflow:hidden;
  background:rgba(var(--bb-theme-surface-rgb, 255,255,255), 0.018);
}
th{
  background:rgba(var(--bb-theme-surface-rgb, 255,255,255), 0.035);
}
td,th{
  border-bottom:1px solid var(--bb-theme-line, rgba(255,255,255,.07));
}
button,
.btn{
  border-radius:7px;
  border:1px solid var(--bb-theme-accent, rgba(246,198,75,.28));
  background:rgba(var(--bb-theme-accent-rgb, 246,198,75), 0.08);
  color:var(--gold);
  font-weight:800;
}
input,select,textarea{
  border:1px solid var(--bb-theme-line, rgba(255,255,255,.10));
  background:rgba(var(--bb-theme-inset-rgb, 255,255,255), 0.035);
  color:var(--text);
  border-radius:7px;
  padding:7px 9px;
}
textarea{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
label{color:var(--bb-theme-muted, #cbd3df)}
.settings-form h3{border-top:1px solid var(--bb-theme-line, rgba(255,255,255,.07));padding-top:12px}
.settings-form h3:first-child{border-top:0;padding-top:0}
.settings-form input[type="number"]{max-width:110px;margin:3px 0 7px 6px}
.settings-form select{min-width:180px}
.action-row{display:flex;flex-wrap:wrap;gap:6px}
.action-row button{padding:6px 9px}
.record-card{
  border:1px solid var(--bb-theme-line, rgba(255,255,255,.12))!important;
  background:linear-gradient(180deg,rgba(var(--bb-theme-surface-rgb, 255,255,255), 0.04),rgba(var(--bb-theme-surface-rgb, 255,255,255), 0.02))!important;
  border-radius:10px!important;
  padding:14px!important;
  margin-bottom:10px!important;
  color:var(--bb-theme-ink, #e7edf6)!important;
}
.record-card strong{color:var(--bb-theme-ink, #fff)}
.p1-card{
  border:1px solid var(--bb-theme-accent, rgba(246,198,75,.18))!important;
  border-radius:10px!important;
  background:linear-gradient(180deg,rgba(var(--bb-theme-accent-rgb, 246,198,75), 0.055),rgba(var(--bb-theme-surface-rgb, 255,255,255), 0.02))!important;
  box-shadow:0 16px 32px rgba(var(--bb-theme-shadow-rgb, 0,0,0), 0.22);
}
.table-wrap{overflow:auto;border:1px solid var(--bb-theme-line, rgba(255,255,255,.08));border-radius:10px}
.table-wrap table{border:0;border-radius:0}
.data-empty {
  padding:10px;
  border:1px dashed var(--bb-theme-accent, rgba(246,198,75,0.25));
  background:rgba(var(--bb-theme-accent-rgb, 246,198,75), 0.08);
  color:var(--bb-theme-muted, #d9c47f);
  border-radius:8px;
  margin:8px 0;
}
.coming-soon{opacity:0.65;cursor:help}
.status-badge{font-size:0.92rem;color:var(--bb-theme-muted, #cbd3df)}
.update-spinner{display:inline-block;width:16px;height:16px;border:2px solid var(--bb-theme-line, #ccc);border-top-color:var(--bb-theme-up, #2b8);border-radius:50%;animation:spin .8s linear infinite;vertical-align:middle;margin-left:6px}
@keyframes spin{to{transform:rotate(360deg)}}

@media(max-width:1100px){
  .topbar{grid-template-columns:1fr}
  .top-action-groups,.top-actions{justify-content:flex-start}
}
/* page-top-v1 (owner 2026-10-31 「策略、交易、AI…都应该跟总览一样平铺在整个页面里…不要收边」): inside the 工作台 frame
   (body.in-workbench, set in base.html) these pages add no side margin or outer box of their own, so their first boxes
   line up with the frame edge exactly like 总览's cards. Opened on their own or in the app they are unchanged. */
/* workspace-flat-v1 (owner 2026-10-31 「不要在这个边上划…是在整个浏览器的边上划」): the 工作台 shows these pages across the whole
   window under the floating header, so the page itself carries the standard spacing — 24 px sides and content 88 px from the
   top on wider screens, 12 px / 72 px on phones (same numbers as --bb-page-top) — and its scrollbar is the browser edge. */
html body.in-workbench:is(.page-settings,.page-paper):not(#_) main.main{padding:88px 24px 32px!important;max-width:none!important}
@media(max-width:800px){html body.in-workbench:is(.page-settings,.page-paper):not(#_) main.main{padding:72px 12px 24px!important}}
html body.in-workbench.page-settings:not(#_) .settings-form{padding-top:0!important}
html body.in-workbench.page-settings:not(#_) .settings-form{padding-left:0!important;padding-right:0!important;margin-left:0!important;margin-right:0!important;max-width:none!important;width:auto!important}
html body.in-workbench.page-settings:not(#_) .strategy-square-grid{padding-left:0!important;padding-right:0!important;border:0!important;background:transparent!important;box-shadow:none!important}
html body.in-workbench.page-ai:not(#_) .chat-center{box-sizing:border-box!important;padding-top:88px!important;border:0!important;border-radius:0!important;box-shadow:none!important}
@media(max-width:800px){html body.in-workbench.page-ai:not(#_) .chat-center{padding-top:72px!important}}

/* mobile-workspace-fixes-20261031: neutral strategy canvas; glass surfaces keep the shared tokens. */
html[data-bigbit-skin=glass]:has(body.in-workbench.page-settings):not(#_){background-image:none!important}
html body.in-workbench.page-settings:not(#_){min-height:100dvh;background:var(--bb-theme-canvas)!important}
/* The embedded-app offset must not pull the workspace trade content above its standard top line. */
html body.in-workbench.page-paper:not(#_) .bigbit-account-strip{margin-top:0!important}

/* h5-flat-v1: inside the H5 shell the 交易 / 策略 pane now reaches the screen bottom; the page itself clears the
   bottom bars (74 px nav + 44 px 进入新版 bar + safe area) so the last card is never hidden under them. */
html body.in-h5-shell:is(.page-paper,.page-settings):not(#_){padding-bottom:calc(130px + env(safe-area-inset-bottom))!important}
