:root {
    --primary-color: #05ce78;
    --primary-dark: #04b367;
    --secondary-color: #f7f7f7;
    --dark-color: #282828;
    --light-color: #ffffff;
    --text-color: #333333;
    --border-color: #e1e1e1;
    --success-color: #05ce78;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --bronze-color: #cd7f32;
    --silver-color: #c0c0c0;
    --gold-color: #ffd700;
    --platinum-color: #e5e4e2;
    --premium-color: #9b59b6;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --bottom-nav-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

html, body {
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    background-color: #f5f5f5;
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
}

body {
    padding-bottom: var(--bottom-nav-height);
    position: relative;
    max-width: 100%;
}

/* 容器 */
.container {
    width: 100%;
    max-width: 768px;
    margin: 0 auto;
    padding: 0 16px;
}

/* 头部 */
.header {
    background-color: var(--light-color);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
}

.logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo i {
    margin-right: 8px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-nav-height);
    background-color: var(--light-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    border-top: 1px solid var(--border-color);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: #666;
    transition: all 0.3s;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 11px;
    font-weight: 500;
}

.nav-item.active i {
    transform: translateY(-2px);
}

/* 页面内容 */
.page-content {
    padding: 16px 0;
    min-height: calc(100vh - var(--bottom-nav-height) - 80px);
}

/* 卡片样式 */
.card {
    background-color: var(--light-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    overflow: hidden;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    gap: 8px;
    text-align: center;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--light-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background-color: var(--secondary-color);
}

.btn-premium {
    background-color: var(--premium-color);
    color: white;
}

.btn-premium:hover {
    background-color: #8e44ad;
}

/* 表单控件 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 16px;
    background-color: var(--light-color);
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 徽章 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-primary {
    background-color: rgba(5, 206, 120, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(5, 206, 120, 0.3);
}

.badge-premium {
    background-color: rgba(155, 89, 182, 0.1);
    color: var(--premium-color);
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.badge-free {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

/* 项目卡片 */
.project-card {
    background-color: var(--light-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.project-image {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.project-content {
    padding: 16px;
}

.project-category {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.project-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.project-description {
    color: #666;
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.4;
}

.project-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.project-stat {
    text-align: center;
    flex: 1;
}

.project-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1;
}

.project-stat-label {
    font-size: 11px;
    color: #777;
    margin-top: 4px;
}

.project-progress {
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    margin-bottom: 12px;
    overflow: hidden;
}

.project-progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
}

/* 圆圈卡片 */
.circle-card {
    background-color: var(--light-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
}

.circle-header {
    padding: 20px;
    color: var(--light-color);
    position: relative;
}

.circle-header.paid {
    background: linear-gradient(135deg, var(--premium-color), #8e44ad);
}

.circle-header.free {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.circle-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.circle-description {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 12px;
}

.circle-stats {
    display: flex;
    gap: 16px;
    font-size: 12px;
}

.circle-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.circle-content {
    padding: 16px;
}

.circle-price {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

/* 页面标题 */
.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.page-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}

/* 网格布局 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* 标签页 */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: #777;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab.active {
    color: var(--primary-color);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px 3px 0 0;
}

/* 加载指示器 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 48px;
    color: var(--border-color);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.empty-state p {
    color: #666;
    margin-bottom: 24px;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .page-title {
        font-size: 22px;
    }
}

@media (min-width: 768px) {
    body {
        background-color: var(--secondary-color);
    }
    
    .container {
        padding: 0 24px;
    }
}

/* 安全区域适配 */
@supports (padding: max(0px)) {
    body {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
        padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
    }
    
    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
    }
    
    .nav-item {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* 触摸友好 */
button, 
a, 
input, 
textarea, 
select {
    -webkit-tap-highlight-color: transparent;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* 添加聊天相关的CSS变量 */
:root {
    --chat-primary: var(--primary-color);
    --chat-secondary: #f0f2f5;
    --chat-bubble-user: var(--primary-color);
    --chat-bubble-them: white;
    --chat-time-color: #999;
}