/* 温馨的情绪陪伴社区样式 */

/* 全局重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Arial', sans-serif;
    background: linear-gradient(135deg, #ffeef8 0%, #f0f4ff 50%, #fffbeb 100%);
    min-height: 100vh;
    color: #4a5568;
    line-height: 1.6;
}

/* 温馨的配色方案 */
:root {
    --primary-color: #ff8fab;          /* 温柔粉色 */
    --secondary-color: #8cc8ff;        /* 温柔蓝色 */
    --accent-color: #ffd93d;           /* 温暖黄色 */
    --success-color: #68d391;          /* 清新绿色 */
    --warning-color: #f6ad55;          /* 温暖橙色 */
    --error-color: #fc8181;            /* 柔和红色 */
    
    --text-primary: #2d3748;           /* 深灰色文字 */
    --text-secondary: #718096;         /* 中灰色文字 */
    --text-light: #a0aec0;             /* 浅灰色文字 */
    
    --bg-white: rgba(255, 255, 255, 0.9);
    --bg-soft: rgba(248, 250, 252, 0.8);
    --bg-overlay: rgba(255, 255, 255, 0.7);
    
    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-large: 0 20px 25px rgba(0, 0, 0, 0.15);
    
    --border-radius: 16px;
    --border-radius-small: 8px;
    --border-radius-large: 24px;
}

/* 容器布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 导航栏 */
.navbar {
    background: var(--bg-white);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-soft);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 182, 193, 0.2);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: "💝";
    font-size: 28px;
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--border-radius-small);
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a:hover {
    background: rgba(255, 139, 171, 0.1);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.nav-links a.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-soft);
}

/* 用户菜单 */
.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.1);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

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

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-soft {
    background: rgba(255, 139, 171, 0.1);
    color: var(--primary-color);
}

.btn-soft:hover {
    background: rgba(255, 139, 171, 0.2);
    transform: translateY(-1px);
}

/* 卡片样式 */
.card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 182, 193, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.card:hover::before {
    opacity: 1;
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* 帖子卡片 */
.post-card {
    margin-bottom: 20px;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.post-info h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.post-info .post-time {
    color: var(--text-secondary);
    font-size: 14px;
}

.post-content {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.post-category {
    display: inline-block;
    padding: 6px 16px;
    border-radius: var(--border-radius-large);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.category-joy {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    color: #d63031;
}

.category-worry {
    background: linear-gradient(135deg, #a8e6cf, #7ed6df);
    color: #00b894;
}

.post-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 182, 193, 0.2);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--border-radius-small);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.action-btn:hover {
    background: rgba(255, 139, 171, 0.1);
    color: var(--primary-color);
}

.reply-count {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 600;
    margin-left: 4px;
}

/* 用户菜单样式 */
.user-menu {
    position: relative;
    display: inline-block;
}

.user-avatar {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    border: 2px solid white;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    padding: 8px 0;
    min-width: 200px;
    z-index: 1000;
    margin-top: 8px;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
    color: var(--text-primary);
}

.dropdown-item:hover {
    background: rgba(255, 139, 171, 0.1);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.new-reply-badge {
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
    margin-left: auto;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid rgba(255, 182, 193, 0.3);
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--bg-white);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 139, 171, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

/* 分类选择器 */
.category-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.category-option {
    flex: 1;
    padding: 16px;
    border: 2px solid rgba(255, 182, 193, 0.3);
    border-radius: var(--border-radius);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-white);
}

.category-option:hover {
    border-color: var(--primary-color);
}

.category-option.selected {
    border-color: var(--primary-color);
    background: rgba(255, 139, 171, 0.1);
}

.category-option .emoji {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.category-option .label {
    font-weight: 600;
    color: var(--text-primary);
}

/* 标签页 */
.tabs {
    display: flex;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    padding: 6px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-soft);
}

.tab {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--border-radius-small);
    transition: all 0.3s ease;
    position: relative;
}

.tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: var(--shadow-soft);
}

.tab:not(.active):hover {
    background: rgba(255, 139, 171, 0.1);
    color: var(--primary-color);
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 139, 171, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state .emoji {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}

.empty-state h3 {
    margin-bottom: 8px;
    color: var(--text-primary);
}

/* 提示框 */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-large);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.success {
    background: var(--success-color);
    color: white;
}

.toast.error {
    background: var(--error-color);
    color: white;
}

.toast.warning {
    background: var(--warning-color);
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-large);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px 24px 0;
    border-bottom: 1px solid rgba(255, 182, 193, 0.2);
    margin-bottom: 24px;
}

.modal-body {
    padding: 0 24px 24px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .navbar-content {
        flex-direction: column;
        gap: 16px;
    }
    
    .nav-links {
        gap: 16px;
    }
    
    .tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .category-selector {
        flex-direction: column;
    }
    
    .post-actions {
        flex-wrap: wrap;
    }
    
    .toast {
        right: 16px;
        left: 16px;
        bottom: 16px;
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 182, 193, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.bounce-in {
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* 特殊效果 */
.floating {
    animation: floating 6s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}