/* 紫微斗数网站样式 */
:root {
    --primary-color: #4e2a84;
    /* 紫微主题色 */
    --secondary-color: #7b2cbf;
    --accent-color: #9d4edd;
    --light-color: #e0b1cb;
    --lighter-color: #f1e8ff;
    --dark-color: #3c096c;
    --text-color: #333;
    --light-text: #fff;
    --border-color: #ddd;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Microsoft YaHei', 'SimSun', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f8f5ff;
    font-size: 16px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

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

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

.header {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    color: var(--light-text);
    padding: 20px 0;
    box-shadow: var(--box-shadow);
    position: relative;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.nav ul {
    display: flex;
    list-style: none;
}

.nav ul li {
    margin-left: 30px;
}

.nav ul li a {
    color: var(--light-text);
    padding: 5px 10px;
    border-radius: 4px;
    transition: var(--transition);
}

.nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.hero {
    background: url('https://pic.616pic.com/bg_w1180/00/04/85/WlAoXzSXLx.jpg') no-repeat center center;
    background-size: cover;
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--light-text);
    text-align: center;
    margin-bottom: 40px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 0 20px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 10px 25px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

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

.btn-light:hover {
    background-color: var(--lighter-color);
}

.form-section {
    background-color: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
}

.form-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: var(--dark-color);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 5px rgba(78, 42, 132, 0.3);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.form-col {
    flex: 1;
    padding: 0 10px;
    min-width: 200px;
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-label input {
    margin-right: 5px;
}

.intro-section {
    background-color: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
}

.intro-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

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

.result-section {
    display: none;
    background-color: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
}

.result-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-align: center;
}

.result-block {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.result-block:last-child {
    border-bottom: none;
}

.result-block h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .result-grid {
        grid-template-columns: 1fr;
    }
}

.result-item {
    background-color: var(--lighter-color);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.result-item h4 {
    color: var(--dark-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.chart-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    table-layout: fixed;
}

.chart-table td {
    border: 2px solid var(--primary-color);
    padding: 15px;
    text-align: center;
    vertical-align: top;
    position: relative;
    height: 120px;
    background-color: var(--lighter-color);
}

.chart-table .gong-name {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.chart-table .gong-zhi {
    position: absolute;
    top: 5px;
    right: 5px;
    color: var(--dark-color);
    font-weight: bold;
}

.chart-table .gong-stars {
    font-size: 0.9rem;
    color: var(--text-color);
}

.loading {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.almanac-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
}

.almanac-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-align: center;
}

.almanac-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

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

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

.almanac-item {
    margin-bottom: 15px;
}

.almanac-item h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.almanac-date {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.almanac-tip {
    background-color: var(--lighter-color);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
    margin-bottom: 20px;
}

.almanac-list {
    list-style: none;
}

.almanac-list li {
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
}

.almanac-list li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.footer {
    background-color: var(--dark-color);
    color: var(--light-text);
    padding: 40px 0 20px;
    text-align: center;
}

.footer-content {
    margin-bottom: 30px;
}

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

.footer p {
    margin-bottom: 10px;
}

.copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.beian {
    margin: 10px 0 0 0;
    font-size: 0.95rem;
}

.beian a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: underline;
    transition: color 0.2s;
}

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

.friend-links {
    margin: 18px 0 0 0;
    font-size: 0.95rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px 18px;
    line-height: 1.8;
}

.friend-links span {
    color: rgba(255, 255, 255, 0.7);
    margin-right: 8px;
}

.friend-links a {
    color: rgba(255, 255, 255, 0.7);
    padding: 0 4px;
    border-radius: 2px;
    transition: color 0.2s, background 0.2s;
    font-size: 0.95rem;
}

.friend-links a:hover {
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.08);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .logo {
        font-size: 1.8rem;
    }

    .nav ul li {
        margin-left: 15px;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .form-col {
        flex: 0 0 100%;
        margin-bottom: 15px;
    }
}

/* 特色功能区域 */
.features-section {
    background-color: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
}

.features-section h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.8rem;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-item {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    background-color: var(--lighter-color);
    transition: var(--transition);
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

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

.feature-item p {
    color: var(--text-color);
    line-height: 1.6;
}

/* 服务优势区域 */
.advantages-section {
    background-color: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
}

.advantages-section h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.8rem;
    text-align: center;
}

.advantages-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.advantage-left h3,
.advantage-right h3 {
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.advantage-left p,
.advantage-right p {
    margin-bottom: 20px;
    line-height: 1.6;
}

/* 使用指南区域 */
.guide-section {
    background-color: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
}

.guide-section h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.8rem;
    text-align: center;
}

.guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.step-item {
    text-align: center;
    padding: 20px;
    border-radius: 8px;
    background-color: var(--lighter-color);
    position: relative;
}

.step-number {
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--light-text);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0 auto 15px;
}

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

.step-item p {
    color: var(--text-color);
    line-height: 1.6;
}

/* 常见问题区域 */
.faq-section {
    background-color: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
}

.faq-section h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.8rem;
    text-align: center;
}

.faq-list {
    display: grid;
    gap: 20px;
}

.faq-item {
    padding: 20px;
    border-radius: 8px;
    background-color: var(--lighter-color);
    border-left: 4px solid var(--accent-color);
}

.faq-item h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.faq-item p {
    color: var(--text-color);
    line-height: 1.6;
}

/* 相关工具区域 */
.tools-section {
    background-color: #fff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    margin-bottom: 40px;
}

.tools-section h2 {
    color: var(--primary-color);
    margin-bottom: 30px;
    font-size: 1.8rem;
    text-align: center;
}

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

.tool-item {
    display: block;
    padding: 20px;
    border-radius: 8px;
    background-color: var(--lighter-color);
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
    text-align: center;
}

.tool-item:hover {
    background-color: var(--accent-color);
    color: var(--light-text);
    transform: translateY(-3px);
}

.tool-item h3 {
    color: inherit;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.tool-item p {
    font-size: 0.9rem;
    opacity: 0.8;
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
    }

    .logo {
        margin-bottom: 15px;
    }

    .nav ul {
        justify-content: center;
    }

    .nav ul li {
        margin: 0 10px;
    }

    .hero {
        height: 300px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .form-section,
    .intro-section,
    .result-section,
    .almanac-section,
    .features-section,
    .advantages-section,
    .guide-section,
    .faq-section,
    .tools-section {
        padding: 30px 20px;
    }

    .advantages-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .features-grid,
    .guide-steps,
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .nav ul {
        flex-wrap: wrap;
    }

    .nav ul li {
        margin: 5px;
    }

    .hero {
        height: 250px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }
}