/* 全局样式 */
:root {
    --primary-color: #e74c3c;
    --secondary-color: #f39c12;
    --text-color: #333;
    --light-color: #f8f9fa;
    --border-color: #e0e0e0;
    --success-color: #2ecc71;
    --info-color: #3498db;
    --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f5f5;
    background-image: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    padding: 0;
    margin: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.lunar-info {
    color: #666;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-top: 10px;
}

/* 每日名言 */
.daily-quote {
    margin-top: 15px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    font-style: italic;
    color: #555;
}

.daily-quote blockquote {
    position: relative;
    padding: 0 15px;
}

.daily-quote blockquote::before,
.daily-quote blockquote::after {
    content: '"';
    font-size: 1.5rem;
    color: var(--secondary-color);
}

.daily-quote blockquote::after {
    content: '"';
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.8rem;
}

.card h3 {
    color: var(--secondary-color);
    margin: 15px 0 10px;
    font-size: 1.3rem;
    border-left: 4px solid var(--secondary-color);
    padding-left: 10px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.2);
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
    width: 100%;
}

.btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

/* 结果样式 */
.result-card {
    border-top: 5px solid var(--success-color);
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.score-number {
    font-size: 2.5rem;
    font-weight: bold;
    line-height: 1;
}

.score-text {
    font-size: 1rem;
}

.result-details {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
}

.detail-row {
    display: flex;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-color);
}

.detail-row .label {
    width: 25%;
    font-weight: bold;
    color: #555;
}

.detail-row .value {
    width: 75%;
}

.meaning,
.personality,
.career {
    line-height: 1.8;
    margin-bottom: 15px;
    text-align: justify;
    color: #444;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background-color: white;
}

table caption {
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--primary-color);
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
    color: var(--text-color);
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #f1f1f1;
}

.total-row {
    font-weight: bold;
    background-color: #f0f0f0;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #eee;
    border-radius: 5px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    border-radius: 5px;
}

/* 三才五格样式 */
.wuge-info {
    margin: 15px 0;
}

.wuge-table td.吉 {
    color: var(--success-color);
}

.wuge-table td.次吉 {
    color: var(--warning-color);
}

.wuge-table td.凶 {
    color: var(--danger-color);
}

.san-cai-analysis {
    margin: 15px 0;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 4px;
    border-left: 4px solid var(--info-color);
}

.san-cai-level {
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 3px;
    color: white;
}

.上等 {
    background-color: var(--success-color);
}

.中上等 {
    background-color: #27ae60;
}

.中等 {
    background-color: var(--warning-color);
}

.中下等 {
    background-color: #e67e22;
}

.下等 {
    background-color: var(--danger-color);
}

/* 音律分析样式 */
.phonetics-info {
    margin: 15px 0;
}

.pinyin-display,
.tone-display {
    margin-bottom: 10px;
    font-size: 1.1em;
}

.phonetics-evaluation {
    margin: 15px 0;
    padding: 10px;
    background-color: #f0f8ff;
    border-radius: 4px;
    border-left: 4px solid var(--info-color);
    line-height: 1.6;
}

/* 日历信息样式 */
.calendar-info {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
}

/* 两列布局 */
.two-column-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.info-section,
.knowledge-section {
    flex: 1;
    min-width: 300px;
}

/* 知识内容样式 */
.knowledge-content {
    text-align: justify;
    line-height: 1.7;
}

.tips-list {
    list-style-position: inside;
    margin: 15px 0;
}

.tips-list li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.tips-list li::before {
    content: "•";
    color: var(--secondary-color);
    font-weight: bold;
    position: absolute;
    left: 0;
}

.random-fact {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff8e1;
    border-radius: 4px;
    border-left: 4px solid var(--warning-color);
}

.random-fact h3 {
    color: var(--warning-color);
    border-left: none;
    padding-left: 0;
    margin-top: 0;
}

/* 热门姓名和推荐名字 */
.popular-table,
.recommend-table {
    font-size: 1em;
    margin-bottom: 20px;
}

.popular-table th,
.recommend-table th {
    text-align: center;
}

.popular-table td:first-child {
    text-align: center;
    font-weight: bold;
}

.recommend-category {
    margin: 15px 0 10px;
    padding: 5px 10px;
    color: white;
    border-radius: 4px;
    font-size: 1.1em;
}

.recommend-category:first-of-type {
    background-color: #3498db;
    margin-top: 0;
}

.recommend-category:nth-of-type(2) {
    background-color: #e74c3c;
}

.name-meaning {
    font-size: 0.9em;
    color: #666;
}

/* 文章预览 */
.article-preview {
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
}

.article-preview h3 {
    color: var(--text-color);
    margin-top: 0;
    font-size: 1.3em;
    margin-bottom: 10px;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #777;
}

.article-meta span {
    margin-right: 15px;
    display: inline-flex;
    align-items: center;
}

.article-date::before {
    content: "\f073";
    font-family: 'FontAwesome', sans-serif;
    margin-right: 5px;
}

.article-author::before {
    content: "\f007";
    font-family: 'FontAwesome', sans-serif;
    margin-right: 5px;
}

.article-category::before {
    content: "\f02b";
    font-family: 'FontAwesome', sans-serif;
    margin-right: 5px;
}

.article-summary {
    line-height: 1.7;
    color: #444;
    text-align: justify;
    margin-bottom: 15px;
    font-size: 1.05em;
}

.article-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.article-note {
    color: #888;
    font-size: 0.9em;
    font-style: italic;
    flex: 1;
}

.read-more {
    text-align: right;
}

.read-more a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.read-more a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 30px 20px;
    color: #777;
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
    background-color: #f8f8f8;
}

footer p {
    margin-bottom: 10px;
}

/* 备案信息样式 */
.beian-info {
    margin: 15px 0;
}

.beian-info a {
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    padding: 3px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-color: #f5f5f5;
    transition: all 0.3s ease;
}

.beian-info a:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: #fff;
}

/* 友情链接样式 */
.friendly-links {
    margin: 20px 0;
    padding: 20px 0;
    border-top: 1px dashed #ddd;
    border-bottom: 1px dashed #ddd;
    text-align: left;
}

.friendly-links h3 {
    text-align: center;
    color: #555;
    margin-bottom: 20px;
    font-size: 1.2rem;
    position: relative;
}

.friendly-links h3:after {
    content: "";
    display: block;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.links-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 20px;
}

.links-category {
    flex: 1;
    min-width: 160px;
}

.links-category h4 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

.links-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.links-category li {
    margin-bottom: 8px;
}

.links-category a {
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
    display: inline-block;
    padding: 2px 0;
}

.links-category a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .card {
        padding: 15px;
    }

    .score-circle {
        width: 100px;
        height: 100px;
    }

    .detail-row {
        flex-direction: column;
    }

    .detail-row .label,
    .detail-row .value {
        width: 100%;
    }

    .detail-row .label {
        margin-bottom: 5px;
    }

    .two-column-layout {
        flex-direction: column;
        gap: 15px;
    }

    table {
        font-size: 0.9em;
    }

    th,
    td {
        padding: 8px 10px;
    }

    .form-section,
    .result-section,
    .info-section,
    .knowledge-section {
        padding: 0;
    }

    .links-container {
        flex-direction: column;
        gap: 15px;
    }

    .links-category {
        width: 100%;
    }

    .friendly-links h3 {
        font-size: 1.1rem;
    }

    .links-category h4 {
        font-size: 0.95rem;
    }
}

/* 动画效果 */
.result-section {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 自动更新内容的样式 */
.update-content {
    position: relative;
    animation: pulse 2s infinite;
    padding-left: 20px;
}

.update-content::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes pulse {
    0% {
        background-color: rgba(231, 76, 60, 0.05);
    }

    50% {
        background-color: rgba(231, 76, 60, 0);
    }

    100% {
        background-color: rgba(231, 76, 60, 0.05);
    }
}

/* 打印样式 */
@media print {
    body {
        background: white;
        font-size: 12pt;
    }

    .container {
        max-width: 100%;
        box-shadow: none;
    }

    .form-section,
    .info-section:not(.result-info),
    .knowledge-section,
    .popular-section,
    .article-section {
        display: none;
    }

    header,
    footer {
        text-align: center;
        border: none;
        padding: 0;
        margin: 0.5cm 0;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        margin: 0;
        padding: 0;
    }

    .score-circle {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}