* { margin:0; padding:0; box-sizing:border-box; }
body { font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif; background:#0f0f0f; color:#e2e8f0; min-height:100vh; }
#app { max-width:95%; margin:0 auto; padding:12px 16px; }
header { display:flex; align-items:center; justify-content:space-between; padding:12px 0; border-bottom:1px solid #1e293b; margin-bottom:12px; gap:12px; flex-wrap:wrap; }
.logo { font-size:18px; font-weight:700; color:#38bdf8; letter-spacing:-0.5px; white-space:nowrap; }
.header-right { display:flex; align-items:center; gap:12px; }
.status-bar { display:flex; align-items:center; gap:8px; font-size:13px; color:#94a3b8; white-space:nowrap; }
.indicator { width:8px; height:8px; border-radius:50%; display:inline-block; }
.indicator.on { background:#22c55e; box-shadow:0 0 6px #22c55e88; }
.indicator.off { background:#ef4444; box-shadow:0 0 6px #ef444488; }
.btn-logout { padding:6px 16px; background:transparent; border:1px solid #475569; color:#94a3b8; border-radius:6px; cursor:pointer; font-size:12px; transition:.15s; white-space:nowrap; }
.btn-logout:hover { background:#ef4444; border-color:#ef4444; color:#fff; }

.tabs { display:flex; gap:4px; margin-bottom:12px; flex-wrap:wrap; }
.tab { padding:8px 20px; border:1px solid #1e293b; background:#1e293b; color:#94a3b8; cursor:pointer; border-radius:6px; font-size:13px; transition:.15s; }
.tab:hover { background:#334155; }
.tab.active { background:#0ea5e9; color:#fff; border-color:#0ea5e9; }

.main { display:flex; gap:16px; }
.tab-content { display:none; width:100%; }
.tab-content.active { display:flex; flex-direction:column; gap:16px; }
#tab-chart { display:flex; flex-direction:column; gap:16px; }
#tab-config.active { display:block; }

.chart-area { display:flex; gap:16px; }
.chart-container { flex:1; min-height:82vh; height:82vh; border-radius:8px; overflow:hidden; border:1px solid #1e293b; }
#tv-chart { width:100%; height:82vh; }

.sidebar { width:280px; flex-shrink:0; }
.signal-section { flex-shrink:0; }
.panel { background:#1e293b; border-radius:8px; padding:16px; }
.panel h3 { font-size:14px; color:#38bdf8; margin-bottom:12px; font-weight:600; }
.stat-row { display:flex; justify-content:space-between; padding:6px 0; font-size:13px; border-bottom:1px solid #0f172a; }
.stat-row:last-child { border-bottom:none; }
.stat-row .label { color:#94a3b8; }
.stat-row .value { color:#e2e8f0; font-weight:500; }
.stat-row .value.green { color:#22c55e; }
.stat-row .value.red { color:#ef4444; }
.stat-row .value.orange { color:#f59e0b; }

.config-panel { max-width:600px; margin:0 auto; }
.form-group { margin-bottom:12px; }
.form-group label { display:block; font-size:12px; color:#94a3b8; margin-bottom:4px; }
.form-group input, .form-group textarea, .form-group select {
    width:100%; padding:8px 10px; background:#0f172a; border:1px solid #334155; border-radius:4px; color:#e2e8f0; font-size:13px; outline:none; transition:.15s;
}
.form-group input:focus, .form-group textarea:focus { border-color:#0ea5e9; }
.form-group textarea { font-family:monospace; font-size:12px; resize:vertical; }
details { margin:16px 0; }
details summary { cursor:pointer; color:#0ea5e9; font-size:13px; margin-bottom:8px; }
hr { border:none; border-top:1px solid #334155; margin:16px 0; }
.btn { padding:10px 28px; background:#0ea5e9; color:#fff; border:none; border-radius:6px; cursor:pointer; font-size:14px; font-weight:600; transition:.15s; }
.btn:hover { background:#0284c7; }
#save-msg { margin-left:12px; font-size:13px; }
#save-msg.success { color:#22c55e; }
#save-msg.error { color:#ef4444; }

.signal-list { max-height:500px; overflow-y:auto; }
.signal-empty { text-align:center; color:#64748b; padding:40px 0; font-size:13px; }
.signal-item { padding:10px 12px; border-bottom:1px solid #0f172a; font-size:12px; line-height:1.6; }
.signal-item:last-child { border-bottom:none; }
.signal-item .sig-time { color:#64748b; font-family:monospace; font-size:11px; }
.signal-item .sig-action { font-weight:600; }
.signal-item .sig-action.buy { color:#22c55e; }
.signal-item .sig-action.sell { color:#ef4444; }
.signal-item .sig-detail { color:#cbd5e1; }
.signal-item .sig-status { display:inline-block; padding:1px 6px; border-radius:3px; font-size:11px; }
.signal-item .sig-status.ok { background:#22c55e22; color:#22c55e; }
.signal-item .sig-status.failed { background:#ef444422; color:#ef4444; }
.signal-item .sig-status.rejected { background:#f59e0b22; color:#f59e0b; }

.hint { font-size:11px; color:#64748b; margin-top:4px; line-height:1.5; }

/* 自适应：平板 */
@media(max-width:900px) {
    .chart-area { flex-direction:column; }
    .sidebar { width:100%; }
    .chart-container { min-height:400px; height:400px; }
    #tv-chart { height:400px; }
    .signal-list { max-height:350px; }
}

/* 自适应：手机 */
@media(max-width:600px) {
    #app { padding:8px 10px; }
    .logo { font-size:15px; }
    header { flex-direction:column; align-items:flex-start; }
    .header-right { width:100%; justify-content:space-between; }
    .tabs { gap:2px; }
    .tab { padding:6px 12px; font-size:12px; flex:1; text-align:center; }
    .chart-container { min-height:300px; height:300px; border-radius:4px; }
    #tv-chart { height:300px; }
    .sidebar { width:100%; }
    .panel { padding:12px; }
    .panel h3 { font-size:13px; }
    .stat-row { font-size:12px; padding:4px 0; }
    .config-panel { max-width:100%; }
    .signal-list { max-height:250px; }
    .signal-item { padding:8px 10px; font-size:11px; }
    .btn-logout { font-size:11px; padding:4px 12px; }
    #save-msg { display:block; margin-left:0; margin-top:8px; }
}
