/**
 * 个人空间 - Bento Box 设计风格
 * 黑白配色 + 天蓝色按钮
 * 特点：简洁、现代、卡片化、网格布局
 */

/* ========== 全局变量 ========== */
:root {
    /* 主色调：黑白配色 */
    --sp-bg-primary: #f8f9fa;
    --sp-bg-white: #ffffff;
    --sp-bg-dark: #1a1a1a;
    --sp-bg-overlay: rgba(0, 0, 0, 0.5);
    
    /* 文字颜色 */
    --sp-text-primary: #1a1a1a;
    --sp-text-secondary: #666666;
    --sp-text-tertiary: #999999;
    --sp-text-white: #ffffff;
    
    /* 天蓝色按钮 */
    --sp-accent-blue: #4a90e2;
    --sp-accent-blue-hover: #3a7bc8;
    --sp-accent-blue-light: rgba(74, 144, 226, 0.1);
    
    /* 其他颜色 */
    --sp-danger: #e85d5d;
    --sp-success: #50c878;
    --sp-warning: #f59e42;
    
    /* 边框和阴影 */
    --sp-border-light: #e5e5e5;
    --sp-border-dark: #333333;
    --sp-border-radius: 16px;
    --sp-border-radius-sm: 12px;
    --sp-border-radius-xs: 8px;
    --sp-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --sp-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --sp-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    
    /* 过渡动画 */
    --sp-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sp-transition-fast: all 0.15s ease;
}

/* ========== 页面容器 ========== */
.space-page {
    background: var(--sp-bg-primary);
    min-height: 100vh;
}

.space-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px;
}

.space-content {
    /* 主内容区域 */
}

/* 动态列表区域 */
.posts-section {
    max-width: 680px;
    margin: 0 auto;
}

.posts-list {
    /* 动态列表 */
}

@media (max-width: 768px) {
    .space-container {
        padding: 16px 12px;
    }
}

/* ========== 空间头部 ========== */
.space-header {
    background: var(--sp-bg-white);
    border-radius: var(--sp-border-radius);
    padding: 32px;
    margin-bottom: 24px;
    border: 1px solid var(--sp-border-light);
    box-shadow: var(--sp-shadow-sm);
}

.space-header-content {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.space-avatar {
    flex-shrink: 0;
}

.space-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--sp-bg-white);
    box-shadow: var(--sp-shadow-md);
}

.space-info {
    flex: 1;
    min-width: 0;
}

.space-name-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.space-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--sp-text-primary);
    margin: 0;
}

.space-vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb347 100%);
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.space-username {
    color: var(--sp-text-tertiary);
    font-size: 14px;
    margin-bottom: 12px;
}

.space-signature {
    color: var(--sp-text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
    max-width: 500px;
}

/* 统计数据 */
.space-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.space-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: var(--sp-transition-fast);
}

.space-stat-item:hover {
    transform: translateY(-2px);
}

.space-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--sp-text-primary);
}

.space-stat-label {
    font-size: 12px;
    color: var(--sp-text-tertiary);
    margin-top: 2px;
}

/* 操作按钮 */
.space-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.sp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--sp-border-radius-xs);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: var(--sp-transition);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.sp-btn-primary {
    background: var(--sp-accent-blue);
    color: var(--sp-text-white);
    border-color: var(--sp-accent-blue);
}

.sp-btn-primary:hover {
    background: var(--sp-accent-blue-hover);
    border-color: var(--sp-accent-blue-hover);
    transform: translateY(-1px);
    box-shadow: var(--sp-shadow-md);
    color: var(--sp-text-white);
    text-decoration: none;
}

.sp-btn-secondary {
    background: var(--sp-bg-white);
    color: var(--sp-text-secondary);
    border-color: var(--sp-border-light);
}

.sp-btn-secondary:hover {
    background: var(--sp-bg-primary);
    color: var(--sp-text-primary);
    border-color: var(--sp-text-tertiary);
    text-decoration: none;
}

.sp-btn-dark {
    background: var(--sp-bg-dark);
    color: var(--sp-text-white);
    border-color: var(--sp-bg-dark);
}

.sp-btn-dark:hover {
    background: #333;
    border-color: #333;
    transform: translateY(-1px);
    color: var(--sp-text-white);
    text-decoration: none;
}

.sp-btn-danger {
    background: transparent;
    color: var(--sp-danger);
    border-color: var(--sp-danger);
}

.sp-btn-danger:hover {
    background: var(--sp-danger);
    color: var(--sp-text-white);
}

.sp-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.sp-btn-icon {
    padding: 8px;
    border-radius: 50%;
}

/* 已关注状态 */
.sp-btn-followed {
    background: var(--sp-bg-primary);
    color: var(--sp-text-secondary);
    border-color: var(--sp-border-light);
}

.sp-btn-followed:hover {
    background: var(--sp-danger);
    color: var(--sp-text-white);
    border-color: var(--sp-danger);
}

.sp-btn-followed:hover .btn-text-normal {
    display: none;
}

.sp-btn-followed:hover .btn-text-hover {
    display: inline;
}

.sp-btn-followed .btn-text-hover {
    display: none;
}

/* ========== Tab 导航 ========== */
.space-tabs {
    background: var(--sp-bg-white);
    border-radius: var(--sp-border-radius);
    padding: 4px;
    margin-bottom: 10px;
    border: 1px solid var(--sp-border-light);
    display: flex;
    gap: 4px;
    overflow-x: auto;
}

.space-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--sp-border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--sp-text-secondary);
    text-decoration: none;
    transition: var(--sp-transition);
    white-space: nowrap;
}

.space-tab:hover {
    background: var(--sp-bg-primary);
    color: var(--sp-text-primary);
    text-decoration: none;
}

.space-tab.active {
    background: var(--sp-bg-dark);
    color: var(--sp-text-white);
}

.space-tab i {
    font-size: 16px;
}

.tab-count {
    background: var(--sp-accent-blue);
    color: var(--sp-text-white);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
}

.space-tab.active .tab-count {
    background: var(--sp-text-white);
    color: var(--sp-bg-dark);
}

/* ========== Bento Box 网格布局 ========== */
.space-bento-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(12, 1fr);
}

.space-bento-grid .bento-card {
    background: var(--sp-bg-white);
    border-radius: var(--sp-border-radius);
    border: 1px solid var(--sp-border-light);
    overflow: hidden;
    transition: var(--sp-transition);
}

.space-bento-grid .bento-card:hover {
    box-shadow: var(--sp-shadow-lg);
    transform: translateY(-2px);
}

/* Bento 卡片尺寸 */
.bento-full { grid-column: span 12; }
.bento-half { grid-column: span 6; }
.bento-third { grid-column: span 4; }
.bento-quarter { grid-column: span 3; }
.bento-two-thirds { grid-column: span 8; }

@media (max-width: 992px) {
    .bento-third { grid-column: span 6; }
    .bento-quarter { grid-column: span 6; }
    .bento-two-thirds { grid-column: span 12; }
}

@media (max-width: 768px) {
    .space-bento-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bento-full, .bento-half, .bento-third, 
    .bento-quarter, .bento-two-thirds {
        grid-column: span 2;
    }
}

/* ========== 作品区域 ========== */
.works-section {
    background: var(--sp-bg-white);
    border-radius: var(--sp-border-radius);
    border: 1px solid var(--sp-border-light);
    padding: 24px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--sp-text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--sp-accent-blue);
}

.section-filters {
    display: flex;
    gap: 8px;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--sp-border-light);
    background: var(--sp-bg-white);
    color: var(--sp-text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--sp-transition);
}

.filter-btn:hover {
    border-color: var(--sp-accent-blue);
    color: var(--sp-accent-blue);
}

.filter-btn.active {
    background: var(--sp-accent-blue);
    border-color: var(--sp-accent-blue);
    color: var(--sp-text-white);
}

/* 作品网格 */
.works-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 992px) {
    .works-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ========== 作品卡片 ========== */
.work-card {
    background: var(--sp-bg-white);
    border-radius: var(--sp-border-radius);
    border: 1px solid var(--sp-border-light);
    overflow: hidden;
    transition: var(--sp-transition);
}

.work-card:hover {
    box-shadow: var(--sp-shadow-lg);
    transform: translateY(-4px);
}

.work-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.work-cover {
    position: relative;
    padding-top: 56.25%; /* 16:9 */
    overflow: hidden;
    background: var(--sp-bg-primary);
}

.work-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--sp-transition);
}

.work-card:hover .work-cover img {
    transform: scale(1.05);
}

.work-cover-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sp-text-tertiary);
    font-size: 32px;
}

.work-type-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--sp-bg-dark);
    color: var(--sp-text-white);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.work-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: var(--sp-text-white);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.work-info {
    padding: 14px;
}

.work-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--sp-text-primary);
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.work-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--sp-text-tertiary);
    flex-wrap: wrap;
}

.work-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.work-time {
    margin-left: auto;
}

/* ========== 收藏页面 ========== */
.favorites-section {
    background: var(--sp-bg-white);
    border-radius: var(--sp-border-radius);
    border: 1px solid var(--sp-border-light);
    padding: 24px;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    align-items: start;
}

@media (max-width: 992px) {
    .favorites-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .favorites-grid {
        display: block;
        column-count: 2;
        column-gap: 10px;
    }

    .favorites-grid .favorite-card {
        break-inside: avoid;
        margin-bottom: 10px;
        display: inline-block;
        width: 100%;
    }
}

.favorite-card {
    background: var(--sp-bg-white);
    border-radius: var(--sp-border-radius);
    border: 1px solid var(--sp-border-light);
    overflow: hidden;
    transition: var(--sp-transition);
    position: relative;
}

.favorite-card:hover {
    box-shadow: var(--sp-shadow-lg);
    transform: translateY(-4px);
}

.favorite-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.favorite-cover {
    position: relative;
    padding-top: 56.25%;
    overflow: hidden;
    background: var(--sp-bg-primary);
}

/* 竖屏封面（漫画/小说 3:4） */
.favorite-cover.cover-portrait {
    padding-top: 133.33%;
}

.favorite-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--sp-transition);
}

.favorite-card:hover .favorite-cover img {
    transform: scale(1.05);
}

/* 内容类型标签 */
.card-type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    line-height: 1.4;
    z-index: 1;
}

.badge-comic { background: rgba(236, 72, 153, 0.85); }
.badge-novel { background: rgba(139, 92, 246, 0.85); }
.badge-video { background: rgba(59, 130, 246, 0.85); }
.badge-article { background: rgba(107, 114, 128, 0.7); }

.cover-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sp-text-tertiary);
    font-size: 32px;
}

.favorite-info {
    padding: 14px;
}

.favorite-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--sp-text-primary);
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.favorite-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--sp-text-tertiary);
}

.favorite-author {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--sp-text-secondary);
    text-decoration: none;
}

.favorite-author img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}

.favorite-author:hover {
    color: var(--sp-accent-blue);
}

.favorite-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--sp-text-white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: var(--sp-transition);
}

.favorite-card:hover .favorite-remove-btn {
    opacity: 1;
}

.favorite-remove-btn:hover {
    background: var(--sp-danger);
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 64px;
    color: var(--sp-border-light);
    margin-bottom: 16px;
}

.empty-text {
    font-size: 15px;
    color: var(--sp-text-tertiary);
    margin-bottom: 20px;
}

.empty-hint {
    font-size: 13px;
    color: var(--sp-text-tertiary);
    margin-bottom: 20px;
}

/* ========== 分页 ========== */
.space-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--sp-border-light);
}

.page-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--sp-border-radius-xs);
    background: var(--sp-bg-primary);
    color: var(--sp-text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--sp-transition);
}

.page-btn:hover {
    background: var(--sp-accent-blue);
    color: var(--sp-text-white);
    text-decoration: none;
}

.page-info {
    font-size: 14px;
    color: var(--sp-text-tertiary);
}

/* ========== 动态卡片 ========== */
.post-card {
    background: var(--sp-bg-white);
    border-radius: var(--sp-border-radius);
    border: 1px solid var(--sp-border-light);
    padding: 20px;
    margin-bottom: 16px;
    transition: var(--sp-transition);
}

.post-card:hover {
    box-shadow: var(--sp-shadow-md);
}

.post-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.post-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.post-author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.post-author-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--sp-text-primary);
}

.post-time {
    font-size: 12px;
    color: var(--sp-text-tertiary);
}

.post-visibility {
    font-size: 14px;
    color: var(--sp-text-tertiary);
    padding: 4px;
}

.post-actions-menu {
    position: relative;
}

.post-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--sp-bg-white);
    border: 1px solid var(--sp-border-light);
    border-radius: var(--sp-border-radius-xs);
    box-shadow: var(--sp-shadow-lg);
    min-width: 120px;
    z-index: 100;
}

.post-menu.show {
    display: block;
}

.post-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--sp-text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--sp-transition-fast);
}

.post-menu-item:hover {
    background: var(--sp-bg-primary);
    color: var(--sp-danger);
    text-decoration: none;
}

.post-content {
    margin-bottom: 14px;
}

.post-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--sp-text-primary);
    word-break: break-word;
    margin-bottom: 12px;
}

/* 图片网格 - 使用 post-images-{n} 格式 */
.post-images {
    display: grid;
    gap: 4px;
    border-radius: var(--sp-border-radius-sm);
    overflow: hidden;
}

.post-images-1 { grid-template-columns: 1fr; max-width: 400px; }
.post-images-2 { grid-template-columns: repeat(2, 1fr); }
.post-images-3 { grid-template-columns: repeat(3, 1fr); }
.post-images-4 { grid-template-columns: repeat(2, 1fr); }
.post-images-5,
.post-images-6 { grid-template-columns: repeat(3, 1fr); }
.post-images-7,
.post-images-8,
.post-images-9 { grid-template-columns: repeat(3, 1fr); }

.post-image-item {
    position: relative;
    padding-top: 100%;
    cursor: pointer;
    overflow: hidden;
}

.post-images-1 .post-image-item {
    padding-top: 56.25%;
}

.post-image-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--sp-transition);
}

.post-image-item:hover img {
    transform: scale(1.05);
}

/* 分享内容卡片 */
.post-shared-content {
    background: var(--sp-bg-primary);
    border-radius: var(--sp-border-radius-sm);
    overflow: hidden;
    margin-top: 12px;
}

.shared-link {
    display: flex;
    text-decoration: none;
    color: inherit;
}

.shared-thumbnail {
    width: 100px;
    height: 70px;
    object-fit: cover;
    flex-shrink: 0;
}

.shared-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shared-type {
    font-size: 12px;
    color: var(--sp-accent-blue);
}

.shared-title {
    font-size: 14px;
    color: var(--sp-text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 动态底部操作栏 */
.post-footer {
    display: flex;
    gap: 24px;
    padding-top: 14px;
    border-top: 1px solid var(--sp-border-light);
}

.post-action {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--sp-text-tertiary);
    font-size: 14px;
    cursor: pointer;
    transition: var(--sp-transition-fast);
    padding: 6px 12px;
    border-radius: var(--sp-border-radius-xs);
    background: transparent;
    border: none;
}

.post-action:hover {
    background: var(--sp-bg-primary);
    color: var(--sp-text-primary);
}

.post-action.liked {
    color: var(--sp-danger);
}

.post-action.liked:hover {
    background: rgba(232, 93, 93, 0.1);
}

.post-action.liked i {
    animation: likeScale 0.3s ease;
}

@keyframes likeScale {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* 转发引用 */
.post-forward-quote {
    background: var(--sp-bg-primary);
    border-radius: var(--sp-border-radius-sm);
    padding: 12px;
    margin-bottom: 12px;
    border-left: 3px solid var(--sp-border-light);
}

.post-forward-quote .forward-user {
    font-weight: 600;
    color: var(--sp-accent-blue);
    margin-right: 8px;
}

.post-forward-quote .forward-content {
    color: var(--sp-text-secondary);
    font-size: 14px;
}

/* ========== 动态发布编辑器 ========== */
.post-editor {
    background: var(--sp-bg-white);
    border-radius: var(--sp-border-radius);
    border: 1px solid var(--sp-border-light);
    margin-bottom: 24px;
    overflow: hidden;
}

.editor-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--sp-border-light);
    background: var(--sp-bg-primary);
}

.editor-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--sp-text-primary);
}

.editor-body {
    padding: 20px;
}

.editor-textarea-wrap {
    position: relative;
    margin-bottom: 16px;
}

.editor-textarea {
    width: 100%;
    min-height: 100px;
    border: 1px solid var(--sp-border-light);
    border-radius: var(--sp-border-radius-xs);
    padding: 14px;
    outline: none;
    resize: none;
    font-size: 15px;
    line-height: 1.6;
    color: var(--sp-text-primary);
    transition: var(--sp-transition);
}

.editor-textarea:focus {
    border-color: var(--sp-accent-blue);
}

.editor-textarea::placeholder {
    color: var(--sp-text-tertiary);
}

.editor-char-count {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 12px;
    color: var(--sp-text-tertiary);
}

.editor-images {
    margin-bottom: 16px;
}

.image-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-preview-item {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: var(--sp-border-radius-xs);
    overflow: hidden;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 12px;
    transition: var(--sp-transition-fast);
}

.image-remove-btn:hover {
    background: var(--sp-danger);
}

.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--sp-border-light);
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--sp-text-secondary);
    cursor: pointer;
    transition: var(--sp-transition-fast);
    background: transparent;
    border: none;
}

.toolbar-btn:hover {
    background: var(--sp-bg-primary);
    color: var(--sp-accent-blue);
}

.emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    background: var(--sp-bg-white);
    border: 1px solid var(--sp-border-light);
    border-radius: var(--sp-border-radius-sm);
    box-shadow: var(--sp-shadow-lg);
    padding: 12px;
    z-index: 100;
    margin-bottom: 8px;
}

.emoji-list {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    max-width: 280px;
}

.emoji-item {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    transition: var(--sp-transition-fast);
}

.emoji-item:hover {
    background: var(--sp-bg-primary);
}

.visibility-select {
    position: relative;
}

.visibility-dropdown {
    padding: 8px 12px;
    border: 1px solid var(--sp-border-light);
    border-radius: var(--sp-border-radius-xs);
    background: var(--sp-bg-white);
    font-size: 13px;
    color: var(--sp-text-secondary);
    cursor: pointer;
    outline: none;
}

/* ========== 评论组件 ========== */
.post-comments {
    padding: 16px 0;
    border-top: 1px solid var(--sp-border-light);
    margin-top: 14px;
}

.comment-input {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.comment-input-field {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--sp-border-light);
    border-radius: var(--sp-border-radius-xs);
    font-size: 14px;
    outline: none;
    transition: var(--sp-transition);
}

.comment-input-field:focus {
    border-color: var(--sp-accent-blue);
}

.comment-list {
    /* 评论列表容器 */
}

.comment-item {
    display: flex;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--sp-border-light);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar-link {
    flex-shrink: 0;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
    color: var(--sp-text-primary);
    text-decoration: none;
    margin-right: 8px;
}

.comment-author:hover {
    color: var(--sp-accent-blue);
}

.comment-text {
    font-size: 14px;
    line-height: 1.6;
    color: var(--sp-text-primary);
    word-break: break-word;
}

.comment-meta {
    margin-top: 6px;
    display: flex;
    gap: 16px;
}

.comment-time {
    font-size: 12px;
    color: var(--sp-text-tertiary);
}

/* ========== 空状态 ========== */
.space-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--sp-text-tertiary);
}

.space-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.space-empty-text {
    font-size: 16px;
    margin-bottom: 20px;
}

/* ========== 加载状态 ========== */
.space-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.space-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--sp-border-light);
    border-top-color: var(--sp-accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .space-header {
        padding: 20px;
    }
    
    .space-header-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .space-avatar img {
        width: 80px;
        height: 80px;
    }
    
    .space-name {
        font-size: 20px;
    }
    
    .space-stats {
        justify-content: center;
    }
    
    .space-actions {
        width: 100%;
        justify-content: center;
    }
    
    .space-signature {
        max-width: none;
    }
    
    .space-tabs {
        border-radius: var(--sp-border-radius-sm);
    }
    
    .space-tab {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .post-card {
        padding: 16px;
    }
    
    .post-card-actions {
        gap: 12px;
    }
    
    .post-action {
        padding: 6px 10px;
        font-size: 13px;
    }
}

/* ========== 工具类 ========== */
.sp-flex { display: flex; }
.sp-flex-center { display: flex; align-items: center; justify-content: center; }
.sp-flex-between { display: flex; align-items: center; justify-content: space-between; }
.sp-gap-8 { gap: 8px; }
.sp-gap-16 { gap: 16px; }
.sp-mt-16 { margin-top: 16px; }
.sp-mb-16 { margin-bottom: 16px; }
.sp-text-center { text-align: center; }
.sp-text-secondary { color: var(--sp-text-secondary); }
.sp-text-tertiary { color: var(--sp-text-tertiary); }

/* ========== 移动端通铺布局 ========== */
@media (max-width: 991px) {
    .site-footer { display: none !important; }
    
    /* 页面通铺 */
    .space-page {
        background: var(--sp-bg-white);
        padding: 0;
    }
    
    .space-container {
        max-width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .space-content {
        padding: 0;
    }
    
    /* 头部通铺 */
    .space-header {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-bottom: 0;
        box-shadow: none;
    }
    
    /* Tab 保持卡片样式 */
    .space-tabs {
        margin-bottom: 10px;
    }
    
    /* 作品区域通铺 */
    .works-section {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 16px 12px;
    }
    
    .works-grid {
        gap: 10px;
    }
    
    /* 动态卡片通铺 */
    .post-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin-bottom: 0;
        border-bottom: 1px solid var(--sp-border-light);
    }
    
    .posts-section {
        max-width: 100%;
    }
    
    /* 编辑器通铺 */
    .post-editor {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    /* 分页通铺 */
    .space-pagination {
        padding: 16px 12px;
    }
    
    /* 收藏区域通铺 */
    .favorites-section {
        border-radius: 0;
        border-left: none;
        border-right: none;
        padding: 16px 12px;
    }
    
    /* Bento 卡片通铺 */
    .space-bento-grid .bento-card {
        border-radius: var(--sp-border-radius-sm);
    }
}

