/* ============================================================
   交易机器人演示系统 - 全局样式
   科技风深色UI + 玻璃拟态 + 蓝光发光效果
   ============================================================ */

/* CSS变量定义 */
:root {
    --bg-dark: #0a0e17;
    --bg-card: rgba(15, 23, 42, 0.8);
    --bg-card-hover: rgba(20, 30, 55, 0.9);
    --color-primary: #00d4ff;
    --color-secondary: #0066ff;
    --color-accent: #00ff88;
    --color-warning: #ffaa00;
    --color-danger: #ff4757;
    --color-text: #e4e9f2;
    --color-text-dim: #8892a4;
    --border-glow: rgba(0, 212, 255, 0.3);
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.3);
    --shadow-glow-strong: 0 0 40px rgba(0, 212, 255, 0.5);
    --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
    --font-main: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-dark);
    color: var(--color-text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* 背景动画效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(0, 102, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(0, 255, 136, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* 网格背景 */
.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-secondary);
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 玻璃拟态卡片 */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    padding: 30px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-primary), transparent);
    opacity: 0.5;
}

.glass-card:hover {
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: var(--shadow-glow);
    transform: translateY(-5px);
}

/* 发光按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-strong);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
    background: rgba(0, 212, 255, 0.1);
    box-shadow: var(--shadow-glow);
}

.btn-danger {
    background: linear-gradient(135deg, #ff4757, #ff6b7a);
    color: #fff;
}

.btn-danger:hover {
    box-shadow: 0 4px 20px rgba(255, 71, 87, 0.4);
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 15px 0;
    background: rgba(10, 14, 23, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-primary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover {
    color: var(--color-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

/* 页面标题 */
.page-header {
    padding: 120px 0 60px;
    text-align: center;
    position: relative;
}

.page-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff, var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 18px;
    color: var(--color-text-dim);
    max-width: 600px;
    margin: 0 auto;
}

/* 状态指示器 */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.status-running {
    background: rgba(0, 255, 136, 0.1);
    color: var(--color-accent);
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.status-stopped {
    background: rgba(255, 71, 87, 0.1);
    color: var(--color-danger);
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.status-running .status-dot {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
    50% { opacity: 0.7; box-shadow: 0 0 0 8px transparent; }
}

/* 闪动动画 */
@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.3; }
}

.blink {
    animation: blink 1s infinite;
}

/* 数字滚动动画 */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.count-up {
    animation: countUp 0.5s ease-out;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--color-text);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    color: var(--color-text);
    font-size: 16px;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-input::placeholder {
    color: var(--color-text-dim);
}

/* 终端样式 */
.terminal {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    font-family: var(--font-mono);
    box-shadow:
        0 0 0 1px rgba(0, 255, 136, 0.2),
        0 20px 50px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: #1a1a1a;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #333;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27ca40; }

.terminal-title {
    flex: 1;
    text-align: center;
    color: #888;
    font-size: 14px;
}

.terminal-body {
    padding: 20px;
    height: 400px;
    overflow-y: auto;
    background: linear-gradient(180deg, #0a0a0a, #000);
}

.terminal-line {
    color: #00ff88;
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 4px;
}

.terminal-line.warning {
    color: #ffaa00;
}

.terminal-line.info {
    color: #00d4ff;
}

.terminal-line.error {
    color: #ff4757;
}

.terminal-line .timestamp {
    color: #666;
}

.terminal-prompt {
    color: var(--color-primary);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: var(--shadow-glow);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 8px;
    font-family: var(--font-mono);
}

.stat-label {
    color: var(--color-text-dim);
    font-size: 14px;
}

.stat-change {
    font-size: 14px;
    margin-top: 8px;
}

.stat-change.up {
    color: var(--color-accent);
}

.stat-change.down {
    color: var(--color-danger);
}

/* 机器人卡片 */
.robot-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

.robot-card {
    background: var(--bg-card);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.robot-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-primary), var(--color-accent));
}

.robot-card:hover {
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: var(--shadow-glow);
    transform: translateY(-8px);
}

.robot-card.running::before {
    background: linear-gradient(90deg, var(--color-accent), #00ff88);
    animation: glow-line 2s infinite;
}

.robot-card.stopped::before {
    background: linear-gradient(90deg, var(--color-danger), #ff6b7a);
}

@keyframes glow-line {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.robot-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.robot-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.robot-info-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
}

.robot-info-label {
    font-size: 12px;
    color: var(--color-text-dim);
    margin-bottom: 4px;
}

.robot-info-value {
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--color-primary);
}

.robot-actions {
    display: flex;
    gap: 12px;
}

/* 警报框 */
.alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: var(--color-accent);
}

.alert-error {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--color-danger);
}

.alert-warning {
    background: rgba(255, 170, 0, 0.1);
    border: 1px solid rgba(255, 170, 0, 0.3);
    color: var(--color-warning);
}

/* 页脚 */
.footer {
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid rgba(0, 212, 255, 0.1);
    margin-top: 80px;
}

.footer-text {
    color: var(--color-text-dim);
    font-size: 14px;
}

/* 登录页面专用 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo {
    font-size: 48px;
    margin-bottom: 16px;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #fff, var(--color-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: var(--color-text-dim);
}

/* 控制台布局 */
.console-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    padding-top: 100px;
}

@media (max-width: 1024px) {
    .console-layout {
        grid-template-columns: 1fr;
    }
}

/* 余额面板 */
.balance-panel {
    background: var(--bg-card);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    padding: 24px;
    position: sticky;
    top: 100px;
}

.balance-main {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
    margin-bottom: 20px;
}

.balance-amount {
    font-size: 36px;
    font-weight: 700;
    color: var(--color-accent);
    font-family: var(--font-mono);
}

.balance-label {
    color: var(--color-text-dim);
    font-size: 14px;
    margin-top: 8px;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 212, 255, 0.05);
}

.balance-item:last-child {
    border-bottom: none;
}

.balance-item-label {
    color: var(--color-text-dim);
}

.balance-item-value {
    font-weight: 600;
    font-family: var(--font-mono);
}

.balance-item-value.positive {
    color: var(--color-accent);
}

.balance-item-value.negative {
    color: var(--color-danger);
}

/* 英雄区 */
.hero {
    padding: 160px 0 100px;
    text-align: center;
    position: relative;
}

.hero-title {
    font-size: 64px;
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.2;
    background: linear-gradient(135deg, #fff 0%, var(--color-primary) 50%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--color-text-dim);
    max-width: 700px;
    margin: 0 auto 40px;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 特性区 */
.features {
    padding: 100px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    padding: 40px 30px;
    text-align: center;
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.feature-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-desc {
    color: var(--color-text-dim);
    line-height: 1.7;
}

/* 响应式 */
@media (max-width: 768px) {
    .page-title {
        font-size: 36px;
    }

    .hero-title {
        font-size: 40px;
    }

    .nav-links {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .robot-cards {
        grid-template-columns: 1fr;
    }

    .console-layout {
        padding-top: 120px;
    }
}

/* 动画类 */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-dim);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 18px;
    margin-bottom: 20px;
}
