/* 通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f5f5f5;
    color: #333;
}

.main-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    background: #1a1a2e;
    color: white;
    padding: 15px 20px;
    margin-bottom: 0;
    border-bottom: 1px solid #e5e7eb;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 1px;
}

.header-nav {
    display: flex;
    gap: 15px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 8px 12px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
}

.nav-link:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

/* Status Bar (inside header) */
.header .status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffc107;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #28a745;
    animation: none;
}

.status-dot.error {
    background: #dc3545;
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.header-status .status-text {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.last-update {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* QuoteTable Component - 响应式行情表格组件 */
/* ATGPM 主题风格 */

.quote-table-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    font-family: 'Open Sans', 'Montserrat', sans-serif;
    background: #ffffff;
    border: none;
    color: #555;
    font-size: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.quote-table-header {
    display: grid;
    grid-template-columns: 2fr 80px 1fr 1fr 0.8fr 1.2fr 1fr 1fr;
    padding: 12px 0;
    background: #bd9e56;
    font-weight: 700;
    font-size: 13px;
    color: #ffffff;
    border-bottom: 2px solid #bd9e56;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.quote-table-header > div {
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0 12px;
}

.quote-table-header > div:first-child {
    padding-left: 16px;
}

.quote-table-header > div:last-child {
    padding-right: 16px;
    border-right: none;
}

.quote-table-header .symbol-column {
    text-align: left;
}

.quote-table-header .chart-column {
    text-align: center;
}

.quote-table-header .high-column,
.quote-table-header .low-column {
    text-align: right;
    padding-right: 8px;
}

.quote-table-header .ask-column,
.quote-table-header .bid-column {
    text-align: right;
    padding-right: 8px;
}

.quote-table-header .spread-column {
    text-align: right;
    padding-right: 8px;
}

.quote-table-body {
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0;
    background: #ffffff;
    flex: 1;
    min-height: 0;
}

.quote-table-row {
    display: grid;
    grid-template-columns: 2fr 80px 1fr 1fr 0.8fr 1.2fr 1fr 1fr;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
    background: #ffffff;
    min-height: 50px;
    align-items: center;
}

.quote-table-row > div {
    border-right: 1px solid #f5f5f5;
    padding: 0 12px;
}

.quote-table-row > div:first-child {
    padding-left: 16px;
}

.quote-table-row > div:last-child {
    padding-right: 16px;
    border-right: none;
}

.quote-table-row:nth-child(odd) {
    background: #f9f9f9;
}

.quote-table-row:hover {
    background-color: #f0f0f0;
}

.quote-symbol-wrapper {
    display: flex;
    align-items: center;
}

.quote-symbol-badge {
    padding: 3px 8px;
    display: inline-block;
    border: 1px solid transparent;
}

.quote-symbol-badge.bg-up {
    color: #d9534f;
    background: transparent;
    border-color: transparent;
}

.quote-symbol-badge.bg-down {
    color: #28a745;
    background: transparent;
    border-color: transparent;
}

.quote-symbol-badge.bg-flat {
    color: #000000;
    background: transparent;
}

.quote-symbol-name {
    font-weight: 700;
    font-size: 15px;
    color: #000000;
    letter-spacing: 0.3px;
}

.quote-price {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
}

.quote-price.up .price-value,
.quote-price.up .price-main,
.quote-price.up .price-decimal {
    color: #d9534f;
}

.quote-price.down .price-value,
.quote-price.down .price-main,
.quote-price.down .price-decimal {
    color: #28a745;
}

.price-high {
    color: #d9534f;
}

.price-low {
    color: #28a745;
}

.price-spread {
    color: #111827;
}

.quote-table-header .change-column {
    text-align: center;
    padding-right: 0;
}

.quote-table-row > div:nth-child(5) .quote-price {
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
}

.quote-table-row > div:nth-child(8) {
    justify-self: end !important;
    text-align: right !important;
}

.quote-table-row > div:nth-child(8) .quote-price {
    justify-content: flex-end !important;
    align-items: flex-end !important;
    text-align: right !important;
}

/* Bid 和 Ask 列的 quote-price 必须横向显示 */
.quote-table-row [data-field="bid"],
.quote-table-row [data-field="ask"] {
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 0 !important;
    justify-content: flex-end !important;
}

.price-value {
    font-family: 'Open Sans', 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #000000;
}

.price-main {
    font-family: 'Open Sans', 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #000000;
}

.price-decimal {
    font-family: 'Open Sans', 'Montserrat', sans-serif;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #000000;
}

.price-change {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    min-width: 60px;
    text-align: center;
}

.price-change.bg-up {
    background: #d9534f;
    color: white;
}

.price-change.bg-down {
    background: #28a745;
    color: white;
}

.price-change.bg-flat {
    background: #e0e0e0;
    color: #999;
}

.quote-table-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 13px;
}

.quote-table-loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.quote-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #bd9e56;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.quote-table-loading > div:last-child {
    margin-top: 16px;
    font-size: 14px;
    color: #666;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.quote-chart-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.quote-spark {
    display: block;
    width: 80px;
    height: 30px;
}

.quote-spark.is-hidden {
    display: none;
}

.quote-spark-skeleton {
    width: 80px;
    height: 30px;
    background: linear-gradient(90deg, #f5f5f5 0%, #e0e0e0 50%, #f5f5f5 100%);
    background-size: 200% 100%;
    animation: quote-spark-loading 1.2s ease-in-out infinite;
}

.quote-spark-skeleton.is-hidden {
    display: none;
}

@keyframes quote-spark-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.quote-table-waiting {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.quote-table-waiting .icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.quote-table-waiting .title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.quote-table-waiting .desc {
    font-size: 14px;
    color: #9ca3af;
}

/* Footer */
.footer {
    text-align: center;
    padding: 15px 20px;
    color: #888;
    font-size: 14px;
    flex-shrink: 0;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 12px 15px;
        flex-direction: column;
        align-items: stretch;
    }

    .header-status {
        width: 100%;
        justify-content: center;
    }

    .header-nav {
        width: 100%;
        justify-content: center;
    }

    .header-title {
        font-size: 20px;
        text-align: center;
    }

    /* 隐藏图表、涨跌、最高、最低、点差列 */
    .quote-table-header .chart-column,
    .quote-table-header .change-column,
    .quote-table-header .high-column,
    .quote-table-header .low-column,
    .quote-table-header .spread-column,
    .quote-table-row .quote-chart-wrapper,
    .quote-table-row .quote-price:has([data-field="change"]),
    .quote-table-row .quote-price:has([data-field="high"]),
    .quote-table-row .quote-price:has([data-field="low"]),
    .quote-table-row .quote-price:has([data-field="spread"]) {
        display: none !important;
    }

    .quote-table-header {
        grid-template-columns: 2fr 1fr 1fr !important;
        min-height: 44px;
        padding: 10px 0;
        align-items: center;
        font-size: 13px;
        font-weight: 600;
        letter-spacing: 0.3px;
    }

    .quote-table-header > div {
        border-right: none !important;
    }

    .quote-table-header .symbol-column {
        font-size: 13px;
        text-align: left !important;
        justify-self: start !important;
    }

    .quote-table-header .ask-column,
    .quote-table-header .bid-column {
        text-align: right !important;
        justify-self: end !important;
        padding-right: 4px;
    }

    .quote-table-row {
        grid-template-columns: 2fr 1fr 1fr !important;
        min-height: 48px;
        padding: 10px 0;
    }

    .quote-table-row > div {
        border-right: none !important;
    }

    .price-value {
        font-size: 15px;
        font-weight: 600;
    }

    .quote-symbol-name {
        font-size: 14px;
        font-weight: 600;
    }
}
