* {
    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;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background-color: #fff;
    min-height: 100vh;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

@media (max-width: 600px) {
    .container {
        max-width: 100%;
        box-shadow: none;
    }
    
    .header {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .asset-summary {
        padding: 15px;
    }
    
    .asset-total {
        font-size: 24px;
    }
    
    .fund-item {
        padding: 12px 15px;
    }
    
    .add-fund {
        padding: 15px;
    }
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 15px;
    text-align: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 1px;
    margin: 0;
}

.refresh-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.refresh-btn:hover {
    background: rgba(255,255,255,0.3);
}

.asset-summary {
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
}

.asset-total {
    font-size: 14px;
    font-weight: normal;
    margin-bottom: 6px;
}

.profit-total {
    font-size: 18px;
    color: #ff6b6b;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.refresh-status {
    font-size: 12px;
    color: #667eea;
    margin-left: 10px;
    display: inline-block;
    white-space: nowrap;
}

.profit-positive {
    color: #ff0000 !important;
    font-weight: 600 !important;
}

.profit-negative {
    color: #2E8B57 !important;
    font-weight: 600 !important;
}

.fund-list {
    padding: 10px 0;
}

.fund-item {
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
}

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

.fund-header div:last-child {
    display: flex;
    align-items: center;
}

.fund-name {
    font-weight: 500;
    font-size: 15px;
}

.fund-code {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
}

.fund-info {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.fund-amount {
    color: #667eea;
    font-weight: 600;
}

.fund-nav {
    color: #764ba2;
    font-weight: 600;
}

.fund-details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.fund-detail-item {
    text-align: right;
    flex: 1;
}

.fund-detail-label {
    font-size: 11px;
    color: #999;
    margin-bottom: 3px;
}

.fund-detail-value {
    font-size: 13px;
    font-weight: 400;
}

.add-fund {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.add-fund h3 {
    margin-bottom: 15px;
    font-size: 16px;
}

.add-fund-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.form-group {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #666;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 11px;
}

.add-btn {
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.no-funds {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.error {
    text-align: center;
    padding: 20px;
    color: #ff6b6b;
}

.fund-refresh-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: #667eea;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.fund-refresh-btn:hover {
    background: rgba(102, 126, 234, 0.2);
}

.fund-edit-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 4px;
    padding: 4px 8px;
    color: #667eea;
    font-size: 12px;
    cursor: pointer;
}

.fund-edit-btn:hover {
    background: rgba(102, 126, 234, 0.2);
}

.fund-delete-btn {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 4px;
    padding: 4px 8px;
    color: #ff6b6b;
    font-size: 12px;
    cursor: pointer;
    margin-left: 8px;
}

.fund-delete-btn:hover {
    background: rgba(255, 107, 107, 0.2);
}

.fund-edit-form {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-save {
    flex: 1;
    padding: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.btn-cancel {
    flex: 1;
    padding: 8px;
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
}

.nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 -1px 6px rgba(0,0,0,0.03);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 8px 0;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
}

.nav-item.active {
    color: #667eea;
}

.nav-icon {
    font-size: 18px;
    margin-bottom: 3px;
}

.nav-text {
    font-size: 11px;
    letter-spacing: 0.5px;
}

/* 为内容区域添加底部 padding，避免被导航栏遮挡 */
.fund-list {
    padding-bottom: 80px;
}

/* 排序栏样式 */
.sort-bar {
    padding: 10px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9f9f9;
}

.sort-item {
    font-size: 14px;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    position: relative;
    display: inline-flex;
    align-items: center;
}

.sort-item:hover {
    background-color: rgba(102, 126, 234, 0.1);
}

.sort-item.active {
    color: #667eea;
    font-weight: 500;
}

.sort-item::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    margin-left: 4px;
    margin-top: 2px;
}

.sort-item.active.desc::after {
    border-top: 6px solid #667eea;
}

.sort-item.active.asc::after {
    border-bottom: 6px solid #667eea;
}

/* 时间标签样式 */
.time-tag {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
    font-weight: normal;
}

/* 刷新状态样式 */
.refresh-status {
    margin-top: 8px;
    font-size: 14px;
    color: #667eea;
}

/* 弹窗样式 */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.popup-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.popup-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    color: #333;
}

.popup-body {
    padding: 20px;
    text-align: center;
}

.popup-wechat {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.popup-wechat img {
    display: block;
    margin: 10px auto 0;
    border: 1px solid #eee;
    border-radius: 8px;
}