/* 公共样式 - common.css */
/* 1. 全局重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul,
ol {
    list-style: none;
}

/* 2. 颜色定义 (根据截图提取) */
:root {
    --primary-color: #6c5ce7;
    /* 主色调 (紫色) */
    --primary-light: #a29bfe;
    /* 主色浅色 */
    --primary-dark: #5542d8;
    /* 主色深色 */
    --secondary-color: #00b894;
    /* 次要颜色 (绿色) */
    --text-color: #2d3436;
    /* 主要文字颜色 */
    --text-light: #636e72;
    /* 次要文字颜色 */
    --background-color: #ffffff;
    /* 背景色 */
    --border-color: #dfe6e9;
    /* 边框颜色 */
    --success-color: #00b894;
    /* 成功色 */
    --warning-color: #fdcb6e;
    /* 警告色 */
    --danger-color: #d63031;
    /* 危险色 */
    --gray-color: #b2bec3;
    /* 灰色 */
}

/* 3. 通用容器和布局 */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 4. 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 5. 卡片样式 */
.card {
    background-color: var(--background-color);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 16px;
}

.card-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-color);
}

/* 6. 表单元素样式 */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background-color: var(--background-color);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(108, 92, 231, 0.2);
}

/* 7. 文字样式 */
.text-primary {
    color: var(--primary-color);
}

.text-success {
    color: var(--success-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-danger {
    color: var(--danger-color);
}

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

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* 8. 图标样式 */
.icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    vertical-align: middle;
}

/* 9. 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
    font-size: 12px;
    cursor: pointer;
}

.bottom-nav .nav-item.active {
    color: var(--primary-color);
}

.bottom-nav .nav-item i {
    font-size: 24px;
    margin-bottom: 4px;
}

/* 10. 加载和提示样式 */
.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
}

.tip {
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    padding: 12px 15px;
    margin: 16px 0;
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-light);
}

/* 11. 特定页面样式 (可根据需要调整或移除) */
/* 首页 */
.home-header {
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.home-header .user-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.home-header .user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    background-color: white;
}

.home-header .user-details h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.home-header .user-details p {
    font-size: 14px;
    opacity: 0.9;
}

.home-header .stats {
    display: flex;
    justify-content: space-between;
}

.home-header .stat-item {
    text-align: center;
    flex: 1;
}

.home-header .stat-item .value {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 4px;
}

.home-header .stat-item .label {
    font-size: 14px;
    opacity: 0.9;
}

/* 达标任务页面 */
.task-progress {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
}

.task-progress .reward {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
}

.task-progress .status {
    background-color: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 15px;
}

.task-progress .description {
    font-size: 14px;
    margin-bottom: 15px;
}

.task-progress .go-btn {
    background-color: white;
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
}

.task-list {
    margin-top: 20px;
}

.task-item {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-item .month {
    font-size: 16px;
    font-weight: 500;
}

.task-item .details {
    font-size: 14px;
    color: var(--text-light);
}

.task-item .status {
    font-size: 14px;
    font-weight: 500;
}

.task-item.completed .status {
    color: var(--success-color);
}

.task-item.uncompleted .status {
    color: var(--danger-color);
}

/* 账户明细页面 */
.account-balance {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
}

.account-balance .balance {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 10px;
}

.account-balance .sub-balance {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 15px;
}

.account-balance .withdraw-btn {
    background-color: white;
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
}

.account-records {
    margin-top: 20px;
}

.record-item {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.record-item .info {
    flex: 1;
}

.record-item .amount {
    font-size: 16px;
    font-weight: 500;
}

.record-item .type {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 4px;
}

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

.record-item.income .amount {
    color: var(--success-color);
}

.record-item.expense .amount {
    color: var(--danger-color);
}

/* 提现页面 */
.withdraw-form {
    background-color: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.withdraw-form .channel {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
}

.withdraw-form .channel.selected {
    border-color: var(--primary-color);
    background-color: #f8f9ff;
}

.withdraw-form .channel .icon {
    margin-right: 10px;
}

.withdraw-form .channel .info {
    flex: 1;
}

.withdraw-form .channel .check {
    color: var(--primary-color);
}

.withdraw-form .form-group {
    margin-bottom: 15px;
}

.withdraw-form .balance-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.withdraw-form .balance-info .label {
    font-size: 14px;
    color: var(--text-light);
}

.withdraw-form .balance-info .amount {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary-color);
}

.withdraw-form .submit-btn {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    font-size: 16px;
}

/* 12. 响应式设计 */
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .card {
        padding: 15px;
    }

    .home-header .stats .stat-item .value {
        font-size: 20px;
    }

    .task-progress .reward {
        font-size: 28px;
    }
}

.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(30, 20, 60, 0.92);
    border: 1px solid rgba(179, 136, 255, 0.4);
    color: #e0d0ff;
    padding: 12px 28px;
    border-radius: 28px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* 底部导航栏 */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #9CA3AF;
    font-size: 10px;
}

.tab-item.active {
    color: #8B5CF6;
}

.tab-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-icon svg {
    width: 22px;
    height: 22px;
}