/*
 * sidebar.css - 左侧导航栏布局样式
 * 仅调整 __base__.html 的导航显示样式，不影响页面业务逻辑
 */

:root {
    --tts-sidebar-width: 240px;
    --tts-sidebar-collapsed-width: 68px;
    --tts-mobilebar-height: 56px;
}

/* ==================== 主区域 ==================== */

.tts-main {
    margin-left: var(--tts-sidebar-width);
    min-height: 100vh;
    background: #f4f6f8;
    transition: margin-left .28s ease;
    display: flex;
    flex-direction: column;
}

body.tts-collapsed .tts-main {
    margin-left: var(--tts-sidebar-collapsed-width);
}

/* 内容区：加宽并水平居中，弹性占据剩余高度 */
.tts-content {
    flex: 1 1 auto;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 12px 28px 48px;
    box-sizing: border-box;
}

/* 页脚：始终钉在视口底部 */
.tts-footer {
    flex: 0 0 auto;
    margin-top: auto;
    background: #eee;
    border-top: 1px solid #ccc;
    text-align: center;
    padding: 12px 16px;
}

.tts-footer p {
    margin: 6px 0;
}

.tts-footer img {
    vertical-align: -3px;
}

body.tts-collapsed .tts-main {
    margin-left: var(--tts-sidebar-collapsed-width);
}

/* ==================== 侧边栏整体 ==================== */

.tts-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--tts-sidebar-width);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #22333f 0%, #1a2833 55%, #14202a 100%);
    box-shadow: 2px 0 14px rgba(15, 25, 35, .18);
    z-index: 1000;
    transition: width .28s ease, transform .28s ease;
}

body.tts-collapsed .tts-sidebar {
    width: var(--tts-sidebar-collapsed-width);
}

/* ==================== 品牌区 ==================== */

.tts-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px 16px;
    text-decoration: none !important;
}

.tts-brand-logo {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #37b5a6, #23767e);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(35, 118, 126, .35);
}

.tts-brand-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    white-space: nowrap;
}

.tts-brand-name {
    color: #f2f7f7;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.25;
}

body.tts-collapsed .tts-brand {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.tts-collapsed .tts-brand-text {
    display: none;
}

/* 折叠按钮 */
.tts-collapse-btn {
    position: absolute;
    right: -12px;
    top: 72px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #e3e8ec;
    background: #fff;
    color: #66788a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
    z-index: 1001;
    padding: 0;
    transition: transform .28s ease, color .15s ease;
}

.tts-collapse-btn:hover {
    color: #23767e;
}

body.tts-collapsed .tts-collapse-btn {
    transform: rotate(180deg);
}

/* ==================== 导航菜单 ==================== */

.tts-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 12px 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .15) transparent;
}

.tts-nav::-webkit-scrollbar {
    width: 5px;
}

.tts-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .12);
    border-radius: 3px;
}

.tts-nav-group-title {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #64808d;
    letter-spacing: 2px;
    padding: 16px 10px 6px;
    white-space: nowrap;
    overflow: hidden;
}

.tts-nav-group-title > .tts-badge-vip {
    margin-left: auto;
}

.tts-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    margin: 2px 0;
    border-radius: 8px;
    color: #aebfc9;
    font-size: 15.5px;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background .18s ease, color .18s ease;
}

.tts-nav-item:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.tts-nav-item.tts-active {
    background: linear-gradient(90deg, rgba(55, 181, 166, .22), rgba(55, 181, 166, .07));
    color: #fff;
    font-weight: 600;
}

.tts-nav-item.tts-active::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    border-radius: 0 4px 4px 0;
    background: #37b5a6;
}

/* VIP 徽标 */
.tts-badge-vip {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #e8b64c, #cf8a2d);
    color: #fff;
    letter-spacing: .5px;
    vertical-align: 1px;
    white-space: nowrap;
}

/* 折叠态：菜单 */
body.tts-collapsed .tts-nav {
    padding-left: 10px;
    padding-right: 10px;
}

body.tts-collapsed .tts-nav-item {
    justify-content: center;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
}

body.tts-collapsed .tts-nav-item .tts-label {
    display: none;
}

body.tts-collapsed .tts-nav-group-title {
    height: 1px;
    min-height: 1px;
    padding: 0;
    margin: 10px 6px;
    background: rgba(255, 255, 255, .08);
    color: transparent;
}

/* 折叠态下彻底隐藏分组标题内的文字与徽标 */
body.tts-collapsed .tts-nav-group-title > * {
    display: none !important;
}

/* ==================== 底部用户区 ==================== */

.tts-userzone {
    flex: 0 0 auto;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, .07);
}

.tts-usercard {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    color: #dfe9ee;
    transition: background .18s ease;
}

.tts-usercard:hover {
    background: rgba(255, 255, 255, .07);
}

/* ==================== 首字头像（全站通用） ==================== */

.tts-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-weight: 600;
    user-select: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .15);
    flex: 0 0 auto;
    overflow: hidden;
    /* 默认品牌色兜底：配色 JS 未生效时也可正常显示 */
    background: linear-gradient(135deg, #37b5a6, #23767e);
}

.tts-usercard .tts-avatar {
    width: 34px;
    height: 34px;
    font-size: 15px;
}

.tts-avatar-80 {
    width: 80px;
    height: 80px;
    font-size: 34px;
}

.tts-avatar-28 {
    width: 28px;
    height: 28px;
    font-size: 13px;
}

.tts-avatar-22 {
    width: 22px;
    height: 22px;
    font-size: 11px;
}

.tts-avatar-20 {
    width: 20px;
    height: 20px;
    font-size: 10px;
}

.tts-avatar-inline {
    margin-right: 5px;
    vertical-align: -4.5px;
}

.tts-user-meta {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    white-space: nowrap;
}

.tts-user-name {
    font-size: 15px;
    font-weight: 600;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tts-user-plan {
    font-size: 12px;
    color: #7f97a3;
}

/* ==================== 深色用户下拉菜单（匹配侧边栏配色） ==================== */

.tts-user-drop {
    min-width: 190px;
    padding: 6px;
    background: linear-gradient(180deg, #243744, #1a2833);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(5, 15, 25, .45);
}

.tts-user-drop .uk-dropdown-nav li a {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    border-radius: 8px;
    color: #cfdbe2;
    font-size: 14px;
}

.tts-user-drop .uk-dropdown-nav li a:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.tts-user-more {
    margin-left: auto;
    color: #7f97a3;
}

body.tts-collapsed .tts-usercard {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.tts-collapsed .tts-user-meta,
body.tts-collapsed .tts-user-more {
    display: none;
}

/* 未登录按钮 */
.tts-authzone {
    display: flex;
    gap: 10px;
}

.tts-btn-ghost,
.tts-btn-accent {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 0;
    border-radius: 8px;
    font-size: 15px;
    text-decoration: none !important;
    transition: all .18s ease;
}

.tts-btn-ghost {
    color: #cfdbe2;
    border: 1px solid rgba(255, 255, 255, .25);
}

.tts-btn-ghost:hover {
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.tts-btn-accent {
    background: linear-gradient(135deg, #37b5a6, #23767e);
    color: #fff;
    box-shadow: 0 4px 10px rgba(35, 118, 126, .35);
}

.tts-btn-accent:hover {
    filter: brightness(1.08);
    color: #fff;
}

body.tts-collapsed .tts-authzone {
    flex-direction: column;
    gap: 8px;
}

body.tts-collapsed .tts-btn-ghost .tts-label,
body.tts-collapsed .tts-btn-accent .tts-label {
    display: none;
}

/* ==================== 个人中心 - 整体布局（左用户卡 / 右主区） ==================== */

#vm.uk-grid {
    align-items: flex-start;
    margin-left: 0;
}

#vm > .uk-width-1-6 .uk-box-shadow-medium,
#vm > [class*="uk-width-"] .uk-box-shadow-medium {
    margin-right: 0;
}

#vm > *:last-child {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

/* ==================== 个人中心 - 用户信息（会员到期 / 注册时间） ==================== */
/* 与下方「我的策略 / 我的组合」同风格的简洁两行 */

.tts-userstat {
    margin: 0 12px 14px;
    padding: 0;
    text-align: center;
}

.tts-userstat-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 0;
    border-top: 1px solid #eef1f5;
}

.tts-userstat-row:first-child {
    border-top: 0;
}

.tts-userstat-label {
    font-size: 13px;
    color: #8a98a4;
    margin-right: 8px;
}

.tts-userstat-value {
    font-size: 13px;
    color: #2f3b46;
    font-weight: 500;
}

.tts-userstat-value.tts-userstat-vip {
    color: #cf8a2d;
    font-weight: 600;
}

/* ==================== 【阶段2】实际回测区间（合并到时间行末尾，行内显示） ==================== */
.bt-qp-period {
    margin-left: 18px;
    color: #8a98a4;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: .3px;
    line-height: 1.5;
    white-space: nowrap;
}

.bt-qp-period > span {
    color: #2f3b46;
    font-weight: 500;
    font-size: 13px;
}

.bt-qp-period > span.bt-qp-period-sep {
    margin: 0 10px;
    color: #c5cdd4;
    font-weight: 400;
    font-size: 13px;
}

/* ==================== 【阶段2】快速选周期工具栏（创建组合/策略页） ==================== */
/* flex 行布局：开始时间 / 结束时间 / 快速选周期 同一行 */
.bt-qp-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 6px 0;
    padding: 0;             /* 不加 padding/border，让"初始资金"那行和本行起点对齐 */
}
.bt-qp-row-left {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.bt-qp-row-right {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.bt-qp-row input[type="date"],
.bt-qp-row input[type="text"] {
    height: 30px !important;          /* override UIkit .uk-input 的 40px */
    font-size: 13px;
    padding: 2px 6px;
    border: 1px solid #d8dde2;
    border-radius: 4px;
    margin: 0;
    vertical-align: middle;
    display: inline-block;
    line-height: 26px;
}

/* 行内版（嵌在第八步"其他参数设置"卡片里） */
.bt-qp-inline-label {
    color: #5a6573;
    font-weight: 600;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    height: 30px;
    line-height: 30px;
    margin: 0;
    white-space: nowrap;
}

.bt-qp-inline-select {
    display: inline-block !important;
    width: auto !important;
    min-width: 110px;
    height: 30px !important;          /* 与 input 同高 30px */
    max-height: 30px;
    line-height: 26px;
    font-size: 13px;
    padding: 2px 22px 2px 8px;        /* 右侧 22px 给箭头 */
    border: 1px solid #d8dde2;
    border-radius: 4px;
    background: #fff;
    vertical-align: middle;
    margin: 0;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}

/* 块状版（兼容旧调用位，已不再使用，保留兜底） */
.bt-quick-period-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f7f9fc;
    border: 1px solid #eef1f5;
    border-radius: 8px;
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #2f3b46;
}

/* ==================== 【阶段3】年度收益（转置表格：表头=年份横向排列） ==================== */
.bt-yearly-transposed {
    border: 1px solid #e8ebef;
    border-radius: 6px;
    overflow-x: auto;
    background: #fff;
}
.bt-yt-row {
    display: flex;
    flex-wrap: nowrap;
    border-bottom: 1px solid #f0f2f5;
}
.bt-yt-row:last-child { border-bottom: none; }
.bt-yt-cell {
    flex: 0 0 80px;
    min-width: 80px;
    padding: 9px 6px;
    text-align: center;
    font-size: 13px;
    border-right: 1px solid #f0f2f5;
    vertical-align: middle;
    white-space: nowrap;
}
.bt-yt-cell:last-child { border-right: none; }
.bt-yt-label {
    flex: 0 0 110px;
    min-width: 110px;
    background: #fafbfc;
    font-weight: 600;
    color: #5a6573;
}
.bt-yt-header {
    background: #fafbfc;
    border-bottom: 2px solid #e0e4ea;
    position: sticky;
    top: 0;
    z-index: 2;
}
.bt-yt-header .bt-yt-label {
    background: #fafbfc;
}
.bt-yt-year {
    cursor: pointer;
    font-weight: 700;
    color: #2f3b46;
    transition: background 0.12s;
}
.bt-yt-year:hover {
    background: #eef4ff;
}
.bt-yt-active {
    background: #e8f4ff !important;
    color: #1e87f0 !important;
    box-shadow: inset 0 -3px 0 #1e87f0;
}

/* tt-work 风格年度卡片：浅红边 + 卡片背景 = 容器底色（融入背景），紧凑间距 */
/* CSS Grid 自适应列宽：第一行填满容器，第二行与第一行对齐 */
.bt-yearly-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
    min-height: 40px;  /* 占位，避免 yearly_cards 为空时网格塌陷看不到 */
}
.bt-yt-card {
    background: #fff;  /* 改为白底，让卡片显形 */
    border: 1px solid rgba(255, 77, 79, 0.35);
    border-radius: 6px;
    padding: 12px 10px;
    text-align: center;  /* 卡片内容居中 */
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.12s, border-color 0.12s, background 0.12s;
    user-select: none;
}
.bt-yt-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border-color: rgba(255, 77, 79, 0.65);
    background: rgba(255, 77, 79, 0.04);
}
.bt-yt-card.bt-yt-active {
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.2);
    background: rgba(22, 119, 255, 0.05);
}
.bt-yt-card-year {
    font-size: 12px;
    color: #555;
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.bt-yt-card-ret {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    margin: 4px 0;
}
.bt-yt-card-dd {
    font-size: 11px;
    color: #888;
    margin-top: 6px;
}
.bt-yt-card-bench {
    font-size: 11px;
    margin-top: 6px;
    padding: 2px 6px;
    border-radius: 3px;
    color: #595959;
    background: rgba(89,89,89,0.06);
    display: inline-block;
}


/* 用 div 网格代替多个 table，让所有年份行无缝排列，没有间隙 */
.bt-yearly-list {
    border: 1px solid #e8ebef;
    border-radius: 6px;
    overflow: hidden;
}
.bt-yearly-header-row {
    display: grid;
    grid-template-columns: 80px 130px 130px 130px 120px 160px;
    background: #fafbfc;
    border-bottom: 2px solid #e0e4ea;
    font-size: 13px;
    font-weight: 600;
    color: #5a6573;
}
.bt-yearly-header-row > div {
    padding: 8px 6px;
    text-align: center;
    border-right: 1px solid #eef1f5;
}
.bt-yearly-header-row > div:last-child { border-right: none; }
.bt-year-row {
    display: grid;
    grid-template-columns: 80px 130px 130px 130px 120px 160px;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.12s, box-shadow 0.12s;
    cursor: pointer;
}
.bt-year-row:last-child { border-bottom: none; }
.bt-year-row > div {
    padding: 9px 6px;
    font-size: 13px;
    text-align: center;
    border-right: 1px solid #f0f2f5;
    vertical-align: middle;
}
.bt-year-row > div:last-child { border-right: none; }
.bt-year-row:hover {
    background: #f5f9ff;
}
.bt-year-row-active {
    background: #e8f4ff !important;
    box-shadow: inset 3px 0 0 #1e87f0;
}

/* 保留旧卡片样式（兜底） */

/* tt-work 风格：单行横向滚动，多张紧凑卡片 */
.bt-yearly-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding: 4px 0 8px 0;
}
.bt-year-card {
    flex: 0 0 92px;
    border-radius: 6px;
    padding: 8px 10px;
    text-align: center;
    border: 1px solid;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    user-select: none;
}
.bt-year-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.bt-year-active {
    box-shadow: 0 0 0 2px #1677ff !important;
}
.bt-year-label {
    font-size: 11px;
    color: #888;
    margin-bottom: 3px;
}
.bt-year-ret {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}
.bt-year-dd {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}
.bt-year-bench {
    font-size: 11px;
    margin-top: 2px;
    padding: 1px 4px;
    border-radius: 3px;
    color: #595959;
    background: rgba(89,89,89,0.08);
    display: inline-block;
}
/* 数字颜色：A 股习惯 — 红涨绿跌 */
.bt-pos { color: #ff4d4f !important; }
.bt-neg { color: #52c41a !important; }
.bt-year-dd {
    font-size: 10px;
    color: #8a98a4;
    margin-bottom: 2px;
}
.bt-year-bench {
    font-size: 10px;
    margin-top: 2px;
    padding-top: 4px;
    border-top: 1px dashed #e8ebef;
}
/* 保留旧的 v1 卡片样式以防回滚 */
.bt-yearly-card {
    border-radius: 8px;
    padding: 10px 12px;
    border: 1px solid #e8ebef;
    background: #fafbfc;
    text-align: center;
    transition: box-shadow 0.15s;
}
.bt-yearly-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.bt-yearly-card-year {
    font-size: 12px;
    color: #7a8693;
    margin-bottom: 4px;
}
.bt-yearly-card-ret {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 6px;
}
.bt-yearly-pos { border-left: 3px solid #c0392b; }
.bt-yearly-pos .bt-yearly-card-ret { color: #c0392b; }
.bt-yearly-neg { border-left: 3px solid #27ae60; }
.bt-yearly-neg .bt-yearly-card-ret { color: #27ae60; }
.bt-yearly-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    border-top: 1px dashed #e8ebef;
    padding-top: 6px;
}
.bt-yearly-card-stat {
    display: inline-flex;
    flex-direction: column;
    flex: 1;
    align-items: center;
    gap: 1px;
}
.bt-yearly-stat-label {
    font-size: 10px;
    color: #8a98a4;
}
.bt-yearly-stat-val {
    font-size: 12px;
    font-weight: 600;
    color: #2f3b46;
}

.bt-qp-label {
    color: #5a6573;
    font-weight: 600;
    white-space: nowrap;
}

.bt-qp-select {
    width: auto;
    min-width: 110px;
    height: 32px;
    font-size: 13px;
}

.bt-qp-hint {
    color: #8a98a4;
    font-size: 12px;
    margin-left: 4px;
}

/* ==================== 移动端顶栏与遮罩 ==================== */

.tts-mobilebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--tts-mobilebar-height);
    background: linear-gradient(90deg, #22333f, #1a2833);
    color: #fff;
    align-items: center;
    padding: 0 10px;
    z-index: 1200;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

.tts-iconbtn {
    background: none;
    border: 0;
    color: #fff;
    padding: 8px;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tts-iconbtn:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.tts-mobilebar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    margin-left: 6px;
    text-decoration: none !important;
    letter-spacing: 1px;
    flex: 1;
}

.tts-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 20, 30, .45);
    z-index: 999;
}

@media (max-width: 959px) {

    .tts-sidebar {
        transform: translateX(-100%);
        width: var(--tts-sidebar-width) !important;
    }

    body.tts-mobile-open .tts-sidebar {
        transform: translateX(0);
    }

    .tts-collapse-btn {
        display: none;
    }

    .tts-main,
    body.tts-collapsed .tts-main {
        margin-left: 0;
        padding-top: var(--tts-mobilebar-height);
    }

    .tts-content {
        padding: 12px 14px 40px;
    }

    .tts-mobilebar {
        display: flex;
    }

    body.tts-mobile-open .tts-backdrop {
        display: block;
    }
}

@media (min-width: 960px) {
    .tts-backdrop {
        display: none !important;
    }
}




/* ==================== 历史交易记录区（bt-sym-*） ==================== */
/* 参考 tt-work/TradeKlineInline.vue + StrategyCreate.vue 实现 */

/* 外层卡片 */
.bt-sym-card {
    background: #fff;
    border: 1px solid #e3e8ee;
    border-radius: 10px;
    padding: 14px 16px 18px;
    margin: 18px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}

.bt-sym-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.bt-sym-title {
    font-size: 15px;
    font-weight: 700;
    color: #2f3b46;
}

.bt-sym-stat {
    color: #8a98a4;
    font-size: 12px;
    margin-left: 8px;
}

.bt-sym-stat b {
    color: #2f3b46;
    font-weight: 600;
}

/* 模式切换 radio */
.bt-sym-mode {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #5a6573;
}
.bt-sym-mode label {
    cursor: pointer;
    padding: 4px 10px;
    border: 1px solid #e3e8ee;
    border-radius: 16px;
    user-select: none;
    transition: all .15s;
}
.bt-sym-mode label.bt-sym-mode-active {
    background: #22333f;
    color: #fff;
    border-color: #22333f;
}
.bt-sym-mode input { display: none; }

/* 标的 tab 栏 */
.bt-sym-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid #e3e8ee;
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.bt-sym-tab {
    cursor: pointer;
    padding: 6px 12px;
    border: 1px solid #e3e8ee;
    border-radius: 18px;
    font-size: 12px;
    background: #f8fafc;
    color: #5a6573;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}

.bt-sym-tab:hover {
    border-color: #22333f;
    color: #22333f;
}

.bt-sym-tab-active {
    background: #22333f;
    color: #fff;
    border-color: #22333f;
    font-weight: 600;
}

.bt-sym-tab-count {
    background: rgba(255,255,255,.18);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 11px;
}
.bt-sym-tab:not(.bt-sym-tab-active) .bt-sym-tab-count {
    background: #eef1f5;
    color: #5a6573;
}

.bt-sym-tab-code {
    font-weight: 700;
}
.bt-sym-tab-cn {
    color: inherit;
    opacity: .85;
}
.bt-sym-tab-pnl {
    font-weight: 600;
}
.bt-pos { color: #c0392b; }
.bt-neg { color: #27ae60; }

/* 全部历史表格 */
.bt-sym-tab-table {
    margin-top: 8px;
    max-height: 480px;
    overflow: auto;
}

.bt-trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.bt-trades-table th,
.bt-trades-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eef1f5;
    text-align: left;
}
.bt-trades-table th {
    background: #f4f6f8;
    color: #5a6573;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}
.bt-trades-table tr.bt-hover-row:hover {
    background: #f8fafc;
}
.bt-trades-table .bt-dir-buy {
    color: #c0392b;
    font-weight: 700;
}
.bt-trades-table .bt-dir-sell {
    color: #27ae60;
    font-weight: 700;
}

/* 单 K 线容器 */
.bt-sym-kline {
    width: 100%;
    height: 420px;
    background: #fff;
    border-radius: 6px;
}

/* 平铺多图容器 */
.bt-sym-tab-tiles {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bt-sym-tab-tile {
    background: #fafbfc;
    border: 1px solid #e3e8ee;
    border-radius: 8px;
    padding: 10px 12px 12px;
}

.bt-sym-tab-tile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 13px;
}

.bt-sym-tab-tile-header .bt-sym-tab-code {
    color: #2f3b46;
    font-weight: 700;
}

.bt-sym-tab-tile-chart {
    width: 100%;
    height: 320px;
}

/* 空状态 */
.bt-sym-empty {
    color: #8a98a4;
    font-size: 13px;
    text-align: center;
    padding: 36px 0;
}

/* 响应式：小屏 tab 栏允许横向滚动 */
@media (max-width: 720px) {
    .bt-sym-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .bt-sym-tab { flex-shrink: 0; }
}
