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

:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #0f0f0f;
    --text-primary: #00ffaa;
    --text-secondary: #00cc88;
    --text-dim: #008866;
    --border-color: #00ffaa33;
    --accent-green: #00ffaa;
    --accent-red: #ff0000;
    --accent-yellow: #ffff00;
}

body {
    font-family: 'Courier New', monospace;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
}

/* Header */
.header {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    left: 0;
    right: 0;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-green);
    text-shadow: 0 0 10px var(--accent-green);
    display: flex;
    align-items: center;
    line-height: 1;
    padding-top: 5px;
}

.nav-menu {
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-green);
    text-shadow: 0 0 5px var(--accent-green);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--accent-green);
    box-shadow: 0 0 5px var(--accent-green);
}

.github-link {
    display: flex;
    align-items: center;
}

/* Health Indicator */
.health-indicator {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 1rem 0 1rem;
    border-radius: 12px;
    background-color: transparent;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.health-indicator:hover {
    border-color: var(--accent-green);
    box-shadow: 0 0 5px var(--accent-green);
}

.health-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--text-dim);
    box-shadow: 0 0 8px rgba(0, 136, 102, 0.6);
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

/* 健康状态：使用主题绿色 */
.health-light.healthy {
    background-color: var(--accent-green);
    box-shadow: 0 0 12px rgba(0, 255, 170, 0.8), 0 0 4px rgba(0, 255, 170, 0.4);
}

/* 警告状态：黄色 */
.health-light.warning {
    background-color: var(--accent-yellow);
    box-shadow: 0 0 12px rgba(255, 255, 0, 0.8), 0 0 4px rgba(255, 255, 0, 0.4);
    animation: pulse-warning 1s ease-in-out infinite;
}

/* 错误状态：红色 */
.health-light.error {
    background-color: var(--accent-red);
    box-shadow: 0 0 12px rgba(255, 0, 0, 0.8), 0 0 4px rgba(255, 0, 0, 0.4);
    animation: pulse-error 0.8s ease-in-out infinite;
}

.health-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    letter-spacing: 0.5px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.health-indicator.healthy .health-text {
    color: var(--accent-green);
    text-shadow: 0 0 8px rgba(0, 255, 170, 0.4);
}

.health-indicator.warning .health-text {
    color: var(--accent-yellow);
    text-shadow: 0 0 8px rgba(255, 255, 0, 0.4);
}

.health-indicator.error .health-text {
    color: var(--accent-red);
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.4);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(0.95);
    }
}

@keyframes pulse-warning {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.08);
    }
}

@keyframes pulse-error {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    25% {
        opacity: 0.5;
        transform: scale(1.12);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    75% {
        opacity: 0.5;
        transform: scale(1.12);
    }
}

.github-stars {
    display: inline-flex;
    align-items: center;
    background-color: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    margin-left: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.github-link:hover .github-stars {
    border-color: var(--accent-green);
    box-shadow: 0 0 5px var(--accent-green);
}

#stars-count {
    min-width: 20px;
    text-align: center;
    padding-top: 1.5px;
}

.btn-waitlist {
    background-color: transparent;
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.btn-waitlist:hover {
    background-color: var(--accent-green);
    color: var(--bg-primary);
    box-shadow: 0 0 10px var(--accent-green);
}

/* Ticker */
.ticker-wrapper {
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    padding: 0.8rem 0;
    width: 100%;
    max-width: 100vw;
}

.ticker-content {
    display: flex;
    gap: 3rem;
    animation: scroll-ticker 90s linear infinite;
    width: fit-content;
}

@keyframes scroll-ticker {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.ticker-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    white-space: nowrap;
}

.crypto-name {
    color: var(--text-dim);
    font-weight: bold;
}

.crypto-price {
    color: var(--accent-green);
    font-weight: bold;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto auto auto auto;
    gap: 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* Chart Section */
.chart-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    position: relative;
    min-height: 500px;
    max-width: 100%;
    overflow: hidden;
}

/* 资产曲线图表区域 - 占据第一行 */
.chart-section:first-child {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
}

/* 交易统计区域 - 占据第二行，跨两列 */
.trading-stats-section {
    grid-column: 1 / 3;
    grid-row: 2 / 3;
}

/* AI 决策区域 - 占据第三行，跨两列 */
.chart-section:nth-child(3) {
    grid-column: 1 / 3;
    grid-row: 3 / 4;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.decision-title {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
}

.decision-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.decision-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.decision-nav-btn {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    /* padding: 0.5rem; */
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    width: 20px;
    height: 20px;
}

.decision-nav-btn:hover:not(:disabled) {
    background-color: var(--bg-secondary);
    border-color: var(--accent-green);
    color: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.decision-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.decision-nav-btn svg {
    width: 16px;
    height: 16px;
}

.decision-time {
    color: var(--text-primary);
    font-size: 0.8rem;
}

/* Chart Container */
.chart-container {
    height: 400px;
    position: relative;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 4px;
    max-width: 100%;
    overflow: hidden;
}

.chart-container canvas {
    max-height: 100%;
    max-width: 100%;
}

.chart-title {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.timeframe-select {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.timeframe-select:hover {
    border-color: var(--accent-green);
    box-shadow: 0 0 5px var(--border-color);
}

.timeframe-select:focus {
    outline: none;
    border-color: var(--accent-green);
}

.decision-container {
    height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 1rem;
    max-width: 100%;
    word-wrap: break-word;
    word-break: break-word;
}

.decision-content {
    color: var(--text-secondary);
    line-height: 1.8;
}

.decision-text {
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* Markdown 内容样式 */
.markdown-content {
    white-space: normal;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    color: var(--accent-green);
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-weight: bold;
}

.markdown-content h1 {
    font-size: 1.4rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.3em;
}

.markdown-content h2 {
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
}

.markdown-content h3 {
    font-size: 1.1rem;
}

.markdown-content h4 {
    font-size: 1rem;
}

.markdown-content h5,
.markdown-content h6 {
    font-size: 0.9rem;
}

.markdown-content p {
    margin: 0.8em 0;
    line-height: 1.6;
}

.markdown-content ul,
.markdown-content ol {
    margin: 0.8em 0;
    padding-left: 2em;
}

.markdown-content li {
    margin: 0.4em 0;
}

.markdown-content strong {
    color: var(--accent-green);
    font-weight: bold;
}

.markdown-content em {
    color: var(--text-primary);
    font-style: italic;
}

.markdown-content code {
    background-color: var(--bg-tertiary);
    color: var(--accent-yellow);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 1em;
    overflow-x: auto;
    margin: 1em 0;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    color: var(--text-primary);
}

.markdown-content blockquote {
    border-left: 3px solid var(--accent-green);
    padding-left: 1em;
    margin: 1em 0;
    color: var(--text-dim);
    font-style: italic;
}

.markdown-content a {
    color: var(--accent-green);
    text-decoration: underline;
    transition: all 0.3s;
}

.markdown-content a:hover {
    text-shadow: 0 0 5px var(--accent-green);
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

.markdown-content table th,
.markdown-content table td {
    border: 1px solid var(--border-color);
    padding: 0.5em;
    text-align: left;
}

.markdown-content table th {
    background-color: var(--bg-tertiary);
    color: var(--accent-green);
    font-weight: bold;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5em 0;
}

.decision-content .loading,
.decision-content .no-data,
.decision-content .error {
    text-align: center;
    color: var(--text-dim);
    padding: 2rem;
}

.decision-content .error {
    color: var(--accent-red);
}

/* Account Section */
.account-section {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 100%;
    overflow: hidden;
    height: 100%;
}

.account-header {
    margin-bottom: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.account-header h2 {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    margin: 0;
}

/* 总资产卡片 */
.account-balance-card {
    background-color: var(--bg-tertiary);
    border: 1px solid rgba(0, 255, 170, 0.2);
    border-radius: 6px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: border-color 0.3s;
    flex-shrink: 0;
}

.account-balance-card:hover {
    border-color: rgba(0, 255, 170, 0.4);
}

.balance-icon {
    font-size: 2.2rem;
    flex-shrink: 0;
}

.balance-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.balance-amount {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.value-amount {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--accent-green);
    text-shadow: 0 0 10px rgba(0, 255, 170, 0.3);
}

.currency-label {
    font-size: 1.8rem;
    color: var(--text-dim);
    font-weight: 500;
}

.balance-change {
    display: flex;
    align-items: baseline;
    gap: 0.3rem;
    flex-shrink: 0;
}

.balance-pnl {
    font-size: 0.9rem;
    font-weight: 600;
}

.balance-pnl.positive {
    color: var(--accent-red);
}

.balance-pnl.negative {
    color: var(--accent-green);
}

.balance-percent {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 500;
}

.balance-percent.positive {
    color: var(--accent-red);
}

.balance-percent.negative {
    color: var(--accent-green);
}

/* 风险指标 */
.risk-metrics {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.2rem;
    transition: border-color 0.3s;
    flex-shrink: 0;
}

.risk-metrics:hover {
    border-color: rgba(0, 255, 170, 0.3);
}

.risk-metrics-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid rgba(0, 255, 170, 0.1);
}

.metrics-icon {
    font-size: 1.1rem;
}

.metrics-title {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.metrics-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-label {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.metric-value {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: bold;
}

.metric-value.positive {
    color: var(--accent-red);
}

.metric-value.negative {
    color: var(--accent-green);
}

/* 风险状态 */
.risk-status {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s;
    flex: 1;
    min-height: 0;
}

.risk-status.safe {
    border-color: rgba(0, 255, 170, 0.4);
    background-color: rgba(0, 255, 170, 0.08);
}

.risk-status.warning {
    border-color: rgba(255, 255, 0, 0.4);
    background-color: rgba(255, 255, 0, 0.08);
}

.risk-status.danger {
    border-color: rgba(255, 0, 0, 0.4);
    background-color: rgba(255, 0, 0, 0.08);
}

.status-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: bold;
    flex-shrink: 0;
}

.risk-status.safe .status-icon {
    background-color: var(--accent-green);
    color: var(--bg-primary);
}

.risk-status.warning .status-icon {
    background-color: var(--accent-yellow);
    color: var(--bg-primary);
}

.risk-status.danger .status-icon {
    background-color: var(--accent-red);
    color: var(--bg-primary);
}

.status-info {
    flex: 1;
}

.status-label {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.status-desc {
    color: var(--text-dim);
    font-size: 0.7rem;
    line-height: 1.4;
}

/* Positions Cards - Small cards under account section */
.positions-cards {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.positions-cards-header {
    margin-bottom: 0.8rem;
}

.positions-cards-title {
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.positions-cards-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
}

.positions-cards-empty {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    padding: 1rem;
    background-color: var(--bg-tertiary);
    border: 1px dashed var(--border-color);
    border-radius: 4px;
}

.position-card {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem 0.7rem;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.position-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--accent-red);
}

.position-card.negative::before {
    background-color: var(--accent-green);
}

.position-card:hover {
    border-color: var(--accent-red);
}

.position-card.negative:hover {
    border-color: var(--accent-green);
}

.position-card-symbol {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-primary);
    flex-shrink: 0;
}

.position-card-pnl {
    font-size: 0.85rem;
    font-weight: bold;
    text-align: right;
}

.position-card-pnl.positive {
    color: var(--accent-red);
}

.position-card-pnl.negative {
    color: var(--accent-green);
}

/* Scrollbar for positions cards */
.positions-cards-container::-webkit-scrollbar {
    width: 4px;
}

.positions-cards-container::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.positions-cards-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 2px;
}

.positions-cards-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* Positions Section */
.positions-section {
    grid-column: 1 / 3;
    grid-row: 4 / 5;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    max-width: 100%;
    overflow: hidden;
}

/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    gap: 0;
    /* margin-bottom: 0.8rem; */
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.tab-button {
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-button:hover {
    color: var(--text-secondary);
    background-color: rgba(0, 255, 170, 0.05);
}

.tab-button.active {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
    text-shadow: 0 0 8px var(--accent-green);
    background-color: rgba(0, 255, 170, 0.1);
}

.tab-button:focus {
    outline: none;
}

/* Tab Content Styles */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Positions Section - Table Styles */
.positions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 700px;
}

.positions-table thead {
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.positions-table th {
    padding: 0.75rem 0.6rem;
    text-align: left;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: var(--bg-secondary);
    position: sticky;
    top: 0;
}

.positions-table td {
    padding: 0.75rem 0.6rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
}

.positions-table tbody tr {
    transition: background-color 0.2s ease;
}

.positions-table tbody tr:hover {
    background-color: var(--bg-tertiary);
}

.positions-table .empty-state,
.positions-table .loading {
    text-align: center;
    color: var(--text-dim);
    padding: 2rem;
}

/* 持仓表格特殊样式 - 与交易历史统一 */
.positions-table .symbol {
    color: var(--accent-green);
    font-weight: bold;
    font-size: 0.9rem;
}

.positions-table .side {
    padding: 0.2rem 0.45rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    min-width: 48px;
    text-align: center;
}

.positions-table .side.long {
    background-color: rgba(0, 255, 170, 0.1);
    color: var(--accent-green);
}

.positions-table .side.short {
    background-color: rgba(255, 82, 82, 0.1);
    color: var(--accent-red);
}

.positions-table .profit {
    color: var(--accent-red);
    font-weight: 600;
}

.positions-table .loss {
    color: var(--accent-green);
    font-weight: 600;
}

/* 条件单类型样式 */
.positions-table .order-type {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 止盈止损表格价格列样式 */
.positions-table .stop-loss {
    color: var(--accent-red);
    font-weight: 600;
}

.positions-table .take-profit {
    color: var(--accent-green);
    font-weight: 600;
}

.positions-table .current-price {
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 1.05em;
}

/* 价格偏差百分比样式 */
.positions-table .deviation {
    font-size: 0.85em;
    color: var(--text-dim);
    font-weight: 400;
    margin-left: 4px;
}

.positions-table .order-status.status-active {
    background-color: rgba(255, 255, 0, 0.1);
    color: var(--accent-yellow);
}

.positions-table .order-status.status-triggered {
    background-color: rgba(0, 255, 170, 0.1);
    color: var(--accent-green);
}

.positions-table .order-status.status-cancelled {
    background-color: rgba(136, 136, 136, 0.1);
    color: #888;
}

/* 止损止盈状态标识样式 */
.positions-table .status-badge {
    display: inline-block;
    font-size: 0.75em;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
}

.positions-table .status-badge.triggered {
    background-color: rgba(0, 255, 170, 0.2);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
    text-shadow: 0 0 3px var(--accent-green);
}

.positions-table .status-badge.cancelled {
    background-color: rgba(136, 136, 136, 0.2);
    color: #888;
    border: 1px solid #666;
}

/* Trades Section */
.trades-section {
    grid-column: 1 / 3;
    grid-row: 5 / 6;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    max-width: 100%;
    overflow: hidden;
}

.section-header {
    color: var(--text-primary);
    font-size: 1rem;
    /* margin-bottom: 1.5rem; */
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-header #tradesCount {
    color: var(--accent-green);
    font-size: 0.85rem;
    opacity: 0.8;
}

.trades-container {
    overflow-y: auto;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

.trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 700px;
}

.trades-table thead {
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.trades-table th {
    padding: 0.75rem 0.6rem;
    text-align: left;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: var(--bg-secondary);
    position: sticky;
    top: 0;
}

.trades-table td {
    padding: 0.75rem 0.6rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.88rem;
}

.trades-table tbody tr {
    transition: background-color 0.2s ease;
}

.trades-table tbody tr:hover {
    background-color: var(--bg-tertiary);
}

.trades-table .empty-state,
.trades-table .loading {
    text-align: center;
    color: var(--text-dim);
    padding: 2rem;
}

/* 交易表格特殊样式 */
.trades-table .symbol {
    color: var(--accent-green);
    font-weight: bold;
    font-size: 0.9rem;
}

.trades-table .type {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
}

.trades-table .type.buy {
    background-color: rgba(0, 255, 170, 0.1);
    color: var(--accent-green);
}

.trades-table .type.sell {
    background-color: rgba(255, 82, 82, 0.1);
    color: var(--accent-red);
}

.trades-table .side {
    padding: 0.2rem 0.45rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    min-width: 48px;
    text-align: center;
}

.trades-table .side.long {
    background-color: rgba(0, 255, 170, 0.1);
    color: var(--accent-green);
}

.trades-table .side.short {
    background-color: rgba(255, 82, 82, 0.1);
    color: var(--accent-red);
}

.trades-table .profit {
    color: var(--accent-red);
    font-weight: 600;
}

.trades-table .loss {
    color: var(--accent-green);
    font-weight: 600;
}

.trades-table .na {
    color: var(--text-dim);
    opacity: 0.5;
}

/* 平仓原因样式 */
.trades-table .close-reason {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}

/* 止损触发 - 红色 */
.trades-table .close-reason-sl {
    background-color: rgba(255, 82, 82, 0.15);
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.3);
}

/* 止盈触发 - 绿色 */
.trades-table .close-reason-tp {
    background-color: rgba(0, 255, 170, 0.15);
    color: #00ffaa;
    border: 1px solid rgba(0, 255, 170, 0.3);
}

/* AI手动平仓 - 蓝色 */
.trades-table .close-reason-manual {
    background-color: rgba(100, 181, 246, 0.15);
    color: #64b5f6;
    border: 1px solid rgba(100, 181, 246, 0.3);
}

/* AI主动平仓 - 青色 */
.trades-table .close-reason-ai {
    background-color: rgba(0, 229, 255, 0.15);
    color: #00e5ff;
    border: 1px solid rgba(0, 229, 255, 0.3);
}

/* 趋势反转平仓 - 粉色 */
.trades-table .close-reason-reversal {
    background-color: rgba(233, 30, 99, 0.15);
    color: #f48fb1;
    border: 1px solid rgba(233, 30, 99, 0.3);
}

/* 系统强制平仓 - 深红色 */
.trades-table .close-reason-forced {
    background-color: rgba(198, 40, 40, 0.15);
    color: #ef5350;
    border: 1px solid rgba(198, 40, 40, 0.3);
}

/* 分批止盈 - 紫色 */
.trades-table .close-reason-partial {
    background-color: rgba(156, 39, 176, 0.15);
    color: #ce93d8;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

/* 峰值回撤平仓 - 橙色 */
.trades-table .close-reason-peak {
    background-color: rgba(255, 152, 0, 0.15);
    color: #ff9800;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

/* 持仓时间到期 - 黄色 */
.trades-table .close-reason-time {
    background-color: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

/* 其他原因 - 灰色 */
.trades-table .close-reason-other {
    background-color: rgba(158, 158, 158, 0.15);
    color: #9e9e9e;
    border: 1px solid rgba(158, 158, 158, 0.3);
}

.loading,
.no-data {
    text-align: center;
    color: var(--text-dim);
    padding: 3rem;
    grid-column: 1 / -1;
}

/* Trade Item Styles (from index.html) */
.trade-item {
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-green);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.trade-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.trade-item:hover {
    transform: translateY(-2px);
    border-left-width: 4px;
    border-left-color: var(--accent-green);
    box-shadow: 0 8px 16px rgba(0, 255, 170, 0.2);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.trade-item:hover::before {
    opacity: 1;
}

.trade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 255, 170, 0.15);
}

.trade-symbol {
    color: var(--accent-green);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px rgba(0, 255, 170, 0.4);
    position: relative;
}

.trade-time {
    color: var(--text-dim);
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
    background: var(--bg-primary);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.trade-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: start;
}

.trade-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 170, 0.1);
    transition: all 0.2s ease;
}

.trade-field:hover {
    border-color: rgba(0, 255, 170, 0.3);
    background: rgba(0, 255, 170, 0.05);
}

.trade-field .label {
    color: var(--text-dim);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.trade-field .value {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 0 0 5px rgba(0, 255, 170, 0.2);
}

.trade-field .value.long {
    color: var(--accent-red);
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
}

.trade-field .value.short {
    color: var(--accent-green);
    text-shadow: 0 0 5px rgba(0, 255, 170, 0.3);
}

.trade-field .value.profit {
    color: var(--accent-red);
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
}

.trade-field .value.loss {
    color: var(--accent-green);
    text-shadow: 0 0 5px rgba(0, 255, 170, 0.3);
}

/* Chat */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 400px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.chat-message {
    margin-bottom: 0.8rem;
    display: flex;
    gap: 0.5rem;
}

.message-prefix {
    color: var(--accent-green);
}

.message-text {
    color: var(--text-secondary);
}

.chat-message.user .message-prefix {
    color: var(--accent-yellow);
}

.chat-input-container {
    display: flex;
    gap: 1rem;
}

.chat-input {
    flex: 1;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--accent-green);
    padding: 0.8rem;
    font-family: inherit;
    font-size: 0.9rem;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 5px var(--border-color);
}

.chat-send-btn {
    background-color: transparent;
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    padding: 0.8rem 2rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.chat-send-btn:hover {
    background-color: var(--accent-green);
    color: var(--bg-primary);
    box-shadow: 0 0 10px var(--accent-green);
}

/* README */
.readme-content {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
}

.readme-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* Trading Statistics Section */
.trading-stats-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    grid-column: 1 / 3;
    grid-row: 2 / 3;
    max-width: 100%;
    overflow: hidden;
}

.stats-header {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.stats-title {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.stat-card {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: 4px;
    transition: all 0.3s;
}

/* .stat-card:hover {
    border-color: var(--accent-green);
    box-shadow: 0 0 8px rgba(0, 255, 170, 0.2);
} */

.stat-card-wide {
    grid-column: span 2;
}

.stat-card-triple {
    grid-column: span 3;
}

.stat-label {
    color: var(--text-dim);
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: bold;
}

.stat-value.positive {
    color: var(--accent-red);
}

.stat-value.negative {
    color: var(--accent-green);
}

.stat-distribution {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.dist-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.dist-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.dist-dot.long {
    background-color: var(--accent-red);
}

.dist-dot.short {
    background-color: var(--accent-green);
}

.dist-dot.neutral {
    background-color: var(--accent-yellow);
}

.stat-pairs {
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto auto auto;
    }

    /* 资产曲线 */
    .chart-section:first-child {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
        min-height: 400px;
    }

    /* 账户信息 */
    .account-section {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
        min-height: auto;
    }

    /* 交易统计 */
    .trading-stats-section {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
        padding: 0.8rem;
    }
    
    /* 交易统计网格 - 在小屏幕上改为3列 */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* 在3列布局下，最后一行的两个triple卡片各占1.5列，使其平分空间 */
    .stat-card-triple {
        grid-column: span 3;
    }

    /* AI 决策 */
    .chart-section:nth-child(3) {
        grid-column: 1 / 2;
        grid-row: 4 / 5;
        min-height: 400px;
    }

    /* 持仓 */
    .positions-section {
        grid-column: 1 / 2;
        grid-row: 5 / 6;
    }

    /* 交易历史 */
    .trades-section {
        grid-column: 1 / 2;
        grid-row: 6 / 7;
    }

    /* 中等屏幕也隐藏交易历史表格的部分非关键列 - 只隐藏数量列 */
    .trades-table th:nth-child(5),
    .trades-table td:nth-child(5),
    .trades-table th:nth-child(6),
    .trades-table td:nth-child(6),
    .trades-table th:nth-child(7),
    .trades-table td:nth-child(7) {
        display: none;
    }

    /* 减小表格列间距 */
    .positions-table th,
    .positions-table td,
    .trades-table th,
    .trades-table td {
        padding: 0.75rem 0.4rem;
        font-size: 0.85rem;
    }

    /* 调整表格最小宽度 */
    .trades-table {
        min-width: 500px;
    }

    .positions-table {
        min-width: 450px;
    }
}

/* 针对较小的平板和大屏手机进行额外优化 */
@media (max-width: 900px) {
    /* 进一步减小表格列间距 */
    .positions-table th,
    .positions-table td,
    .trades-table th,
    .trades-table td {
        padding: 0.6rem 0.25rem;
        font-size: 0.75rem;
    }

    /* 进一步减小表格最小宽度 */
    .trades-table {
        min-width: 100%;
    }

    .positions-table {
        min-width: 100%;
    }
    
    /* 交易统计网格 - 改为2列 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .stat-card {
        padding: 0.8rem;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: 80px;
    }
    
    .stat-card-triple {
        grid-column: span 2;
    }
    
    .stat-label {
        font-size: 0.7rem;
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.3;
    }
    
    .stat-value {
        font-size: 1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .stat-pairs {
        font-size: 0.75rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.4;
    }
    
    .stat-distribution {
        font-size: 0.75rem;
    }
}

@media (max-width: 768px) {
    /* Header */
    .header {
        padding: 0.5rem 0.8rem;
        max-width: 100vw;
        overflow: hidden;
    }
    
    .logo {
        font-size: 1.2rem;
    }

    .nav-bar {
        max-width: 100%;
        overflow: hidden;
        flex-wrap: wrap;
        gap: 0.3rem;
        justify-content: space-between;
        align-items: center;
    }

    .logo {
        font-size: 1rem;
        flex-shrink: 0;
    }

    .nav-menu {
        gap: 0.5rem;
        flex-wrap: wrap;
        align-items: center;
    }

    .nav-link {
        font-size: 0.75rem;
        display: flex;
        align-items: center;
    }
    
    /* 移动端去除 LIVE 下面的线 */
    .nav-link.active::after {
        display: none;
    }

    /* 移动端健康警示灯优化 */
    .health-indicator {
        padding: 0.4rem 0.7rem;
        gap: 0.5rem;
        font-size: 0.8rem;
    }
    
    .health-light {
        width: 8px;
        height: 8px;
    }
    
    .health-text {
        font-size: 0.75rem;
    }

    .nav-link svg {
        width: 16px;
        height: 16px;
        margin-right: 3px !important;
    }

    /* 移动端隐藏 GitHub 文字和图标，只保留星数 */
    .github-link > svg {
        display: none;
    }

    .github-link > span:first-of-type {
        display: none;
    }

    .github-stars {
        margin-left: 0;
        padding: 2px 6px;
        font-size: 0.75rem;
    }

    .nav-link {
        white-space: nowrap;
    }

    .btn-waitlist {
        display: none;
    }
    
    /* 决策导航按钮移动端样式 */
    .decision-nav {
        flex-wrap: nowrap;
        gap: 0.3rem;
    }
    
    .decision-nav-btn {
        width: 23px;
        height: 23px;
        padding: 0.3rem;
    }
    
    .decision-nav-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .decision-meta {
        gap: 0.5rem;
    }
    
    .decision-time {
        font-size: 0.7rem;
    }

/* Ticker */
    .ticker-wrapper {
        padding: 0.4rem 0;
        width: 100%;
    }

    .ticker-content {
        gap: 1.5rem;
    }

    .ticker-item {
        font-size: 0.8rem;
    }

    /* Main Content */
    .main-content {
        padding: 0.6rem;
        gap: 0.6rem;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Chart Section */
    .chart-section {
        padding: 0.8rem;
        min-height: auto;
        max-width: 100%;
        overflow: hidden;
    }
    
    /* 资产曲线保持一定高度 */
    .chart-section:first-child {
        min-height: 350px;
    }

    .chart-container {
        height: auto;
        min-height: 280px;
        padding: 0.4rem;
        max-width: 100%;
        overflow: hidden;
    }
    
    .chart-container canvas {
        height: auto !important;
        width: 100% !important;
    }

    .chart-title,
    .decision-title {
        font-size: 0.85rem;
    }
    
    .chart-header {
        /* margin-bottom: 0.6rem; */
        padding-bottom: 0.4rem;
    }
    
    /* 统一各区块标题的间距 */
    .stats-header {
        /* margin-bottom: 0.8rem; */
        padding-bottom: 0.4rem;
    }

    /* Tab按钮字体大小适配 */
    .tab-button {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }

    .timeframe-select {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .decision-container {
        height: auto;
        min-height: 150px;
        max-height: 400px;
        padding: 0.6rem;
    }

    .decision-text {
        font-size: 0.75rem;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* 移动端 Markdown 样式 */
    .markdown-content h1 {
        font-size: 1.1rem;
    }

    .markdown-content h2 {
        font-size: 1rem;
    }

    .markdown-content h3 {
        font-size: 0.95rem;
    }

    .markdown-content h4,
    .markdown-content h5,
    .markdown-content h6 {
        font-size: 0.85rem;
    }

    .markdown-content ul,
    .markdown-content ol {
        padding-left: 1.5em;
    }

    .markdown-content code {
        font-size: 0.75rem;
    }

    .markdown-content pre {
        padding: 0.6em;
        font-size: 0.7rem;
    }

    .markdown-content table {
        font-size: 0.75rem;
    }

    .markdown-content table th,
    .markdown-content table td {
        padding: 0.3em;
    }

    /* Positions Cards */
    .positions-cards {
        margin-top: 0.8rem;
        padding-top: 0.8rem;
    }

    .positions-cards-title {
        font-size: 0.7rem;
    }

    .positions-cards-container {
        max-height: 120px;
        gap: 0.3rem;
    }

    .position-card {
        padding: 0.35rem 0.5rem;
    }

    .position-card-symbol {
        font-size: 0.8rem;
    }

    .position-card-pnl {
        font-size: 0.75rem;
    }

    /* Account Section */
    .account-section {
        padding: 0.8rem;
    }

    .account-value {
        font-size: 1.8rem;
        margin: 0.6rem 0;
    }

    .currency-symbol {
        font-size: 1.3rem;
    }
    
    .account-header {
        margin-bottom: 0.6rem;
        padding-bottom: 0.4rem;
    }
    
    .account-details {
        margin-top: 0.8rem;
        padding-top: 0.8rem;
        gap: 0.6rem;
    }
    
    /* 移动端盈亏信息换行显示 */
    .balance-info {
        flex-direction: column;
        align-items: flex-start;
        /* gap: 0.5rem; */
    }
    
    .balance-change {
        flex-direction: row;
        align-items: baseline;
        gap: 0.3rem;
    }
    
    .balance-pnl,
    .balance-percent {
        font-size: 0.85rem;
    }

    /* Tables */
    .positions-section,
    .trades-section {
        padding: 0.8rem;
        max-width: 100%;
        overflow: hidden;
    }

    .section-header {
        font-size: 0.85rem;
        margin-bottom: 0.8rem;
        padding-bottom: 0.5rem;
    }

    .positions-table,
    .trades-table {
        font-size: 0.65rem;
        min-width: 100%;
    }

    .positions-table th,
    .positions-table td,
    .trades-table th,
    .trades-table td {
        padding: 0.4rem 0.15rem;
        font-size: 0.65rem;
        white-space: nowrap;
    }
    
    /* 表头字体略微放大 */
    .positions-table th,
    .trades-table th {
        font-size: 0.68rem;
        letter-spacing: 0.3px;
        font-weight: 700;
    }

    /* 移动端隐藏持仓表格的列 - 只保留: 币种、方向、当前价格、未实现盈亏、收益率 */
    #tab-positions .positions-table th:nth-child(3),
    #tab-positions .positions-table td:nth-child(3),
    #tab-positions .positions-table th:nth-child(4),
    #tab-positions .positions-table td:nth-child(4),
    #tab-positions .positions-table th:nth-child(5),
    #tab-positions .positions-table td:nth-child(5) {
        display: none;
    }

    /* 移动端隐藏止盈止损表格的列 - 只保留: 币种、方向、止损价格、当前价格、止盈价格 */
    #tab-price-orders .positions-table th:nth-child(2),
    #tab-price-orders .positions-table td:nth-child(2),
    #tab-price-orders .positions-table th:nth-child(6),
    #tab-price-orders .positions-table td:nth-child(6),
    #tab-price-orders .positions-table th:nth-child(7),
    #tab-price-orders .positions-table td:nth-child(7),
    #tab-price-orders .positions-table th:nth-child(8),
    #tab-price-orders .positions-table td:nth-child(8) {
        display: none;
    }

    /* 移动端隐藏交易历史表格的列 - 只保留: 平仓时间、币种、方向、杠杆、持仓时间、净盈亏 */
    .trades-table th:nth-child(5),
    .trades-table td:nth-child(5),
    .trades-table th:nth-child(6),
    .trades-table td:nth-child(6),
    .trades-table th:nth-child(7),
    .trades-table td:nth-child(7),
    .trades-table th:nth-child(9),
    .trades-table td:nth-child(9) {
        display: none;
    }
    
    /* 优化币种名称和标签的显示 */
    .positions-table .symbol,
    .trades-table .symbol {
        font-size: 0.7rem;
        font-weight: 700;
    }
    
    .positions-table .side,
    .trades-table .side {
        padding: 0.15rem 0.25rem;
        font-size: 0.58rem;
        min-width: 36px;
    }

    .trades-container {
        max-height: 450px;
        max-width: 100%;
    }

    .trade-item {
        padding: 1rem;
    }

    .trade-symbol {
        font-size: 1rem;
    }

    .trade-time {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }

    .trade-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .trade-field {
        padding: 0.4rem;
    }

    .trade-field .label {
        font-size: 0.7rem;
    }
    
    .trade-field .value {
        font-size: 0.9rem;
    }

    .tabs-header {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .header {
        padding: 0.4rem 0.6rem;
    }

    .nav-bar {
        gap: 0.3rem;
    }

    .logo {
        font-size: 0.9rem;
    }

    .nav-link {
        font-size: 0.65rem;
    }

    .github-stars {
        padding: 2px 4px;
        font-size: 0.65rem;
    }
    
    .main-content {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .chart-section {
        padding: 0.6rem;
        min-height: auto;
    }
    
    /* 资产曲线保持一定高度 */
    .chart-section:first-child {
        min-height: 300px;
    }
    
    /* 交易统计网格 - 在超小屏幕改为2列 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.6rem;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        min-height: 70px;
    }
    
    .stat-card-wide,
    .stat-card-triple {
        grid-column: span 2;
    }
    
    /* 修复标签和数值的显示 */
    .stat-label {
        white-space: normal;
        word-wrap: break-word;
        overflow-wrap: break-word;
        text-overflow: clip;
        overflow: visible;
        line-height: 1.3;
        margin-bottom: 0.4rem;
    }
    
    .stat-value {
        font-size: 1rem;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .stat-distribution {
        gap: 0.5rem;
        font-size: 0.7rem;
    }
    
    .stat-pairs {
        font-size: 0.7rem;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.4;
    }
    
    .trading-stats-section {
        padding: 0.8rem;
    }

    .account-section {
        padding: 0.6rem;
        gap: 0.5rem;
    }
    
    .account-header {
        /* margin-bottom: 0.6rem; */
        padding-bottom: 0.4rem;
    }
    
    .balance-change {
        flex-direction: row;
        gap: 0.3rem;
    }
    
    .balance-pnl,
    .balance-percent {
        font-size: 0.8rem;
    }
    
    /* 超小屏幕表格优化 */
    .positions-section,
    .trades-section {
        padding: 0.6rem;
    }
    
    .positions-table,
    .trades-table {
        font-size: 0.6rem;
        min-width: 100%;
    }

    .positions-table th,
    .positions-table td,
    .trades-table th,
    .trades-table td {
        padding: 0.35rem 0.1rem;
        font-size: 0.6rem;
    }
    
    .positions-table th,
    .trades-table th {
        font-size: 0.55rem;
        letter-spacing: 0.2px;
    }
    
    .positions-table .symbol,
    .trades-table .symbol {
        font-size: 0.7rem;
    }
    
    .positions-table .side,
    .trades-table .side {
        padding: 0.1rem 0.25rem;
        font-size: 0.55rem;
        min-width: 35px;
    }
    
    .section-header {
        font-size: 0.85rem;
        margin-bottom: 0.6rem;
        padding-bottom: 0.4rem;
    }
    
    /* 超小屏幕表头字体略微放大 */
    .positions-table th,
    .trades-table th {
        font-size: 0.65rem;
        font-weight: 700;
    }

    /* 超小屏幕Tab按钮字体大小适配 */
    .tab-button {
        font-size: 0.85rem;
        padding: 0.5rem 0.8rem;
    }

    /* 超小屏幕隐藏止盈止损表格的列 - 只保留: 币种、方向、止损价格、当前价格、止盈价格 */
    #tab-price-orders .positions-table th:nth-child(6),
    #tab-price-orders .positions-table td:nth-child(6),
    #tab-price-orders .positions-table th:nth-child(7),
    #tab-price-orders .positions-table td:nth-child(7),
    #tab-price-orders .positions-table th:nth-child(8),
    #tab-price-orders .positions-table td:nth-child(8) {
        display: none;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-green);
}