:root {
    --primary: #4CAF50;
    --primary-dark: #2E7D32;
    --primary-light: #8BC34A;
    --accent: #FF9800;
    --accent-dark: #F57C00;
    --text-dark: #333;
    --text-medium: #555;
    --text-light: #777;
    --white: #fff;
    --light-bg: #f9f9f9;
    --light-border: #eaeaea;
    --card-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

a{
    text-decoration: none;
    color: var(--primary-dark);
}

a:hover{
    color: var(--primary);
    text-decoration: underline;
}

ul li{
    list-style: none;
}



body {
    font-family: 'Noto Serif SC', serif;
    color: var(--text-dark);
    line-height: 1.7;
    background-color: #f5f9f5;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23f5f9f5"/><path d="M0,50 Q25,30 50,50 T100,50" stroke="%23e8f5e9" fill="none" stroke-width="1"/></svg>');

}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

th, td {
    border: 1px solid #ccc; /* 单元格边框 */
    padding: 10px; /* 单元格内边距，避免内容贴边 */
    text-align: center;
}
/* 表头居中对齐 */
th {
    text-align: center;
    background-color: #f5f5f5;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    letter-spacing: 2px;
}

.logo i {
    margin-right: 10px;
    color: #FFEB3B;
}

.search-container {
    flex: 1;
    max-width: 600px;
    margin: 0 20px;
    position: relative;
}

#global-search {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 5px;
    background: var(--accent);
    border: none;
    color: white;
    padding: 7px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: var(--accent-dark);
}

/* 导航样式 */
nav {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    border-top: 1px solid var(--light-border);
    border-bottom: 1px solid var(--light-border);
}

.nav-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.nav-link {
    padding: 15px 25px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-dark);
}

.nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--primary);
    transition: all 0.3s;
    transform: translateX(-50%);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 80%;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 8px 15px;
    border-radius: 4px;
    color: var(--text-light);
    border: 1px solid var(--border-color);
    transition: all 0.3s;
}

.pagination li {
    display: inline-block;
    margin: 0 5px;
    border-radius: 4px;
    color: var(--white);
}

.pagination a:hover,
.pagination li.active {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.pagination li.active span{
    color: var(--white);
}

.pagination .prev,
.pagination .next {
    padding: 8px 12px;
}

.pagination .ellipsis {
    border: none;
}

/* 主内容区 */
.main-content {
    display: flex;
    margin: 30px 0;
}

.content-area {
    flex: 1;
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 30px;
    margin-right: 20px;
    max-width: 860px;
}

.sidebar {
    width: 300px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    padding: 25px;
    align-self: flex-start;
}


/* 通用内容块样式 */
.section-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-light);
    position: relative;
}

.section-header::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100px;
    height: 2px;
    background: var(--accent);
}

.section-title {
    font-size: 1.8rem;
    color: var(--primary-dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.section-title i {
    margin-right: 12px;
    color: var(--accent);
}

.section-subtitle {
    color: var(--text-medium);
    font-size: 1.1rem;
    font-weight: 400;
}

/* 文章内容样式 */
.article-content{
    line-height: 1.8;
    font-size: 1.05rem;
}

.article-content p {
    margin-bottom: 20px;
    text-align: justify;
}

.article-content h2 {
    color: var(--primary-dark);
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.article-content h3 {
    color: var(--primary-dark);
    margin: 25px 0 15px;
}


/* 栏目特定样式 */
.herb-highlight {
    background: linear-gradient(to right, rgba(139, 195, 74, 0.1), transparent);
    border-left: 4px solid var(--primary);
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

.category-list {
    list-style: none;
}

.category-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--light-border);
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list a {
    color: var(--text-dark);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.3s;
}

.category-list a:hover {
    color: var(--primary);
}

.category-list a i {
    margin-right: 10px;
    color: var(--primary-light);
}

.page-content {
    line-height: 1.8;
}

.page-content h3 {
    color: var(--primary-dark);
    margin: 25px 0 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--light-border);
}

.page-content p {
    margin-bottom: 15px;
}

.herb-property {
    display: flex;
    margin-bottom: 10px;
}

.herb-property .label {
    width: 100px;
    font-weight: bold;
    color: var(--primary-dark);
}

/* 药方卡片 */
.prescription-card {
    background: #f8faf1;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e1e8d9;
}

.prescription-title {
    color: var(--primary-dark);
    font-size: 1.4rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.prescription-title i {
    margin-right: 10px;
    color: var(--accent);
}

.herb-list {
    display: flex;
    flex-wrap: wrap;
    margin: 15px 0;
}

.herb-list span {
    background: #e8f5e9;
    padding: 5px 12px;
    border-radius: 30px;
    margin: 0 8px 8px 0;
    font-size: 0.9rem;
}

/* 内容卡片样式 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.content-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid var(--light-border);
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    border-color: var(--primary-light);
}

.card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid var(--light-border);
}

.card-body {
    padding: 20px;
}

.card-title {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--primary-dark);
}

.card-desc {
    color: var(--text-medium);
    font-size: 1rem;
    margin-bottom: 15px;
    height: 60px;
    /* 隐藏超出容器的内容 */
    overflow: hidden;
    /* 多行文本的情况下，用省略号隐藏超出范围的文本 */
    text-overflow: ellipsis;
    /* 将对象作为弹性伸缩盒子模型显示 */
    display: -webkit-box;
    /* 设置或检索伸缩盒对象的子元素的排列方式 */
    -webkit-box-orient: vertical;
    /* 限制在一个块元素显示的文本的行数 */
    -webkit-line-clamp: 2;
}
.card-desc h2, .card-desc h3{
    font-size: 1rem;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-light);
    font-size: 0.85rem;
    border-top: 1px dashed var(--light-border);
    padding-top: 15px;
}

/* 页脚样式 */
footer {
    background: var(--primary-dark);
    color: white;
    padding: 50px 0 20px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
    font-weight: 600;
}

.footer-col h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--accent);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}

.footer-links a:hover {
    color: white;
}

.footer-links a i {
    margin-right: 10px;
    font-size: 0.9rem;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.15);
    color: #aaa;
    font-size: 0.9rem;
}

/* 面包屑导航 */
.breadcrumb {
    padding: 15px 0;
    margin-bottom: 20px;
    font-size: 0.95rem;
    color: var(--text-medium);
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }

    .content-area {
        margin-right: 0;
        margin-bottom: 30px;
    }

    .sidebar {
        width: 100%;
    }

    .header-container {
        flex-direction: column;
        text-align: center;
    }

    .search-container {
        margin: 15px 0;
        width: 100%;
    }
    .search-container input{
        font-size: 12px !important;
    }

    .logo a,.logo img{
        max-width: 100px !important;
        max-height: 40px !important
    }
    .logo span{
        font-size: 18px;
    }
    .pagination{
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding: 5px 0;
    }

    .nav-link {
        padding: 12px 15px;
        white-space: nowrap;
    }

    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }

    .section-title {
        font-size: 1.5rem;
    }
    .search-container input{
        font-size: 12px !important;
    }
    .logo a,.logo img{
        max-width: 100px !important;
        max-height: 40px !important;
    }
    .logo span{
        font-size: 18px;
    }
    .pagination{
        flex-wrap: wrap;
        justify-content: center;
    }
}
