/* 糖心vlog网站 - 全局样式 */

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

:root {
    --primary-color: #ff6b9d;
    --secondary-color: #c44569;
    --accent-color: #ffa07a;
    --bg-color: #fff5f7;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --border-color: #ffd4e5;
    --shadow: 0 2px 15px rgba(255, 107, 157, 0.1);
    --shadow-hover: 0 8px 30px rgba(255, 107, 157, 0.2);
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #fff5f7 0%, #ffe8f0 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.txhome-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.site-header {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(255, 107, 157, 0.3);
    transition: all 0.3s ease;
}

.site-header.scrolled {
    padding: 10px 0;
    box-shadow: 0 6px 25px rgba(255, 107, 157, 0.4);
}

.txheader-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area h1 {
    margin: 0;
}

.logo-area a {
    color: white;
    text-decoration: none;
    font-size: 28px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
    display: inline-block;
}

.logo-area a:hover {
    transform: scale(1.05);
}

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

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
}

/* 搜索区域 */
.search-section {
    background: white;
    padding: 40px 20px;
    margin: 30px 0;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.txsearch-wrapper {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    font-size: 16px;
    transition: all 0.3s ease;
}

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

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.4);
}

/* 分类导航 */
.category-nav {
    background: white;
    padding: 25px;
    border-radius: 20px;
    margin: 30px 0;
    box-shadow: var(--shadow);
}

.txcategory-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    list-style: none;
    justify-content: center;
}

.txcategory-list a {
    display: inline-block;
    padding: 10px 25px;
    background: linear-gradient(135deg, #fff0f5, #ffe8f0);
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 25px;
    border: 2px solid var(--border-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.txcategory-list a:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.3);
}

/* 主内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    margin: 30px 0;
}

/* 帖子列表 */
.posts-area {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.post-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.post-card:hover {
    box-shadow: var(--shadow-hover);
}

.txpost-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
}

.user-info h3 {
    font-size: 16px;
    color: var(--text-color);
    margin-bottom: 3px;
}

.post-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--text-light);
}

.post-title {
    font-size: 22px;
    color: var(--text-color);
    margin: 15px 0;
    line-height: 1.4;
}

.post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-light);
    line-height: 1.8;
    margin: 15px 0;
}

.post-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 15px;
    margin: 15px 0;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.tag {
    padding: 5px 12px;
    background: linear-gradient(135deg, #fff0f5, #ffe8f0);
    color: var(--secondary-color);
    border-radius: 15px;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.txpost-actions {
    display: flex;
    gap: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
    background: none;
    border: none;
}

.action-btn:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

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

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-widget {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 20px;
    color: var(--text-color);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.hot-topics-list,
.recent-posts-list {
    list-style: none;
}

.hot-topics-list li,
.recent-posts-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.hot-topics-list li:last-child,
.recent-posts-list li:last-child {
    border-bottom: none;
}

.hot-topics-list a,
.recent-posts-list a {
    color: var(--text-color);
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
}

.hot-topics-list a:hover,
.recent-posts-list a:hover {
    color: var(--primary-color);
    padding-left: 10px;
}

.hot-number {
    display: inline-block;
    width: 25px;
    height: 25px;
    line-height: 25px;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin-right: 10px;
}

/* 页脚 */
.site-footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 50px 20px 30px;
    margin-top: 50px;
}

.txfooter-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 5px 20px rgba(255, 107, 157, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.5);
}

/* 响应式设计 */
@media (max-width: 968px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        flex-direction: column;
        padding: 20px;
        transition: left 0.3s ease;
    }

    .nav-menu.active {
        left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .txhome-container {
        padding: 10px;
    }

    .logo-area a {
        font-size: 22px;
    }

    .post-card {
        padding: 15px;
    }

    .post-title {
        font-size: 18px;
    }

    .post-image {
        height: 200px;
    }

    .txcategory-list {
        gap: 10px;
    }

    .txcategory-list a {
        padding: 8px 15px;
        font-size: 14px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeInUp 0.6s ease-out;
}

.post-card:nth-child(1) { animation-delay: 0.1s; }
.post-card:nth-child(2) { animation-delay: 0.2s; }
.post-card:nth-child(3) { animation-delay: 0.3s; }
.post-card:nth-child(4) { animation-delay: 0.4s; }
.post-card:nth-child(5) { animation-delay: 0.5s; }

/* 表单样式 */
.comment-form {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

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

.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: all 0.3s ease;
}

.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

.submit-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.4);
}
