@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=Noto+Serif+SC:wght@400;500;600;700&display=swap');
/**
 * =====================================================
 * 古风模拟股票网站 - 样式表
 * =====================================================
 * 设计风格：中国传统古风
 * 色彩体系：朱砂红、黛蓝、墨黑、牙白、宣纸黄
 */

/* =====================================================
 * 基础样式和CSS变量
 * ===================================================== */
 
 /* =====================================================
 * 字体导入
 * ===================================================== */

 
:root {
    /* 主色调 - 朱砂红 */
    --primary-color: #8B1E1E;
    --primary-light: #B83E3E;
    --primary-dark: #5C1414;
    
    /* 辅助色 - 黛蓝 */
    --secondary-color: #2F4F4F;
    --secondary-light: #4A6A6A;
    
    /* 背景色 - 宣纸黄 */
    --bg-color: #F5F5DC;
    --bg-light: #FAFAE8;
    --bg-dark: #E8E8D0;
    
    /* 文字色 */
    --text-primary: #1A1A1A;
    --text-secondary: #4A4A4A;
    --text-muted: #7A7A7A;
    
    /* 涨跌色 */
    --rise-color: #C23A2B;  /* 涨 - 朱红 */
    --fall-color: #2E8B57;  /* 跌 - 竹青 */
    
    /* 强调色 - 金箔 */
    --accent-color: #D4AF37;
    
    /* 边框 */
    --border-color: rgba(139, 30, 30, 0.2);
    --border-radius: 6px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
    
    /* 字体 */
    --font-title: 'Ma Shan Zheng', 'Noto Serif SC', serif;
    --font-body: 'Noto Serif SC', 'SimSun', serif;
    
    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

/* =====================================================
 * 全局样式重置
 * ===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.8;
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(139, 30, 30, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(47, 79, 79, 0.03) 0%, transparent 50%);
}

/* 宣纸纹理背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: -1;
}


/* =====================================================
 * 容器和布局
 * ===================================================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* =====================================================
 * 导航栏
 * ===================================================== */
.navbar {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: var(--spacing-sm) 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-title);
    font-size: 1.8rem;
    color: var(--accent-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo::before {
    content: '◆';
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
    list-style: none;
}

.nav-links a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-size: 0.95rem;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links a:hover::after {
    width: 80%;
}

.nav-links a:hover {
    color: #fff;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.1);
}

/* =====================================================
 * 按钮样式
 * ===================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-family: var(--font-body);
    font-size: 0.95rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-dark);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #2E8B57 0%, #1E5B37 100%);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #C23A2B 0%, #8B1E1E 100%);
    color: #fff;
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1.1rem;
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.85rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* =====================================================
 * 卡片样式
 * ===================================================== */
.card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-family: var(--font-title);
    font-size: 1.3rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.card-title::before {
    content: '❖';
    color: var(--accent-color);
}

/* =====================================================
 * 表单样式
 * ===================================================== */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: var(--font-body);
    font-size: 1rem;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 30, 30, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* =====================================================
 * 首页资产概览
 * ===================================================== */
.asset-overview {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    padding: var(--spacing-xl);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-lg);
}

.asset-item {
    text-align: center;
}

.asset-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-bottom: var(--spacing-xs);
}

.asset-value {
    font-size: 1.8rem;
    font-weight: 600;
}

.asset-value.up {
    color: #90EE90;
}

.asset-value.down {
    color: #FFB6C1;
}

/* =====================================================
 * 表格样式
 * ===================================================== */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-dark);
}

.data-table tr:hover {
    background: var(--bg-dark);
}

.data-table .up {
    color: var(--rise-color);
}

.data-table .down {
    color: var(--fall-color);
}

/* =====================================================
 * 市场快照
 * ===================================================== */
/* 模拟市场快照 - 第一行2个，第二行3个 */
.market-snapshot {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.market-snapshot .index-item {
    flex: 0 0 calc(50% - 4px);  /* 前两个默认50%宽度 */
    padding: 10px;
    min-height: 75px;
    box-sizing: border-box;
}

/* 第3-5个（后三个）改为33.33%宽度 */
.market-snapshot .index-item:nth-child(3),
.market-snapshot .index-item:nth-child(4),
.market-snapshot .index-item:nth-child(5) {
    flex: 0 0 calc(33.333% - 5.33px);
}

/* 如果只有4个指数，第4个也适用 */
.market-snapshot .index-item:nth-child(4) {
    flex: 0 0 calc(33.333% - 5.33px);
}

.index-item {
    padding: var(--spacing-sm);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.index-name {
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.index-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.index-change {
    font-size: 0.75rem;
    margin-top: 2px;
}

/* =====================================================
 * 排行榜样式
 * ===================================================== */
.ranking-list {
    list-style: none;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s ease;
}

.ranking-item:hover {
    background: var(--bg-dark);
}

.ranking-rank {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: var(--spacing-md);
}

.ranking-rank.top-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #fff;
    border-radius: 50%;
}

.ranking-rank.top-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A0A0A0 100%);
    color: #fff;
    border-radius: 50%;
}

.ranking-rank.top-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #A0522D 100%);
    color: #fff;
    border-radius: 50%;
}

.ranking-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: var(--spacing-md);
}

.ranking-info {
    flex: 1;
}

.ranking-name {
    font-weight: 500;
}

.ranking-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* =====================================================
 * 交易动态
 * ===================================================== */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--spacing-md);
    font-size: 0.9rem;
}

.activity-icon.buy {
    background: rgba(194, 58, 43, 0.1);
    color: var(--rise-color);
}

.activity-icon.sell {
    background: rgba(46, 139, 87, 0.1);
    color: var(--fall-color);
}

.activity-icon.system {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-color);
}

.activity-content {
    flex: 1;
}

.activity-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* =====================================================
 * 弹窗样式
 * ===================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-family: var(--font-title);
    font-size: 1.3rem;
    color: var(--primary-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--primary-color);
}

.modal-body {
    padding: var(--spacing-lg);
}

.modal-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
}

/* =====================================================
 * 登录/注册页面
 * ===================================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: var(--spacing-lg);
}

.auth-container {
    background: var(--bg-light);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 420px;
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-title {
    font-family: var(--font-title);
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.auth-tabs {
    display: flex;
    margin-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: var(--spacing-md);
    text-align: center;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.auth-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

/* =====================================================
 * 页脚
 * ===================================================== */
.footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.7);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-xl);
}

.footer-content {
    text-align: center;
}

.footer-disclaimer {
    margin-bottom: var(--spacing-md);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #fff;
}

.footer-copyright {
    font-size: 0.9rem;
}

/* =====================================================
 * 模拟标签
 * ===================================================== */
.sim-tag {
    display: inline-block;
    background: #ff4d4f;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* =====================================================
 * 响应式设计
 * ===================================================== */
@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
    }
    
    .nav-links {
        display: none;
    }
    
    .asset-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .asset-value {
        font-size: 1.4rem;
    }
    
    .market-snapshot {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card {
        padding: var(--spacing-md);
    }
    
    .auth-container {
        padding: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .asset-grid {
        grid-template-columns: 1fr;
    }
    
    .market-snapshot {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
 * 动画效果
 * ===================================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s ease infinite;
}

/* =====================================================
 * 加载动画
 * ===================================================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =====================================================
 * 提示消息
 * ===================================================== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius);
    color: #fff;
    font-weight: 500;
    z-index: 3000;
    transform: translateX(150%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: linear-gradient(135deg, #2E8B57 0%, #1E5B37 100%);
}

.toast.error {
    background: linear-gradient(135deg, #C23A2B 0%, #8B1E1E 100%);
}

.toast.info {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

/* =====================================================
 * 交易规则弹窗
 * ===================================================== */
.rules-content {
    max-height: 60vh;
    overflow-y: auto;
    line-height: 2;
}

.rules-content h3 {
    color: var(--primary-color);
    margin: var(--spacing-md) 0 var(--spacing-sm);
}

.rules-content ol {
    padding-left: var(--spacing-lg);
}

.rules-content li {
    margin-bottom: var(--spacing-sm);
}

/* =====================================================
 * 签到按钮
 * ===================================================== */
.checkin-btn {
    background: linear-gradient(135deg, var(--accent-color) 0%, #B8962E 100%);
    color: #fff;
    font-weight: 600;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: 30px;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.checkin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.4);
}

.checkin-btn:disabled {
    background: var(--text-muted);
    box-shadow: none;
}

/* =====================================================
 * 抽奖区域
 * ===================================================== */
.lottery-section {
    text-align: center;
    padding: var(--spacing-xl);
}

.lottery-wheel {
    width: 200px;
    height: 200px;
    margin: 0 auto var(--spacing-lg);
    border-radius: 50%;
    background: conic-gradient(
        var(--primary-color) 0deg 60deg,
        var(--accent-color) 60deg 120deg,
        var(--secondary-color) 120deg 180deg,
        var(--primary-color) 180deg 240deg,
        var(--accent-color) 240deg 300deg,
        var(--secondary-color) 300deg 360deg
    );
    position: relative;
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.lottery-wheel.spinning {
    animation: spin-fast 2s ease-out;
}

@keyframes spin-fast {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(1800deg); }
}

.lottery-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: var(--bg-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--primary-color);
}

/* =====================================================
 * 搜索框
 * ===================================================== */
.search-box {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

.search-input {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    padding-left: 45px;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 30, 30, 0.1);
}

.search-icon {
    position: absolute;
    left: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* =====================================================
 * 买卖操作区
 * ===================================================== */
.trade-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
}

.trade-form {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
}

.trade-form.buy {
    border-top: 3px solid var(--rise-color);
}

.trade-form.sell {
    border-top: 3px solid var(--fall-color);
}

.trade-title {
    font-family: var(--font-title);
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.trade-form.buy .trade-title {
    color: var(--rise-color);
}

.trade-form.sell .trade-title {
    color: var(--fall-color);
}

@media (max-width: 768px) {
    .trade-panel {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
 * 移动端适配优化 - 新增
 * ===================================================== */

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--spacing-sm);
}

.mobile-only {
    display: none;
}

/* =====================================================
 * 移动端浏览器优化 - 全面修复版（仅针对屏幕宽度小于768px）
 * ===================================================== */

@media (max-width: 768px) {
    /* 1. 基础字体和布局缩小 */
    html {
        font-size: 14px;
    }
    
    body {
        line-height: 1.6;
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    /* 2. 汉堡菜单修复 - 默认隐藏，点击展开 */
    .mobile-menu-btn {
        display: block !important;
        background: none;
        border: none;
        color: var(--accent-color);
        font-size: 1.5rem;
        cursor: pointer;
        padding: var(--spacing-sm);
        z-index: 1001;
        order: 2;
    }
    
    .nav-links {
        display: none;  /* 默认隐藏，JS控制显示 */
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        flex-direction: column;
        padding: 0;
        margin: 0;
        gap: 0;
        box-shadow: var(--shadow-md);
        z-index: 1000;
        list-style: none;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .nav-links.active {
        display: flex !important;
    }
    
    .nav-links li {
        border-bottom: 1px solid rgba(255,255,255,0.1);
        margin: 0;
        width: 100%;
    }
    
    .nav-links li:last-child {
        border-bottom: none;
    }
    
    .nav-links a {
        display: block;
        padding: var(--spacing-md);
        color: #fff;
        text-decoration: none;
        transition: background 0.3s ease;
    }
    
    .nav-links a:hover {
        background: rgba(255,255,255,0.1);
    }
    
    /* 桌面端菜单隐藏，移动端显示 */
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
    
    /* 3. 模拟市场快照改为两行显示（2x2网格） */
    .market-snapshot {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: repeat(2, auto);
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-md);
    }
    
    .index-item {
        padding: var(--spacing-sm);
        min-height: 90px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
    
    .index-name {
        font-size: 0.85rem;
        margin-bottom: 4px;
        color: var(--text-secondary);
    }
    
    .index-value {
        font-size: 1.3rem;
        font-weight: 600;
        margin: 2px 0;
    }
    
    .index-change {
        font-size: 0.85rem;
        margin-top: 2px;
    }
    
    /* 4. 热门股票表格横向滑动优化 */
    .card:has(#hotStocks) .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 calc(-1 * var(--spacing-sm));
        padding: 0 var(--spacing-sm);
        scrollbar-width: thin;
        scrollbar-color: var(--primary-color) var(--bg-dark);
        cursor: grab;
    }
    
    .card:has(#hotStocks) .table-container:active {
        cursor: grabbing;
    }
    
    .card:has(#hotStocks) .table-container::-webkit-scrollbar {
        height: 6px;
    }
    
    .card:has(#hotStocks) .table-container::-webkit-scrollbar-track {
        background: var(--bg-dark);
        border-radius: 3px;
    }
    
    .card:has(#hotStocks) .table-container::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 3px;
    }
    
    /* 确保表格内容不换行，强制横向滚动 */
    #hotStocks {
        min-width: 600px;
        font-size: 0.9rem;
    }
    
    #hotStocks th,
    #hotStocks td {
        padding: var(--spacing-sm);
        white-space: nowrap;
    }
    
    /* 操作按钮列宽度优化 */
    #hotStocks td:last-child {
        width: 80px;
        text-align: center;
    }
    
    #hotStocks .btn-sm {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.8rem;
    }
    
    /* 5. 卡片和布局优化 */
    .card {
        padding: var(--spacing-md);
        margin-bottom: var(--spacing-md);
        border-radius: var(--border-radius);
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
        padding-bottom: var(--spacing-sm);
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    /* 资产概览强制2×2网格并缩小 */
    .asset-overview {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }
    
    .asset-overview .asset-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        grid-template-rows: repeat(2, auto) !important;
        gap: 8px !important;
    }
    
    .asset-overview .asset-item {
        padding: 6px !important;
        text-align: center !important;
    }
    
    .asset-overview .asset-label {
        font-size: 0.75rem !important;
        margin-bottom: 2px !important;
        opacity: 0.9;
    }
    
    .asset-overview .asset-value {
        font-size: 1.1rem !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
    }
    
    .asset-label {
        font-size: 0.8rem;  /* 缩小标签字体 */
        opacity: 0.9;
        margin-bottom: 4px;
    }
    
    /* 每日福利按钮纵向排列 */
    section:has(#checkinBtn) > div[style*="flex"] {
        flex-direction: column !important;
        gap: var(--spacing-sm) !important;
    }
    
    .checkin-btn, 
    section:has(#checkinBtn) .btn-primary, 
    section:has(#checkinBtn) .btn-success {
        width: 100%;
        justify-content: center;
        padding: var(--spacing-md);
        font-size: 1rem;
    }
    
    /* 导航栏优化 */
    .navbar {
        padding: var(--spacing-xs) 0;
        position: sticky;
        top: 0;
    }
    
    .navbar .container {
        flex-wrap: nowrap;
        position: relative;
    }
    
    .logo {
        font-size: 1.3rem;
        order: 0;
    }
    
    /* 6. 排行榜适配 */
    .ranking-list {
        font-size: 0.9rem;
    }
    
    .ranking-item {
        padding: var(--spacing-sm);
    }
    
    .ranking-rank {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .ranking-avatar {
        width: 32px;
        height: 32px;
        margin-right: var(--spacing-sm);
    }
    
    .ranking-name {
        font-size: 0.9rem;
    }
    
    .ranking-value {
        font-size: 1rem;
    }
    
    /* 交易动态优化 */
    .activity-list {
        font-size: 0.9rem;
    }
    
    .activity-item {
        padding: var(--spacing-sm);
    }
    
    .activity-icon {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        margin-right: var(--spacing-sm);
        flex-shrink: 0;
    }
    
    .activity-content {
        flex: 1;
        min-width: 0;
    }
    
    .activity-time {
        font-size: 0.75rem;
    }
    
    /* 页脚优化 */
    .footer {
        padding: var(--spacing-lg) 0;
        margin-top: var(--spacing-lg);
    }
    
    .footer-links {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
        font-size: 0.85rem;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    /* 更小屏幕额外优化 */
    html {
        font-size: 13px;
    }
    
    .asset-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .market-snapshot {
        gap: 8px;
    }
    
    .index-value {
        font-size: 1.2rem;
    }
    
    .logo {
        font-size: 1.1rem;
    }
}

/* =====================================================
 * 后台管理页面移动端适配（admin/index.php）
 * ===================================================== */

@media (max-width: 768px) {
    /* 后台布局改为单列 */
    .admin-layout {
        display: block;
        min-height: 100vh;
        padding-bottom: 60px;
    }
    
    /* 热门股票表格整体缩小 - 确保一屏显示 */
    #hotStocks {
        font-size: 0.75rem;
        table-layout: fixed;
        width: 100%;
        min-width: 100%;
    }
    
    #hotStocks th,
    #hotStocks td {
        padding: 6px 2px;
        vertical-align: middle;
        border-bottom: 1px solid var(--border-color);
    }
    
    #hotStocks th {
        font-size: 0.7rem;
        white-space: normal !important;
        line-height: 1.2;
        font-weight: 600;
    }
    
    /* 调整列宽：压缩代码和现价，增加涨跌和操作 */
    #hotStocks th:nth-child(1),
    #hotStocks td:nth-child(1) {
        width: 18%;              /* 名称略微缩小 */
        max-width: 50px;
        word-break: break-all;
        white-space: normal !important;
        line-height: 1.2;
        font-size: 0.7rem;
        text-align: left;        /* 左对齐更美观 */
        padding-left: 4px;
    }
    
    #hotStocks th:nth-child(2),
    #hotStocks td:nth-child(2) {
        width: 18%;              /* 代码从22%缩小到18% */
        font-size: 0.7rem;
        word-break: break-all;
        white-space: normal !important;
        text-align: center;
        letter-spacing: -0.5px;  /* 压缩数字间距 */
    }
    
    #hotStocks th:nth-child(3),
    #hotStocks td:nth-child(3) {
        width: 20%;              /* 现价从24%缩小到20% */
        font-size: 0.75rem;
        text-align: right;
        padding-right: 4px;
    }
    
    #hotStocks th:nth-child(4),
    #hotStocks td:nth-child(4) {
        width: 22%;              /* 涨跌从18%增加到22% */
        font-size: 0.75rem;      /* 稍微放大字体 */
        text-align: right;
        padding-right: 6px;
    }
    
    #hotStocks th:nth-child(5),
    #hotStocks td:nth-child(5) {
        width: 22%;              /* 操作从16%增加到22%，给按钮更多空间 */
        text-align: center;
    }
    
    #hotStocks .btn-sm {
        padding: 4px 2px;
        font-size: 0.65rem;
        line-height: 1.1;
        white-space: normal !important;
        word-break: break-all;
        width: 90%;              /* 稍微减小宽度，避免贴边 */
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    
    .table-container {
        overflow-x: visible !important;
        margin: 0;
        padding: 0;
    }
}
    
    /* 侧边栏默认隐藏，全屏覆盖 */
    .admin-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--primary-dark);
        z-index: 2000;
        padding: var(--spacing-xl) var(--spacing-lg);
        overflow-y: auto;
    }
    
    .admin-sidebar.mobile-open {
        display: block;
    }
    
    /* 移动端关闭按钮 */
    .admin-sidebar .mobile-close-btn {
        position: absolute;
        top: 15px;
        right: 15px;
        background: none;
        border: none;
        color: var(--accent-color);
        font-size: 1.8rem;
        cursor: pointer;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .admin-main {
        padding: var(--spacing-md);
    }
    
    .admin-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-bottom: var(--spacing-lg);
        padding-bottom: var(--spacing-md);
        border-bottom: 2px solid var(--border-color);
    }
    
    /* 后台菜单切换按钮（悬浮） */
    .admin-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: var(--primary-color);
        color: #fff;
        border: none;
        border-radius: 50%;
        font-size: 1.3rem;
        cursor: pointer;
        box-shadow: var(--shadow-lg);
        transition: transform 0.3s ease, background 0.3s ease;
    }
    
    .admin-menu-toggle:hover {
        transform: scale(1.1);
        background: var(--primary-light);
    }
    
    /* 后台统计卡片 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-lg);
    }
    
    .stat-card {
        padding: var(--spacing-md);
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    /* 后台表格横向滚动 */
    .admin-main .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 calc(-1 * var(--spacing-md));
        padding: 0 var(--spacing-md);
    }
    
    .admin-main .data-table {
        min-width: 800px;
        font-size: 0.85rem;
    }
    
    /* 后台卡片优化 */
    .admin-main .card {
        margin-bottom: var(--spacing-lg);
    }
    
    .admin-main .card-header {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }
    
    /* 表单优化 */
    .admin-main .form-group {
        margin-bottom: var(--spacing-md);
    }
    
    .admin-main .form-input {
        font-size: 16px; /* 防止iOS缩放 */
        padding: var(--spacing-md);
    }
    
    /* 底部导航栏（后台移动端） */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--primary-dark);
        padding: var(--spacing-sm) 0;
        justify-content: space-around;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
    }
    
    .mobile-bottom-nav a {
        color: rgba(255,255,255,0.7);
        font-size: 1.3rem;
        text-decoration: none;
        padding: var(--spacing-sm) var(--spacing-lg);
        transition: color 0.3s ease;
    }
    
    .mobile-bottom-nav a:hover,
    .mobile-bottom-nav a.active {
        color: var(--accent-color);
    }
}

@media (min-width: 769px) {
    /* 桌面端隐藏移动端元素 */
    .admin-menu-toggle,
    .mobile-close-btn,
    .mobile-bottom-nav {
        display: none !important;
    }
}
