/* plan-generator.css - 健身计划生成器页面的专属美化样式 */
/* Basic Reset & Body Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', 'Helvetica Neue', Helvetica, sans-serif;
    line-height: 0.6;
    color: #333;
    background-color: #f4f4f4;
}

/* Header Styles */
header {
    background-color: #fff;
    color: #333;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #5cb85c;
}

footer p{
    text-align: center;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 40px;
    margin-right: 10px;
    /* filter: drop-shadow(2px 2px 2px #aaa); Example of a subtle effect */
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: #5cb85c;
    font-weight: bold; /* Font property */
}

.search-bar {
    display: flex;
    flex-grow: 0.5; /* Allows search bar to take available space */
    max-width: 400px; /* Max width for search bar */
}

.search-bar input[type="search"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-right: none;
    border-radius: 4px 0 0 4px;
    flex-grow: 1;
    font-size: 0.9rem; /* Font property */
}

.search-bar button {
    padding: 0.5rem 1rem;
    background-color: #5cb85c;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 0 4px 4px 0;
    transition: background-color 0.3s ease; /* Transition for button */
}

.search-bar button:hover {
    background-color: #4cae4c;
}

.auth-links a, .auth-links-simple a {
    color: #5cb85c;
    text-decoration: none;
    margin-left: 10px;
    font-weight: 600; /* Font property */
}

.auth-links a:hover, .auth-links-simple a:hover {
    text-decoration: underline;
}

/* Main Navigation Styles */
.main-nav {
    background-color: #333;
    padding: 0.5rem 0; /* Vertical padding */
}

.main-nav ul {
    list-style: none;
    display: flex;
    justify-content: space-evenly;
}

.main-nav ul li {
    position: relative; /* For submenu positioning */
}

.main-nav ul li a {
    color: white;
    text-decoration: none;
    padding: 1rem 1.5rem; /* Increased padding for richer feel */
    display: block;
    transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition */
    font-size: 1rem; /* Font property */
    text-transform: uppercase; /* Text transformation */
    letter-spacing: 0.5px; /* Text property */
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    background-color: #5cb85c;
    color: #fff;
}

/* Submenu Styles (Secondary Navigation) */
.main-nav ul .submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #444; /* Slightly different background for submenu */
    min-width: 200px; /* Richer width */
    z-index: 1000;
    padding: 0; /* Remove padding from ul */
    border-top: 3px solid #5cb85c; /* Accent border */
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); /* Box shadow for depth */
}

.main-nav ul li:hover > .submenu { /* Display on hover of parent li */
    display: block;
}

.main-nav ul .submenu li {
    width: 100%; /* Full width list items */
}

.main-nav ul .submenu li a {
    padding: 0.8rem 1.2rem; /* Padding for submenu items */
    color: #eee; /* Lighter text color for submenu */
    font-size: 0.9rem; /* Font property */
    text-transform: none; /* Normal text case */
    border-bottom: 1px solid #555; /* Separator */
}

.main-nav ul .submenu li:last-child a {
    border-bottom: none; /* No border for the last item */
}

.main-nav ul .submenu li a:hover {
    background-color: #5cb85c;
    color: #fff;
}

/* 1. 主内容区网格布局 (核心) */
.index-main {
    display: grid;
    /* 定义一个两列网格：主内容区占2份，侧边栏占1份 */
    grid-template-columns: 2fr 1fr;
    gap: 2rem; /* 列之间的间距 */
    padding: 2rem;
    max-width: 1400px; /* <-- 修改：保持之前的宽度调整 */
    margin: 0 auto;
}

/* 2. 通用内容模块/小部件样式 */
.content-module {
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden; /* 隐藏内部溢出的内容 */
    margin-bottom: 1.5rem; /* 增加模块之间的垂直间距 */
}

.module-header {
    padding: 0.8rem 1.5rem; /* 增加 header 的左右内边距 */
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-header .title {
    font-size: 1.2rem;
    color: #343a40;
    font-weight: 600;
    margin: 0;
}

.module-header .more-link {
    font-size: 0.9rem;
    color: #6c757d;
    text-decoration: none;
}
.module-header .more-link:hover {
    color: #5cb85c;
}

.module-body {
    padding: 1rem 1.5rem; /* 增加 body 的左右内边距 */
}

/* 3. 主内容区特定模块样式 */

/* 顶部头条区域 */
.hero-section {
    grid-column: 1 / 2; /* 占据第一列 */
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem; /* 增加 hero section 的内边距 */
    align-items: flex-start;
}
.hero-image {
    width: 200px;
    height: auto;
    flex-shrink: 0;
    border-radius: 6px;
}
.hero-content h2 {
    margin: 0 0 0.75rem 0; /* 稍微增加标题的下边距 */
    font-size: 1.7rem; /* 稍微减小标题字号 */
    line-height: 1.4;
}
.hero-content h2 a {
    color: #333;
    text-decoration: none;
}
.hero-content h2 a:hover {
    color: #5cb85c;
}
.hero-content .summary {
    color: #666;
    margin-bottom: 1.2rem; /* 增加摘要的下边距 */
}
.hero-content .links-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.hero-content .links-list li {
    margin-bottom: 0.6rem;
    font-size: 1rem;
}
.hero-content .links-list li a {
    color: #495057;
    text-decoration: none;
}
.hero-content .links-list li a:hover {
    text-decoration: underline;
}

/* 新增的博客文章列表项样式 */
.blog-list-item {
    grid-column: 1 / 2;
}

.blog-item-content {
    padding: 1.5rem;
}

.blog-item-content h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.blog-item-content h3 a {
    color: #333;
    text-decoration: none;
}

.blog-item-content h3 a:hover {
    color: #5cb85c;
}

.blog-item-content .blog-summary {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.blog-item-content .blog-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1rem;
}

.blog-item-content .blog-links li a {
    color: #007bff;
    text-decoration: none;
    font-size: 0.95rem;
}

.blog-item-content .blog-links li a:hover {
    text-decoration: underline;
}

/* 热点话题模块 */
.hot-topics .module-body {
    display: flex;
    gap: 1rem;
    align-items: center; /* 垂直居中图片和列表 */
}
.hot-topics .topic-image {
    width: 100px; /* 稍微缩小图片尺寸 */
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.hot-topics .topic-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}
.hot-topics .topic-list li {
    margin-bottom: 0.4rem;
}

/* 4. 侧边栏特定模块样式 */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem; /* 侧边栏模块之间的间距 */
}

/* 专家专栏模块 */
.expert-column .expert-item {
    display: flex;
    flex-direction: column;
    padding-bottom: 1rem; /* 增加底部内边距 */
    margin-bottom: 1rem; /* 增加底部外边距 */
    border-bottom: 1px dashed #ced4da;
}
.expert-column .expert-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}
.expert-column .expert-item h4 {
    margin: 0 0 0.5rem 0; /* 增加标题的下边距 */
    font-size: 1.1rem;
    line-height: 1.5;
}
.expert-column .expert-item h4 a {
    color: #333;
    text-decoration: none;
}
.expert-column .expert-item h4 a:hover {
    color: #5cb85c;
}
.expert-column .expert-item p {
    margin: 0;
    font-size: 0.9rem;
    color: #888;
}

/* 食品安全公开课 */
.food-safety .module-body {
    display: flex; /* 使图片和文字可以更好地排列 */
    align-items: center; /* 垂直居中对齐 */
    padding: 1.5rem;
}
.food-safety .author-pic {
    width: 70px; /* 稍微缩小图片 */
    height: 70px;
    border-radius: 50%;
    margin-right: 1rem;
    flex-shrink: 0; /* 防止图片被压缩 */
}
.food-safety h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.15rem;
}
.food-safety .module-body p {
    line-height: 1.7;
    margin-top: 0;
    font-size: 0.9rem;
    color: #555;
}
.food-safety .more-link {
    display: block; /* 使其占据一行 */
    margin-top: 1rem;
    text-align: right;
    font-size: 0.9rem;
}