.coin-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .coin-dashboard {
        grid-template-columns: 1fr 2fr;
    }
}

.coin-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.coin-info {
    background: var(--card-bg, white);
    padding: 0.25rem !important;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
    cursor: pointer;
    min-height: 44px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.coin-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}

.coin-info.active {
    border-color: var(--positive-color, #00c805);
    background: var(--active-bg, rgba(0, 200, 5, 0.05));
}

.coin-info.active.negative {
    border-color: var(--negative-color, #dc3545);
    background: var(--negative-bg, rgba(220, 53, 69, 0.05));
}

.coin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

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

.mini-chart {
    width: 80px;
    height: 30px;
    position: relative;
}

.mini-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

.price-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--price-bg, rgba(0, 0, 0, 0.02));
    border-radius: 12px;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
}

.price-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'SF Mono', 'Roboto Mono', monospace;
}

.price-change {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.price-change.positive {
    background: var(--positive-bg, rgba(0, 200, 5, 0.1));
    color: var(--positive-color, #00c805);
}

.price-change.negative {
    background: var(--negative-bg, rgba(220, 53, 69, 0.1));
    color: var(--negative-color, #dc3545);
}

.price-chart {
    background: var(--card-bg, white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    height: 500px;
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
    display: flex;
    flex-direction: column;
}

.price-chart canvas {
    width: 100% !important;
    height: 100% !important;
    flex-grow: 1;
}

/* 新增：图表下方操作按钮组样式 */
.chart-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

/* 新增：单个操作按钮样式 */
.action-button {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.action-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--hover-bg-color);
    color: var(--secondary-text-color);
    border-color: var(--border-color);
}

.action-button:disabled:hover {
    transform: none;
    background-color: var(--hover-bg-color);
}

/* 买入按钮样式 */
.buy-button {
    background-color: var(--success-color);
    color: white;
}

/* 卖出按钮样式 */
.sell-button {
    background-color: var(--negative-color);
    color: #fff;
}

.sell-button:hover {
    background-color: var(--negative-color-dark);
}

/* 高频交易按钮样式 */
.hft-button {
    background-color: var(--button-neutral-bg);
    color: var(--button-neutral-text);
}

.hft-button:hover {
    background-color: var(--button-neutral-hover-bg);
}

/* 新增：时间间隔按钮组样式 */
.time-intervals {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.interval-button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.interval-button:hover {
    background: var(--price-bg);
}

.interval-button.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 暗色模式适配 */
[data-theme="dark"] {
    --card-bg: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --price-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --positive-color: #00ff00;
    --negative-color: #ff4444;
    --positive-bg: rgba(0, 255, 0, 0.1);
    --negative-bg: rgba(255, 68, 68, 0.1);
    --grid-color: rgba(255, 255, 255, 0.1);
    --tooltip-bg: rgba(0, 0, 0, 0.9);
    --tooltip-border: rgba(255, 255, 255, 0.2);
    --active-bg: rgba(0, 255, 0, 0.1);
    --primary-color: #00ff00;

    /* 新增：按钮主题颜色变量（暗色模式） */
    --positive-color-dark: #00e000;
    --negative-color-dark: #e03535;
    --button-neutral-bg: #4a4a4a;
    --button-neutral-text: #ffffff;
    --button-neutral-hover-bg: #5e5e5e;
    --pending-bg: rgba(255, 193, 7, 0.15);
    --pending-color: #ffc107;
    --cancelled-bg: rgba(220, 53, 69, 0.15);
    --cancelled-color: #ff4444;
    --executed-bg: rgba(0, 255, 0, 0.15);
    --executed-color: #00ff00;
}

/* 亮色模式适配 (默认值或在 light 规则中定义) */
:root {
    --positive-color: #00c805; /* 买入按钮绿色 */
    --negative-color: #dc3545; /* 卖出按钮红色 */
    --positive-color-dark: #00b000;
    --negative-color-dark: #c02a3a;
    --button-neutral-bg: #0066cc;
    --button-neutral-text: #ffffff;
    --button-neutral-hover-bg: #0052a3;
    --pending-bg: rgba(255, 193, 7, 0.1);
    --pending-color: #ffc107;
    --cancelled-bg: rgba(220, 53, 69, 0.1);
    --cancelled-color: #dc3545;
    --executed-bg: rgba(0, 200, 5, 0.1);
    --executed-color: #00c805;
}

/* 动画效果 */
@keyframes priceUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.price-update {
    animation: priceUpdate 0.3s ease;
}

/* 新增：手机屏幕下的按钮样式 */
@media (max-width: 768px) {
    .coin-dashboard {
        padding: 1rem;
        gap: 1rem;
    }

    .price-chart {
        height: 400px;  /* 减小图表高度 */
        padding: 1rem;
    }

    .chart-actions {
        margin-top: 1rem;
        padding-top: 1rem;
        gap: 0.5rem;
    }

    .action-button {
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
        min-width: 90px;
    }

    /* 确保底部有足够的空间 */
    .coin-dashboard {
        margin-bottom: 80px;  /* 为footer留出空间 */
    }

    /* 调整时间间隔按钮在移动端的显示 */
    .time-intervals {
        flex-wrap: wrap;
        gap: 0.3rem;
        padding: 0.3rem;
    }

    .interval-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .coin-info {
        padding: 0.08rem !important;
        min-height: 4px !important;
    }
}

/* Notification System */
.notification {
    position: fixed;
    top: 80px;  /* Increased top margin to avoid navbar */
    right: 40px;
    padding: 10px 14px;  /* Reduced padding */
    border-radius: 10px;
    background: rgba(17, 17, 17, 0.853);
    box-shadow: 0 2px 8px rgba(96, 94, 94, 0.529);
    z-index: 1000;
    animation: slideIn 0.2s ease-out;
    max-width: 340px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.notification.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

.notification-message {
    display: flex;
    flex-direction: column;
    gap: 2px;  /* Reduced gap */
}

.notification-action {
    font-weight: 800;
    color: #fff;
    font-size: 1.2rem;  /* Slightly smaller font */
    display: flex;
    align-items: center;
    gap: 4px;
}

.notification-details {
    color: #666;
    font-size: 0.85rem;  /* Slightly smaller font */
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* HFT Button Active State */
.hft-button.active {
    background-color: var(--negative-color);
    color: white;
}

/* Trade History Section */
.trade-history {
    margin-top: 48px;
    width: 100%;
    z-index: 2;
    position: relative;
}

.trade-history h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.trade-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.trade-list .trade-item {
    border-bottom: none !important;
    border-top: none !important;
    box-shadow: none !important;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-text-color);
}

.trade-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
    line-height: 1.6;  /* 增加行高 */
}

.trade-item:last-child {
    border-bottom: none;
}

.trade-details {
    flex-grow: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;  /* 添加元素间距 */
    align-items: center;
}

.trade-action {
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 0.5rem;
}

.trade-amount {
    color: var(--text-primary);
    font-family: 'SF Mono', 'Roboto Mono', monospace;
    margin: 0 0.5rem;
    font-weight: 500;
}

.trade-balance {
    color: var(--text-primary);
    font-family: 'SF Mono', 'Roboto Mono', monospace;
    margin: 0 0.5rem;
    font-weight: 500;
}

.trade-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

/* 分隔符样式 */
.trade-separator {
    color: var(--text-secondary);
    margin: 0 0.5rem;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .trade-history {
        padding: 0 1rem;
        margin-top: 10rem;  /* 移动端增加更多间距 */
    }
    
    .trade-item {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
    
    .trade-details {
        gap: 0.3rem;  /* 移动端减小间距 */
    }
    
    .trade-amount, .trade-balance {
        font-size: 0.85rem;
    }
    
    .trade-time {
        font-size: 0.8rem;
    }
    
    /* 确保底部有足够的空间 */
    .coin-dashboard {
        margin-bottom: 100px;  /* 为footer留出更多空间 */
    }
}

/* 删除状态标签相关样式 */
/* Trade Status Styles */
.trade-status {
    display: none;
}

.status-pending,
.status-cancelled,
.status-executed {
    display: none;
}

/* 余额显示样式 */
.balance-display {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.balance-label {
    font-size: 1.1rem;
    color: var(--secondary-text-color);
    font-weight: 500;
}

.balance-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.login-prompt {
    text-align: center;
    padding: 1rem;
    background-color: var(--hover-bg-color);
}

.login-prompt a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
}

/* 动画效果 */
@keyframes balanceUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.balance-update {
    animation: balanceUpdate 0.3s ease;
}

body {
    background-color: var(--secondary-bg-color);
}

.account-info-container {
    padding: 1rem 2rem;
    background-color: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.derivative-list {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: flex-start;
}

.derivative-item {
    position: relative;
    min-height: 160px; /* 确保有足够空间 */
    padding-bottom: 60px; /* 为底部按钮留出空间 */
}

.derivative-item:hover {
    box-shadow: 0 6px 24px 0 rgba(80, 80, 180, 0.13);
    transform: translateY(-2px) scale(1.01);
    border-color: #6366f1;
}

.derivative-title {
    font-size: 1.13rem;
    margin-bottom: 4px;
}

.derivative-meta {
    font-size: 0.98rem;
    margin-bottom: 4px;
}

.derivative-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 8px;
}

.derivative-action-row {
    position: relative !important; /* 强制使用相对定位 */
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    width: auto !important;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 15px; /* 向下移动 */
    padding: 0 8px; /* 向右移动 */
    z-index: 2;
}

.derivative-amount {
    width: 60px !important;
    font-size: 1.08rem;
    padding: 6px 8px;
    border-radius: 7px;
    margin: 0;
    margin-right: 8px; /* 向右移动 */
    border: 1px solid #ddd;
    background: #fff;
}

.derivative-total {
    font-size: 1.08rem;
    min-width: 80px;
    text-align: right;
    margin-right: 8px; /* 向右移动 */
}

.derivative-buy, .derivative-sell {
    font-size: 1.08rem;
    padding: 8px 16px;
    min-width: 50px;
    min-height: 36px;
    border-radius: 8px;
    font-weight: 600;
    margin-left: 0;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.07);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.derivative-buy {
    background: linear-gradient(90deg, #4ade80 0%, #22d3ee 100%);
    color: #fff;
}

.derivative-buy:hover {
    background: linear-gradient(90deg, #22d3ee 0%, #4ade80 100%);
    transform: translateY(-1px);
}

.derivative-sell {
    background: linear-gradient(90deg, #f87171 0%, #fbbf24 100%);
    color: #fff;
}

.derivative-sell:hover {
    background: linear-gradient(90deg, #fbbf24 0%, #f87171 100%);
    transform: translateY(-1px);
}

/* 保证卡片内容不被遮挡 */
.derivative-row, .derivative-meta, .derivative-title {
    position: relative;
    z-index: 1;
}

/* 隐藏coin页面的交易记录区块 */
.recent-trades-section { 
    display: none !important; 
}

/* 移动端和iPad端隐藏recent trades */
@media (max-width: 1200px) {
    .trade-history,
    #trade-history-section,
    .trade-history-section,
    .responsive-hide-mobile {
        display: none !important;
    }
}

/* coin页面footer下移，避免与内容重叠 */
footer {
    margin-top: 200px !important; /* 从100px增加到200px，让footer往下移动 */
    position: relative;
    z-index: 5;
}

/* 大屏幕优化 */
@media (min-width: 1201px) {
    .trade-history {
        margin-left: 80px;
    }
    .derivative-item {
        min-height: 180px;
        margin-bottom: 20px;
        min-width: 300px; /* 大屏幕下进一步增加宽度 */
        max-width: 360px;
    }
    .derivative-action-row {
        margin-top: 20px;
        padding: 0 12px;
    }
    .derivative-amount {
        width: 70px !important;
        margin-right: 8px; /* 减少向右移动，让按钮往左移 */
    }
    .derivative-total {
        min-width: 90px;
        margin-right: 6px; /* 减少向右移动，让按钮往左移 */
    }
    /* 电脑端buy/sell按钮往左移动 */
    .derivative-buy, .derivative-sell {
        margin-left: -4px; /* 按钮往左移动 */
    }
    /* 电脑端footer进一步下移 */
    footer {
        margin-top: 300px !important;
    }
}

/* 中等屏幕优化 */
@media (min-width: 901px) and (max-width: 1200px) {
    .derivative-item {
        min-height: 170px;
        margin-bottom: 15px;
        min-width: 280px; /* 中等屏幕适中的宽度 */
        max-width: 330px;
    }
    .derivative-action-row {
        margin-top: 18px;
        padding: 0 10px;
    }
    .derivative-amount {
        margin-right: 6px; /* 减少向右移动 */
    }
    .derivative-total {
        margin-right: 4px; /* 减少向右移动 */
    }
    /* 中等屏幕buy/sell按钮往左移动 */
    .derivative-buy, .derivative-sell {
        margin-left: -2px;
    }
    /* iPad端footer下移 */
    footer {
        margin-top: 2000px !important;
    }
}

/* 移动端优化 */
@media (max-width: 900px) {
    footer {
        margin-top: 2400px !important; /* 从1400px增加到1800px，让footer往下移动 */
    }
    .derivative-item {
        min-height: 140px;
        padding-bottom: 50px;
        min-width: 0; /* 移动端自适应宽度 */
        max-width: 100%;
        width: 100%;
    }
    .derivative-action-row {
        margin-top: 12px;
        padding: 0 6px;
        gap: 6px;
    }
    .derivative-amount {
        width: 50px !important;
        font-size: 0.95rem;
        padding: 4px 6px;
        margin-right: 6px;
    }
    .derivative-total {
        font-size: 0.95rem;
        min-width: 60px;
        margin-right: 6px;
    }
    .derivative-buy, .derivative-sell {
        font-size: 0.95rem;
        padding: 6px 12px;
        min-width: 40px;
        min-height: 32px;
    }
}

#etf10x-price, #etf10x-total {
    font-size: 1.08rem;
    color: #0e1726;
    font-weight: 700;
    margin-left: 0.2rem;
}

/* 衍生品卡片基础样式补充 */
.derivative-item {
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.1));
    border-radius: 16px;
    padding: 22px 16px 22px 16px;
    font-size: 1.08rem;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 290px; /* 从270px增加到290px */
    max-width: 340px; /* 从320px增加到340px */
}

/* 暗色模式适配 */
[data-theme="dark"] .derivative-item {
    background: linear-gradient(135deg, #232946 60%, #181c2f 100%);
    border: 1px solid #232946;
}

[data-theme="dark"] .derivative-title {
    color: #a5b4fc;
}

[data-theme="dark"] .derivative-meta {
    color: #818cf8;
}

[data-theme="dark"] .derivative-label {
    color: #e0e7ff;
}

[data-theme="dark"] .derivative-price {
    background: linear-gradient(90deg, #a5b4fc 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .derivative-total {
    color: #a5b4fc;
}

[data-theme="dark"] .derivative-amount {
    background: #2a2f4c;
    border-color: #4a5568;
    color: #e0e7ff;
}

/* 衍生品余额警告样式 */
.derivative-balance-warning {
    font-size: 0.82rem !important;
    margin-top: 1px;
    color: #f87171;
}

@media (max-width: 600px) {
  .notification {
    top: 120px !important;
  }
}

[data-theme="dark"] #deposit-modal h2,
[data-theme="dark"] #deposit-modal p {
  color: #111 !important;
}

