/* 开心快乐每一天网站 - 主样式文件 */
/* Main styles for Happy Daily Website */

/* CSS 变量定义 */
:root {
    /* 主要颜色 */
    --primary-color: #FF6B6B;
    --secondary-color: #4ECDC4;
    --background-color: #F7F9FC;
    --text-color: #2C3E50;
    --text-light: #7F8C8D;
    --white: #FFFFFF;
    --shadow: rgba(0, 0, 0, 0.1);
    
    /* 间距 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-xxl: 4rem;
    
    /* 边框半径 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* 字体大小 */
    --font-sm: 0.875rem;
    --font-md: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.25rem;
    --font-xxl: 1.5rem;
    --font-xxxl: 2rem;
    
    /* 最大内容宽度 */
    --max-width: 1200px;
    --content-width: 800px;
}

/* 深色模式变量 */
[data-theme="dark"] {
    --background-color: #1a1a1a;
    --text-color: #E8E8E8;
    --text-light: #B0B0B0;
    --white: #2d2d2d;
    --shadow: rgba(255, 255, 255, 0.1);
}

/* ================================
   通用工具类
   ================================ */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.content-container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

.hidden { display: none; }
.visible { display: block; }

/* ================================
   网站头部样式
   ================================ */

.site-header {
    background: var(--white);
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) 0;
}

.site-logo {
    font-size: var(--font-xxl);
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.site-logo::before {
    content: "😊";
    font-size: var(--font-xl);
}

/* 主导航样式 */
.main-nav {
    display: flex;
    gap: var(--spacing-lg);
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    background-color: rgba(255, 107, 107, 0.1);
}

/* 移动端汉堡菜单 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: var(--spacing-xs);
    gap: 4px;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ================================
   主要内容区域
   ================================ */

.main-content {
    min-height: calc(100vh - 140px);
    padding: var(--spacing-xl) 0;
}

/* Hero Banner 样式 */
.hero-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    padding: var(--spacing-xxl) 0;
    margin-bottom: var(--spacing-xl);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: bold;
    margin-bottom: var(--spacing-md);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: var(--font-lg);
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* 功能卡片样式 */
.feature-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.feature-card {
    background: var(--white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px var(--shadow);
    transition: all 0.3s ease;
    text-align: center;
    border: 1px solid rgba(255, 107, 107, 0.1);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px var(--shadow);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    display: block;
}

.feature-title {
    font-size: var(--font-xl);
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: var(--spacing-sm);
}

.feature-description {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.feature-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    font-weight: 500;
    gap: var(--spacing-xs);
    transition: all 0.3s ease;
}

.feature-link:hover {
    color: var(--secondary-color);
    transform: translateX(5px);
}

/* ================================
   文章列表样式
   ================================ */

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.article-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid rgba(76, 205, 196, 0.1);
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--shadow);
}

.article-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}

.article-content {
    padding: var(--spacing-lg);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-sm);
    color: var(--text-light);
}

.article-date::before {
    content: "📅";
    margin-right: var(--spacing-xs);
}

.article-read-time::before {
    content: "⏱️";
    margin-right: var(--spacing-xs);
}

.article-title {
    font-size: var(--font-xl);
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

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

.article-excerpt {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.article-tag {
    background: rgba(76, 205, 196, 0.1);
    color: var(--secondary-color);
    padding: 4px var(--spacing-xs);
    border-radius: var(--radius-sm);
    font-size: var(--font-sm);
    font-weight: 500;
}

/* ================================
   面包屑导航
   ================================ */

.breadcrumb {
    background: var(--white);
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-lg);
    border-radius: var(--radius-md);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: var(--font-sm);
}

.breadcrumb-item {
    color: var(--text-light);
}

.breadcrumb-item:not(:last-child)::after {
    content: ">";
    margin-left: var(--spacing-xs);
    color: var(--text-light);
}

.breadcrumb-item a {
    color: var(--primary-color);
}

.breadcrumb-item a:hover {
    color: var(--secondary-color);
}

/* ================================
   页面标题样式
   ================================ */

.page-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.page-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: var(--spacing-md);
    position: relative;
}

.page-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    margin: var(--spacing-md) auto 0;
    border-radius: 2px;
}

.page-subtitle {
    font-size: var(--font-lg);
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ================================
   按钮样式
   ================================ */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: var(--font-md);
}

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

.btn-primary:hover {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

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

.btn-secondary:hover {
    background: #26d0ce;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(76, 205, 196, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 999;
    box-shadow: 0 4px 15px var(--shadow);
}

.back-to-top:hover {
    background: #ff5252;
    transform: scale(1.1);
}

.back-to-top.visible {
    display: flex;
}

/* ================================
   网站底部样式
   ================================ */

.site-footer {
    background: var(--text-color);
    color: white;
    padding: var(--spacing-xl) 0 var(--spacing-lg);
    margin-top: var(--spacing-xxl);
}

.footer-content {
    text-align: center;
}

.footer-info {
    margin-bottom: var(--spacing-lg);
}

.footer-title {
    font-size: var(--font-xl);
    font-weight: bold;
    margin-bottom: var(--spacing-sm);
}

.footer-description {
    color: #BDC3C7;
    margin-bottom: var(--spacing-md);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.footer-link {
    color: #BDC3C7;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--primary-color);
}

.footer-legal {
    border-top: 1px solid #34495E;
    padding-top: var(--spacing-lg);
    font-size: var(--font-sm);
    color: #BDC3C7;
}

.footer-legal a {
    color: #3498DB;
    text-decoration: underline;
}

.footer-legal a:hover {
    color: #2980B9;
}

/* ================================
   加载动画
   ================================ */

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-xl);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 107, 107, 0.3);
    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); }
}

/* ================================
   深色模式切换按钮
   ================================ */

.theme-toggle {
    background: none;
    border: 2px solid var(--text-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: var(--font-lg);
}

.theme-toggle:hover {
    background: var(--text-color);
    color: var(--background-color);
}

/* ================================
   无障碍访问样式
   ================================ */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 键盘焦点样式 */
*:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

/* 打印样式 */
@media print {
    .site-header,
    .site-footer,
    .back-to-top,
    .theme-toggle {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}