/* ========== 全局样式 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1a1a2e;
    color: #e0e0e0;
    min-height: 100vh;
}

/* ========== 顶栏 ========== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: #16213e;
    border-bottom: 1px solid #0f3460;
}
.header h1 {
    font-size: 18px;
    color: #4fc3f7;
}
.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-right input {
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid #0f3460;
    background: #1a1a2e;
    color: #e0e0e0;
    width: 180px;
}
.header-right button {
    padding: 6px 14px;
    border-radius: 4px;
    border: none;
    background: #4fc3f7;
    color: #1a1a2e;
    cursor: pointer;
    font-weight: 600;
}
.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ef5350;
    display: inline-block;
}
.status-dot.connected {
    background: #66bb6a;
}

/* ========== 导航标签 ========== */
.tabs {
    display: flex;
    padding: 0 24px;
    background: #16213e;
    border-bottom: 2px solid #0f3460;
}
.tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: #90a4ae;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}
.tab:hover { color: #e0e0e0; }
.tab.active {
    color: #4fc3f7;
    border-bottom-color: #4fc3f7;
}

/* ========== Tab内容 ========== */
.tab-content {
    display: none;
    padding: 20px 24px;
}
.tab-content.active { display: block; }

/* ========== 三栏布局（余额交易） ========== */
.layout-3col {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    gap: 16px;
    height: calc(100vh - 120px);
}
.layout-3col .col-left,
.layout-3col .col-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
}
.layout-3col .col-center {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.layout-3col .col-center .card {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.layout-3col .col-center .card .tf-tasks-wrap {
    flex: 1;
    overflow-y: auto;
}
.layout-3col .col-right .card {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.layout-3col .col-right .log-box {
    flex: 1;
    height: auto;
}
.layout-3col .card {
    margin-bottom: 0;
}
.layout-3col .form-row input {
    width: 100%;
    min-width: 0;
}
.layout-3col .col-left .form-row {
    flex-direction: column;
    align-items: stretch;
}
.layout-3col .col-left .form-row input,
.layout-3col .col-left .form-row button {
    width: 100%;
}
.layout-3col .col-left .data-table {
    font-size: 12px;
}
.layout-3col .col-left .data-table th,
.layout-3col .col-left .data-table td {
    padding: 5px 6px;
}

/* ========== 卡片 ========== */
.card {
    background: #16213e;
    border: 1px solid #0f3460;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.card h2 {
    font-size: 15px;
    color: #4fc3f7;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ========== 表单行 ========== */
.form-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.form-row input, .form-row select {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #0f3460;
    background: #1a1a2e;
    color: #e0e0e0;
    font-size: 13px;
}
.form-row input:focus, .form-row select:focus {
    outline: none;
    border-color: #4fc3f7;
}
.flex-1 { flex: 1; min-width: 200px; }

/* ========== 按钮 ========== */
button {
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #0f3460;
    background: #1a1a2e;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}
button:hover { background: #0f3460; }
.btn-primary {
    background: #4fc3f7;
    color: #1a1a2e;
    border-color: #4fc3f7;
    font-weight: 600;
}
.btn-primary:hover { background: #29b6f6; }
.btn-danger {
    background: #ef5350;
    color: #fff;
    border-color: #ef5350;
}
.btn-danger:hover { background: #e53935; }
.btn-sm {
    padding: 3px 10px;
    font-size: 12px;
}

/* ========== 代理状态 ========== */
.proxy-status {
    display: flex;
    gap: 20px;
    padding: 8px 12px;
    background: #1a1a2e;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 13px;
    flex-wrap: wrap;
}

/* ========== 代理表单切换 ========== */
.proxy-form { margin-bottom: 8px; }
.hidden { display: none; }

/* ========== 数据表格 ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 13px;
}
.data-table th {
    padding: 8px 12px;
    text-align: left;
    background: #0f3460;
    color: #4fc3f7;
    border-bottom: 1px solid #0f3460;
}
.data-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #1a1a2e;
}
.data-table tr:hover { background: #1a1a2e; }

/* ========== 任务列表 ========== */
.tasks-list {
    margin-top: 10px;
}
.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #1a1a2e;
    border-radius: 4px;
    margin-bottom: 6px;
    font-size: 13px;
}
.task-item .task-status {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}
.task-status.running { background: #4fc3f7; color: #1a1a2e; }
.task-status.success { background: #66bb6a; color: #1a1a2e; }
.task-status.stopped { background: #ef5350; color: #fff; }

/* ========== 日志 ========== */
.log-box {
    background: #0d1117;
    border: 1px solid #0f3460;
    border-radius: 4px;
    padding: 10px;
    height: 250px;
    overflow-y: auto;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 12px;
    line-height: 1.6;
    word-break: break-all;
}
.log-box .log-entry {
    padding: 1px 0;
}
.log-box .log-time {
    color: #546e7a;
    margin-right: 8px;
}

/* ========== Coming Soon ========== */
.coming-soon {
    text-align: center;
    padding: 60px;
    color: #546e7a;
    font-size: 16px;
}

/* ========== 分页控件 ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 0;
    font-size: 13px;
}
.pagination button {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    min-width: 36px;
}
.pagination button.active {
    background: #4fc3f7;
    color: #1a1a2e;
    border-color: #4fc3f7;
    font-weight: 600;
}
.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.pagination .page-info {
    color: #8b949e;
    font-size: 12px;
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #1a1a2e; }
::-webkit-scrollbar-thumb { background: #0f3460; border-radius: 3px; }

/* ========== 步骤指示器 ========== */
.step-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 8px;
    margin-bottom: 16px;
    background: #1a1a2e;
    border-radius: 8px;
    position: relative;
}
.step-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 40px;
    right: 40px;
    height: 2px;
    background: #2a2a4a;
    transform: translateY(-50%);
    z-index: 0;
}
.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 1;
}
.step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    background: #2a2a4a;
    color: #8b949e;
    transition: all 0.3s;
}
.step-name {
    font-size: 11px;
    color: #8b949e;
}
.step-item.active .step-num {
    background: #4fc3f7;
    color: #1a1a2e;
}
.step-item.done .step-num {
    background: #66bb6a;
    color: #fff;
}
.step-item.done .step-num::after {
    content: '✓';
    position: absolute;
}
.step-item.active .step-name,
.step-item.done .step-name {
    color: #c9d1d9;
}

/* ========== 日志区 ========== */
.log-viewer {
    height: 300px;
    overflow-y: auto;
    background: #0d0d1a;
    border-radius: 6px;
    padding: 12px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #c9d1d9;
    word-break: break-all;
}
.log-entry {
    margin-bottom: 2px;
}
.log-entry .log-time {
    color: #8b949e;
    margin-right: 8px;
}
.log-entry.step { color: #4fc3f7; }
.log-entry.success { color: #66bb6a; }
.log-entry.error { color: #ef5350; }
.log-entry.warning { color: #ffa726; }
