:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --bg-lighter: #475569;
    --text: #f8fafc;
    --text-dim: #94a3b8;
    --border: #475569;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 30px 0;
    margin-bottom: 30px;
    border-radius: 16px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.header p {
    opacity: 0.9;
    font-size: 14px;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary);
    border-radius: 2px;
}

/* Grid */
.grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.grid > .card {
    margin-bottom: 0;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* Form */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* 隐藏按钮 */
.btn-hide {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    margin-left: 8px;
}

.btn-hide:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-hide.active {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.btn-hide.active:hover {
    background: rgba(34, 197, 94, 0.25);
}

/* 官网按钮 */
.btn-official {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-official:hover {
    background: rgba(96, 165, 250, 0.25);
    border-color: rgba(96, 165, 250, 0.5);
}

/* 下载按钮 */
.btn-download {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.15);
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.btn-download:hover {
    background: rgba(167, 139, 250, 0.25);
    border-color: rgba(167, 139, 250, 0.5);
}

.btn-block {
    width: 100%;
}

/* Table */
.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    vertical-align: middle;
    height: 48px;
    box-sizing: border-box;
}

th {
    background: var(--bg-input);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-dim);
    text-transform: uppercase;
}

/* 账号列表样式 */
.user-table {
    width: 100%;
    margin: 0;
    float: none;
}
.user-table th,
.user-table td {
    white-space: nowrap;
    padding: 12px 10px;
    text-align: left !important;
}
.user-table th:nth-child(7), .user-table td:nth-child(7) { text-align: center !important; }   /* 状态 */

tr:hover {
    background: rgba(99, 102, 241, 0.1);
}

/* Status */
.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    vertical-align: middle;
}

.status-running {
    background: rgba(34, 197, 94, 0.2);
    color: var(--success);
}

.status-stopped {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-dim);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Stats */
.stat-box {
    background: var(--bg-input);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 4px;
}

.stat-value.profit { color: var(--danger); }  /* 红色盈利 */
.stat-value.loss { color: var(--success); }    /* 绿色亏损 */

/* 通用盈亏颜色 */
.profit { color: var(--danger); }   /* 红色盈利 */
.loss { color: var(--success); }    /* 绿色亏损 */

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 24px;
    cursor: pointer;
}

/* History Table */
.history-result {
    font-family: monospace;
    font-size: 16px;
    letter-spacing: 2px;
}

.win-badge {
    background: var(--success);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.lose-badge {
    background: var(--text-dim);
    color: var(--bg);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}

/* Cycle Info */
.cycle-info {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    background: var(--bg-input);
    border-radius: 10px;
    margin-bottom: 20px;
}

.cycle-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.countdown {
    font-size: 32px;
    font-weight: 700;
    color: var(--warning);
}

/* Hot Combo */
.hot-combo {
    display: flex;
    gap: 10px;
    align-items: center;
}

.combo-num {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

/* Actions */
.actions {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
    height: 100%;
}

/* Toast */
/* Modal 弹窗 */
#tokenGuideModal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}
.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 90%;
    max-width: 420px;
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    font-weight: 600;
}
.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: var(--text-dim);
    line-height: 1;
}
.modal-close:hover { color: var(--danger); }
.modal-body {
    padding: 20px;
}
.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    text-align: right;
}
.guide-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 14px;
}
.guide-step:last-child { border-bottom: none; }
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
.guide-step kbd {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}
.guide-step code {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.empty {
    text-align: center;
    padding: 40px;
    color: var(--text-dim);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.pagination .page-info {
    color: var(--text-dim);
    font-size: 14px;
    margin-right: auto;
}

.pagination .btn {
    min-width: 60px;
}

.pagination .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
