/* 量化交易平台基础样式 */
/* 主色调定义 */
:root {
    --primary-navy: #1A365D;
    --primary-blue: #2C5282;
    --primary-light: #2B6CB0;
    --accent-gold: #D69E2E;
    --accent-gold-light: #ECC94B;
    --bg-white: #FFFFFF;
    --bg-light: #F7FAFC;
    --text-dark: #2D3748;
    --text-medium: #4A5568;
    --text-light: #718096;
    --success: #48BB78;
    --warning: #E53E3E;
    --border-light: #E2E8F0;
    --shadow-sm: 0 1px 2px 0 rgba(26, 54, 93, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(26, 54, 93, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(26, 54, 93, 0.1);
    --shadow-gold: 0 4px 6px -1px rgba(214, 158, 46, 0.15);
    --gradient-navy: linear-gradient(135deg, #1A365D 0%, #2C5282 100%);
    --gradient-gold: linear-gradient(135deg, #D69E2E 0%, #ECC94B 100%);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-light);
    min-height: 100vh;
    color: var(--text-dark);
    line-height: 1.6;
}

/* 移动端容器 */
.mobile-container {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
    background: var(--bg-light);
    min-height: 100vh;
    padding-bottom: 80px; /* 为底部导航预留空间 */
}

/* 顶部导航栏 */
.header {
    background: var(--gradient-navy);
    color: white;
    padding: 20px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 430px;
    margin: 0 auto;
}

.header h1 {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.header-btn {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 底部导航栏样式由 components/bottom_nav.html 管理 */

/* 卡片样式 */
.card {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 20px;
    margin: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

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

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-navy);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background: #EBF0F5;
    border-color: var(--primary-light);
}

.btn-danger {
    background: #FFF5F5;
    color: var(--warning);
    border: 1px solid #FED7D7;
}

.btn-danger:hover {
    background: #FED7D7;
}

.btn-gold {
    background: var(--gradient-gold);
    color: var(--text-dark);
    font-weight: 600;
}

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

/* 输入框样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-light);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--bg-light);
    color: var(--text-dark);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.08);
}

/* 统计卡片 */
.stat-card {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-navy);
    margin: 8px 0;
}

.stat-label {
    font-size: 13px;
    color: var(--text-light);
}

.stat-change {
    font-size: 13px;
    font-weight: 500;
    margin-top: 4px;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--warning);
}

/* 列表项 */
.list-item {
    background: var(--bg-white);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.list-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-light);
}

.list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.list-item-title {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 15px;
}

.list-item-desc {
    font-size: 13px;
    color: var(--text-light);
}

.list-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.list-item-date {
    font-size: 12px;
    color: var(--text-light);
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.tag-success {
    background: #F0FFF4;
    color: var(--success);
}

.tag-warning {
    background: #FFF5F5;
    color: var(--warning);
}

.tag-info {
    background: #EBF8FF;
    color: var(--primary-blue);
}

.tag-gold {
    background: #FFFBF0;
    color: var(--accent-gold);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 14px;
    line-height: 1.6;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-white);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

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

.modal-title {
    font-weight: 600;
    font-size: 18px;
    color: var(--text-dark);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 8px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 提示框 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-dark);
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 3000;
    opacity: 0;
    animation: fadeInOut 3s ease;
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--warning);
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (min-width: 768px) {
    body {
        background: #E2E8F0;
    }
    
    .mobile-container {
        width: 430px;
        max-width: 430px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
        border-radius: 20px;
        min-height: calc(100vh - 40px);
        margin: 20px auto;
        position: relative;
        overflow: hidden;
    }
    
    .bottom-nav {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        width: 430px;
        max-width: 430px;
        border-radius: 0 0 20px 20px;
    }
}

/* 辅助类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }