/* -------------------------------------------------------------
 * TSF / ELC 做市商 (AMM) 极简商务浅色设计系统
 * 纯粹黑白灰高质感、全圆角、全交互动效、零 Emoji
 * ------------------------------------------------------------- */
:root {
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-subtle: #f1f5f9;
    --bg-input: #ffffff;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --text-main: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --primary-btn: #0f172a;
    --primary-btn-hover: #1e293b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    --shadow-subtle: 0 1px 3px 0 rgba(15, 23, 42, 0.05), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
    --shadow-elevated: 0 12px 30px -8px rgba(15, 23, 42, 0.08), 0 4px 10px -4px rgba(15, 23, 42, 0.03);
    --transition-smooth: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* 纯色矢量图标 */
.svg-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    stroke-width: 0;
    stroke: currentColor;
    fill: currentColor;
    vertical-align: middle;
    transition: var(--transition-smooth);
}

/* ------------------ 顶栏导航 ------------------ */
.navbar {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 24px;
}
.nav-container {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--text-main);
}
.brand-logo {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background-color: var(--primary-btn);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
}
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.sync-badge {
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-smooth);
}
.sync-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #0f172a;
    opacity: 0.6;
    animation: pulse-dot 2.5s infinite ease-in-out;
}
@keyframes pulse-dot {
    0%, 100% { transform: scale(0.9); opacity: 0.4; }
    50% { transform: scale(1.2); opacity: 0.9; }
}

/* ------------------ 主体容器 ------------------ */
.main-content {
    max-width: 1240px;
    margin: 24px auto;
    padding: 0 20px;
    flex: 1;
    width: 100%;
}

/* 四项核心统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-subtle);
    transition: var(--transition-smooth);
}
.stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-elevated);
}
.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}
.stat-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 看板双栏网格 */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    align-items: start;
}
.left-column, .right-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 通用面板卡片 */
.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-subtle);
    transition: var(--transition-smooth);
}
.panel-card:hover {
    border-color: var(--border-hover);
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.panel-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}
.panel-time-tag {
    font-size: 11px;
    color: var(--text-muted);
    background-color: var(--bg-subtle);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* 折线图容器 */
.chart-container {
    width: 100%;
    height: 260px;
    position: relative;
}

/* 交易操作卡片 */
.trade-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: var(--bg-subtle);
    padding: 4px;
    border-radius: var(--radius-md);
    margin-bottom: 18px;
}
.tab-btn {
    border: none;
    background: transparent;
    padding: 9px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.tab-btn.active {
    background: #ffffff;
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

/* 提示通知条 */
.warning-banner {
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* 表单输入组件 */
.form-group {
    margin-bottom: 14px;
}
.form-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.trade-input {
    width: 100%;
    padding: 12px 64px 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
    outline: none;
    transition: var(--transition-smooth);
}
.trade-input:focus {
    border-color: var(--text-main);
    box-shadow: 0 0 0 1px var(--text-main);
}
.input-currency {
    position: absolute;
    right: 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    pointer-events: none;
}

/* 交换方向分隔器 */
.swap-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px 0;
}
.swap-arrow-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: default;
    user-select: none;
}

/* 结算参数卡片 */
.quote-details {
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 12px;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.detail-row:last-child {
    margin-bottom: 0;
}
.detail-val {
    color: var(--text-main);
    font-weight: 600;
}

/* 主操作按钮 */
.btn-action {
    width: 100%;
    padding: 13px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #ffffff;
    background-color: var(--primary-btn);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-smooth);
    text-decoration: none;
}
.btn-action:hover {
    background-color: var(--primary-btn-hover);
    transform: translateY(-1px);
}
.btn-action:active {
    transform: scale(0.985);
}
.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 直接转账指引卡片 */
.direct-transfer-box {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 14px;
    text-align: center;
    transition: var(--transition-smooth);
}
.transfer-box-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.transfer-account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    margin-bottom: 12px;
    gap: 10px;
}
.transfer-email-tag {
    font-family: monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    user-select: all;
    word-break: break-all;
    text-align: left;
}
.btn-copy-account {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: var(--transition-smooth);
}
.btn-copy-account:hover {
    background: #ffffff;
    border-color: var(--border-hover);
    transform: translateY(-1px);
}
.btn-copy-account:active {
    transform: scale(0.97);
}
.transfer-hint-text {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 10px;
    text-align: left;
    background: rgba(255, 255, 255, 0.7);
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-color);
}

/* 市场交易明细表格 */
.trade-table-container {
    width: 100%;
    overflow-x: auto;
    max-height: 360px;
    overflow-y: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}
.trade-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    text-align: left;
}
.trade-table th {
    background-color: var(--bg-subtle);
    color: var(--text-secondary);
    padding: 9px 12px;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
}
.trade-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}
.trade-table tr:hover td {
    background-color: var(--bg-subtle);
}
.badge {
    display: inline-block;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}
.badge-buy {
    background-color: var(--bg-subtle);
    color: var(--text-main);
    border: 1px solid var(--border-hover);
}
.badge-sell {
    background-color: var(--bg-page);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

/* 资产查询区域 */
.query-box {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.btn-outline {
    background: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-smooth);
}
.btn-outline:hover {
    background-color: var(--bg-subtle);
    color: var(--text-main);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}
.btn-outline:active {
    transform: scale(0.98);
}

/* 模态弹窗系统 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    transition: var(--transition-smooth);
}
.modal-overlay.active {
    display: flex;
    opacity: 1;
}
.modal-dialog {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 440px;
    padding: 24px;
    box-shadow: var(--shadow-elevated);
    transform: translateY(12px) scale(0.97);
    transition: var(--transition-smooth);
}
.modal-overlay.active .modal-dialog {
    transform: translateY(0) scale(1);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.modal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
}
.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-smooth);
}
.modal-close:hover {
    color: var(--text-main);
    background: var(--bg-subtle);
}
.pay-card {
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    margin-bottom: 14px;
}
.pay-code-box {
    background: #ffffff;
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    padding: 10px;
    margin: 10px 0;
    font-family: monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: 1.5px;
    user-select: all;
    cursor: pointer;
}
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-top-color: var(--text-main);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 吐司提示组件 */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    pointer-events: none;
}
.toast {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    box-shadow: var(--shadow-elevated);
    font-size: 13px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: toast-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 380px;
    word-break: break-word;
    line-height: 1.45;
    pointer-events: auto;
}
@keyframes toast-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .stats-grid { grid-template-columns: 1fr; }
}