/* 天干地支关系页面样式 */

.relation-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* 页面标题 */
.page-header {
    text-align: center;
    margin-bottom: 60px;
    padding: 40px 0;
}

.page-header h1 {
    font-size: 2.8em;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.page-header .subtitle {
    font-size: 1.15em;
    color: #666;
    font-weight: 400;
}

/* 介绍区域 */
.intro-section {
    background: #ffffff;
    border-radius: 24px;
    padding: 48px;
    margin-bottom: 60px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}

.intro-content {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.intro-title {
    font-size: 2.2em;
    font-weight: 700;
    margin-bottom: 24px;
    color: #1a1a1a;
}

.intro-text {
    font-size: 1.1em;
    line-height: 1.9;
    margin-bottom: 20px;
    color: #555;
}

/* 关系分组区域 */
.relation-section {
    margin-bottom: 60px;
}

.section-header {
    margin-bottom: 32px;
}

.section-title {
    font-size: 2em;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-icon {
    font-size: 1.2em;
}

.section-desc {
    font-size: 1.05em;
    color: #666;
    line-height: 1.7;
}

/* 关系卡片网格 */
.relation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.relation-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 28px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.relation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4caf50, #2196f3, #f44336, #ff9800, #00bcd4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.relation-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    border-color: transparent;
}

.relation-card:hover::before {
    opacity: 1;
}

.relation-card:hover .item-badge {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.relation-card:hover .item-icon {
    transform: rotate(10deg) scale(1.1);
}

/* 卡片头部 */
.card-header {
    margin-bottom: 20px;
}

.relation-name {
    font-size: 1.6em;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.relation-items {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.item-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.1em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid currentColor;
    transition: all 0.3s ease;
}

.item-badge.gan {
    /* 背景色由具体天干颜色决定 */
}

.item-badge.zhi {
    /* 背景色由具体地支颜色决定 */
}

.item-icon {
    font-size: 1.2em;
    display: inline-block;
}

.item-wuxing {
    font-size: 0.75em;
    opacity: 0.8;
    font-weight: 500;
}

.relation-symbol {
    font-size: 1.2em;
    color: #666;
    font-weight: 600;
}

.relation-symbol.chong {
    color: #f44336;
}

.relation-symbol.xing {
    color: #ff9800;
}

.relation-symbol.hai {
    color: #9c27b0;
}

.relation-symbol.po {
    color: #607d8b;
}

.wuxing-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.85em;
    font-weight: 600;
    color: #fff;
    margin-top: 8px;
}

.wuxing-badge[data-wuxing="木"] {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
}

.wuxing-badge[data-wuxing="火"] {
    background: linear-gradient(135deg, #f44336 0%, #c62828 100%);
}

.wuxing-badge[data-wuxing="土"] {
    background: linear-gradient(135deg, #ff9800 0%, #e65100 100%);
}

.wuxing-badge[data-wuxing="金"] {
    background: linear-gradient(135deg, #2196f3 0%, #1565c0 100%);
}

.wuxing-badge[data-wuxing="水"] {
    background: linear-gradient(135deg, #00bcd4 0%, #00838f 100%);
}

/* 卡片内容 */
.card-body {
    flex: 1;
    margin-bottom: 20px;
}

.relation-description {
    font-size: 0.95em;
    line-height: 1.7;
    color: #666;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

/* 卡片底部 */
.card-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.card-link-text {
    color: #666;
    font-size: 0.9em;
    font-weight: 500;
    transition: color 0.3s ease;
}

.relation-card:hover .card-link-text {
    color: #2196f3;
}

/* 不同关系类型的卡片样式 */
.relation-card.relation-chong {
    border-left: 4px solid #f44336;
}

.relation-card.relation-xing {
    border-left: 4px solid #ff9800;
}

.relation-card.relation-hai {
    border-left: 4px solid #9c27b0;
}

.relation-card.relation-po {
    border-left: 4px solid #607d8b;
}

.relation-card.relation-sanhe {
    border-left: 4px solid #2196f3;
}

.relation-card.relation-sanhui {
    border-left: 4px solid #4caf50;
}

/* 详情页面样式 */
.detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: #666;
    text-decoration: none;
    font-size: 0.95em;
    margin-bottom: 32px;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #2196f3;
}

.detail-header {
    background: #ffffff;
    border-radius: 24px;
    padding: 48px;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 32px;
}

.header-info {
    flex: 1;
}

/* 合的结果 - 紧凑版本（放在header右侧） */
.header-he-result {
    flex-shrink: 0;
    width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
    border-radius: 16px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.he-result-compact-title {
    font-size: 1.2em;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
    text-align: center;
}

.he-result-compact {
    width: 100%;
    max-width: 280px;
    margin-bottom: 16px;
}

.he-chart-compact {
    width: 100%;
    height: auto;
    animation: chartFadeIn 1s ease-in;
}

.he-item-circle-compact {
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.he-item-group:hover .he-item-circle-compact {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transform: scale(1.1);
}

.he-item-text-compact {
    font-family: 'Microsoft YaHei', sans-serif;
    pointer-events: none;
}

.he-item-wuxing-compact {
    font-family: 'Microsoft YaHei', sans-serif;
    pointer-events: none;
}

.he-result-circle-compact {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
    animation: resultGlow 2s ease-in-out infinite;
}

.he-result-text-compact {
    font-family: 'Microsoft YaHei', sans-serif;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.he-result-wuxing-compact {
    font-family: 'Microsoft YaHei', sans-serif;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.he-result-compact-info {
    text-align: center;
    width: 100%;
}

.he-result-compact-desc {
    font-size: 0.95em;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

.he-result-compact-desc strong {
    font-size: 1.1em;
    color: #1a1a1a;
    font-weight: 700;
}

.relation-type-badge {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 24px;
    font-size: 1em;
    font-weight: 600;
    margin-bottom: 16px;
}

.relation-type-badge[data-relation-type="he"] {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    color: #fff;
}

.relation-type-badge[data-relation-type="chong"] {
    background: linear-gradient(135deg, #f44336 0%, #c62828 100%);
    color: #fff;
}

.relation-type-badge[data-relation-type="xing"] {
    background: linear-gradient(135deg, #ff9800 0%, #e65100 100%);
    color: #fff;
}

.relation-type-badge[data-relation-type="hai"] {
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
    color: #fff;
}

.relation-type-badge[data-relation-type="po"] {
    background: linear-gradient(135deg, #607d8b 0%, #455a64 100%);
    color: #fff;
}

.relation-type-badge[data-relation-type="sanhe"] {
    background: linear-gradient(135deg, #2196f3 0%, #1565c0 100%);
    color: #fff;
}

.relation-type-badge[data-relation-type="sanhui"] {
    background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    color: #fff;
}

.detail-title {
    font-size: 3em;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 24px;
    line-height: 1.2;
}

.header-items {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.item-badge-large {
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 1.5em;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    border: 3px solid currentColor;
    transition: all 0.3s ease;
}

.item-badge-large.gan {
    /* 颜色由具体天干决定 */
}

.item-badge-large.zhi {
    /* 颜色由具体地支决定 */
}

.item-icon-large {
    font-size: 1.3em;
    display: inline-block;
}

.item-wuxing-large {
    font-size: 0.6em;
    opacity: 0.8;
    font-weight: 600;
    margin-left: 4px;
}

.relation-symbol-large {
    font-size: 2em;
    color: #666;
    font-weight: 600;
}

.relation-symbol-large[data-relation-type="chong"] {
    color: #f44336;
}

.relation-symbol-large[data-relation-type="xing"] {
    color: #ff9800;
}

.relation-symbol-large[data-relation-type="hai"] {
    color: #9c27b0;
}

.relation-symbol-large[data-relation-type="po"] {
    color: #607d8b;
}

.header-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.type-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    background: linear-gradient(135deg, #9e9e9e 0%, #616161 100%);
    color: #fff;
}

.wuxing-badge-large {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    color: #fff;
}

.strength-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    background: linear-gradient(135deg, #ffd54f 0%, #ffb300 100%);
    color: #1a1a1a;
}

.info-section {
    background: #ffffff;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
}

.section-title {
    font-size: 1.8em;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.section-content {
    color: #555;
    line-height: 1.9;
}

.description-text {
    font-size: 1.05em;
    color: #333;
    line-height: 1.8;
    margin: 0;
}

/* 合的结果动画部分 */
.he-result-section {
    margin-top: 0;
}

.he-animation-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.he-chart-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 600px;
    padding: 40px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9));
    border-radius: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.he-chart {
    width: 100%;
    max-width: 400px;
    height: auto;
    animation: chartFadeIn 1s ease-in;
}

@keyframes chartFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.he-item-group {
    animation: itemFadeIn 1s ease-in forwards;
    opacity: 0;
}

@keyframes itemFadeIn {
    to {
        opacity: 1;
    }
}

.he-item-group:nth-child(1) {
    animation-delay: 0.2s;
}

.he-item-group:nth-child(2) {
    animation-delay: 0.4s;
}

.he-item-group:nth-child(3) {
    animation-delay: 0.6s;
}

.he-item-circle {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.he-item-group:hover .he-item-circle {
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3));
    transform: scale(1.15);
}

.he-item-text {
    font-family: 'Microsoft YaHei', sans-serif;
    pointer-events: none;
}

.he-item-wuxing {
    font-family: 'Microsoft YaHei', sans-serif;
    pointer-events: none;
}

.he-merge-line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: lineDraw 2s ease-in-out forwards;
}

@keyframes lineDraw {
    to {
        stroke-dashoffset: 0;
    }
}

.he-merge-line:nth-of-type(1) {
    animation-delay: 0.8s;
}

.he-merge-line:nth-of-type(2) {
    animation-delay: 1s;
}

.he-merge-line:nth-of-type(3) {
    animation-delay: 1.2s;
}

.he-result-group {
    animation: resultPulse 2s ease-in-out infinite;
    opacity: 0;
    animation-fill-mode: forwards;
    animation-delay: 1.5s;
}

@keyframes resultPulse {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.he-result-circle {
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.3));
    animation: resultGlow 2s ease-in-out infinite;
}

@keyframes resultGlow {
    0%, 100% {
        filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.3));
    }
    50% {
        filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
    }
}

.he-result-text {
    font-family: 'Microsoft YaHei', sans-serif;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.he-result-wuxing {
    font-family: 'Microsoft YaHei', sans-serif;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.he-rotate-dot {
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% {
        opacity: 0.4;
    }
    50% {
        opacity: 0.8;
    }
}

.he-result-info {
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.he-result-text-info {
    padding: 24px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.05), rgba(33, 150, 243, 0.05));
    border-radius: 16px;
    border: 2px solid rgba(76, 175, 80, 0.2);
}

.he-result-title {
    font-size: 1.8em;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.he-result-desc {
    font-size: 1.05em;
    line-height: 1.8;
    color: #555;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .relation-container {
        padding: 20px 16px 60px;
    }
    
    .page-header h1 {
        font-size: 2em;
    }
    
    .page-header .subtitle {
        font-size: 1em;
    }
    
    .intro-section {
        padding: 32px 24px;
    }
    
    .intro-title {
        font-size: 1.6em;
    }
    
    .relation-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .relation-card {
        padding: 24px 20px;
    }
    
    .detail-container {
        padding: 20px 16px 60px;
    }
    
    .detail-header {
        padding: 32px 24px;
    }
    
    .detail-title {
        font-size: 2em;
    }
    
    .header-items {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-main {
        flex-direction: column;
        gap: 24px;
    }
    
    .header-he-result {
        width: 100%;
        max-width: 100%;
    }
    
    .he-result-compact {
        max-width: 100%;
    }
    
    .info-section {
        padding: 24px 20px;
    }
    
    .section-title {
        font-size: 1.4em;
    }
}

/* 关系卡片基本样式（无动画） */

.relation-card.relation-he {
    border-left: 4px solid #4caf50;
}

.relation-card.relation-chong::after {
    display: none;
}

.relation-card.relation-po::after {
    display: none;
}

.relation-card .relation-items .item-badge {
    transition: all 0.3s ease;
}

.relation-card.relation-hai .relation-items .item-badge {
    transition: filter 0.3s ease;
}

.relation-card.relation-hai:hover .relation-items .item-badge {
    filter: brightness(0.95);
}

