body {
    font-family: 'Roboto', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #495057;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    background-color: #343a40;
    color: white;
    width: 100%;
    text-align: center;
    padding: 20px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0;
    font-size: 2.5em;
}

nav {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

nav a {
    text-decoration: none;
    color: #495057;
    font-size: 18px;
    padding: 5px 10px;
    margin: 0 10px;
    border-radius: 5px;
    transition: color 0.3s, background-color 0.3s, transform 0.3s;
    position: relative;
}

nav a:hover {
    color: #007bff;
    background-color: #e9ecef;
    transform: scale(1.1);
}

nav a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: #007bff;
    bottom: -2px;
    left: 0;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

nav a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

main {
    background-color: white;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.6;
}

main h2 {
    font-size: 1.8em;
    margin-top: 0;
    color: #007bff;
}

#visitor-info {
    margin: 10px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

footer {
    background-color: #343a40;
    color: white;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    font-size: 14px;
    margin-top: 20px;
}

#visit-count, #last-visit-time {
    font-size: 0.9em;
    color: #868e96;
}

/* ==============================
   仓位数据面板 — 深海蓝（Ocean Blue）交易终端风格
   ============================== */

#positions-info,
#price-info {
    background-color: #004b87;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

/* ---- 表格基础 ---- */
.crypto-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

/* ---- Logo 尺寸控制 ---- */
.crypto-table .logo-col img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    vertical-align: middle;
    object-fit: cover;
}

/* ---- 价格表格列宽约束（#price-info） ---- */
.crypto-table .logo-col {
    width: 60px;
    text-align: center !important;
}

.crypto-table .name-col {
    text-align: left !important;
}

.crypto-table .price-col {
    text-align: right !important;
}

/* ---- 表头 ---- */
.crypto-table thead tr {
    background: linear-gradient(135deg, #005b9f 0%, #0074c7 100%);
}

.crypto-table thead th {
    color: #d6eaff;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
    white-space: nowrap;
}

.crypto-table thead th:first-child {
    text-align: left;
}

.crypto-table thead th:last-child {
    text-align: right;
}

/* ---- 数据行 ---- */
.crypto-table tbody tr {
    background-color: #004b87;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.crypto-table tbody tr:last-child {
    border-bottom: none;
}

.crypto-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.crypto-table tbody td {
    color: #d6eaff;
    padding: 11px 16px;
    vertical-align: middle;
}

/* ---- 数字列右对齐 ---- */
.crypto-table .num-cell,
.crypto-table .price-col {
    text-align: right;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

/* ---- 方向列（红涨绿跌：A股惯例） ---- */
.crypto-table .dir-cell {
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.02em;
}

/* 高权重方向色，override tbody td */
.crypto-table tbody td.dir-long {
    color: #e53935;
}

.crypto-table tbody td.dir-short {
    color: #43a047;
}

/* ---- 盈亏列（红盈绿亏） ---- */
.crypto-table .pnl-cell {
    text-align: right;
    font-weight: 600;
    font-size: 14px;
}

/* 高权重盈亏色，override tbody td */
.crypto-table tbody td.pnl-positive {
    color: #e53935;
    text-shadow: 0 0 10px rgba(229, 57, 53, 0.4);
}

.crypto-table tbody td.pnl-negative {
    color: #43a047;
    text-shadow: 0 0 10px rgba(67, 160, 71, 0.4);
}

.crypto-table tbody td.pnl-zero {
    color: #8ab4d8;
}

/* ---- 币种列（首列） ---- */
.crypto-table .coin-cell {
    text-align: left;
    font-weight: 600;
    color: #e8f4ff;
    white-space: nowrap;
}

/* ---- 悬浮行时首列同步高亮 ---- */
.crypto-table tbody tr:hover td:first-child {
    background-color: rgba(255, 255, 255, 0.1);
}

/* ---- 加载中指示器 ---- */
.loading-indicator {
    text-align: center;
    color: #a8d4f5;
    font-size: 14px;
    padding: 28px 0;
    margin: 0;
    letter-spacing: 0.05em;
}

/* ---- 空状态卡片（海蓝） ---- */
.empty-state-card {
    background-color: #004b87;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    padding: 52px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

.empty-state-card .es-icon {
    color: #5ba8d8;
    line-height: 1;
}

.empty-state-card .es-title {
    color: #a8d4f5;
    font-size: 17px;
    font-weight: 600;
    margin: 0;
}

.empty-state-card .es-subtitle {
    color: #7bbce0;
    font-size: 13px;
    margin: 0;
    line-height: 1.6;
}

.empty-state-card .es-divider {
    width: 40px;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: 4px 0;
}

/* ---- 移动端横向滚动 ---- */
@media (max-width: 768px) {
    #positions-info,
    #price-info {
        border-radius: 8px;
        position: relative;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    }

    /* 左右滚动提示阴影（海蓝） */
    #positions-info::before,
    #price-info::before {
        content: '';
        position: absolute;
        top: 0; bottom: 0; left: 0;
        width: 28px;
        background: linear-gradient(to right, #004b87 0%, transparent 100%);
        pointer-events: none;
        z-index: 1;
    }

    #positions-info::after,
    #price-info::after {
        content: '';
        position: absolute;
        top: 0; bottom: 0; right: 0;
        width: 28px;
        background: linear-gradient(to left, #004b87 0%, transparent 100%);
        pointer-events: none;
        z-index: 1;
    }

    .crypto-table thead th,
    .crypto-table tbody td {
        padding: 9px 10px;
        font-size: 12px;
    }

    /* 首列 sticky 固定（海蓝背景） */
    .crypto-table thead th:first-child,
    .crypto-table tbody td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        background-color: inherit;
    }

    .crypto-table thead th:first-child {
        z-index: 3;
        background: linear-gradient(135deg, #005b9f 0%, #0074c7 100%);
    }

    .crypto-table tbody td:first-child {
        background-color: #004b87;
    }

    /* 悬浮行时 sticky 首列同步变色 */
    .crypto-table tbody tr:hover td:first-child {
        background-color: rgba(255, 255, 255, 0.15);
    }

    .empty-state-card {
        padding: 36px 16px;
    }

    .empty-state-card .es-title {
        font-size: 15px;
    }

    .empty-state-card .es-subtitle {
        font-size: 12px;
    }
}