:root {
  --bf-blue: #06266f;
  --bf-blue-mid: #0a358f;
  --bf-blue-dark: #031842;
  --bf-gold: #f5a623;
  --bf-gold-light: #ffc14d;
  --bf-gold-grad: linear-gradient(135deg, #f5a623, #ffc14d);
  --bf-bg: #eef1f7;
  --bf-card: #ffffff;
  --bf-text: #16203d;
  --bf-muted: #7a8299;
  --bf-border: #e3e8f2;
  --bf-green: #0fae52;
  --bf-green-bg: #e7f8ee;
  --bf-red: #e0353e;
  --bf-red-bg: #fdecee;
  --shadow-sm: 0 1px 3px rgba(16, 34, 77, 0.08);
  --shadow-md: 0 4px 16px rgba(16, 34, 77, 0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bf-bg);
  color: var(--bf-text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ---- 顶部导航 ---- */
.navbar {
  background: linear-gradient(135deg, var(--bf-blue-dark), var(--bf-blue) 55%, var(--bf-blue-mid));
  color: #fff;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  box-shadow: 0 2px 12px rgba(3, 24, 66, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo { display: flex; align-items: center; }
.brand .name { font-size: 17px; font-weight: 700; letter-spacing: 0.3px; }
.brand .name small { display: block; font-size: 10px; font-weight: 400; color: #9fb0d8; letter-spacing: 0.5px; }
.links { display: flex; align-items: center; gap: 6px; }
.links a {
  color: #b9c5e6; text-decoration: none; font-size: 14px;
  padding: 7px 16px; border-radius: 8px; transition: all 0.15s;
}
.links a:hover { color: #fff; background: rgba(255,255,255,0.08); }
.links a.active { color: var(--bf-gold); font-weight: 600; background: rgba(245,166,35,0.12); }
.live-dot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #9fb0d8; margin-left: 10px; }
.live-dot .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bf-green); box-shadow: 0 0 0 3px rgba(15,174,82,0.25); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

.container { max-width: 1280px; margin: 24px auto; padding: 0 24px; }

/* ---- Hero 大屏 ---- */
.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 18px;
  margin-bottom: 20px;
}
.hero-main {
  background: linear-gradient(135deg, var(--bf-blue-dark), var(--bf-blue));
  color: #fff; border-radius: 16px; padding: 26px 30px;
  box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
.hero-main::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(245,166,35,0.25), transparent 70%);
}
.hero-label { font-size: 13px; color: #9fb0d8; letter-spacing: 1px; }
.hero-value { font-size: 44px; font-weight: 800; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.hero-value.up { color: #5be28a; }
.hero-value.down { color: #ff7b84; }
.hero-sub { font-size: 13px; color: #b9c5e6; }

.hero-side {
  background: var(--bf-card); border-radius: 16px; padding: 22px 26px;
  box-shadow: var(--shadow-md); display: flex; flex-direction: column; justify-content: center; gap: 14px;
}
.hero-side .row { display: flex; justify-content: space-between; align-items: center; }
.hero-side .row .k { color: var(--bf-muted); font-size: 13px; }
.hero-side .row .v { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- 卡片 ---- */
.card {
  background: var(--bf-card); border: 1px solid var(--bf-border);
  border-radius: 14px; padding: 20px; box-shadow: var(--shadow-sm);
}
.card h2 {
  font-size: 14px; color: var(--bf-blue); margin-bottom: 14px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.card h2::before { content: ''; width: 4px; height: 16px; background: var(--bf-gold-grad); border-radius: 2px; }

.grid { display: grid; gap: 18px; }
.grid-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(500px, 1fr)); }

.stat { text-align: center; padding: 16px 12px; }
.stat .num { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .num.green { color: var(--bf-green); }
.stat .num.red { color: var(--bf-red); }
.stat .num.gold { color: var(--bf-gold); }
.stat .label { font-size: 12px; color: var(--bf-muted); margin-top: 6px; }

/* ---- 曲线图 ---- */
.chart-wrap { width: 100%; height: 220px; position: relative; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }

/* ---- 表格 ---- */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 8px; text-align: left; border-bottom: 1px solid var(--bf-border); font-size: 12px; white-space: nowrap; }
th { color: var(--bf-muted); font-weight: 600; font-size: 11px; background: #f8fafd; }
tbody tr:hover { background: #f6f8fc; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
img, svg, canvas { max-width: 100%; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 5px; font-size: 12px; font-weight: 600; }
.badge.long { background: var(--bf-green-bg); color: var(--bf-green); }
.badge.short { background: var(--bf-red-bg); color: var(--bf-red); }
.badge.none { background: #eef1f7; color: var(--bf-muted); }
.badge.scheduled { background: #fff5e0; color: #b7791f; }
.badge.completed { background: var(--bf-green-bg); color: var(--bf-green); }

.pnl-up { color: var(--bf-green); font-weight: 700; }
.pnl-down { color: var(--bf-red); font-weight: 700; }

/* ---- Tab ---- */
.tabs { display: flex; gap: 4px; background: #eef1f7; padding: 4px; border-radius: 10px; margin-bottom: 14px; }
.tabs button {
  flex: 1; border: none; background: transparent; padding: 8px 12px;
  border-radius: 7px; font-size: 13px; cursor: pointer; color: var(--bf-muted);
  transition: all 0.15s;
}
.tabs button.active { background: #fff; color: var(--bf-blue); font-weight: 700; box-shadow: var(--shadow-sm); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- 登录 ---- */
.login-box { max-width: 380px; margin: 40px auto 0; padding: 28px; }
.login-box .logo-big { text-align: center; margin-bottom: 20px; }
.login-box input {
  width: 100%; padding: 11px 14px; margin: 8px 0 16px;
  border: 1px solid var(--bf-border); border-radius: 8px; font-size: 16px;
}
.login-box input:focus { outline: none; border-color: var(--bf-blue); box-shadow: 0 0 0 3px rgba(6,38,111,0.1); }

/* ---- 表单/按钮 ---- */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 12px; color: var(--bf-muted); margin-bottom: 5px; }
.form-row input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--bf-border); border-radius: 8px; font-size: 16px;
}
.form-row textarea {
  width: 100%; min-height: 118px; padding: 12px 14px; border: 1px solid var(--bf-border);
  border-radius: 8px; font: inherit; font-size: 16px; line-height: 1.55; resize: vertical;
}
.form-row textarea:focus { outline: none; border-color: var(--bf-blue); box-shadow: 0 0 0 3px rgba(6,38,111,.08); }
.signal-filters { display:flex; align-items:center; justify-content:flex-end; gap:8px; margin:-4px 0 12px; }
.signal-filters input { padding:7px 9px; border:1px solid var(--bf-border); border-radius:7px; color:var(--bf-text); }
.signal-filters button { border:1px solid var(--bf-border); background:#fff; color:var(--bf-blue); border-radius:7px; padding:7px 10px; cursor:pointer; }
.signal-filters span { color:var(--bf-muted); font-size:12px; min-width:42px; text-align:center; }
.form-row input:focus { outline: none; border-color: var(--bf-blue); }
.admin-logo-preview { width: 88px; height: 88px; object-fit: contain; display: block; margin: 0 auto 14px; border-radius: 18px; background: #f5f7fb; padding: 8px; }
.experience-history { margin-top:20px; padding-top:16px; border-top:1px solid var(--bf-border); }
.experience-history-title { color:var(--bf-blue); font-size:13px; font-weight:700; margin-bottom:10px; }
.experience-item { padding:11px 12px; border:1px solid var(--bf-border); border-radius:9px; margin-bottom:8px; background:#fbfcff; }
.experience-item.revoked { opacity:.58; }
.experience-item-main { display:flex; gap:9px; align-items:flex-start; font-size:13px; line-height:1.45; }
.experience-item-main b { color:var(--bf-gold); flex-shrink:0; }
.experience-item-foot { display:flex; justify-content:space-between; align-items:center; margin-top:7px; color:var(--bf-muted); font-size:11px; }
.revoke-btn { border:0; background:var(--bf-red-bg); color:var(--bf-red); border-radius:6px; padding:5px 9px; cursor:pointer; font-weight:700; }
.experience-empty { color:var(--bf-muted); font-size:12px; padding:8px 0; }
.strategy-stat { position:relative; overflow:hidden; }
.strategy-stat::before { content:''; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--bf-blue); }
.strategy-stat-title { color:var(--bf-blue); font-size:12px; font-weight:800; margin-bottom:4px; }
.strategy-badge { display:inline-block; min-width:26px; padding:3px 7px; border-radius:6px; text-align:center; font-size:11px; font-weight:800; }
.strategy-a { color:var(--bf-blue); background:#e8efff; }
.strategy-c { color:#166534; background:#dcfce7; }
.strategy-b { color:#9a5b00; background:#fff1d6; }
.admin-content { max-width: 1180px; margin: 0 auto; }
.admin-page-intro { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; }
.admin-page-intro h1 { color:var(--bf-blue); font-size:24px; margin:3px 0 4px; }
.admin-page-intro p { color:var(--bf-muted); font-size:13px; }
.admin-eyebrow { color:var(--bf-gold); font-size:10px; font-weight:800; letter-spacing:1.4px; }
.admin-live { color:var(--bf-green); background:var(--bf-green-bg); border-radius:999px; padding:7px 12px; font-size:12px; font-weight:700; white-space:nowrap; }
.admin-card { margin-top:14px; }
.admin-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:18px; }
.admin-fields .form-row { min-width:0; }
.admin-fields .exp-select, .admin-fields input { min-height:42px; }
.admin-bottom-nav { display:none; }
.admin-nav-icon { font-size:18px; line-height:1; }
@media (min-width: 768px) {
  .admin-content { display:block; overflow-y:auto; }
  .admin-brand-card { max-width:100%; }
}
@media (max-width: 767px) {
  .admin-content { padding:14px 12px 90px; }
  .admin-page-intro { align-items:flex-start; }
  .admin-page-intro h1 { font-size:21px; }
  .admin-page-intro p { line-height:1.5; }
  .admin-fields { display:block; }
  .admin-card h2 { margin-bottom:16px; }
  .admin-content .btn { min-height:44px; }
  .admin-content .admin-section { display:none; }
  .admin-content .admin-section.active { display:block; }
  .admin-bottom-nav { display:flex; position:fixed; left:0; right:0; bottom:0; z-index:60; height:calc(62px + env(safe-area-inset-bottom, 0px)); padding-bottom:env(safe-area-inset-bottom, 0px); background:rgba(255,255,255,.70); backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px); border-top:1px solid rgba(255,255,255,.20); box-shadow:0 -6px 22px rgba(16,34,77,.10); }
  .admin-bottom-nav button { flex:1; border:0; background:transparent; color:var(--bf-muted); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; font-size:11px; font-weight:600; }
  .admin-bottom-nav button.active { color:var(--bf-blue); }
  .admin-bottom-nav button.active .admin-nav-icon { color:var(--bf-gold); transform:translateY(-1px); }
}

.btn {
  display: inline-block; background: var(--bf-gold-grad); color: #fff;
  border: none; padding: 10px 22px; border-radius: 8px;
  font-size: 14px; font-weight: 700; cursor: pointer; text-decoration: none;
  box-shadow: 0 3px 10px rgba(245,166,35,0.35); transition: transform 0.1s, box-shadow 0.15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(245,166,35,0.45); }
.btn.blue { background: linear-gradient(135deg, var(--bf-blue), var(--bf-blue-mid)); box-shadow: 0 3px 10px rgba(6,38,111,0.3); }

.toast {
  position: fixed; bottom: 24px; right: 24px; background: var(--bf-blue);
  color: #fff; padding: 13px 22px; border-radius: 10px; display: none;
  box-shadow: var(--shadow-md); z-index: 200;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero-value { font-size: 34px; }
  .container { padding: 0 14px; margin: 14px auto; }
  .navbar { padding: 0 14px; height: 54px; }
  .brand .name small { display: none; }
  .links a { padding: 6px 10px; font-size: 13px; }
  .tab-panel { overflow-x: auto; }
  table { min-width: 500px; }
  .stat .num { font-size: 22px; }
  .hero-main { padding: 20px; }
  .hero-side { padding: 16px 18px; }
}

/* ================= App 布局 ================= */
html, body { height: 100%; width: 100%; overflow: hidden; max-width: 100%; }

.app-shell {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bf-bg);
}
@media (min-width: 768px) {
  .app-shell {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(1080px, 100vw);
    box-shadow: 0 0 30px rgba(3,24,66,0.12);
  }
}

/* 桌面端：内容区更宽，表格完整展示 */
@media (min-width: 768px) {
  .app-content { padding: 20px 28px; }
  .market-card { display: inline-block; width: calc(50% - 8px); margin: 0 12px 12px 0; vertical-align: top; }
  .markets-grid { display: flex; flex-wrap: wrap; }
}

.app-header {
  flex-shrink: 0;
  height: calc(54px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: linear-gradient(135deg, var(--bf-blue-dark), var(--bf-blue) 55%, var(--bf-blue-mid));
  color: #fff; display: flex; align-items: center; justify-content: space-between;
  z-index: 50;
}
.app-header .brand { display: flex; align-items: center; gap: 9px; }
.brand-logo { width: 30px; height: 30px; object-fit: contain; display: block; }
.app-header .name { font-size: 16px; font-weight: 700; }
.app-header .live-dot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #b9c5e6; }
.app-header .live-dot .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bf-green); box-shadow: 0 0 0 3px rgba(15,174,82,0.25); animation: pulse 2s infinite; }
.header-right { display: flex; align-items: center; gap: 12px; }
.lang-switch { position: relative; }
.lang-btn {
  color: #b9c5e6; background: transparent; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 7px 8px; border-radius: 6px; transition: all 0.15s;
}
.lang-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.lang-menu {
  position: absolute; top: 36px; right: 0; background: #fff; border-radius: 8px;
  box-shadow: 0 6px 20px rgba(3,24,66,0.2); overflow: hidden; display: none; z-index: 200;
  min-width: 120px;
}
.lang-menu button {
  display: block; width: 100%; padding: 10px 16px; border: none; background: none;
  text-align: left; font-size: 13px; color: var(--bf-text); cursor: pointer;
}
.lang-menu button:hover { background: #f4f6fb; color: var(--bf-blue); }

.app-content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px; background: var(--bf-bg); -webkit-overflow-scrolling: touch; min-height: 0; }
.tab { display: none; }
.tab.active { display: block; }

/* 电脑端：隐藏底部导航，所有内容多列平铺 */
@media (min-width: 768px) {
  .bottom-nav { display: none; }
  .app-content { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-content: start; padding: 20px 24px; }
  .tab { display: block !important; }
  #tab-markets, #tab-performance, #tab-chart { grid-column: 1 / -1; }
}

.bottom-nav {
  position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); width: min(92vw, 430px);
  display: flex; align-items: center;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.42); border-radius: 24px;
  height: 58px; padding: 4px 6px;
  z-index: 50;
  box-shadow: 0 8px 28px rgba(19,35,70,.16), inset 0 1px 0 rgba(255,255,255,.55);
}
.bottom-nav button {
  flex: 1; border: none; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 11px; line-height: 1.2; font-weight: 700; color: var(--bf-muted); transition: color 0.18s, transform 0.18s;
  padding: 4px 3px; position: relative; min-width: 0; border-radius: 19px;
}
.bottom-nav button svg { display:block; width:22px; height:22px; padding:3px; border-radius:9px; transition:transform .18s, background .18s, color .18s; }
.bottom-nav button.active { color: var(--bf-blue); font-weight: 700; background:rgba(231,238,255,.92); box-shadow:0 2px 8px rgba(26,54,110,.10); }
.bottom-nav button.active svg { transform:translateY(-1px) scale(1.08); color:var(--bf-blue); }
.bottom-nav button:active { transform:scale(.94); }

/* 交易标的卡片 */
.market-card {
  background: var(--bf-card); border: 1px solid var(--bf-border);
  border-radius: 14px; padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
}
.market-state { padding: 42px 16px; text-align: center; color: var(--bf-muted); font-size: 14px; }
.market-state.error { color: #b7791f; }
.m-top { display: flex; justify-content: space-between; align-items: center; }
.m-symbol { font-size: 17px; font-weight: 800; color: var(--bf-blue); }
.m-symbol span { font-size: 12px; color: var(--bf-muted); font-weight: 500; }
.m-quote { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 6px; }
.m-price { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.m-change { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.m-stats { display: flex; flex-wrap: wrap; gap: 10px 16px; color: var(--bf-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.m-stats b { color: var(--bf-text); font-weight: 700; }
.m-source { color: var(--bf-muted); font-size: 10px; margin-top: 7px; }
.m-bottom { display: flex; justify-content: space-between; font-size: 12px; color: var(--bf-muted); padding-top: 8px; border-top: 1px dashed var(--bf-border); }

/* 盈亏大屏 */
.perf-hero {
  background: linear-gradient(135deg, var(--bf-blue-dark), var(--bf-blue));
  color: #fff; border-radius: 16px; padding: 24px; text-align: center;
  margin-bottom: 14px; box-shadow: var(--shadow-md); position: relative; overflow: hidden;
}
.perf-hero::after { content:''; position:absolute; right:-50px; top:-50px; width:180px; height:180px; background: radial-gradient(circle, rgba(245,166,35,0.22), transparent 70%); }
.perf-label { font-size: 13px; color: #9fb0d8; letter-spacing: 1px; }
.perf-value { font-size: 42px; font-weight: 800; margin: 6px 0; font-variant-numeric: tabular-nums; }
.perf-sub { font-size: 13px; color: #b9c5e6; }

/* 我的页面 */
.me-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--bf-border); font-size: 14px; }
.me-row:last-child { border-bottom: none; }
.me-row span { color: var(--bf-muted); }
.me-row b { font-weight: 700; font-variant-numeric: tabular-nums; }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--bf-border);
  border-radius: 8px;
}
.table-wrap table { width: 100%; min-width: max-content; }
.table-wrap thead th { position: sticky; top: 0; z-index: 2; }

/* ---- K线详情 ---- */
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.back-btn { background: none; border: none; color: var(--bf-blue); font-size: 15px; font-weight: 600; cursor: pointer; padding: 4px 0; }
.chart-title { font-size: 16px; font-weight: 800; color: var(--bf-blue); }
.chart-price { font-size: 14px; font-weight: 700; }

.tf-btns { display: flex; gap: 6px; margin-bottom: 10px; }
.tf-btns button {
  flex: 1; border: 1px solid var(--bf-border); background: #fff; color: var(--bf-muted);
  padding: 6px 0; border-radius: 6px; font-size: 12px; cursor: pointer;
}
.tf-btns button.active { background: var(--bf-blue); color: #fff; border-color: var(--bf-blue); font-weight: 600; }

.kline-wrap { width: 100%; height: 360px; }
.kline-wrap canvas { width: 100%; height: 100%; display: block; }

.back-link { color: #cbd5f0; text-decoration: none; font-size: 14px; font-weight: 600; }
.back-link:active { opacity: 0.7; }

/* ================= 电脑版布局（成熟后台模板） ================= */
body.web-page { height: 100vh; overflow: hidden; }
.desktop-layout { display: flex; height: 100vh; width: 100%; }
.sidebar {
  width: 220px; flex-shrink: 0;
  background: linear-gradient(180deg, #031842, #06266f 70%, #0a358f);
  color: #fff; display: flex; flex-direction: column;
}
.sidebar-brand { padding: 20px 18px; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-brand .brand-logo { width: 34px; height: 34px; }
.sidebar-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 14px;
  color: #aebbe0; text-decoration: none; border-radius: 9px; margin-bottom: 3px;
  font-size: 14px; cursor: pointer; transition: all 0.15s;
}
.sidebar-nav a svg { flex-shrink: 0; }
.sidebar-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.sidebar-nav a.active { background: var(--bf-gold); color: #fff; font-weight: 700; box-shadow: 0 3px 10px rgba(245,166,35,0.3); }
.desktop-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bf-bg); }
.desktop-header {
  height: 60px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; background: #fff; border-bottom: 1px solid var(--bf-border);
}
.desktop-header h1 { font-size: 19px; color: var(--bf-blue); font-weight: 700; }
.desktop-header .right { display: flex; align-items: center; gap: 16px; }
.desktop-header .right .live-dot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--bf-muted); }
.desktop-header .right .live-dot .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bf-green); box-shadow: 0 0 0 3px rgba(15,174,82,0.25); animation: pulse 2s infinite; }
.desktop-content { flex: 1; overflow-y: auto; padding: 22px 24px; }
.view { display: none; }
.view.active { display: block; }
.view h2.page-title { font-size: 16px; color: var(--bf-blue); margin-bottom: 16px; }

.exp-select { width: 100%; padding: 10px 12px; border: 1px solid var(--bf-border); border-radius: 8px; font-size: 16px; background: #fff; }

/* ---- 交易终端细节优化：只调整呈现，不改变数据与交互逻辑 ---- */
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid rgba(245,166,35,0.45); outline-offset: 2px;
}
.card, .market-card { transition: box-shadow .18s ease, border-color .18s ease; }
.market-card:hover, .card:hover { border-color: #cbd6eb; box-shadow: var(--shadow-md); }
.market-card:active { transform: translateY(1px); }
.table-wrap { background: var(--bf-card); }
tbody tr:last-child td { border-bottom: 0; }
th { letter-spacing: .02em; }
.badge { min-width: 54px; text-align: center; }
.desktop-content { scrollbar-gutter: stable; }
.desktop-content > .view { max-width: 1480px; margin: 0 auto; }
.desktop-layout .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.desktop-layout .hero { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr); }
.desktop-layout .card { min-width: 0; }

@media (max-width: 767px) {
  .app-content { padding: 12px 12px 92px; }
  .card { padding: 16px; border-radius: 12px; }
  .market-card { padding: 16px; }
  .m-price { font-size: 28px; }
  .perf-value { font-size: 38px; }
  .bottom-nav { box-shadow: 0 8px 28px rgba(19,35,70,.16), inset 0 1px 0 rgba(255,255,255,.55); }
  .bottom-nav button { min-height: 48px; gap: 3px; font-size: 11px; }
  .bottom-nav button span { max-width:64px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .table-wrap { margin-left: -2px; margin-right: -2px; }
  .kline-wrap { height: min(52vh, 360px); min-height: 260px; }
}

@media (min-width: 1400px) {
  .sidebar { width: 240px; }
  .desktop-header { padding-left: 32px; padding-right: 32px; }
  .desktop-content { padding-left: 32px; padding-right: 32px; }
}

/* iOS/Android 添加到主屏幕后：独立窗口自身接管安全区，避免内容顶到状态栏或整体上移。 */
@media (display-mode: standalone), (display-mode: fullscreen) {
  body { background: var(--bf-blue-dark); }
  .app-shell { top: 0; bottom: 0; }
  .app-header { height: calc(54px + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); }
  .app-content { padding-bottom: 92px; }
  .bottom-nav { bottom: 3px; height: 58px; padding: 4px 6px; border-radius: 24px; }
}

/* 后台桌面端：固定阅读宽度、双栏表单和清晰的内容分组。 */
@media (min-width: 768px) {
  .admin-content { display: block !important; width: 100%; max-width: none; padding: 24px 40px 40px; }
  .app-shell:has(.admin-content) { width: 100vw; max-width: none; }
  .admin-sidebar { display:flex; position:absolute; left:0; top:0; bottom:0; width:220px; z-index:70; }
  .app-shell:has(.admin-content) .app-header,
  .app-shell:has(.admin-content) .admin-content { margin-left:220px; }
  .app-shell:has(.admin-content) .app-header { width:calc(100% - 220px); }
  .app-shell:has(.admin-content) .admin-content { width:calc(100% - 220px); }
  .admin-page-intro { margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--bf-border); }
  .admin-page-intro h1 { font-size: 26px; }
  .admin-card { margin-top: 20px; padding: 24px 26px; }
  .admin-card h2 { font-size: 16px; margin-bottom: 20px; }
  .admin-brand-card { display: grid; grid-template-columns: 130px minmax(0,1fr) 180px; align-items: center; gap: 22px; }
  .admin-brand-card h2 { grid-column: 1 / -1; margin-bottom: 0; }
  .admin-brand-card .admin-logo-preview { grid-row: 2 / span 2; margin: 0; width: 112px; height: 112px; }
  .admin-brand-card .form-row { margin: 0; }
  .admin-brand-card .btn { width: 100% !important; }
  .admin-brand-card > div:last-child { grid-column: 2 / -1; }
  .admin-content .admin-section[data-section="trading-a"] .admin-fields,
  .admin-content .admin-section[data-section="trading-c"] .admin-fields { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px 22px; }
  .admin-content .admin-section { display: none; }
  .admin-content .admin-section.active { display: block; }
  .admin-content .admin-section.active { width: 100%; max-width: 1180px; margin: 0 auto; }
  .admin-content .admin-page-intro { max-width: 1180px; margin-left: auto; margin-right: auto; }
  .admin-bottom-nav { display: none; }
}

@media (max-width: 767px) {
  .admin-sidebar { display:none; }
}

/* 信号页日期快捷按钮 */
.range-btn {
  padding: 5px 10px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 14px;
  background: transparent;
  color: #9aa3b5;
  font-size: 12px;
  cursor: pointer;
}
.range-btn.active {
  background: #f5a623;
  color: #06266f;
  border-color: #f5a623;
  font-weight: 600;
}

/* 2026-10 UI consistency: preserve desktop/mobile frameworks, fix internal overflow and state presentation. */
.desktop-main, .desktop-content, .desktop-content > .view { min-width: 0; width: 100%; }
.desktop-content .card { min-width: 0; overflow-x: auto; }
.desktop-content .table-wrap { max-width: 100%; overflow-x: auto; }
.desktop-content table { min-width: max-content; }
.empty-hint, .form-help { color: var(--bf-muted); font-size: 12px; line-height: 1.55; margin-top: 8px; }
.security-note { color: #8b5e00; background: #fff8e6; border: 1px solid #f4d48a; border-radius: 8px; padding: 9px 11px; margin: -6px 0 16px; font-size: 12px; line-height: 1.5; }
.secret-status { display: block; color: var(--bf-muted); font-size: 11px; margin-top: 4px; }
.secret-status.configured { color: var(--bf-green); }
.section-save { width: 100%; margin-top: 8px; }
.learning-summary { color: var(--bf-blue); font-weight: 700; line-height: 1.6; }
@media (max-width: 767px) {
  .app-content .table-wrap { max-width: 100%; }
  .app-content .card { min-width: 0; }
  .security-note { margin-top: -4px; }
}
