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

:root {
    --primary: #ff9ec4;
    --primary-dark: #ff6b9d;
    --secondary: #a78bfa;
    --accent: #67e8f9;
    --bg-main: #fef6f9;
    --bg-card: #ffffff;
    --text-main: #4a4a6a;
    --text-light: #9090a0;
    --shadow: rgba(255, 158, 196, 0.3);
    --gradient-pink: linear-gradient(135deg, #ff9ec4 0%, #ff6b9d 100%);
    --gradient-purple: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
}

body {
    font-family: 'M PLUS Rounded 1c', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==================== 背景装饰 ==================== */
.bg-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    color: var(--primary);
    font-size: 1.5rem;
    animation: twinkle 2s ease-in-out infinite;
}

.star1 { top: 10%; left: 5%; animation-delay: 0s; }
.star2 { top: 25%; right: 10%; animation-delay: 0.5s; font-size: 1rem; }
.star3 { top: 60%; left: 8%; animation-delay: 1s; font-size: 1.2rem; }

.cloud {
    position: absolute;
    font-size: 4rem;
    color: rgba(167, 139, 250, 0.15);
    animation: float 8s ease-in-out infinite;
}

.cloud1 { top: 15%; right: 15%; }
.cloud2 { bottom: 20%; left: 5%; animation-delay: 2s; }

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

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

/* ==================== 顶部导航 ==================== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(255, 158, 196, 0.3);
    padding: 0.8rem 2rem;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 2rem;
    animation: bounce 2s ease-in-out infinite;
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--gradient-pink);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav {
    display: flex;
    gap: 0.5rem;
}

.nav-item {
    padding: 0.6rem 1.2rem;
    border-radius: 2rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: rgba(255, 158, 196, 0.2);
    color: var(--primary-dark);
}

.nav-item.active {
    background: var(--gradient-pink);
    color: white;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.login-btn {
    padding: 0.5rem 1.5rem;
    background: var(--gradient-pink);
    color: white;
    border: none;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.login-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px var(--shadow);
}

.login-modal-content {
    max-width: 400px;
}

.login-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid rgba(255, 158, 196, 0.3);
    border-radius: 1rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    font-family: inherit;
}

.login-input:focus {
    outline: none;
    border-color: var(--primary);
}
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    background: white;
}

.username {
    font-weight: 500;
    color: var(--text-main);
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    position: fixed;
    left: 2rem;
    top: 100px;
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 50;
}

.sidebar-card {
    background: var(--bg-card);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 8px 30px var(--shadow);
    border: 2px solid rgba(255, 158, 196, 0.2);
}

/* 个人资料卡 */
.profile-card {
    text-align: center;
    padding-top: 0;
    overflow: hidden;
}

.profile-banner {
    height: 80px;
    background: var(--gradient-pink);
    border-radius: 1.5rem 1.5rem 0 0;
}

.profile-avatar {
    margin-top: -40px;
}

.profile-avatar img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 15px var(--shadow);
}

.profile-name {
    font-size: 1.2rem;
    margin: 0.5rem 0 0.3rem;
    color: var(--text-main);
}

.profile-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 1rem;
    padding: 0.8rem 0;
    border-top: 1px dashed rgba(255, 158, 196, 0.3);
    border-bottom: 1px dashed rgba(255, 158, 196, 0.3);
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

.btn-follow {
    background: var(--gradient-pink);
    color: white;
    border: none;
    padding: 0.6rem 2rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-follow:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px var(--shadow);
}

/* 标签卡 */
.card-title {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: rgba(167, 139, 250, 0.15);
    color: var(--secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--gradient-purple);
    color: white;
}

/* 天气卡 */
.weather {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.weather-icon {
    font-size: 2.5rem;
}

.weather-temp {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.weather-desc {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ==================== 主内容区 ==================== */
.main-content {
    margin-left: 320px;
    padding: 2rem;
    max-width: 900px;
    position: relative;
    z-index: 10;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    padding: 0.9rem 1.2rem;
    border: 2px solid rgba(255, 158, 196, 0.3);
    border-radius: 2rem;
    font-size: 0.95rem;
    font-family: inherit;
    background: white;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 158, 196, 0.15);
}

.search-btn {
    width: 50px;
    height: 50px;
    border: none;
    background: var(--gradient-pink);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px var(--shadow);
}

/* 发帖按钮 */
.btn-post {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    background: white;
    border: 2px dashed var(--primary);
    border-radius: 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-dark);
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-post:hover {
    background: rgba(255, 158, 196, 0.1);
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 1.3rem;
}

/* ==================== 帖子卡片 ==================== */
.posts {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-card {
    background: var(--bg-card);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: 0 8px 30px var(--shadow);
    border: 2px solid rgba(255, 158, 196, 0.15);
    display: flex;
    gap: 1rem;
    transition: all 0.3s ease;
}

.post-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
}

.post-avatar img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid rgba(255, 158, 196, 0.3);
    background: white;
}

.post-content {
    flex: 1;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.5rem;
}

.post-author {
    font-weight: 600;
    color: var(--text-main);
}

.post-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

.post-title {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.post-excerpt {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post-images {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.post-img {
    width: 120px;
    height: 120px;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.post-img.wide {
    width: 250px;
}

.post-img:hover {
    transform: scale(1.05);
}

.post-actions {
    display: flex;
    gap: 1rem;
    padding-top: 0.8rem;
    border-top: 1px dashed rgba(255, 158, 196, 0.2);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0.8rem;
    border-radius: 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
    transition: all 0.3s ease;
    font-family: inherit;
}

.action-btn:hover {
    background: rgba(255, 158, 196, 0.15);
    color: var(--primary-dark);
}

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

.action-btn.liked .action-icon {
    animation: heartBeat 0.3s ease;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.action-icon {
    font-size: 1rem;
}

.action-count {
    font-weight: 500;
}

/* ==================== 弹窗 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(74, 74, 106, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 1.5rem;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(74, 74, 106, 0.3);
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px dashed rgba(255, 158, 196, 0.3);
}

.modal-header h3 {
    font-size: 1.2rem;
    color: var(--text-main);
}

.modal-close {
    width: 30px;
    height: 30px;
    border: none;
    background: rgba(255, 158, 196, 0.2);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-main);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--primary);
    color: white;
}

.modal-body {
    padding: 1.5rem;
}

.post-title-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid rgba(255, 158, 196, 0.3);
    border-radius: 1rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    font-family: inherit;
}

.post-title-input:focus {
    outline: none;
    border-color: var(--primary);
}

.post-content-input {
    width: 100%;
    height: 150px;
    padding: 0.8rem 1rem;
    border: 2px solid rgba(255, 158, 196, 0.3);
    border-radius: 1rem;
    font-size: 0.95rem;
    resize: none;
    font-family: inherit;
    margin-bottom: 1rem;
}

.post-content-input:focus {
    outline: none;
    border-color: var(--primary);
}

.post-options {
    display: flex;
    gap: 0.8rem;
}

.option-btn {
    padding: 0.5rem 1rem;
    background: rgba(167, 139, 250, 0.15);
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--secondary);
    transition: all 0.3s ease;
    font-family: inherit;
}

.option-btn:hover {
    background: var(--gradient-purple);
    color: white;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    border-top: 1px dashed rgba(255, 158, 196, 0.3);
}

.btn-cancel {
    padding: 0.6rem 1.5rem;
    background: rgba(144, 144, 160, 0.2);
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-cancel:hover {
    background: rgba(144, 144, 160, 0.3);
}

.btn-submit {
    padding: 0.6rem 1.5rem;
    background: var(--gradient-pink);
    border: none;
    border-radius: 2rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-submit:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px var(--shadow);
}

/* ==================== 响应式 ==================== */
@media (max-width: 1100px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 2rem;
    }
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }
    .header {
        padding: 0.8rem 1rem;
    }
    .main-content {
        margin-left: 1rem;
        padding: 1rem;
    }
    .post-card {
        flex-direction: column;
        padding: 1rem;
    }
    .post-avatar {
        display: none;
    }
}
