/* H5 Mobile Optimization */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea, button {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

body {
    font-family: 'Arial', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa726 16%, #ffeb3b 32%, #4caf50 48%, #26c6da 64%, #42a5f5 80%, #ab47bc 100%);
    min-height: 100vh;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* H5 Safe Area Support */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

/* WeChat Browser Specific Styles */
.wechat-browser body {
    /* WeChat browser specific adjustments */
    -webkit-overflow-scrolling: touch;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.wechat-browser .container {
    /* Adjust for WeChat's navigation bar */
    padding-top: 20px;
    padding-bottom: 20px;
}

.wechat-browser header {
    /* WeChat browser header adjustments */
    margin-bottom: 15px;
}

.wechat-browser .input-section {
    /* WeChat input optimizations */
    margin-bottom: 20px;
}

.wechat-browser input[type="text"],
.wechat-browser input[type="number"],
.wechat-browser input[type="date"],
.wechat-browser input[type="time"] {
    /* WeChat input styling */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    padding: 8px 12px;
    width: 100%;
    box-sizing: border-box;
}

.wechat-browser .btn {
    /* WeChat button optimizations */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.wechat-browser .btn:active {
    background: #0056b3;
    transform: scale(0.98);
}

/* WeChat Share Button */
.wechat-share-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    background: #07c160;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    display: none;
}

.wechat-browser .wechat-share-btn {
    display: block;
}

.wechat-browser .wechat-share-btn:active {
    transform: scale(0.95);
}

/* WeChat Loading Indicator */
.wechat-loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 8px;
    z-index: 9999;
    display: none;
}

.wechat-browser .wechat-loading.show {
    display: block;
}

/* WeChat Toast Messages */
.wechat-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wechat-toast.show {
    opacity: 1;
}

/* WeChat Browser Table Optimizations */
.wechat-browser .birth-calculation-table {
    /* WeChat specific table optimizations */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.wechat-browser .birth-calculation-table::-webkit-scrollbar {
    display: none;
}

.wechat-browser .triangle-container {
    /* WeChat specific triangle optimizations */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.wechat-browser .triangle-point {
    /* WeChat specific point optimizations */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.wechat-browser .birth-info-table {
    /* WeChat specific spacing */
    gap: 12px;
    margin: 12px 0;
}

.wechat-browser .birth-table {
    /* WeChat specific padding */
    padding: 12px;
    margin: 8px 0;
}

.wechat-browser .tree-diagram {
    /* WeChat specific padding */
    padding: 18px 12px;
    margin: 12px 0;
}

/* H5 Touch Optimization */
.btn, button, input[type="button"], input[type="submit"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.btn:active, button:active, input[type="button"]:active, input[type="submit"]:active {
    transform: scale(0.98);
}

/* H5 Input Optimization */
input[type="text"], input[type="number"], input[type="date"], input[type="time"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: 4px;
    font-size: 16px; /* Prevent zoom on iOS */
}

/* H5 Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* H5 Pull to Refresh */
.pull-to-refresh {
    position: fixed;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.1);
    color: white;
    padding: 10px 20px;
    border-radius: 0 0 10px 10px;
    transition: top 0.3s ease;
    z-index: 1000;
}

.pull-to-refresh.show {
    top: 0;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    background: linear-gradient(45deg, #ff6b6b, #ffa726, #ffeb3b, #4caf50, #26c6da, #42a5f5, #ab47bc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    font-weight: bold;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.input-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

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

.age-reminder {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #f39c12;
    border-radius: 8px;
    padding: 10px 15px;
    margin-bottom: 15px;
    text-align: center;
}

.age-reminder p {
    margin: 0;
    color: #856404;
    font-weight: 500;
    font-size: 0.9em;
}

.age-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 1px solid #dc3545;
    border-radius: 8px;
    padding: 15px 20px;
    margin: 20px 0;
    text-align: center;
}

.age-error p {
    margin: 0 0 10px 0;
    color: #721c24;
    font-weight: 500;
    font-size: 1em;
}

.swap-button {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.swap-button:hover {
    background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.person-input h3 {
    background: linear-gradient(45deg, #ff6b6b, #ffa726, #ffeb3b, #4caf50, #26c6da, #42a5f5, #ab47bc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(45deg, #ff6b6b, #ffa726, #ffeb3b, #4caf50, #26c6da, #42a5f5, #ab47bc) 1;
    padding-bottom: 10px;
    font-weight: bold;
}

.input-group {
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.input-group input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.input-group input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.date-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.date-inputs input {
    flex: 1;
    text-align: center;
    font-weight: bold;
    min-width: 50px;
}

.date-inputs input:first-child {
    flex: 1.5; /* Year field is wider */
}

.date-inputs input::placeholder {
    color: #999;
    font-weight: normal;
}


.generate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa726 16%, #ffeb3b 32%, #4caf50 48%, #26c6da 64%, #42a5f5 80%, #ab47bc 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    margin-top: 20px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.results-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.person-results {
    margin-bottom: 40px;
}

.person-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa726 16%, #ffeb3b 32%, #4caf50 48%, #26c6da 64%, #42a5f5 80%, #ab47bc 100%);
    color: white;
    border-radius: 10px;
}

.person-header h2 {
    font-size: 1.8em;
    margin-bottom: 10px;
}

.birth-info {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.birth-date {
    text-align: center;
}

.birth-date h4 {
    margin-bottom: 5px;
    color: #667eea;
}

.numbers-table {
    margin: 20px 0;
    overflow-x: auto;
}

.numbers-table table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.numbers-table th,
.numbers-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    font-size: 14px;
}

.numbers-table th {
    background: #f8f9fa;
    font-weight: bold;
}

.tree-diagram {
    margin: 30px 0;
    text-align: center;
}

.tree-node {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border: 2px solid #333;
    border-radius: 50%;
    margin: 5px;
    font-weight: bold;
    background: white;
    position: relative;
}

.tree-node.highlight-green {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.tree-node.highlight-red {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

.tree-level {
    margin: 20px 0;
}

.tree-level::after {
    content: '';
    display: block;
    clear: both;
}

.number-row {
    margin: 15px 0;
    text-align: center;
}

.number-item {
    display: inline-block;
    padding: 8px 12px;
    margin: 3px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: white;
    font-weight: bold;
}

.number-item.highlight-green {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.number-item.highlight-red {
    background: #f44336;
    color: white;
    border-color: #f44336;
}

.timeline-section {
    margin: 30px 0;
}

.timeline-title {
    text-align: center;
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #667eea;
}

.timeline-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.timeline-year {
    font-weight: bold;
    min-width: 80px;
}

.timeline-months {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.timeline-month {
    padding: 5px 10px;
    border-radius: 5px;
    background: white;
    border: 1px solid #ddd;
}

.annual-tables {
    margin: 30px 0;
}

.annual-table {
    margin: 20px 0;
    overflow-x: auto;
}

.annual-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.annual-table th,
.annual-table td {
    border: 1px solid #ddd;
    padding: 6px 4px;
    text-align: center;
}

.annual-table th {
    background: #f8f9fa;
    font-weight: bold;
    position: sticky;
    top: 0;
}

.annual-table tr:nth-child(even) {
    background: #f8f9fa;
}

.rainbow-results {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.rainbow-results h3 {
    text-align: center;
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.results-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.result-item h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.rainbow-number {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
    margin: 0;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .input-section {
        flex-direction: column;
        padding: 20px;
        gap: 20px;
    }
    
    .person-input {
        min-width: auto;
    }
    
    .birth-info {
        flex-direction: column;
    }
    
    .timeline-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .timeline-months {
        justify-content: center;
    }
    
    /* 表格移动端优化 */
    .numbers-table,
    .annual-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .numbers-table table,
    .annual-table {
        min-width: 600px;
        font-size: 12px;
    }
    
    .numbers-table th,
    .numbers-table td,
    .annual-table th,
    .annual-table td {
        padding: 6px 4px;
        font-size: 11px;
    }
    
    /* 关系网格移动端优化 */
    .relationship-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .square-with-edges {
        width: 280px;
        height: 280px;
    }
    
    .square-grid {
        width: 240px;
        height: 240px;
    }
    
    /* 信息网格移动端优化 */
    .info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* 时间线移动端优化 */
    .timeline-container {
        flex-direction: column;
        padding: 20px 10px;
    }
    
    .timeline-date {
        min-width: 120px;
    }
    
    /* 进度容器移动端优化 */
    .progression-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* 按钮移动端优化 */
    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* 输入框移动端优化 */
    input[type="text"],
    input[type="number"],
    select {
        padding: 12px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    header h1 {
        font-size: 2em;
    }
    
    header p {
        font-size: 1em;
    }
    
    .date-inputs {
        flex-direction: column;
        gap: 10px;
    }
    
    .date-inputs input {
        min-width: auto;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    .input-section {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.8em;
    }
    
    .numbers-table table,
    .annual-table {
        min-width: 500px;
        font-size: 10px;
    }
    
    .numbers-table th,
    .numbers-table td,
    .annual-table th,
    .annual-table td {
        padding: 4px 2px;
        font-size: 10px;
    }
    
    .square-with-edges {
        width: 250px;
        height: 250px;
    }
    
    .square-grid {
        width: 210px;
        height: 210px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    input[type="text"],
    input[type="number"],
    select {
        padding: 10px;
        font-size: 14px;
    }
    
    /* 出生信息表格超小屏幕优化 */
    .birth-calculation-table {
        font-size: 10px;
    }
    
    .birth-calculation-table th,
    .birth-calculation-table td {
        padding: 4px 2px;
        font-size: 9px;
        min-width: 40px;
    }
    
    .birth-calculation-table .label-cell {
        min-width: 50px !important;
        font-size: 9px;
        padding: 4px 2px !important;
    }
    
    .birth-table {
        padding: 10px;
        margin: 8px 0;
    }
    
    .table-header h4 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    /* 九年生命周期超小屏幕优化 */
    .tree-diagram {
        padding: 15px 10px;
        margin: 10px 0;
    }
    
    .tree-diagram h3 {
        font-size: 1.2em;
        margin-bottom: 12px;
    }
    
    .triangle-container {
        max-width: 300px;
        height: 250px;
    }
    
    .triangle-point {
        width: 40px;
        height: 40px;
        font-size: 8px;
    }
    
    .number-display {
        font-size: 8px;
        line-height: 1.0;
    }
    
    .positive,
    .negative {
        font-size: 10px;
    }
}

/* 横屏优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .timeline-container {
        flex-direction: row;
        padding: 15px 10px;
    }
    
    .timeline-date {
        min-width: 100px;
    }
    
    .relationship-grid {
        grid-template-columns: 1fr 2fr 1fr;
    }
    
    /* 九年生命周期横屏优化 */
    .triangle-container {
        max-width: 400px;
        height: 280px;
    }
    
    .triangle-point {
        width: 55px;
        height: 55px;
        font-size: 11px;
    }
    
    .number-display {
        font-size: 11px;
    }
    
    .positive,
    .negative {
        font-size: 13px;
    }
}

/* 移动端表格优化 */
@media (max-width: 768px) {
    /* 出生信息表格移动端优化 */
    .birth-calculation-table {
        font-size: 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        min-width: 100%;
    }
    
    .birth-calculation-table th,
    .birth-calculation-table td {
        padding: 8px 4px;
        font-size: 11px;
        white-space: nowrap;
        min-width: 50px;
    }
    
    .birth-calculation-table .label-cell {
        min-width: 60px !important;
        font-size: 10px;
        padding: 6px 4px !important;
    }
    
    /* 出生信息表格容器移动端优化 */
    .birth-info-table {
        gap: 15px;
        margin: 15px 0;
    }
    
    .birth-table {
        padding: 15px;
        margin: 10px 0;
    }
    
    .table-header h4 {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    /* 九年生命周期移动端优化 */
    .tree-diagram {
        padding: 20px 15px;
        margin: 15px 0;
    }
    
    .tree-diagram h3 {
        font-size: 1.3em;
        margin-bottom: 15px;
    }
    
    .triangle-container {
        width: 100%;
        max-width: 350px;
        height: 300px;
        margin: 0 auto;
    }
    
    .triangle-point {
        width: 50px;
        height: 50px;
        font-size: 10px;
    }
    
    .number-display {
        font-size: 10px;
        line-height: 1.1;
    }
    
    .positive,
    .negative {
        font-size: 12px;
    }
    
    /* 关系计算表格移动端优化 */
    .relationship-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .relationship-table table {
        min-width: 500px;
        font-size: 12px;
    }
    
    .relationship-table th,
    .relationship-table td {
        padding: 6px 4px;
        font-size: 11px;
    }
    
    /* 灵魂等级表格移动端优化 */
    .soul-level-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .soul-level-table table {
        min-width: 400px;
        font-size: 12px;
    }
    
    .soul-level-table th,
    .soul-level-table td {
        padding: 6px 4px;
        font-size: 11px;
    }
    
    /* 移动端滚动条优化 */
    .numbers-table::-webkit-scrollbar,
    .annual-table-container::-webkit-scrollbar,
    .relationship-table::-webkit-scrollbar,
    .soul-level-table::-webkit-scrollbar,
    .birth-calculation-table::-webkit-scrollbar {
        height: 8px;
    }
    
    .numbers-table::-webkit-scrollbar-track,
    .annual-table-container::-webkit-scrollbar-track,
    .relationship-table::-webkit-scrollbar-track,
    .soul-level-table::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .numbers-table::-webkit-scrollbar-thumb,
    .annual-table-container::-webkit-scrollbar-thumb,
    .relationship-table::-webkit-scrollbar-thumb,
    .soul-level-table::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, #ff6b6b 0%, #ffa726 16%, #ffeb3b 32%, #4caf50 48%, #26c6da 64%, #42a5f5 80%, #ab47bc 100%);
        border-radius: 4px;
    }
}

/* 移动端触摸优化 */
@media (max-width: 768px) {
    /* 增加触摸目标大小 */
    .btn,
    input[type="button"],
    input[type="submit"],
    button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 优化触摸滚动 */
    .timeline-container,
    .numbers-table,
    .annual-table-container {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* 移动端字体大小优化 */
    body {
        font-size: 14px;
        line-height: 1.5;
    }
    
    h1, h2, h3, h4, h5, h6 {
        line-height: 1.3;
    }
    
    /* 移动端间距优化 */
    .result-item,
    .detailed-birth-info,
    .annual-tables {
        margin: 15px 0;
        padding: 20px;
    }
    
    /* 移动端卡片优化 */
    .calendar-section {
        margin: 10px 0;
        padding: 15px;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .info-row .label {
        font-weight: bold;
        color: #667eea;
    }
    
    .info-row .value {
        color: #333;
    }
}

/* Detailed Birth Information Styles */
.detailed-birth-info {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.detailed-birth-info h3 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.calendar-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.calendar-section h4 {
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.2em;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    font-weight: bold;
    color: #555;
    min-width: 80px;
}

.info-row .value {
    color: #333;
    font-weight: 600;
}

/* Soul Level Styling */
.soul-level-1 { color: #dc3545; font-weight: bold; }
.soul-level-2 { color: #fd7e14; font-weight: bold; }
.soul-level-3 { color: #ffc107; font-weight: bold; }
.soul-level-4 { color: #20c997; font-weight: bold; }
.soul-level-5 { color: #0dcaf0; font-weight: bold; }
.soul-level-6 { color: #6f42c1; font-weight: bold; }
.soul-level-7 { color: #e83e8c; font-weight: bold; }

.soul-explanation {
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    font-size: 0.9em;
    line-height: 1.4;
}

.soul-explanation strong {
    color: #667eea;
}

.soul-explanation small {
    color: #6c757d;
}

/* Tree Diagram Styles */
.tree-diagram {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.tree-diagram h3 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
}

.triangle-container {
    position: relative;
    width: 400px;
    height: 350px;
    margin: 0 auto;
}

.triangle-point {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.triangle-point:hover {
    transform: scale(1.1);
}

.number-display {
    text-align: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    line-height: 1.2;
}

.positive {
    color: #2ecc71;
    font-size: 14px;
}

.negative {
    color: #e74c3c;
    font-size: 14px;
}

/* Current year indicator */
.current-year {
    border: 3px solid #f39c12 !important;
    background: rgba(243, 156, 18, 0.2) !important;
}

.current-indicator {
    color: #f39c12;
    font-size: 10px;
    font-weight: bold;
    margin-top: 2px;
}

/* Year marker between current and next year */
.year-marker {
    position: absolute;
    z-index: 10;
}

.marker-dot {
    width: 8px;
    height: 8px;
    background: #f39c12;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #f39c12;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(243, 156, 18, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(243, 156, 18, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(243, 156, 18, 0);
    }
}

/* Flow year marker line */
.flow-marker-line {
    position: absolute;
    height: 3px;
    background: linear-gradient(90deg, #f39c12, #e67e22);
    z-index: 5;
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(243, 156, 18, 0.5);
}

.flow-marker-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #f39c12;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 0 0 3px #f39c12, 0 0 15px rgba(243, 156, 18, 0.8);
    z-index: 10;
    animation: pulse 2s infinite;
}

/* Triangle point positions - now using dynamic positioning */

/* Triangle connecting lines */
.triangle-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.triangle-lines::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 200px solid transparent;
    border-right: 200px solid transparent;
    border-bottom: 300px solid rgba(102, 126, 234, 0.1);
}

/* Chronological Progression Styles */
.chronological-progression {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.chronological-progression h3 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
}

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

.year-section {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.year-section h4 {
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.1em;
}

.months-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.month-section {
    background: white;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.month-section h5 {
    color: #495057;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.month-numbers {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.number-cell {
    background: #667eea;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
}

.number-cell.highlight-green {
    background: #28a745;
}

/* Annual Tables Styles */
.annual-tables {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.annual-tables h3 {
    background: linear-gradient(45deg, #ff6b6b, #ffa726, #ffeb3b, #4caf50, #26c6da, #42a5f5, #ab47bc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
    font-weight: bold;
}

.annual-table-section {
    margin-bottom: 30px;
}

.annual-table-container {
    overflow-x: auto;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    background: white;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.annual-table-container::-webkit-scrollbar {
    height: 10px;
}

.annual-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 5px;
}

.annual-table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa726 16%, #ffeb3b 32%, #4caf50 48%, #26c6da 64%, #42a5f5 80%, #ab47bc 100%);
    border-radius: 5px;
}

.annual-table-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff9800 16%, #ffc107 32%, #4caf50 48%, #00bcd4 64%, #2196f3 80%, #9c27b0 100%);
}

.annual-table-section h4 {
    background: linear-gradient(45deg, #ff6b6b, #ffa726, #ffeb3b, #4caf50, #26c6da, #42a5f5, #ab47bc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
}

.annual-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    min-width: 100%;
    max-width: 100%;
    border: 1px solid rgba(102, 126, 234, 0.1);
    table-layout: fixed;
}

.annual-table th {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa726 16%, #ffeb3b 32%, #4caf50 48%, #26c6da 64%, #42a5f5 80%, #ab47bc 100%);
    color: white;
    padding: 8px 4px;
    text-align: center;
    font-weight: bold;
    font-size: 10px;
    border: none;
    width: auto;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    word-wrap: break-word;
    overflow: hidden;
}

.annual-table td {
    padding: 6px 4px;
    text-align: center;
    border: 1px solid #e9ecef;
    font-size: 9px;
    width: auto;
    transition: all 0.3s ease;
    word-wrap: break-word;
    overflow: hidden;
}

/* Style for the first column (岁次, 年份, 阳历, 阴历) */
.annual-table td:first-child,
.annual-table th:first-child {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: bold;
    width: 60px;
    position: sticky;
    left: 0;
    z-index: 10;
    background: linear-gradient(45deg, #ff6b6b, #ffa726, #ffeb3b, #4caf50, #26c6da, #42a5f5, #ab47bc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    border-right: 3px solid transparent;
    border-image: linear-gradient(45deg, #ff6b6b, #ffa726, #ffeb3b, #4caf50, #26c6da, #42a5f5, #ab47bc) 1;
}

.annual-table tbody tr:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.annual-table tbody tr:nth-child(even) {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.annual-table tbody tr:nth-child(odd) {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

/* Current year highlighting */
.current-year-cell {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%) !important;
    color: white !important;
    font-weight: bold !important;
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
    animation: currentYearPulse 2s infinite;
}

@keyframes currentYearPulse {
    0% {
        box-shadow: 0 0 5px rgba(243, 156, 18, 0.5);
    }
    50% {
        box-shadow: 0 0 15px rgba(243, 156, 18, 0.8);
    }
    100% {
        box-shadow: 0 0 5px rgba(243, 156, 18, 0.5);
    }
}

/* Relationship Chart Styles */
.relationship-chart {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.relationship-chart h3 {
    color: #667eea;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.5em;
}

.relationship-analysis {
    margin-top: 20px;
}

.relationship-grid {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 30px;
    align-items: center;
}

.person-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.person-info h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.person-numbers {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.number-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.number-item .label {
    font-weight: bold;
    color: #666;
}

.number-item .value {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1em;
}

.compatibility-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.compatibility-info h4 {
    margin-bottom: 20px;
    font-size: 1.3em;
}

.compatibility-item {
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.compatibility-item .label {
    display: block;
    font-size: 0.9em;
    margin-bottom: 5px;
    opacity: 0.9;
}

.compatibility-item .value {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 5px;
}

.compatibility-item .description {
    display: block;
    font-size: 0.9em;
    opacity: 0.8;
}

/* Compatibility level colors */
.value.excellent {
    color: #2ecc71;
}

.value.very-good {
    color: #27ae60;
}

.value.good {
    color: #f39c12;
}

.value.moderate {
    color: #e67e22;
}

.value.fair {
    color: #e74c3c;
}

.value.challenging {
    color: #c0392b;
}

/* Main Life Relationship Square Styles */
.main-life-relationship-square {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.main-life-relationship-square h4 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.relationship-square-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.square-with-edges {
    position: relative;
    width: 350px;
    height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.square-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    width: 300px;
    height: 300px;
    position: relative;
}

.edge-number {
    position: absolute;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2em;
    font-weight: bold;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
    z-index: 10;
}

.edge-number.top-edge {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.edge-number.bottom-edge {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.edge-number.left-edge {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.edge-number.right-edge {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* Relationship Timeline Styles */
.relationship-timeline {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.relationship-timeline h3 {
    color: #667eea;
    margin-bottom: 30px;
    text-align: center;
    font-size: 1.5em;
}

.timeline-container {
    display: flex;
    flex-direction: row;
    gap: 0;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    padding: 30px 20px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa726 16%, #ffeb3b 32%, #4caf50 48%, #26c6da 64%, #42a5f5 80%, #ab47bc 100%);
    border-radius: 20px;
    margin: 20px 0;
    overflow-x: auto;
    position: relative;
    box-shadow: 0 10px 30px rgba(255, 107, 107, 0.3);
    min-width: 100%;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0.3) 100%);
    transform: translateY(-50%);
    z-index: 1;
}

.timeline-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    min-width: 140px;
    z-index: 2;
}

.timeline-date:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 4px;
    background: linear-gradient(90deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.4) 100%);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.date-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 3;
}

.date-marker .marker-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid #667eea;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.date-marker .marker-dot:hover {
    transform: scale(1.2);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.date-marker.person1 .marker-dot {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    border-color: #2ecc71;
}

.date-marker.person2 .marker-dot {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border-color: #e74c3c;
}

.date-marker.current-date .marker-dot {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border-color: #f39c12;
    animation: currentYearPulse 2s infinite;
    box-shadow: 0 4px 20px rgba(243, 156, 18, 0.6);
}

.date-marker .date-label {
    font-size: 1em;
    font-weight: 700;
    text-align: center;
    color: #ffffff;
    line-height: 1.2;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 12px;
    border-radius: 12px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.date-marker .date-label:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.timeline-relationship-square {
    margin: 0 15px;
    padding: 15px;
    transform: scale(0.7);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.timeline-relationship-square:hover {
    transform: scale(0.75);
    box-shadow: 0 12px 35px rgba(0,0,0,0.2);
    border-color: rgba(102, 126, 234, 0.4);
}

.timeline-relationship-square h4 {
    font-size: 1em;
    margin-bottom: 12px;
    color: #2c3e50;
    font-weight: 600;
    text-align: center;
}

.timeline-relationship-square .square-with-edges {
    width: 200px;
    height: 200px;
}

.timeline-relationship-square .square-grid {
    width: 160px;
    height: 160px;
}

.timeline-relationship-square .square-cell {
    padding: 8px;
}

.timeline-relationship-square .square-cell .positive,
.timeline-relationship-square .square-cell .negative {
    font-size: 1.2em;
}

.timeline-relationship-square .square-cell .person-label {
    font-size: 0.6em;
}

.timeline-relationship-square .edge-number {
    width: 30px;
    height: 30px;
    font-size: 1em;
}

.timeline-relationship-square.current-period {
    border: 3px solid #f39c12;
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.5);
    animation: currentYearPulse 2s infinite;
}

.year-label {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1em;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
    z-index: 10;
    position: relative;
}

.year-label.current-year {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    animation: currentYearPulse 2s infinite;
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.5);
}

.timeline-year .main-life-relationship-square {
    margin: 0;
    padding: 20px;
    transform: scale(0.8);
}

.timeline-year .square-with-edges {
    width: 280px;
    height: 280px;
}

.timeline-year .square-grid {
    width: 240px;
    height: 240px;
}

.square-cell {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #667eea;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.square-cell .number-display {
    margin-bottom: 10px;
}

.square-cell .positive {
    color: #2ecc71;
    font-size: 1.5em;
    font-weight: bold;
}

.square-cell .negative {
    color: #e74c3c;
    font-size: 1.5em;
    font-weight: bold;
}

.square-cell .person-label {
    font-size: 0.8em;
    color: #666;
    text-align: center;
    line-height: 1.2;
}


/* Responsive Design */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .progression-container {
        grid-template-columns: 1fr;
    }
    
    .tree-level {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .tree-number {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .annual-table {
        font-size: 8px;
        min-width: 100%;
    }
    
    .annual-table th,
    .annual-table td {
        padding: 3px 2px;
        width: auto;
    }
    
    .annual-table th:first-child,
    .annual-table td:first-child {
        width: 50px;
    }
    
    .annual-table-container {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    
    .annual-table-container::-webkit-scrollbar {
        height: 8px;
    }
    
    .annual-table-container::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .annual-table-container::-webkit-scrollbar-thumb {
        background: linear-gradient(135deg, #ff6b6b 0%, #ffa726 16%, #ffeb3b 32%, #4caf50 48%, #26c6da 64%, #42a5f5 80%, #ab47bc 100%);
        border-radius: 4px;
    }
    
    .annual-table-container::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(135deg, #ff5252 0%, #ff9800 16%, #ffc107 32%, #4caf50 48%, #00bcd4 64%, #2196f3 80%, #9c27b0 100%);
    }
}

/* Birth Info Table Styles */
.birth-info-table {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin: 20px 0;
}

.birth-table {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.table-header h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.birth-calculation-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    font-size: 14px;
}

.birth-calculation-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #ddd;
    min-width: 60px;
}

.birth-calculation-table td {
    padding: 10px 8px;
    text-align: center;
    border: 1px solid #ddd;
    background: white;
    min-width: 60px;
}

.birth-calculation-table tr:nth-child(even) td {
    background: #f8f9fa;
}

.label-cell {
    background: #e9ecef !important;
    font-weight: 600;
    color: #495057;
    text-align: left !important;
    padding-left: 15px !important;
    min-width: 80px !important;
}

.date-cell {
    font-weight: 600;
    color: #2c3e50;
}

.post-heaven-cell {
    color: #e74c3c;
    font-weight: 600;
}

.master-cell {
    color: #27ae60;
    font-weight: 600;
}

.soul-cell {
    font-weight: 700;
    font-size: 16px;
}

.soul-explanations {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.soul-explanations h5 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 16px;
}

.explanation-item {
    margin: 8px 0;
    font-size: 13px;
    line-height: 1.4;
}

.explanation-item strong {
    color: #495057;
}

/* Soul Level Color Coding */
.soul-level-1 { color: #e74c3c; }
.soul-level-2 { color: #f39c12; }
.soul-level-3 { color: #f1c40f; }
.soul-level-4 { color: #27ae60; }
.soul-level-5 { color: #3498db; }
.soul-level-6 { color: #9b59b6; }
.soul-level-7 { color: #e91e63; }

/* Two person layout styles */
.two-person-layout {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.birth-info-row,
.tree-diagram-row,
.annual-tables-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    width: 100%;
    overflow-x: auto;
}

.birth-info-row > *,
.tree-diagram-row > *,
.annual-tables-row > * {
    flex: 1;
    min-width: 0;
    max-width: 50%;
}

.relationship-chart-row,
.relationship-timeline-row {
    display: flex;
    justify-content: center;
    width: 100%;
}

.relationship-chart-row > *,
.relationship-timeline-row > * {
    max-width: 100%;
}

.relationship-chart {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.relationship-analysis {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 10px;
}

.relationship-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.relationship-title {
    text-align: center;
    color: #2c3e50;
    font-size: 1.5em;
    font-weight: 600;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #ff6b6b, #ffa726, #ffeb3b, #4caf50, #26c6da, #42a5f5, #ab47bc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive Design for Tables */
@media (max-width: 768px) {
    .two-person-layout {
        gap: 20px;
    }
    
    .birth-info-row,
    .tree-diagram-row,
    .annual-tables-row {
        flex-direction: column;
        gap: 15px;
        overflow-x: visible;
    }
    
    .birth-info-row > *,
    .tree-diagram-row > *,
    .annual-tables-row > * {
        flex: none;
        min-width: auto;
        max-width: 100%;
    }
    
    .birth-info-table {
        gap: 20px;
    }
    
    .birth-table {
        padding: 15px;
    }
    
    .birth-calculation-table {
        font-size: 12px;
    }
    
    .birth-calculation-table th,
    .birth-calculation-table td {
        padding: 8px 4px;
    }
    
    .soul-cell {
        font-size: 14px;
    }
    
    .soul-explanations {
        padding: 10px;
    }
    
    .explanation-item {
        font-size: 12px;
    }
}
