/* CSS变量定义 */
:root {
    /* 主色调 */
    --primary-color: #8b9dc3;
    --primary-dark: #6b7b9a;
    --accent-color: #a8b8d8;
    
    /* 背景色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-gradient-start: #f8fafc;
    --bg-gradient-end: #e2e8f0;
    
    /* 文字颜色 */
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-white: #ffffff;
    
    /* 边框颜色 */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e0;
    --border-dark: #a0aec0;
    
    /* 阴影 */
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --shadow-strong: rgba(0, 0, 0, 0.15);
    
    /* 状态颜色 */
    --success-color: #48bb78;
    --warning-color: #ed8936;
    --danger-color: #f56565;
    --info-color: #4299e1;
    
    /* 悬停颜色 */
    --hover-bg: rgba(139, 157, 195, 0.1);
    --hover-primary: rgba(139, 157, 195, 0.2);
}

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.4;
    min-height: 100vh;
}

.container {
    max-width: 414px;
    margin: 0 auto;
    background: var(--bg-primary);
    min-height: 100vh;
    box-shadow: 0 0 30px var(--shadow-light);
    position: relative;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    padding: 12px 16px 10px;
    text-align: center;
    position: relative;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 20px var(--shadow-medium);
}

.header h1 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 0;
    letter-spacing: 0.5px;
}

.back-btn {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-white);
    font-size: 16px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.header-actions {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 6px;
    align-items: center;
}

.edit-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-white);
    font-size: 14px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edit-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.publish-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-white);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 16px;
    text-decoration: none;
    letter-spacing: 0.3px;
}

.publish-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 搜索框样式 */
.search-card {
    background: var(--bg-primary);
    margin: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--shadow-light);
    border: 1px solid var(--border-light);
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
    padding: 12px 16px;
}

.search-icon {
    font-size: 16px;
    color: var(--text-muted);
    margin-right: 10px;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: var(--text-primary);
    background: transparent;
    font-weight: 400;
}

.search-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.search-clear {
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear:hover {
    background: var(--border-medium);
    color: var(--text-secondary);
}

/* 动态列表样式 */
.moments-list {
    padding: 0 0 80px;
}

.moment-item {
    background: var(--bg-primary);
    margin: 0 0 1px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

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

.moment-item:hover {
    background: var(--bg-secondary);
}

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

.moment-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.moment-avatar .avatar-text {
    display: block;
    line-height: 1;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

.moment-user {
    flex: 1;
}

.moment-user h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.moment-time {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.moment-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.moment-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 12px;
}

.moment-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.moment-image {
    aspect-ratio: 1;
    background: var(--bg-secondary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid var(--border-light);
    cursor: pointer;
    overflow: hidden;
}
.moment-image a{
    display: block;
}
.moment-image img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.moment-image:hover {
    border-color: var(--primary-color);
}

.moment-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.action-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    margin-right: 6px;
}

.action-btn:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.action-btn.liked {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

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

.moment-edit-actions {
    position: absolute;
    bottom: 12px;
    right: 16px;
    display: none;
    gap: 6px;
    z-index: 10;
}

.edit-action-btn, .delete-action-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--shadow-light);
}

.edit-action-btn:hover {
    background: var(--primary-color);
    color: var(--text-white);
}

.delete-action-btn:hover {
    background: var(--danger-color);
    color: var(--text-white);
}

/* 浮动发布按钮 */
.fab {
    position: fixed;
    bottom: 80px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--text-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 300;
    text-decoration: none;
    box-shadow: 0 4px 20px var(--shadow-medium);
    z-index: 1000;
}

.fab:hover {
    box-shadow: 0 6px 25px var(--shadow-strong);
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 414px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    display: flex;
    padding: 8px 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 -4px 20px var(--shadow-light);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px;
    cursor: pointer;
    border-radius: 8px;
    margin: 0 4px;
}

.nav-item:hover {
    background: var(--hover-bg);
}

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

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

.nav-text {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-item.active .nav-text {
    color: var(--primary-color);
    font-weight: 600;
}

/* 发布页面样式 */
.publish-container {
    max-width: 414px;
    margin: 0 auto;
    background: var(--bg-primary);
    min-height: 100vh;
    box-shadow: 0 0 30px var(--shadow-light);
    border-radius: 0 0 20px 20px;
}

.publish-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-white);
    padding: 12px 16px 10px;
    text-align: center;
    position: relative;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 20px var(--shadow-medium);
}

.publish-header h1 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 0;
    letter-spacing: 0.5px;
}

.publish-form {
    padding: 16px;
    padding-bottom: 100px;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--border-light);
    border-radius: 10px;
    font-size: 14px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    font-weight: 400;
    font-family: inherit;
}

.form-input:focus {
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(139, 157, 195, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
    line-height: 1.4;
}

.image-upload-area {
    border: 2px dashed var(--border-medium);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    background: var(--bg-secondary);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.image-upload-area:hover {
    border-color: var(--primary-color);
    background: var(--bg-primary);
}

.image-upload-area.dragover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--text-white);
}

.upload-icon {
    font-size: 28px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.image-upload-area:hover .upload-icon {
    color: var(--primary-color);
}

.image-upload-area.dragover .upload-icon {
    color: var(--text-white);
}

.upload-text {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 3px;
}

.upload-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.image-preview-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 16px;
}

.image-preview {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
}

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

.image-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger-color);
    color: var(--text-white);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-remove:hover {
    background: #e53e3e;
}

.form-actions {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 414px;
    background: var(--bg-primary);
    padding: 16px;
    border-top: 2px solid var(--border-light);
    backdrop-filter: blur(10px);
    box-shadow: 0 -4px 20px var(--shadow-light);
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.3px;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 2px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: var(--text-white);
    box-shadow: 0 4px 15px var(--shadow-medium);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px var(--shadow-strong);
}

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

.character-count {
    text-align: right;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

.character-count.warning {
    color: var(--warning-color);
}

.character-count.danger {
    color: var(--danger-color);
}

.hidden {
    display: none;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        border-radius: 0;
    }
    
    .header {
        border-radius: 0;
    }
    
    .publish-container {
        border-radius: 0;
    }
    
    .publish-header {
        border-radius: 0;
    }
    
    .moments-list {
        padding: 0 0 80px;
    }
    
    .moment-item {
        padding: 10px 12px;
    }
    
    .fab {
        right: 16px;
        bottom: 70px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
.pages {
    text-align: center;
    margin: 24px 0;
    padding: 0 16px;
}

.pages ul {
    display: flex;
    justify-content: center;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
    flex-wrap: wrap;
}

.pages ul li {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pages ul li a,
.pages ul li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-primary);
    box-shadow: 0 1px 3px var(--shadow-light);
    cursor: pointer;
    user-select: none;
}

.pages ul li a:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-medium);
}

.pages ul li.active span {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-color: var(--primary-color);
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(139, 157, 195, 0.3);
    transform: translateY(-1px);
}

.pages ul li.disabled span {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.pages ul li.disabled span:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-light);
    color: var(--text-muted);
    transform: none;
    box-shadow: none;
}

/* 上一页/下一页按钮特殊样式 */
.pages ul li:first-child a,
.pages ul li:last-child a {
    font-weight: 600;
    min-width: 40px;
}

.pages ul li:first-child a:hover,
.pages ul li:last-child a:hover {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

/* 省略号样式 */
.pages ul li span:contains("...") {
    background: transparent;
    border: none;
    box-shadow: none;
    cursor: default;
    color: var(--text-muted);
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .pages {
        margin: 20px 0;
        padding: 0 12px;
    }
    
    .pages ul {
        gap: 6px;
    }
    
    .pages ul li a,
    .pages ul li span {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        font-size: 13px;
    }
    
    .pages ul li:first-child a,
    .pages ul li:last-child a {
        min-width: 36px;
    }
}

/* 加载动画 */
@keyframes paginationFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pages {
    animation: paginationFadeIn 0.5s ease-out;
}
