/* 全局样式 */
@import url('https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=Noto+Serif+SC:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #CF0A2C;
    --secondary-color: #E8CA9F;
    --text-color: #333;
    --background-color: #FEF6E9;
    --accent-color: #8E1D18;
    --border-color: #DAA520;
    --success-color: #3CB371;
    --wisdom-bg: rgba(142, 29, 24, 0.05);
    --almanac-bg: rgba(207, 10, 44, 0.03);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif SC', serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    background-image: url('https://www.transparenttextures.com/patterns/rice-paper.png');
}

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

/* 标题和头部 */
header {
    text-align: center;
    margin-bottom: 30px;
}

h1,
h2,
h3 {
    font-family: 'Ma Shan Zheng', cursive;
    color: var(--accent-color);
}

h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.subtitle {
    display: block;
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-top: 5px;
}

.banner {
    width: 100%;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

.banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.2));
    z-index: 1;
}

.banner img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.banner img:hover {
    transform: scale(1.02);
}

/* 内容部分 */
section {
    margin-bottom: 40px;
    background-color: #fff;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(218, 165, 32, 0.2);
    position: relative;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 8px 8px 0 0;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.intro p,
.explanation p {
    margin-bottom: 15px;
    text-align: justify;
}

/* 黄历样式 */
.almanac-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    background-color: var(--almanac-bg);
    padding: 20px;
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

.almanac-date {
    flex: 1;
    min-width: 250px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.almanac-date>div {
    margin-bottom: 10px;
    line-height: 1.5;
}

.solar-date,
.lunar-date,
.ganzhi {
    padding: 5px 0;
    border-bottom: 1px dotted #ddd;
}

.almanac-details {
    flex: 2;
    min-width: 300px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.yi-ji,
.direction,
.festival {
    flex: 1;
    min-width: 200px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.yi-ji p,
.direction p,
.festival p {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* 动态内容样式 */
.dynamic-content {
    background-color: var(--wisdom-bg);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid var(--accent-color);
}

.dynamic-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

/* 表单样式 */
.form-group {
    margin-bottom: 25px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

.form-group h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.input-group {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.input-group label {
    width: 100px;
    font-weight: 500;
}

.input-group input,
.input-group select {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'Noto Serif SC', serif;
}

.calculate-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 20px auto 0;
    padding: 12px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    font-family: 'Ma Shan Zheng', cursive;
}

.calculate-btn:hover {
    background-color: var(--accent-color);
}

/* 结果样式 */
.result-card {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.score-container {
    flex: 0 0 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.score-label {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent-color);
}

.details {
    flex: 1;
    min-width: 300px;
}

.details h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

#result-details {
    line-height: 1.8;
}

/* 解释部分 */
.explanation-content ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.explanation-content li {
    margin-bottom: 10px;
}

/* 页脚 */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    color: #666;
    font-size: 0.9rem;
}

.update-time {
    margin: 10px 0;
    font-style: italic;
}

.disclaimer {
    font-size: 0.8rem;
    max-width: 600px;
    margin: 0 auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1.2rem;
    }

    section {
        padding: 15px;
    }

    .input-group {
        flex-direction: column;
        align-items: flex-start;
    }

    .input-group label {
        width: 100%;
        margin-bottom: 5px;
    }

    .input-group input,
    .input-group select {
        width: 100%;
    }

    .score-container {
        flex: 0 0 100%;
        margin-bottom: 15px;
    }

    .details {
        flex: 0 0 100%;
    }

    .almanac-content {
        flex-direction: column;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dynamic-content,
.almanac-content {
    animation: fadeIn 1s ease;
}

/* 红色装饰元素 */
.decorator {
    position: absolute;
    width: 30px;
    height: 30px;
    background-color: var(--primary-color);
    opacity: 0.8;
    border-radius: 50%;
    z-index: -1;
}

/* 新增样式 - 婚姻配对方法详解部分 */
.methods-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.method-item {
    flex: 1;
    min-width: 300px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
    transition: transform 0.3s, box-shadow 0.3s;
}

.method-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.method-item h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px dotted var(--border-color);
}

.five-elements {
    list-style-type: none;
    margin: 15px 0;
}

.five-elements li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.element {
    display: inline-block;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    margin-right: 10px;
    color: white;
    text-align: center;
    line-height: 25px;
    font-weight: bold;
    font-size: 0.9em;
}

.element.metal {
    background-color: #d3d3d3;
}

.element.wood {
    background-color: #7fb37c;
}

.element.water {
    background-color: #6e7dab;
}

.element.fire {
    background-color: #e06666;
}

.element.earth {
    background-color: #d4a76a;
}

/* 新增样式 - FAQ部分 */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.faq-item {
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.faq-item h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    position: relative;
    padding-left: 20px;
}

.faq-item h3::before {
    content: '?';
    position: absolute;
    left: 0;
    color: var(--accent-color);
    font-weight: bold;
}

.faq-item p {
    margin-bottom: 10px;
    text-align: justify;
}

.faq-item ul,
.faq-item ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.faq-item li {
    margin-bottom: 8px;
}

/* 新增样式 - 案例分析部分 */
.case-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.case-intro {
    text-align: center;
    margin-bottom: 10px;
}

.case-item {
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px solid rgba(218, 165, 32, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.case-item h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px dotted var(--border-color);
}

.case-details {
    padding: 10px;
    background-color: var(--wisdom-bg);
    border-radius: 5px;
}

.case-details p {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* 新增样式 - 择日部分 */
.date-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.date-content>p {
    text-align: center;
    font-style: italic;
    margin-bottom: 10px;
}

.date-principles,
.date-tips {
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

.date-principles h3,
.date-tips h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center;
}

.date-principles ul,
.date-tips ol {
    margin-left: 20px;
}

.date-principles li,
.date-tips li {
    margin-bottom: 10px;
    line-height: 1.5;
}

/* 响应式调整 */
@media (max-width: 768px) {

    .method-item,
    .faq-item,
    .case-item,
    .date-principles,
    .date-tips {
        padding: 15px;
    }

    .methods-content,
    .faq-container,
    .case-container {
        gap: 15px;
    }

    .five-elements li {
        display: block;
        margin-bottom: 8px;
    }

    .element {
        margin-bottom: 5px;
    }
}

/* 备案信息样式 */
.icp-info {
    margin: 15px 0;
    font-size: 0.85rem;
}

.icp-info a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
    border-bottom: 1px dotted #999;
    padding-bottom: 2px;
}

.icp-info a:hover {
    color: var(--primary-color);
}

/* 友情链接样式 */
.friend-links {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-color);
}

.friend-links h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--accent-color);
    text-align: center;
}

.links-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
}

.links-container a {
    color: #666;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(218, 165, 32, 0.2);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.links-container a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 响应式友情链接 */
@media (max-width: 576px) {
    .links-container {
        gap: 10px;
    }

    .links-container a {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
}