<?php include_once 'config.php'; 
$settings = get_site_settings();
$project_name = $settings['site_name'] ?? 'BitCrypto';
?>
<!DOCTYPE html>
<html lang="zh-hans">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo $project_name; ?> - 全球领先的数字资产交易平台</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
    <link rel="stylesheet" href="/static/css/custom.css">
    <style>
        :root {
            --bg-dark: #0b0e11;
            --bg-card: #181a20;
            --text-primary: #eaecef;
            --text-secondary: #848e9c;
            --accent-color: #fcd535;
            --up-color: #0ecb81;
            --down-color: #f6465d;
        }
        body {
            background-color: var(--bg-dark);
            color: var(--text-primary);
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            margin: 0;
            padding: 0;
        }
        .navbar {
            background-color: var(--bg-dark);
            border-bottom: 1px solid #2b2f36;
            padding: 0.75rem 1.5rem;
        }
        .nav-link {
            color: var(--text-primary) !important;
            font-weight: 500;
            font-size: 14px;
            margin: 0 8px;
            transition: color 0.2s;
        }
        .nav-link:hover { color: var(--accent-color) !important; }
        .btn-primary {
            background-color: var(--accent-color);
            border-color: var(--accent-color);
            color: #181a20;
            font-weight: 600;
            padding: 8px 20px;
            border-radius: 4px;
        }
        .glass-card {
            background: rgba(255, 255, 255, 0.05);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
        }
        .cs-float {
            position: fixed;
            right: 30px;
            bottom: 40px;
            width: 60px;
            height: 60px;
            background: var(--accent-color);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #181a20;
            font-size: 28px;
            box-shadow: 0 4px 20px rgba(252, 213, 53, 0.4);
            cursor: pointer;
            z-index: 9999;
            transition: all 0.3s;
            text-decoration: none;
        }
        .cs-float:hover {
            transform: scale(1.1) rotate(5deg);
            color: #181a20;
        }
    </style>
</head>
<body>
    <nav class="navbar navbar-expand-lg sticky-top">
        <div class="container-fluid">
            <a class="navbar-brand d-flex align-items-center" href="/">
                <img src="/static/images/logo.png" alt="Logo" style="height: 28px; margin-right: 8px;">
                <span class="fw-bold fs-5 text-white"><?php echo $project_name; ?></span>
            </a>
            <button class="navbar-toggler border-secondary" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <i class="bi bi-list text-white"></i>
            </button>
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item"><a class="nav-link" href="/">首页</a></li>
                    <li class="nav-item"><a class="nav-link" href="/trade.php?type=SPOT">现货交易</a></li>
                    <li class="nav-item"><a class="nav-link" href="/trade.php?type=CONTRACT">合约交易</a></li>
                    <li class="nav-item"><a class="nav-link" href="/market.php">行情中心</a></li>
                </ul>
                <div class="d-flex align-items-center">
                    <?php if (isset($_SESSION['user_id'])): ?>
                        <div class="dropdown">
                            <a class="nav-link dropdown-toggle d-flex align-items-center" href="#" role="button" data-bs-toggle="dropdown">
                                <i class="bi bi-person-circle fs-5 me-2"></i>
                                <span><?php echo $_SESSION['username']; ?></span>
                            </a>
                            <ul class="dropdown-menu dropdown-menu-dark dropdown-menu-end shadow">
                                <li><a class="dropdown-item" href="/profile.php"><i class="bi bi-person-badge me-2"></i>个人中心</a></li>
                                <li><a class="dropdown-item" href="/profile.php"><i class="bi bi-wallet2 me-2"></i>我的资产</a></li>
                                <li><hr class="dropdown-divider"></li>
                                <li><a class="dropdown-item text-danger" href="/logout.php"><i class="bi bi-box-arrow-right me-2"></i>安全退出</a></li>
                            </ul>
                        </div>
                    <?php else: ?>
                        <a href="/login.php" class="nav-link me-3">登录</a>
                        <a href="/register.php" class="btn btn-primary">立即注册</a>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </nav>
    <main>
