/* 全局样式 */
:root {
    --primary-color: #4F46E5;
    --secondary-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;
    --success-color: #10B981;
    --text-color: #1F2937;
    --text-light: #6B7280;
    --bg-color: #F9FAFB;
    --card-bg: #FFFFFF;
    --border-color: #E5E7EB;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.5;
}

/* 移动容器 */
.mobile-container {
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    background-color: var(--bg-color);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    background-color: var(--card-bg);
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.status-left, .status-right {
    display: flex;
    align-items: center;
}

.status-signal, .status-wifi, .status-battery {
    margin-right: 6px;
}

.user-balance {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.balance-info {
    display: flex;
    flex-direction: column;
}

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

.balance-value {
    font-size: 24px;
    font-weight: 600;
}

.balance-actions {
    display: flex;
    gap: 8px;
}

/* 内容区域 */
.content {
    flex: 1;
    padding: 16px;
    padding-bottom: 80px; /* 为底部导航留出空间 */
}

/* 卡片样式 */
.card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
}

.card-action {
    font-size: 14px;
    color: var(--primary-color);
}

.card-body {
    padding: 16px;
}

.card-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* 挖矿卡片 */
.mining-card {
    padding: 20px;
}

.mining-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.mining-title {
    font-size: 20px;
    font-weight: 600;
}

.mining-rate {
    font-size: 14px;
    color: var(--text-light);
}

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

.mining-animation {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
    position: relative;
    margin-bottom: 20px;
}

.mining-icon {
    font-size: 48px;
    color: var(--primary-color);
    animation: pulse 2s infinite;
}

.mining-particles {
    position: absolute;
    width: 100%;
    height: 100%;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 50%;
    opacity: 0;
}

.mining-animation.mining .particle:nth-child(1) {
    top: 50%;
    left: 30%;
    animation: particle 3s ease-out infinite;
}

.mining-animation.mining .particle:nth-child(2) {
    top: 30%;
    left: 50%;
    animation: particle 2.5s ease-out 0.2s infinite;
}

.mining-animation.mining .particle:nth-child(3) {
    top: 70%;
    left: 50%;
    animation: particle 2.8s ease-out 0.4s infinite;
}

.mining-animation.mining .particle:nth-child(4) {
    top: 40%;
    left: 70%;
    animation: particle 2.2s ease-out 0.6s infinite;
}

.mining-animation.mining .particle:nth-child(5) {
    top: 60%;
    left: 40%;
    animation: particle 2.7s ease-out 0.8s infinite;
}

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

@keyframes particle {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 0.5;
    }
    100% {
        transform: translate(50px, -50px) scale(0);
        opacity: 0;
    }
}

.mining-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

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

.stat-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
}

.mining-actions {
    margin-bottom: 20px;
}

.mining-boost {
    background-color: rgba(79, 70, 229, 0.1);
    border-radius: 8px;
    padding: 12px;
}

.boost-label {
    font-size: 14px;
    margin-bottom: 4px;
}

.boost-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.boost-progress {
    height: 6px;
    background-color: rgba(79, 70, 229, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
}

/* 排行榜样式 */
.leaderboard-list {
    padding: 12px 16px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-item.current-user {
    background-color: rgba(79, 70, 229, 0.05);
}

.rank {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #E5E7EB;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    margin-right: 12px;
}

.rank-top-1 {
    background-color: #FFD700;
    color: #FFFFFF;
}

.rank-top-2 {
    background-color: #C0C0C0;
    color: #FFFFFF;
}

.rank-top-3 {
    background-color: #CD7F32;
    color: #FFFFFF;
}

.user-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.username {
    font-weight: 500;
}

.mining-amount {
    color: var(--primary-color);
    font-weight: 600;
}

/* 签到日历 */
.checkin-calendar {
    display: flex;
    justify-content: space-between;
    padding: 16px;
}

.calendar-day {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.calendar-day.checked {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
}

.calendar-day.today {
    border-color: var(--primary-color);
    border-width: 2px;
}

.day-number {
    font-size: 14px;
    font-weight: 500;
}

.check-mark {
    color: var(--success-color);
    font-size: 12px;
    margin-top: 2px;
}

.checkin-actions {
    padding: 0 16px 16px;
    text-align: center;
}

/* 任务列表 */
.tasks-list {
    padding: 8px 16px;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.task-item:last-child {
    border-bottom: none;
}

.task-item.completed .task-name {
    text-decoration: line-through;
    color: var(--text-light);
}

.task-info {
    flex: 1;
}

.task-name {
    font-size: 14px;
    margin-bottom: 4px;
}

.task-reward {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 500;
}

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

/* 底部导航 */
.navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--card-bg);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    border-top: 1px solid var(--border-color);
    max-width: 480px;
    margin: 0 auto;
}

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

.nav-icon {
    font-size: 20px;
    margin-bottom: 4px;
}

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

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    outline: none;
}

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

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

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

.btn-text {
    background-color: transparent;
    color: var(--primary-color);
    padding: 4px 8px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
    width: 100%;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
}

.input-group {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.input-group .form-control {
    border: none;
    flex: 1;
}

.input-group-text {
    padding: 0 12px;
    background-color: #F3F4F6;
    color: var(--text-light);
    font-size: 14px;
}

/* 市场页面样式 */
.price-chart {
    padding: 16px;
}

.price-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.current-price {
    display: flex;
    align-items: center;
}

.price-value {
    font-size: 24px;
    font-weight: 600;
    margin-right: 8px;
}

.price-change {
    font-size: 14px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
}

.price-change.positive {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.price-change.negative {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.price-date {
    font-size: 14px;
    color: var(--text-light);
}

.chart-container {
    height: 200px;
    margin-bottom: 16px;
}

.trade-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 12px;
    text-align: center;
    background: none;
    border: none;
    font-weight: 500;
    color: var(--text-light);
    cursor: pointer;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.tab-content {
    display: none;
    padding: 16px;
}

.tab-content.active {
    display: block;
}

.price-info {
    text-align: center;
    margin: 16px 0;
    font-size: 14px;
    color: var(--text-light);
}

/* 新闻页面样式 */
.news-categories {
    display: flex;
    overflow-x: auto;
    padding: 8px 0;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

.category-btn {
    padding: 8px 16px;
    margin-right: 8px;
    border-radius: 20px;
    background-color: #F3F4F6;
    border: none;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
}

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

.news-item {
    margin-bottom: 16px;
}

.news-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-content {
    padding: 16px;
}

.news-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.news-meta {
    display: flex;
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.news-date {
    margin-right: 12px;
}

.news-excerpt {
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.6;
}

.news-read-more {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.load-more {
    margin-top: 16px;
    text-align: center;
}

/* 邀请页面样式 */
.invite-illustration {
    text-align: center;
    padding: 20px 0;
}

.invite-image {
    max-width: 200px;
    height: auto;
}

.invite-description {
    text-align: center;
    margin-bottom: 20px;
    padding: 0 16px;
}

.invite-rewards {
    display: flex;
    justify-content: space-around;
    margin-bottom: 24px;
}

.reward-item {
    text-align: center;
    flex: 1;
}

.reward-icon {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.reward-title {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 4px;
}

.reward-value {
    font-size: 16px;
    font-weight: 500;
}

.invite-code-section, .invite-link-section {
    padding: 0 16px;
    margin-bottom: 16px;
}

.section-label {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 8px;
}

.invite-code {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #F3F4F6;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 2px;
}

.invite-link {
    display: flex;
    align-items: center;
    background-color: #F3F4F6;
    border-radius: 8px;
    overflow: hidden;
}

.invite-link input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font-size: 14px;
}

.copy-btn {
    background: none;
    border: none;
    padding: 12px 16px;
    color: var(--primary-color);
    cursor: pointer;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 16px;
}

.share-btn {
    flex: 1;
    min-width: calc(50% - 8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: white;
    cursor: pointer;
}

.share-btn i {
    font-size: 20px;
    margin-bottom: 8px;
}

.share-btn.whatsapp i {
    color: #25D366;
}

.share-btn.telegram i {
    color: #0088cc;
}

.share-btn.twitter i {
    color: #1DA1F2;
}

.share-btn.facebook i {
    color: #4267B2;
}

.invite-history-list {
    padding: 8px 16px;
}

.invite-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.invite-history-item:last-child {
    border-bottom: none;
}

.invite-user {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #F3F4F6;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 12px;
}

.user-avatar i {
    color: var(--text-light);
}

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

.invite-status {
    font-size: 14px;
}

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

.invite-status.pending {
    color: var(--warning-color);
}

/* 个人资料页面样式 */
.profile-header {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: #F3F4F6;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 16px;
    font-size: 24px;
    color: var(--text-light);
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.profile-email {
    font-size: 14px;
    color: var(--text-light);
}

.wallet-content {
    padding: 16px;
}

.wallet-type, .wallet-address {
    margin-bottom: 16px;
}

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

.value {
    font-size: 16px;
    font-weight: 500;
}

.address-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #F3F4F6;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    word-break: break-all;
}

.security-content, .settings-content {
    padding: 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.password-form {
    margin-top: 16px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    font-size: 16px;
}

.form-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: white;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.about-content {
    padding: 16px;
}

.app-info {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.app-logo {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background-color: var(--primary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 16px;
    font-size: 32px;
    color: white;
}

.app-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
}

.app-version {
    font-size: 14px;
    color: var(--text-light);
}

.about-links {
    display: flex;
    flex-direction: column;
}

.about-link {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-color);
}

.about-link:last-child {
    border-bottom: none;
}

.about-link i {
    margin-right: 12px;
    color: var(--text-light);
    width: 20px;
}

.logout-section {
    margin-top: 24px;
    margin-bottom: 24px;
}

/* 错误和成功消息 */
.error-message {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.success-message {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* 无数据提示 */
.no-data {
    text-align: center;
    padding: 24px 0;
    color: var(--text-light);
}

/* 提示消息 */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}

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

/* 深色模式 */
body.dark-mode {
    --text-color: #E5E7EB;
    --text-light: #9CA3AF;
    --bg-color: #111827;
    --card-bg: #1F2937;
    --border-color: #374151;
}

/* 响应式调整 */
@media (max-width: 360px) {
    .mining-stats {
        flex-direction: column;
    }
    
    .stat-item {
        margin-bottom: 12px;
    }
    
    .checkin-calendar {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .calendar-day {
        margin: 4px;
    }
}