/* 全局样式 */
@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;
}

/* 友情链接样式 */
.friendly-links {
    background: linear-gradient(135deg, rgba(207, 10, 44, 0.05), rgba(142, 29, 24, 0.05));
    border: 1px solid rgba(218, 165, 32, 0.3);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.links-grid a {
    display: block;
    padding: 12px 15px;
    background-color: rgba(255, 255, 255, 0.8);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid rgba(218, 165, 32, 0.2);
    transition: all 0.3s ease;
    font-size: 0.95rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.links-grid a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(207, 10, 44, 0.1), transparent);
    transition: left 0.5s ease;
}

.links-grid a:hover {
    background-color: rgba(207, 10, 44, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(207, 10, 44, 0.2);
    color: var(--primary-color);
}

.links-grid a:hover::before {
    left: 100%;
}

.links-grid a:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(207, 10, 44, 0.2);
}

/* 备案号样式 */
.beian-info {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 6px;
    border: 1px dashed var(--border-color);
    text-align: center;
}

.beian-info a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.beian-info a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.beian-info a:hover {
    color: var(--accent-color);
}

.beian-info a:hover::after {
    width: 100%;
}

/* 响应式友情链接 */
@media (max-width: 768px) {
    .links-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }

    .links-grid a {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .beian-info {
        margin-top: 15px;
        padding: 12px;
    }
}

/* 八字合婚特色服务样式 */
.bazi-features {
    background: linear-gradient(135deg, rgba(207, 10, 44, 0.03), rgba(142, 29, 24, 0.03));
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.feature-card {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 10px;
    border: 1px solid rgba(218, 165, 32, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(207, 10, 44, 0.15);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    display: block;
}

.feature-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--accent-color);
}

.feature-card p {
    margin-bottom: 15px;
    line-height: 1.6;
    color: var(--text-color);
}

.feature-card ul {
    list-style: none;
    padding: 0;
}

.feature-card li {
    padding: 5px 0;
    position: relative;
    padding-left: 20px;
    color: var(--text-color);
}

.feature-card li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* 八字合婚知识样式 */
.bazi-knowledge {
    background: linear-gradient(135deg, rgba(142, 29, 24, 0.03), rgba(207, 10, 44, 0.03));
}

.knowledge-content {
    margin-top: 25px;
}

.knowledge-item {
    margin-bottom: 30px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(218, 165, 32, 0.2);
}

.knowledge-item h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--accent-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.knowledge-item p {
    line-height: 1.7;
    margin-bottom: 15px;
    text-align: justify;
}

.elements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.element {
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.element h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.element p {
    font-size: 0.95rem;
    line-height: 1.5;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tip {
    padding: 18px;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(218, 165, 32, 0.3);
    transition: all 0.3s ease;
}

.tip:hover {
    background-color: rgba(207, 10, 44, 0.05);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.tip h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.tip p {
    font-size: 0.95rem;
    line-height: 1.6;
}

/* 选择我们的优势样式 */
.bazi-advantages {
    background: linear-gradient(135deg, rgba(207, 10, 44, 0.02), rgba(142, 29, 24, 0.02));
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.advantage-card {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(218, 165, 32, 0.2);
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.advantage-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

.advantage-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(207, 10, 44, 0.1);
}

.advantage-card:hover::after {
    width: 80%;
}

.advantage-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    display: block;
}

.advantage-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--accent-color);
}

.advantage-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
}

/* 响应式设计补充 */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .elements-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .tips-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .advantages-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }

    .feature-card,
    .knowledge-item,
    .advantage-card {
        padding: 15px;
    }

    .feature-icon,
    .advantage-icon {
        font-size: 2rem;
    }
}