* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #0d1117; color: #c9d1d9; font-size: 14px; overflow-x: hidden;
}
.hidden { display: none !important; }

.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); display: flex;
    align-items: center; justify-content: center; z-index: 9999;
}
.login-box {
    background: #161b22; border: 1px solid #30363d; border-radius: 12px;
    padding: 40px; text-align: center; width: 380px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.login-box h2 { color: #58a6ff; margin-bottom: 16px; font-size: 22px; }
.login-box p { color: #8b949e; margin-bottom: 20px; }
.login-box input {
    width: 100%; padding: 12px 16px; background: #0d1117;
    border: 1px solid #30363d; border-radius: 8px; color: #c9d1d9;
    font-size: 16px; margin-bottom: 16px; outline: none;
}
.login-box input:focus { border-color: #58a6ff; }
.login-box button {
    width: 100%; padding: 12px; background: #238636; border: none;
    border-radius: 8px; color: #fff; font-size: 16px; cursor: pointer;
}
.login-box button:hover { background: #2ea043; }
.error-msg { color: #f85149; margin-top: 12px; font-size: 13px; min-height: 18px; }

.top-bar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 24px; background: #161b22; border-bottom: 1px solid #30363d;
}
.top-title { font-size: 18px; font-weight: 700; color: #58a6ff; }
.top-stats { display: flex; gap: 20px; }
.top-stat { font-size: 13px; color: #8b949e; }
.top-stat b { color: #c9d1d9; font-size: 15px; }
.green { color: #3fb950; }
.red { color: #f85149; }

.data-status-bar {
    margin: 16px 16px 0 16px;
    border-radius: 12px;
    padding: 6px 24px; font-size: 13px; font-weight: 600; text-align: center;
}
.data-status-bar.ok { background: rgba(35,134,54,0.15); color: #3fb950; }
.data-status-bar.error { background: rgba(248,81,73,0.15); color: #f85149; border-radius: 12px; }

.panels-container {
    display: flex; gap: 16px; padding: 16px; min-height: calc(100vh - 100px);
}
.panel {
    flex: 1; background: #161b22; border: 1px solid #30363d;
    border-radius: 12px; overflow: hidden; display: flex; flex-direction: column;
}
.smart-money-panel { border-top: 3px solid #58a6ff; }
.copy-account-panel { border-top: 3px solid #3fb950; }

.panel-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px; background: #161b22; border-bottom: 1px solid #30363d;
}
.panel-header h2 { font-size: 17px; color: #c9d1d9; }
.equity-display { font-size: 15px; color: #8b949e; }
.equity-display span { color: #58a6ff; font-weight: 700; }
.copy-account-panel .equity-display span { color: #3fb950; }

.section { padding: 14px 20px; border-bottom: 1px solid #21262d; }
.section:last-child { border-bottom: none; }
.section h3 {
    font-size: 13px; color: #8b949e; margin-bottom: 10px;
    text-transform: uppercase; letter-spacing: 0.5px;
}

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
    padding: 8px 10px; text-align: left; color: #8b949e;
    font-weight: 600; border-bottom: 1px solid #30363d; white-space: nowrap;
}
.data-table tbody td { padding: 7px 10px; border-bottom: 1px solid #21262d; }
.data-table tbody tr:hover { background: #1c2128; }
.data-table tbody tr:last-child td { border-bottom: none; }
.empty-row { text-align: center; color: #484f58; padding: 16px !important; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.tag-buy, .tag-long { background: rgba(35,134,54,0.2); color: #3fb950; }
.tag-sell, .tag-short { background: rgba(248,81,73,0.2); color: #f85149; }
.tag-open { background: rgba(88,166,255,0.2); color: #58a6ff; }
.tag-close { background: rgba(139,148,158,0.2); color: #8b949e; }
.tag-add { background: rgba(163,113,247,0.2); color: #a371f7; }
.tag-reduce { background: rgba(210,153,34,0.2); color: #d29922; }
.tag-filled { background: rgba(35,134,54,0.2); color: #3fb950; }
.tag-failed { background: rgba(248,81,73,0.2); color: #f85149; }
.tag-pending { background: rgba(210,153,34,0.2); color: #d29922; }
.pnl-positive { color: #3fb950; }
.pnl-negative { color: #f85149; }

.config-form { display: flex; flex-direction: column; gap: 10px; }
.config-row { display: flex; align-items: center; gap: 12px; }
.config-row label { width: 120px; font-size: 13px; color: #8b949e; flex-shrink: 0; }
.config-row input, .config-row select {
    flex: 1; padding: 7px 10px; background: #0d1117;
    border: 1px solid #30363d; border-radius: 6px; color: #c9d1d9; font-size: 13px; outline: none;
}
.config-row input:focus, .config-row select:focus { border-color: #58a6ff; }
.config-row-3 { display: flex; gap: 12px; }
.config-row-3 > div { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.config-row-3 label { width: auto; font-size: 12px; }
.config-row-3 input { width: 100%; }

.config-actions { display: flex; gap: 8px; margin-top: 4px; }
.btn-save, .btn-start, .btn-stop {
    padding: 8px 16px; border: none; border-radius: 6px;
    color: #fff; font-size: 13px; cursor: pointer; flex: 1;
}
.btn-save { background: #1f6feb; }
.btn-save:hover { background: #388bfd; }
.btn-start { background: #238636; }
.btn-start:hover { background: #2ea043; }
.btn-start:disabled { background: #21262d; color: #484f58; cursor: not-allowed; }
.btn-stop { background: #da3633; }
.btn-stop:hover { background: #f85149; }
.btn-stop:disabled { background: #21262d; color: #484f58; cursor: not-allowed; }

.copy-status-display { font-size: 14px; color: #8b949e; margin-top: 4px; }
.copy-status-display span { margin: 0; padding: 0; }
.status-on { color: #3fb950; font-weight: 700; }
.status-off { color: #f85149; font-weight: 700; }

.btn-close {
    padding: 4px 10px; background: rgba(248,81,73,0.2);
    border: 1px solid rgba(248,81,73,0.3); border-radius: 4px;
    color: #f85149; font-size: 12px; cursor: pointer;
}
.btn-close:hover { background: rgba(248,81,73,0.3); }

#toast-container {
    position: fixed; top: 80px; right: 24px; z-index: 9998;
    display: flex; flex-direction: column; gap: 8px;
}
.toast {
    background: #161b22; border: 1px solid #30363d; border-radius: 8px;
    padding: 12px 20px; min-width: 280px; max-width: 400px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4); animation: slideIn 0.3s ease;
}
.toast.signal { border-left: 3px solid #58a6ff; }
.toast.success { border-left: 3px solid #3fb950; }
.toast.error { border-left: 3px solid #f85149; }
.toast.fade-out { animation: slideOut 0.3s ease forwards; }
@keyframes slideIn { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(400px); opacity: 0; } }

@media (max-width: 1024px) { .panels-container { flex-direction: column; } }
@media (max-width: 768px) {
    .top-bar { flex-direction: column; gap: 8px; }
    .top-stats { flex-wrap: wrap; justify-content: center; }
    .data-table { font-size: 12px; }
}

.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.table-wrap::-webkit-scrollbar {
    height: 6px;
}
.table-wrap::-webkit-scrollbar-track {
    background: #0d1117;
}
.table-wrap::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 3px;
}

.data-table { table-layout: auto; }
.data-table thead th, .data-table tbody td {
    white-space: nowrap;
    text-align: right;
}
.data-table thead th:first-child, .data-table tbody td:first-child {
    text-align: left;
}
.data-table thead th:nth-child(2), .data-table tbody td:nth-child(2) {
    text-align: center;
}

.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 10px 0; }
.pagination button { background: #21262d; color: #c9d1d9; border: 1px solid #30363d; border-radius: 6px; padding: 4px 12px; cursor: pointer; font-size: 13px; }
.pagination button:hover { background: #30363d; border-color: #58a6ff; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination button.active { background: #1f6feb; color: #fff; border-color: #1f6feb; }
.pagination span { color: #8b949e; font-size: 13px; }

/* === WS 状态圆点动画 === */
.ws-indicator-wrap { display: flex; align-items: center; gap: 6px; }
.ws-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    flex-shrink: 0;
}
.ws-dot-connecting { background: #d29922; animation: ws-blink 1s ease-in-out infinite; }
.ws-dot-connected { background: #3fb950; animation: ws-blink 1.5s ease-in-out infinite; box-shadow: 0 0 6px rgba(63,185,80,0.6); }
.ws-dot-disconnected { background: #f85149; animation: none; box-shadow: 0 0 4px rgba(248,81,73,0.4); }
@keyframes ws-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.7); }
}

/* === 数据状态栏跑马灯边框 === */
/* === 数据状态栏跑马灯边框转圈 === */
@property --marquee-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}
.data-status-bar {
    margin: 16px 16px 0 16px;
    border-radius: 12px;
    position: relative;
    border: 1px solid rgba(63,185,80,0.1);
}
.data-status-bar.ok {
    border-color: rgba(63,185,80,0.1);
}
.data-status-bar.ok .marquee-border {
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(
        from var(--marquee-angle),
        #3fb950, #58a6ff, #a371f7, #f85149, #d29922, #3fb950
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: marquee-rotate 3s linear infinite;
    pointer-events: none;
}
@keyframes marquee-rotate {
    to { --marquee-angle: 360deg; }
}
.data-status-bar.error {
    border-color: rgba(248,81,73,0.3);
    border-radius: 12px;
}
.data-status-bar.error .marquee-border { display: none; }
.top-bar {
    background: linear-gradient(135deg, #161b22 0%, #1a1f2e 50%, #161b22 100%);
    background-size: 200% 200%;
    animation: gradient-shift 8s ease infinite;
}
@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.panel {
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}
.panel:hover {
    
    
}
.smart-money-panel { border-top: 3px solid #58a6ff; }
.copy-account-panel { border-top: 3px solid #3fb950; }


/* === Toast 弹跳动画 === */
.toast {
    animation: slideIn 0.3s ease, bounce-in 0.5s ease;
}
@keyframes bounce-in {
    0% { transform: translateX(400px) scale(0.8); }
    60% { transform: translateX(-10px) scale(1.02); }
    100% { transform: translateX(0) scale(1); }
}

/* === 权益数字发光 === */
.equity-display span {
    text-shadow: 0 0 8px rgba(88,166,255,0.3);
}
.copy-account-panel .equity-display span {
    text-shadow: 0 0 8px rgba(63,185,80,0.3);
}

/* === 标题发光 === */
.top-title {
    text-shadow: 0 0 12px rgba(88,166,255,0.2);
}

/* === 卡片顶部颜色条滚动闪烁 === */
.smart-money-panel {
    border-top: 3px solid #58a6ff;
    position: relative;
}
.copy-account-panel {
    border-top: 3px solid #3fb950;
    position: relative;
}
.smart-money-panel::before {
    content: '';
    position: absolute;
    top: -3px; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, #58a6ff, #a371f7, #3fb950, #58a6ff);
    background-size: 200% 100%;
    opacity: 0;
    border-radius: 12px 12px 0 0;
    animation: bar-scroll 2s linear infinite;
}
.copy-account-panel::before {
    content: '';
    position: absolute;
    top: -3px; left: 0;
    width: 100%; height: 3px;
    background: linear-gradient(90deg, #3fb950, #58a6ff, #a371f7, #3fb950);
    background-size: 200% 100%;
    opacity: 0;
    border-radius: 12px 12px 0 0;
    animation: bar-scroll 2s linear infinite;
}
.smart-money-panel:hover::before,
.copy-account-panel:hover::before {
    opacity: 1;
}
@keyframes bar-scroll {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
.panel {
    transition: none;
}

/* === API 状态显示 === */
.copy-status-display { font-size: 14px; color: #8b949e; margin-top: 4px; display: block; }
.api-status { font-size: 14px; color: #8b949e; float: right; }





.api-status {
    font-size: 14px;
    color: #8b949e;
}
.api-status b.green { color: #3fb950; font-weight: 700; }
.api-status b.red { color: #f85149; font-weight: 700; }
