/* 自定义样式 */

body {
    background-color: #f5f5f5;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 全局缩放：降低根字号以整体缩小布局与间距（Bootstrap rem 基于根字号） */
html { font-size: 14px; }
@media (max-width: 1440px) { html { font-size: 13.5px; } }
@media (max-width: 1280px) { html { font-size: 13px; } }

.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: none;
    margin-bottom: 0;
}

.card-header {
    font-weight: bold;
}

/* 斐波那契水平选择 */
.fib-levels {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.form-check-inline {
    margin-right: 0;
}

/* 价格表格样式 */
.price-table {
    width: 100%;
}

.price-table th {
    background-color: #17a2b8;
    color: white;
    padding: 10px;
    text-align: left;
}

.price-table td {
    padding: 8px;
    border-bottom: 1px solid #dee2e6;
}

.price-table tr:hover {
    background-color: #f8f9fa;
}

.level-triggered {
    background-color: #d4edda !important;
    font-weight: bold;
}

/* 日志容器 */
.log-container {
    max-height: 300px;
    overflow-y: auto;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.log-entry {
    padding: 5px 0;
    border-bottom: 1px solid #e9ecef;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: #6c757d;
    font-size: 0.85em;
}

.log-info {
    color: #0dcaf0;
}

.log-success {
    color: #198754;
}

.log-warning {
    color: #ffc107;
}

.log-error {
    color: #dc3545;
}

/* 状态指示器 */
.status-running {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 价格显示 */
#currentPrice {
    font-size: 1.2em;
    font-weight: bold;
}

/* 连接状态 */
.badge .fa-circle {
    font-size: 0.6em;
    margin-right: 3px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .fib-levels {
        flex-direction: column;
    }
    
    .form-check-inline {
        margin-bottom: 5px;
    }
}

/* 按钮禁用状态 */
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

/* 警报动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.alert-shake {
    animation: shake 0.5s;
}


/* ===== Cyber Neon Theme ===== */
html, body { height: 100%; }

.theme-cyber {
    --bg-900: #0b1020;
    --bg-800: #0e142b;
    --bg-700: #131a35;
    --text-100: #e6f1ff;
    --text-300: #a8b3cf;

    --cyan: #00e5ff;
    --teal: #2ef2e6;
    --pink: #ff3d9a;
    --purple: #7b61ff;

    --success: #2de37b;
    --warning: #ffc107;
    --danger:  #ff4d6d;
    --info:    #24c8ff;

    color: var(--text-100);
    background:
      radial-gradient(1200px 800px at 10% -10%, rgba(0,229,255,.12), transparent 60%),
      radial-gradient(1000px 800px at 110% 10%, rgba(255,61,154,.10), transparent 60%),
      linear-gradient(180deg, #0a0f1f 0%, #0b1126 100%);
    font-family: 'Oxanium', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

.theme-cyber *, .theme-cyber .form-label { color-scheme: dark; color: var(--text-100); }
.theme-cyber .text-muted { color: var(--text-300) !important; }

.theme-cyber > .container-fluid {
    min-height: 100dvh;
    padding-top: 8px;
    padding-bottom: 24px;
}

/* 缩小行间距，适配较小窗口的三列布局 */
.theme-cyber .row.g-3 { --bs-gutter-x: .85rem; --bs-gutter-y: .85rem; }

/* 顶部导航 */
.theme-cyber .navbar {
    background: linear-gradient(90deg, rgba(11,17,38,.85), rgba(19,26,53,.85));
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 0 40px rgba(0,229,255,.08);
    padding-top: .2rem;  /* 压缩顶栏上下留白 */
    padding-bottom: .2rem;
}
.theme-cyber .navbar.mb-4 { margin-bottom: .25rem !important; }
.theme-cyber .navbar .container-fluid { min-height: auto; padding-top: 0; padding-bottom: 0; }
.theme-cyber .navbar-brand {
    letter-spacing: .3px;
    text-shadow: 0 0 12px rgba(0,229,255,.35);
}
/* 顶栏标题与价格紧凑排布（仅影响导航栏） */
.theme-cyber .navbar .navbar-brand { font-size: 1.05rem; line-height: 1; padding: 0; margin: 0; }
.theme-cyber .navbar #currentPrice { line-height: 1; }

/* 卡片玻璃风 */
.theme-cyber .card {
    background: linear-gradient(180deg, rgba(19,26,53,.65), rgba(14,20,43,.65));
    border: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 8px 30px rgba(0,0,0,.5), 0 0 0 1px rgba(123,97,255,.08) inset;
    border-radius: 14px;
}
.theme-cyber .card-header {
    background: linear-gradient(90deg, rgba(123,97,255,.18), rgba(0,229,255,.18));
    color: var(--text-100);
    border-bottom: 1px solid rgba(255,255,255,.06);
    padding: .5rem .9rem; /* 紧凑标题栏上下留白 */
}
.theme-cyber .card-header h5 {
    margin: 0;
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
/* 标题适度减小 */
.theme-cyber .card-header h5 { font-size: 1.05rem; line-height: 1.2; }

/* 按钮霓虹渐变 */
.theme-cyber .btn {
    border: none;
    border-radius: 12px;
    transition: transform .08s ease, box-shadow .2s ease, background .2s ease;
}
.theme-cyber .btn-lg { font-size: 1.05rem; padding: .5rem 1rem; }
.theme-cyber .btn:hover { transform: translateY(-1px); }
.theme-cyber .btn:disabled { opacity: .65; cursor: not-allowed; }

.theme-cyber .btn-primary {
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    box-shadow: 0 0 18px rgba(0,229,255,.25);
}
.theme-cyber .btn-success {
    background: linear-gradient(135deg, #14cba8, var(--teal));
    box-shadow: 0 0 18px rgba(46,242,230,.22);
}
.theme-cyber .btn-warning {
    color: #091020;
    background: linear-gradient(135deg, #ffd166, #ffb703);
    box-shadow: 0 0 18px rgba(255,183,3,.25);
}
.theme-cyber .btn-danger {
    background: linear-gradient(135deg, #ff5b84, var(--danger));
    box-shadow: 0 0 18px rgba(255,77,109,.25);
}
.theme-cyber .btn-info {
    background: linear-gradient(135deg, #2aa7ff, var(--cyan));
    box-shadow: 0 0 18px rgba(36,200,255,.25);
}

/* 输入框玻璃与高亮焦点 */
.theme-cyber .form-control, .theme-cyber .form-select {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    color: var(--text-100);
    border-radius: 10px;
}
.theme-cyber .form-control, .theme-cyber .form-select { padding: .4rem .65rem; }
.theme-cyber .form-control::placeholder { color: rgba(230,241,255,.55); }
.theme-cyber .form-control:focus, .theme-cyber .form-select:focus {
    background: rgba(255,255,255,.06);
    border-color: rgba(0,229,255,.55);
    box-shadow: 0 0 0 3px rgba(0,229,255,.18);
}

/* 单选/多选组边框 */
.theme-cyber .btn-outline-success, .theme-cyber .btn-outline-danger,
.theme-cyber .btn-outline-warning, .theme-cyber .btn-outline-info {
    color: var(--text-100);
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
}
.theme-cyber .btn-check:checked + .btn {
    background: linear-gradient(135deg, var(--purple), var(--cyan));
    border-color: transparent;
    box-shadow: 0 0 14px rgba(0,229,255,.25);
}

/* 表格头与行 */
.theme-cyber .price-table { width: 100%; }
.theme-cyber .price-table th {
    background: linear-gradient(90deg, rgba(36,200,255,.18), rgba(123,97,255,.18));
    color: var(--text-100);
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.theme-cyber .price-table td {
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.theme-cyber .price-table tr:hover { background: rgba(255,255,255,.04); }
.theme-cyber .level-triggered {
    background: rgba(45,227,123,.12) !important;
    box-shadow: inset 0 0 0 1px rgba(45,227,123,.35);
}

/* 统一覆盖 Bootstrap 变量，确保卡片与表格为深色 */
.theme-cyber {
    --bs-body-color: var(--text-100);
    --bs-card-bg: rgba(19,26,53,.65);
    --bs-card-color: var(--text-100);
    --bs-card-border-color: rgba(255,255,255,.06);
    --bs-card-cap-bg: rgba(123,97,255,.18);
    --bs-table-color: var(--text-100);
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255,255,255,.04);
    --bs-table-border-color: rgba(255,255,255,.06);
}

/* 修正 table 白底与条纹为深色 */
.theme-cyber .table { color: var(--text-100); background-color: transparent; border-color: rgba(255,255,255,.06); }
.theme-cyber .table > :not(caption) > * > * { background-color: transparent; border-bottom-color: rgba(255,255,255,.06); }
.theme-cyber .table-striped > tbody > tr:nth-of-type(odd) > * { background-color: rgba(255,255,255,.04); }
.theme-cyber .table thead th {
    background: linear-gradient(90deg, rgba(36,200,255,.18), rgba(123,97,255,.18));
    color: var(--text-100);
}

/* 针对斐波那契表容器的兜底：确保任何 table 都为暗色 */
.theme-cyber #fibPricesTable table { background: rgba(255,255,255,.02); color: var(--text-100); }
.theme-cyber #fibPricesTable th, .theme-cyber #fibPricesTable td { border-color: rgba(255,255,255,.06); }

/* 统一 alert 风格为暗色霓虹边框 */
.theme-cyber .alert { color: var(--text-100); border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.05); }
.theme-cyber .alert-secondary { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.12); }
.theme-cyber .alert-success { background: rgba(45,227,123,.12); border-color: rgba(45,227,123,.35); color: #b8ffda; }
.theme-cyber .alert-info    { background: rgba(36,200,255,.12); border-color: rgba(36,200,255,.35); color: #adf0ff; }
.theme-cyber .alert-warning { background: rgba(255,193,7,.12);  border-color: rgba(255,193,7,.35);  color: #fff0c2; }
.theme-cyber .alert-danger  { background: rgba(255,77,109,.12); border-color: rgba(255,77,109,.35); color: #ffd4de; }

/* 覆盖 bg-light（JS 动态插入的卡片标题）为暗色 */
.theme-cyber .bg-light { background-color: rgba(255,255,255,.06) !important; color: var(--text-100) !important; }

/* 日志区域（自适应高度） */
.theme-cyber .log-container {
    background: linear-gradient(180deg, rgba(9,16,32,.9), rgba(9,16,32,.8));
    border: 1px solid rgba(255,255,255,.06);
    color: #b8ffda;
    max-height: clamp(220px, 34vh, 420px);
}
.theme-cyber .log-time { color: #7aa2c7; }
.theme-cyber .log-info    { color: var(--info); }
.theme-cyber .log-success { color: var(--success); }
.theme-cyber .log-warning { color: var(--warning); }
.theme-cyber .log-error   { color: var(--danger); }

/* 连接状态徽章与发光小圆点 */
.theme-cyber .badge.bg-secondary {
    background: rgba(255,255,255,.08) !important;
    border: 1px solid rgba(255,255,255,.12);
}
.theme-cyber .badge .fa-circle {
    color: var(--teal);
    filter: drop-shadow(0 0 6px rgba(46,242,230,.75));
}

/* 信息/提示框 */
.theme-cyber .alert.alert-secondary {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    color: var(--text-100);
}

/* 价格显示 */
.theme-cyber #currentPrice {
    font-size: 1.2em;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0,229,255,.35);
}

/* 自适应：避免横向溢出，表格可滚动 */
.theme-cyber .row > [class^="col-"], .theme-cyber .row > [class*=" col-"] { min-width: 0; }
.theme-cyber #fibPricesTable { overflow-x: auto; }
.theme-cyber #fibPricesTable table { min-width: 520px; }

/* 辅助：渐变文字与发光 */
.theme-cyber .gradient-text {
    background: linear-gradient(90deg, var(--cyan), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.theme-cyber .text-glow-positive { text-shadow: 0 0 10px rgba(45,227,123,.6); }
.theme-cyber .text-glow-negative { text-shadow: 0 0 10px rgba(255,77,109,.6); }

/* 小幅响应式微调 */
@media (max-width: 768px) {
    .theme-cyber .card { border-radius: 12px; }
    .theme-cyber .btn  { border-radius: 10px; }
}

