/* 基础重置和全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

html, body {
    overflow-x: hidden;
    max-width: 480px;
    margin: 0 auto;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    /* 滚动条样式合并 */
    scrollbar-width: thin;
    scrollbar-color: #c62828 #f0f0f0;
}

/* 滚动条样式（webkit） */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f0f0f0;
}

::-webkit-scrollbar-thumb {
    background: #c62828;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #8b0000;
}

/* 状态栏 */
.status-bar {
    background: linear-gradient(135deg, #8b0000, #c62828);
    color: white;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
    height: 40px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    max-width: 480px;
    margin: 0 auto;
}

.status-left, .status-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.time {
    font-weight: bold;
    font-size: 13px;
}

.signal, .wifi, .battery {
    font-size: 11px;
    opacity: 0.9;
}

/* 标题栏 */
.header {
    background: linear-gradient(135deg, #c62828, #d32f2f);
    color: white;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    top: 0px;
    left: 0;
    right: 0;
    z-index: 999;
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 50px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    max-width: 480px;
    margin: 0 auto;
}

.nav-item {
    text-align: center;
    color: #666;
    font-size: 12px;
    cursor: pointer;
    flex: 1;
}

.nav-item i {
    font-size: 20px;
    display: block;
    margin-bottom: 4px;
}

.nav-item.active {
    color: #c62828;
}

.btn-icon {
    font-size: 16px;
    margin-bottom: 2px;
    opacity: 0.8;
}

.btn-label {
    font-size: 10px;
    font-weight: 500;
}

.back-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.header h1 {
    font-size: 18px;
    font-weight: bold;
    flex: 1;
    text-align: center;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* 选项卡容器（合并重复定义） */
.tabs {
    display: flex;
    background: white;
    border-bottom: 2px solid #ddd;      /* 来自后定义，覆盖原1px边框 */
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    z-index: 998;
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 20px;                /* 来自后定义 */
}

/* 选项卡项（只保留最终有效样式，删除旧版干扰） */
.tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    text-decoration: none;
}

.tab:hover {
    color: #c62828;
    background: #fff5f5;
}

/* 激活选项卡（合并，只保留后定义样式） */
.tab.active {
    color: #c62828;
    font-weight: bold;
    border-bottom: 3px solid #c62828;
    background: linear-gradient(to bottom, rgba(198, 40, 40, 0.05), transparent);
}

/* Tab内容区域（合并公共样式与隐藏状态） */
.tab-content {
    margin-top: 100px;
    margin-bottom: 50px;
}

.tab-content:not(.active) {
    display: none;
}

/* 主容器和内容区域 */
.main-content {
    padding: 5px 0 5px 0;
    background: white;
    min-height: 100vh;
}

.container {
    padding: 2px 0 50px 0;
    background: white;
    min-height: 80vh;
}

/* 用户信息 */
.user-info {
    padding: 5px 5px;
    background: white;
    border-bottom: 1px solid #eee;
    margin-top: 100px;
}

/* 按钮通用样式 */
.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-outline {
    background: white;
    color: #c62828;
    border: 2px solid #c62828;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    font-size: 14px;
}

.link {
    color: #c62828;
    text-decoration: none;
}

/* 底部按钮 */
.bottom-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn, .buy-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 100px;
}

.nav-btn {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.nav-btn:hover {
    background: #e0e0e0;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.buy-btn {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    color: white;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.buy-btn:hover {
    background: linear-gradient(135deg, #388e3c, #1b5e20);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

/* 按钮区域样式 */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.action-btn {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 5px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.action-btn:hover {
    background: #ff6b6b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,107,107,0.3);
}

.action-btn i {
    font-size: 16px;
}

/* 表单组 */
.form-group {
    margin-top: 10px;
}

.btn-group {
    margin-top: 10px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #666;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .container {
        padding: 10px 0 60px 0;
    }

    .nav-btn, .buy-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 80px;
    }

    .chart-container {
        height: 250px;
    }

    .y-label {
        font-size: 9px;
    }

    .x-label {
        font-size: 10px;
    }

}