html,
body.tm-market-page {
    background: #fff !important;
    color: #222;
}
body.tm-market-page .tm-site-header,
body.tm-market-page .tm-market-main-tabs,
body.tm-market-page .tm-market-mobile-toolbar,
body.tm-market-page .tm-market-mobile-search,
body.tm-market-page .tm-home-summary,
body.tm-market-page .tm-market-side,
body.tm-market-page .customer-service,
body.tm-market-page #tm-global-footer-host {
    display: none !important;
}
body.tm-market-page .tm-market-stage {
    min-height: 100vh;
    padding: 4px 8px 64px;
    background: #fff;
}
body.tm-market-page .tm-market-stage::after { display: none; }
body.tm-market-page .tm-market-shell {
    width: 100%;
    max-width: 1100px;
    min-height: calc(100vh - 72px);
    margin: 0 auto;
    padding: 0 18px 20px;
    background: #fff;
}
.tm-market-title {
    height: 48px;
    margin: 0 -18px;
    border-bottom: 4px solid #f3f4f6;
    text-align: center;
    line-height: 44px;
    font-size: 16px;
    font-weight: 600;
}
body.tm-market-page .tm-market-layout {
    display: block;
    margin: 0;
}
body.tm-market-page .tm-market-main { display: block; }
body.tm-market-page .tm-market-board {
    display: block;
    background: #fff;
    border: 0;
    overflow: visible;
}
body.tm-market-page .tm-market-table-header,
body.tm-market-page .tm-market-table-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(82px, 0.65fr) 82px;
    column-gap: 12px;
    align-items: center;
    padding-left: 0;
    padding-right: 0;
}
body.tm-market-page .tm-market-table-header {
    min-height: 46px;
    background: #fff;
    color: #888f99;
    font-size: 13px;
    font-weight: 400;
}
body.tm-market-page .tm-market-table-header > :nth-child(2) { text-align: right; }
body.tm-market-page .tm-market-table-header > :nth-child(3) { text-align: center; }
body.tm-market-page .tm-market-table-body { min-height: 0; }
body.tm-market-page .tm-market-table-row {
    min-height: 76px;
    padding-top: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #edf0f3;
    color: #252525;
    font-size: 14px;
}
body.tm-market-page .tm-market-table-row:hover {
    background: #f8fbfc;
    box-shadow: none;
}
body.tm-market-page .tm-market-name {
    min-width: 0;
    gap: 8px;
    align-items: center;
}
body.tm-market-page .tm-market-name img,
body.tm-market-page .tm-market-name .tm-market-symbol-badge {
    width: 25px;
    height: 25px;
    flex-basis: 25px;
}
body.tm-market-page .tm-market-name-details { min-width: 0; }
body.tm-market-page .tm-market-name-main {
    color: #242424;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.tm-market-page .tm-market-name-sub {
    display: block;
    margin-top: 6px;
    color: #90969d;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.tm-market-page .tm-market-price {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    color: #e7473e;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
}
body.tm-market-page .tm-market-price.is-up { color: #1eb889; }
body.tm-market-page .tm-market-price small {
    color: #848b92;
    font-size: 12px;
    font-weight: 400;
}
body.tm-market-page .tm-market-price > span:not(.tm-market-change),
body.tm-market-page .tm-market-price > small {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
body.tm-market-page .tm-market-change {
    display: inline-flex;
    justify-self: stretch;
    align-items: center;
    justify-content: center;
    height: 28px;
    min-width: 0;
    padding: 0 2px;
    border-radius: 5px;
    background: #e7493f;
    color: #fff !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
body.tm-market-page .tm-market-change.is-up { background: #22b88c; }
body.tm-market-page .tm-market-change.is-unavailable { background: #a6adb6; }
body.tm-market-page .tm-market-empty { color: #818994; }
@media (max-width: 640px) {
    body.tm-market-page .tm-market-stage { padding: 4px 8px 64px; background: #fff; }
    body.tm-market-page .tm-market-shell { padding: 0 18px 20px; }
    body.tm-market-page .tm-market-table-header,
    body.tm-market-page .tm-market-table-row {
        grid-template-columns: minmax(0, 1fr) minmax(75px, 0.67fr) 82px;
        column-gap: 10px;
    }
}
@media (max-width: 380px) {
    body.tm-market-page .tm-market-shell { padding-left: 12px; padding-right: 12px; }
    .tm-market-title { margin-left: -12px; margin-right: -12px; }
    body.tm-market-page .tm-market-table-header,
    body.tm-market-page .tm-market-table-row {
        grid-template-columns: minmax(0, 1fr) minmax(72px, 0.67fr) 70px;
        column-gap: 6px;
    }
    body.tm-market-page .tm-market-change { font-size: 11px; }
    body.tm-market-page .tm-market-price { font-size: 13px; }
}

/* Market terminal: this stylesheet is loaded only by /index/index/market. */
html, body.tm-market-page, body.tm-market-page .tm-market-stage {
    background: #fff !important;
    color: #171b24;
}
body.tm-market-page .tm-mobile-bottom-bar { display: none !important; }
body.tm-market-page .tm-market-stage {
    min-height: 100vh;
    padding: 0 0 16px;
}
body.tm-market-page .tm-market-shell {
    max-width: none;
    padding: 0 14px;
    min-height: 0;
}
body.tm-market-page .tm-market-desktop-top {
    height: 43px;
    display: flex;
    align-items: center;
    gap: 9px;
    border-bottom: 1px solid #edf0f6;
    white-space: nowrap;
}
.tm-market-desktop-logo {
    width: 62px;
    height: 37px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #111;
    flex: 0 0 62px;
}
.tm-market-desktop-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tm-market-brand { text-decoration: none; color: #fff; }
.tm-market-brand > span { display: block; position: relative; color: #fff; font-size: 19px; letter-spacing: -1.8px; line-height: 1; font-weight: 900; font-style: italic; }
.tm-market-brand > span::after { content: ""; position: absolute; left: 69%; top: 1px; width: 2px; height: 18px; transform: rotate(-29deg); background: #ec283e; }
.tm-market-brand small { display: block; font-size: 4px; font-style: normal; letter-spacing: 1.2px; text-align: center; margin-top: 2px; }
.tm-market-top-action, .tm-market-periods button {
    background: #fff;
    border: 0;
    color: #202431;
    cursor: pointer;
    font-size: 13px;
    padding: 6px 7px;
}
.tm-market-top-action.is-active, .tm-market-periods button.is-active {
    background: #e5f0ff;
    color: #0666f7;
}
.tm-market-periods { display: flex; gap: 3px; align-items: center; }
.tm-market-top-spacer { flex: 1 1 auto; }
.tm-market-top-user { max-width: 190px; overflow: hidden; text-overflow: ellipsis; color: #3b4453; text-decoration: none; font-size: 12px; }
body.tm-market-page .tm-market-layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr) 260px;
    gap: 7px;
    margin: 3px 0 0;
    height: min(620px, calc(100vh - 365px));
    min-height: 440px;
}
body.tm-market-page .tm-market-main, body.tm-market-page .tm-market-board,
.tm-market-workspace, .tm-market-chart-panel, .tm-market-order-side {
    min-width: 0;
    min-height: 0;
}
body.tm-market-page .tm-market-main { display: block; border: 1px solid #f0f1f5; border-radius: 10px; overflow: hidden; }
body.tm-market-page .tm-market-board { height: 100%; display: flex; flex-direction: column; }
.tm-market-desktop-filter { display: flex; gap: 8px; align-items: center; height: 49px; padding: 4px 8px; }
.tm-market-desktop-search {
    height: 32px; display: flex; align-items: center; gap: 5px; border-radius: 19px;
    padding: 0 10px; background: #f5f5f7; min-width: 0; flex: 1;
}
.tm-market-desktop-search span { font-size: 24px; color: #404b60; line-height: 1; }
.tm-market-desktop-search input { width: 100%; min-width: 0; border: 0; outline: none; background: transparent; }
.tm-market-desktop-filter select { width: 120px; height: 32px; color: #657182; border: 1px solid #e4e8f1; background: #fff; border-radius: 4px; font-size: 12px; }
body.tm-market-page .tm-market-table-body { min-height: 0; overflow-y: auto; flex: 1; scrollbar-width: thin; }
body.tm-market-page .tm-market-table-row {
    display: grid;
    grid-template-columns: minmax(87px, 1fr) minmax(63px, .75fr) 62px;
    gap: 3px;
    height: 53px;
    min-height: 53px;
    padding: 2px 8px;
    border-bottom: 1px solid #eef0f4;
    color: #222;
    border-radius: 0;
}
body.tm-market-page .tm-market-table-row:hover {
    background: #f5f9ff;
    box-shadow: none;
}
/* 选中品种底色加深（与 hover 浅色区分开） */
body.tm-market-page .tm-market-table-row.is-selected {
    background: #dce4f0;
    box-shadow: none;
}
body.tm-market-page .tm-market-name { gap: 5px; }
body.tm-market-page .tm-market-name-main { font-size: 12px; color: #202126; font-weight: 500; }
.tm-market-icon-wrap { width: 37px; height: 37px; position: relative; display: inline-block; flex: 0 0 37px; }
body.tm-market-page .tm-market-icon-wrap .tm-market-asset-icon,
body.tm-market-page .tm-market-icon-wrap .tm-market-symbol-badge {
    width: 24px; height: 24px; position: absolute; bottom: 1px; left: 1px;
    border-radius: 50%; object-fit: cover;
}
body.tm-market-page .tm-market-icon-wrap .tm-market-quote-flag {
    width: 23px; height: 23px; position: absolute; right: 0; top: 0;
    border-radius: 50%; object-fit: cover; z-index: 1;
}
body.tm-market-page .tm-market-price {
    display: contents;
    font-size: 12px; font-weight: 500; color: #f03b4c;
}
body.tm-market-page .tm-market-price.is-up { color: #0769f9; }
body.tm-market-page .tm-market-price > span:first-child {
    align-self: center; color: #f03b4c; font-size: 12px; white-space: nowrap;
    overflow: hidden; text-overflow: clip;
}
body.tm-market-page .tm-market-price.is-up > span:first-child { color: #0769f9; }
body.tm-market-page .tm-market-change {
    flex: none; min-width: 62px; max-width: 62px; height: 25px; align-self: center;
    background: #f23c4e; color: #fff !important; font-size: 10px; border-radius: 6px;
    white-space: nowrap; padding: 0;
}
body.tm-market-page .tm-market-change.is-up { background: #0966f9; }
/* 休市：灰色块 + 「休市」文案 */
body.tm-market-page .tm-market-change.is-closed { background: #a9b1bb; }
/* PC 宽屏不再显示迷你趋势（仅 ≤700px 移动端卡片保留） */
.tm-market-sparkline { display: none; height: 37px; width: 100%; overflow: hidden; }
.tm-market-sparkline svg { width: 100%; height: 100%; display: block; }
.tm-market-workspace, .tm-market-chart-panel { height: 100%; }
.tm-market-chart-panel { border: 1px solid #f0f1f5; border-radius: 10px; display: flex; flex-direction: column; padding: 8px 10px; }
.tm-market-chart-caption { flex: 0 0 40px; padding: 0 9px; font-size: 11px; }
.tm-market-chart-caption strong { display: block; color: #121820; font-size: 13px; }
.tm-market-chart-caption #tm-market-ohlc { color: #77808e; margin-top: 5px; }
.tm-market-chart-wrap { position: relative; flex: 1; min-height: 0; }
.tm-market-chart-wrap canvas { width: 100% !important; height: 100% !important; }
#tm-market-chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #a2a9b3; font-size: 13px; pointer-events: none; }
#tm-market-chart-empty[hidden] { display: none; }
.tm-market-order-side { display: flex; flex-direction: column; gap: 12px; }
.tm-market-account { background: #0662ed; border-radius: 10px; color: #fff; height: 95px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; }
.tm-market-account small { font-size: 12px; }
.tm-market-account span { font-size: 12px; opacity: .85; }
.tm-market-account strong { font-size: 24px; }
.tm-market-order-form { min-height: 0; background: #fff; border: 1px solid #f0f1f5; border-radius: 10px; padding: 13px 14px; display: flex; flex-direction: column; gap: 7px; }
.tm-market-order-form > strong { font-size: 13px; font-weight: 500; }
.tm-market-order-form > b { color: #0966f9; font-size: 18px; line-height: 1; }
.tm-market-order-form label { font-size: 12px; color: #222; margin-top: 2px; }
.tm-market-order-form input, .tm-market-order-form select, .tm-market-select-readonly {
    border: 1px solid #dce3ed; border-radius: 4px; height: 30px; width: 100%;
    padding: 0 8px; font: inherit; color: #414a57; font-size: 12px; background: #fff;
}
.tm-market-select-readonly { display: flex; align-items: center; }
.tm-market-kind-toggle { display: flex; gap: 8px; }
.tm-market-kind-toggle button { flex: 1; border: 1px solid #dce3ed; border-radius: 4px; height: 30px; font: inherit; font-size: 12px; color: #414a57; background: #fff; cursor: pointer; padding: 0 8px; }
.tm-market-kind-toggle button.is-active { border-color: #0769f9; color: #0769f9; background: #e6efff; }
.tm-market-pos-stats { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 12px; color: #79818c; }
.tm-market-pos-stats[hidden], .tm-market-pos-cats[hidden] { display: none; }
.tm-market-pos-stats b { font-weight: 600; color: #171d26; margin-left: 2px; }
.tm-market-pos-cats { display: flex; align-items: center; gap: 4px; padding: 6px 0 2px; border-bottom: 1px solid #f0f1f5; }
.tm-market-pos-cats button { border: 0; background: none; font: inherit; font-size: 12px; color: #79818c; cursor: pointer; padding: 3px 10px; border-radius: 4px; }
.tm-market-pos-cats button:hover { color: #0769f9; }
.tm-market-pos-cats button.is-active { color: #0769f9; background: #e6efff; font-weight: 600; }
.tm-market-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 46px 0 34px; color: #b3b9c2; font-size: 13px; }
.tm-market-empty-state svg { width: 92px; height: 76px; }
.tm-market-order-metrics { display: flex; justify-content: space-between; gap: 5px; margin-top: 9px; font-size: 12px; }
.tm-market-order-buttons { display: flex; gap: 8px; margin-top: 5px; }
.tm-market-order-buttons button { flex: 1; border: 0; border-radius: 20px; height: 29px; color: #fff; background: #0769f9; cursor: pointer; }
.tm-market-order-buttons .tm-market-sell { background: #f03d4c; }
.tm-market-order-buttons button:disabled { opacity: .5; cursor: wait; }
.tm-market-order-feedback { margin: 0; min-height: 16px; font-size: 11px; color: #d83242; }
.tm-market-positions { min-height: 220px; border: 1px solid #f0f1f5; border-radius: 9px; margin-top: 9px; padding: 6px 14px; }
.tm-market-position-tabs { display: flex; align-items: center; gap: 26px; height: 27px; }
.tm-market-position-tabs button { border: 0; background: none; color: #aab0b9; cursor: pointer; font-size: 13px; padding: 0; }
.tm-market-position-tabs button.is-active { color: #0666f7; }
.tm-market-positions-head, .tm-market-position-row { display: grid; grid-template-columns: 1.2fr repeat(7, 1fr); gap: 6px; align-items: center; min-height: 25px; font-size: 11px; }
.tm-market-positions-head { color: #adb2bc; }
.tm-market-position-row { color: #313844; border-top: 1px solid #eff1f4; }
body.tm-trade-quick .tm-market-positions-head, body.tm-trade-quick .tm-market-position-row { grid-template-columns: 1.2fr repeat(5, 1fr); }
.tm-market-position-row .tm-pos-pl.is-positive, .tm-orders-pl.is-positive, .tm-orders-card-pl.is-positive { color: #0869f9; font-weight: 600; }
.tm-market-position-row .tm-pos-pl.is-negative, .tm-orders-pl.is-negative, .tm-orders-card-pl.is-negative { color: #f13f4e; font-weight: 600; }
.tm-market-position-list { min-height: 160px; color: #9da5b0; display: block; padding-top: 5px; font-size: 12px; }
.tm-market-position-list.is-empty { display: flex; justify-content: center; align-items: center; }
.tm-market-mobile-head, .tm-market-bottom-nav { display: none; }
.tm-market-confirm[hidden] { display: none !important; }
.tm-market-confirm { position: fixed; inset: 0; background: rgba(14,24,40,.5); z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.tm-market-confirm-dialog { width: min(350px, 100%); padding: 20px; border-radius: 12px; background: #fff; color: #1b2638; box-shadow: 0 15px 50px #12213d33; }
.tm-market-confirm-dialog strong { font-size: 16px; }
.tm-market-confirm-dialog p { line-height: 1.5; white-space: pre-line; font-size: 13px; }
.tm-market-confirm-dialog div { display: flex; justify-content: flex-end; gap: 12px; }
.tm-market-confirm-dialog button { border: 0; border-radius: 5px; padding: 8px 17px; cursor: pointer; color: #fff; background: #0769f9; }
.tm-market-confirm-dialog button:first-child { background: #eef1f5; color: #333; }
@media (max-width: 900px) {
    body.tm-market-page .tm-market-layout { grid-template-columns: 210px minmax(0, 1fr) 230px; gap: 4px; }
    body.tm-market-page .tm-market-table-row { grid-template-columns: minmax(82px, 1fr) 68px 62px; }
    body.tm-market-page .tm-market-sparkline { display: none; }
}
@media (max-width: 700px) {
    html, body.tm-market-page { background: #f9fbfe !important; }
    body.tm-market-page .tm-market-stage { min-height: 100vh; padding: 0 0 calc(77px + env(safe-area-inset-bottom)); overflow: visible; background: #f9fbfe !important; }
    body.tm-market-page .tm-market-shell { padding: 0 15px; max-width: 460px; margin: 0 auto; }
    body.tm-market-page .tm-market-mobile-head { display: flex; align-items: center; justify-content: space-between; height: 64px; }
    .tm-market-locale { width: 36px; height: 26px; display: flex; align-items: center; font-size: 25px; line-height: 1; text-decoration: none; }
    .tm-market-locale img { display: block; width: 30px; height: 20px; object-fit: cover; }
    .tm-market-tw-flag { display: block; position: relative; width: 30px; height: 20px; background: #ed182b; }
    .tm-market-tw-flag::before { content: ""; position: absolute; left: 0; top: 0; width: 15px; height: 10px; background: #122a91; }
    .tm-market-tw-flag::after { content: ""; position: absolute; left: 5px; top: 2px; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
    .tm-market-logo { width: 94px; height: 47px; display: inline-flex; align-items: center; justify-content: center; background: #111; }
    .tm-market-logo > span { font-size: 29px; }
    .tm-market-logo small { font-size: 6px; }
    body.tm-market-page .tm-market-mobile-search-toggle { display: flex; align-items: center; justify-content: center; width: 37px; height: 37px; border: 1px solid #eff1f7; border-radius: 8px; background: #fff; color: #222; box-shadow: 0 3px 15px #c3cbd62b; }
    body.tm-market-page .tm-market-mobile-search-toggle svg { width: 23px; height: 23px; }
    body.tm-market-page .tm-market-mobile-toolbar { display: block !important; height: 48px; margin: 0 -15px 8px; }
    body.tm-market-page .tm-market-mobile-toolbar .tm-market-main-tabs { display: flex !important; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 5px 16px; background: #fff; border-radius: 0; }
    body.tm-market-page .tm-market-main-tab { background: #f1f3f7; color: #0d1119; border-radius: 18px; min-height: 29px; font-size: 15px; font-weight: 500; padding: 0 12px; line-height: 28px; }
    body.tm-market-page .tm-market-main-tab.is-active { background: #e2edff; color: #0966f9; }
    body.tm-market-page .tm-market-mobile-search { display: none; background: #fff; border: 1px solid #e5eaf1; border-radius: 9px; margin: 0 0 10px; }
    body.tm-market-page .tm-market-stage.is-search-open .tm-market-mobile-search { display: flex; }
    body.tm-market-page .tm-market-desktop-top, .tm-market-desktop-filter, .tm-market-workspace, .tm-market-order-side, .tm-market-positions { display: none !important; }
    body.tm-market-page .tm-market-layout { display: block; height: auto; min-height: 0; margin: 0; }
    body.tm-market-page .tm-market-main { border: 0; border-radius: 0; overflow: visible; }
    body.tm-market-page .tm-market-board { display: block; background: transparent; overflow: visible; }
    body.tm-market-page .tm-market-table-body { overflow: visible; }
    body.tm-market-page .tm-market-table-row {
        display: grid; grid-template-columns: minmax(125px, 1.35fr) minmax(68px, .85fr) minmax(80px, .9fr);
        gap: 4px; min-height: 66px; height: 66px; margin: 0 0 9px; padding: 0 10px;
        background: #fff; border: 0; border-radius: 16px; box-shadow: 0 2px 11px #cad4e123;
    }
    body.tm-market-page .tm-market-name { gap: 6px; }
    body.tm-market-page .tm-market-name-main { font-size: 15px; font-weight: 400; }
    body.tm-market-page .tm-market-icon-wrap { flex-basis: 44px; width: 44px; height: 43px; }
    body.tm-market-page .tm-market-icon-wrap .tm-market-asset-icon, body.tm-market-page .tm-market-icon-wrap .tm-market-symbol-badge { width: 25px; height: 25px; bottom: 2px; }
    body.tm-market-page .tm-market-icon-wrap .tm-market-quote-flag { width: 23px; height: 23px; right: 3px; top: 2px; }
    body.tm-market-page .tm-market-price { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 6px; font-size: 15px; color: #18202d; }
    body.tm-market-page .tm-market-price.is-up { color: #18202d; }
    body.tm-market-page .tm-market-price > span:first-child,
    body.tm-market-page .tm-market-price.is-up > span:first-child { align-self: flex-start; color: #18202d; font-size: 15px; }
    body.tm-market-page .tm-market-change, body.tm-market-page .tm-market-change.is-up {
        display: block; flex: none; min-width: 0; max-width: none; height: auto; align-self: flex-start;
        background: none; color: #ff3b4a !important; font-size: 13px; font-weight: 600; line-height: 1;
    }
    body.tm-market-page .tm-market-change.is-up { color: #0769f9 !important; }
    /* 移动端卡片：休市为灰色文字，无底色无箭头 */
    body.tm-market-page .tm-market-change.is-closed { color: #98a1ab !important; background: none; }
    body.tm-market-page .tm-market-change.is-down::after { content: " ▾"; }
    body.tm-market-page .tm-market-change.is-up::after { content: " ▴"; }
    body.tm-market-page .tm-market-sparkline { display: block; height: 35px; }
    .tm-market-bottom-nav {
        display: grid; position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
        grid-template-columns: repeat(5, minmax(0, 1fr)); height: calc(58px + env(safe-area-inset-bottom));
        padding: 0 0 env(safe-area-inset-bottom); background: #fff; box-shadow: 0 2px 29px #a1a1a12e;
    }
    .tm-market-bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; padding-bottom: 3px; text-decoration: none; font-size: 13px; line-height: 16px; color: #cecece; white-space: nowrap; }
    .tm-market-bottom-nav a.is-active { color: #0166fc; }
    .tm-market-bottom-nav .tm-nav-icon { width: 30px; height: 30px; display: block; flex: none; fill: currentColor; background: none; border-radius: 0; }
    .tm-market-bottom-nav .tm-market-bottom-trade { justify-content: flex-start; padding: 0; }
    .tm-market-bottom-nav .tm-market-bottom-trade .tm-nav-icon { position: relative; top: -25px; width: 50px; height: 50px; fill: #0166fc; }
}

/* ---------- PC 端整体字号加大一点（仅 tm-device-pc 作用域，移动端不受影响） ---------- */
body.tm-device-pc .tm-market-table-header { font-size: 14px; }
body.tm-device-pc .tm-market-name-main { font-size: 13px; }
body.tm-device-pc .tm-market-price, body.tm-device-pc .tm-market-price > span:first-child { font-size: 13px; }
body.tm-device-pc .tm-market-change { font-size: 11px; }
body.tm-device-pc .tm-market-desktop-filter select { font-size: 13px; }
body.tm-device-pc .tm-market-desktop-search input { font-size: 13px; }
body.tm-device-pc .tm-market-top-action, body.tm-device-pc .tm-market-periods button { font-size: 14px; }
body.tm-device-pc .tm-market-top-user { font-size: 13px; }
body.tm-device-pc .tm-market-chart-caption { font-size: 12px; }
body.tm-device-pc .tm-market-chart-caption strong { font-size: 14px; }
body.tm-device-pc .tm-market-order-form > strong { font-size: 14px; }
body.tm-device-pc .tm-market-order-form label, body.tm-device-pc .tm-market-order-form input,
body.tm-device-pc .tm-market-order-form select, body.tm-device-pc .tm-market-order-metrics { font-size: 13px; }
body.tm-device-pc .tm-market-order-feedback { font-size: 12px; }
body.tm-device-pc .tm-market-pos-stats, body.tm-device-pc .tm-market-pos-cats button { font-size: 13px; }
body.tm-device-pc .tm-market-positions-head, body.tm-device-pc .tm-market-position-row { font-size: 12px; }
body.tm-device-pc .tm-market-position-list { font-size: 13px; }
body.tm-device-pc .tm-market-position-tabs button { font-size: 14px; }
body.tm-device-pc .tm-market-account small, body.tm-device-pc .tm-market-account span { font-size: 13px; }

/* ---------- PC 顶栏语言切换（设计图：边框按钮 + 线框/阴影下拉） ---------- */
.tm-lang-switch { position: relative; flex: none; margin-right: 6px; }
.tm-lang-btn {
    display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px;
    border: 1px solid #dfe3ea; border-radius: 6px; background: #fff;
    color: #404b60; font-size: 12px; cursor: pointer;
}
.tm-lang-btn:hover { border-color: #0866f9; }
.tm-lang-btn img { width: 21px; height: 15px; object-fit: cover; border-radius: 2px; }
.tm-lang-btn svg { width: 10px; height: 6px; transition: transform .15s; }
.tm-lang-switch.is-open .tm-lang-btn svg { transform: rotate(180deg); }
.tm-lang-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 95; min-width: 158px;
    padding: 5px; background: #fff; border: 1px solid #e3e7ee; border-radius: 8px;
    box-shadow: 0 10px 26px rgba(22, 35, 58, .16);
}
.tm-lang-menu[hidden] { display: none; }
.tm-lang-item {
    display: flex; align-items: center; gap: 9px; width: 100%; padding: 7px 10px;
    border: 0; border-radius: 6px; background: none; color: #333; font-size: 13px;
    text-align: left; cursor: pointer;
}
.tm-lang-item img { width: 21px; height: 15px; object-fit: cover; border-radius: 2px; flex: none; }
.tm-lang-item:hover { background: #f2f6ff; }
.tm-lang-item.is-current { background: #0866f9; color: #fff; }

/* ---------- PC 持仓/历史持仓区：工作区加高使持仓区下移，并压缩其预留占位（不影响 /pc/orders 订单页） ---------- */
body.tm-market-page.tm-device-pc:not(.tm-orders-page) .tm-market-layout { height: min(780px, calc(100vh - 250px)); }
body.tm-market-page.tm-device-pc:not(.tm-orders-page) .tm-market-positions { min-height: 0; margin-top: 14px; }
body.tm-market-page.tm-device-pc:not(.tm-orders-page) .tm-market-position-list { min-height: 0; padding-bottom: 8px; }
body.tm-market-page.tm-device-pc:not(.tm-orders-page) .tm-market-position-list.is-empty { min-height: 84px; }

/* ---------- PC 顶部 Orders 按钮：收起/展开右侧交易面板 ---------- */
body.tm-market-page .tm-market-layout.tm-side-collapsed { grid-template-columns: 310px minmax(0, 1fr); }
body.tm-market-page .tm-market-layout.tm-side-collapsed .tm-market-order-side { display: none; }
@media (max-width: 900px) {
    body.tm-market-page .tm-market-layout.tm-side-collapsed { grid-template-columns: 210px minmax(0, 1fr); }
}

/* ---------- PC 交易面板（Gate 设计图：下单类型下拉/借款/止盈止损开关+步进器/数量步进/信息行/灰胶囊按钮） ---------- */
.tm-order-contract { gap: 2px; }
.tm-order-contract > strong { font-size: 15px; font-weight: 600; color: #171b24; }
.tm-order-contract > b { color: #0866f9; font-size: 22px; font-weight: 700; margin: 2px 0 4px; }
.tm-order-contract label { display: block; margin: 10px 0 6px; color: #333; }
.tm-order-contract input, .tm-order-contract select { height: 38px; border-color: #e2e6ee; border-radius: 6px; color: #22262e; font-size: 13px; }
.tm-order-contract input:focus, .tm-order-contract select:focus { outline: none; border-color: #0866f9; }
.tm-order-contract input:disabled { background: #f7f8fa; color: #b6bcc6; }
.tm-stepper { display: flex; align-items: stretch; height: 38px; border: 1px solid #e2e6ee; border-radius: 6px; overflow: hidden; background: #fff; }
.tm-stepper button { width: 40px; flex: none; border: 0; background: #fff; color: #333; font-size: 18px; line-height: 1; cursor: pointer; padding: 0; }
.tm-stepper button:hover { background: #f4f6f9; }
.tm-stepper button:first-child { border-right: 1px solid #e2e6ee; }
.tm-stepper button:last-child { border-left: 1px solid #e2e6ee; }
.tm-stepper input { flex: 1; min-width: 0; width: auto; height: 100%; border: 0; border-radius: 0; text-align: center; font-size: 13px; color: #22262e; }
.tm-stepper input:focus { border: 0; outline: none; }
.tm-step-hint { color: #8a93a1; font-weight: 400; }
/* (0,2,1) 压过上方 .tm-order-contract label 的 display:block，保证开关胶囊靠行右缘 */
.tm-order-contract label.tm-switch-row, .tm-switch-row { display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.tm-switch { position: relative; display: inline-block; width: 34px; height: 18px; flex: none; }
.tm-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tm-switch i { position: absolute; inset: 0; border-radius: 9px; background: #d5dae2; transition: background .15s; pointer-events: none; }
.tm-switch i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20,30,50,.2); transition: transform .15s; }
.tm-switch input:checked + i { background: #0866f9; }
.tm-switch input:checked + i::after { transform: translateX(16px); }
.tm-risk-row .tm-stepper { margin-top: 6px; }
.tm-limit-row[hidden] { display: none; }
.tm-metrics-list { display: block; margin-top: 14px; border-top: 1px solid #f0f2f6; padding-top: 6px; }
.tm-metrics-row { display: flex; align-items: center; justify-content: space-between; min-height: 26px; font-size: 12px; }
.tm-metrics-row em { font-style: normal; color: #6d7684; }
.tm-metrics-row b { color: #1a2029; font-weight: 500; max-width: 60%; text-align: right; overflow-wrap: anywhere; }
.tm-order-contract .tm-market-order-buttons { gap: 10px; margin-top: 16px; }
/* 开市：買入蓝/賣出红胶囊；休市由 .is-closed 整体置灰（JS 同步 disabled） */
.tm-order-contract .tm-market-order-buttons button { height: 40px; border-radius: 20px; font-size: 14px; }
.tm-order-contract .tm-market-order-buttons button:hover { opacity: .9; }
.tm-market-order-buttons.is-closed button,
.tm-market-order-buttons.is-closed button:hover { background: #d9dde3; opacity: 1; cursor: not-allowed; }
/* 移动端：图表容器有固定高度，分时线/K线在窄屏也可渲染 */
@media (max-width: 700px) {
    body.tm-market-page .tm-market-chart-panel { height: 230px; padding: 6px 8px; }
    body.tm-market-page .tm-market-chart-caption { margin-bottom: 4px; font-size: 11px; }
}
