/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* 加载提示 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading.hidden {
    display: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 提示框 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* 应用容器 */
.app {
    max-width: 750px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    padding-bottom: 60px;
    position: relative;
}

/* 页面 */
.page {
    display: none;
    min-height: calc(100vh - 60px);
}

.page.active {
    display: block;
}

/* 页面头部 */
.page-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-header h2 {
    font-size: 18px;
    font-weight: 500;
}

.back-btn {
    color: white;
    font-size: 20px;
    text-decoration: none;
}

.header-right {
    width: 20px;
}

/* 轮播图 */
.banner-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.banner-slider {
    display: flex;
    transition: transform 0.3s ease;
}

.banner-slider img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    flex-shrink: 0;
}

.banner-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.banner-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.banner-dots .dot.active {
    background: white;
}

/* 公告栏 */
.notice-bar {
    background: #fff5f5;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ff6b6b;
    font-size: 13px;
}

.notice-bar i {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 分类导航 */
.category-nav {
    display: flex;
    justify-content: space-around;
    padding: 20px 15px;
    background: white;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.category-item i {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 0.3s;
}

.category-item:active i {
    transform: scale(0.9);
}

.category-item span {
    font-size: 12px;
    color: #666;
}

/* 区块 */
.section {
    background: white;
    margin-top: 10px;
    padding: 15px;
}

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

.section-header h3 {
    font-size: 16px;
    color: #333;
}

.section-header h3 i {
    color: #ff6b6b;
    margin-right: 5px;
}

.section-header a {
    color: #999;
    text-decoration: none;
    font-size: 12px;
}

/* 心愿列表 */
.wish-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wish-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.wish-item:active {
    transform: scale(0.98);
}

.wish-item-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.wish-item-content {
    padding: 12px;
}

.wish-item-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wish-item-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wish-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wish-item-category {
    font-size: 12px;
    color: #ff6b6b;
    background: #fff5f5;
    padding: 2px 8px;
    border-radius: 4px;
}

.wish-item-time {
    font-size: 12px;
    color: #999;
}

/* 发布按钮 */
.publish-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    z-index: 99;
    transition: transform 0.3s;
}

.publish-btn:active {
    transform: scale(0.95);
}

/* 筛选栏 */
.filter-bar {
    background: white;
    padding: 10px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-tabs {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    white-space: nowrap;
}

.filter-tab {
    padding: 6px 12px;
    border-radius: 20px;
    background: #f5f5f5;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-tab.active {
    background: #ff6b6b;
    color: white;
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
    cursor: pointer;
}

/* 心愿详情 */
.wish-detail-content {
    padding: 15px;
}

.wish-detail-images {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-bottom: 15px;
}

.wish-detail-images img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.wish-detail-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.wish-detail-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.wish-detail-meta span {
    font-size: 12px;
    color: #999;
}

.wish-detail-category {
    display: inline-block;
    font-size: 12px;
    color: #ff6b6b;
    background: #fff5f5;
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.wish-detail-content-text {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 20px;
}

.wish-detail-contact {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
}

.wish-detail-contact h4 {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
}

.wish-detail-contact p {
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

/* 认领按钮 */
.claim-btn-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 750px;
    margin: 0 auto;
    padding: 15px;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.claim-btn {
    width: 100%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.3s;
}

.claim-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 表单样式 */
.publish-form-container {
    padding: 15px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group label .required {
    color: #ff6b6b;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #ff6b6b;
}

.image-upload {
    margin-bottom: 10px;
}

.image-upload-btn {
    width: 80px;
    height: 80px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #999;
}

.image-upload-btn i {
    font-size: 24px;
    margin-bottom: 5px;
}

.image-upload-btn span {
    font-size: 12px;
}

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.image-preview-item .remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ff6b6b;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 20px;
}

/* 个人中心 */
.not-logged-in {
    padding: 60px 15px;
    text-align: center;
}

.user-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 20px;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.login-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    border: none;
    padding: 12px 40px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
}

.logged-in {
    padding: 20px 15px;
}

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

.user-info .user-avatar {
    width: 60px;
    height: 60px;
    font-size: 30px;
}

.user-details {
    flex: 1;
}

.user-details h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.user-details p {
    font-size: 13px;
    color: #999;
}

.logout-btn {
    background: none;
    border: 1px solid #e0e0e0;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    color: #999;
    cursor: pointer;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.stat-number {
    font-size: 24px;
    font-weight: 600;
    color: #ff6b6b;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #999;
}

.menu-list {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

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

.menu-item i:first-child {
    color: #ff6b6b;
    font-size: 18px;
    margin-right: 10px;
}

.menu-item span {
    flex: 1;
    color: #333;
}

.menu-item i:last-child {
    color: #ccc;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    overflow: hidden;
}

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

.modal-header h3 {
    font-size: 16px;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    color: #999;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.auth-tab.active {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
}

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

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 750px;
    margin: 0 auto;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: #999;
    font-size: 12px;
}

.nav-item i {
    font-size: 20px;
}

.nav-item.active {
    color: #ff6b6b;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 20px;
    color: #ddd;
}

.empty-state p {
    font-size: 14px;
}

/* 状态标签 */
.status-tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.status-tag.pending {
    background: #fff5e6;
    color: #ff9800;
}

.status-tag.published {
    background: #e6f7ff;
    color: #1890ff;
}

.status-tag.claimed {
    background: #f0f9ff;
    color: #52c41a;
}

.status-tag.completed {
    background: #f6ffed;
    color: #52c41a;
}
