/* ========== 全局样式 ========== */
:root {
    --primary-color: #c41e3a;
    --primary-light: #e63946;
    --secondary-color: #2d1f1a;
    --accent-gold: #d4af37;
    --text-dark: #1a1a1a;
    --text-gray: #666;
    --bg-light: #faf8f5;
    --border-color: #e5ddd3;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
}

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

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'STHeiti', sans-serif;
    background: linear-gradient(135deg, #faf8f5 0%, #f5f1ec 100%);
    color: var(--text-dark);
    line-height: 1.8;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 装饰性背景图案 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(196, 30, 58, 0.03) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: float 20s ease-in-out infinite;
}

body::after {
    content: '';
    position: fixed;
    bottom: -30%;
    left: -5%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.04) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(5deg); }
    66% { transform: translate(-20px, 20px) rotate(-5deg); }
}

.container {
    position: relative;
    z-index: 1;
}

/* ========== 主标题区 ========== */
.main-header {
    text-align: center;
    padding: 60px 20px 40px;
    margin-bottom: 40px;
    position: relative;
}

.main-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

.main-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 16px;
    letter-spacing: 4px;
    position: relative;
    display: inline-block;
    animation: fadeInDown 0.8s ease-out;
}

.main-title::before,
.main-title::after {
    content: '◆';
    color: var(--primary-color);
    font-size: 23px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
}

.main-title::before {
    left: -40px;
}

.main-title::after {
    right: -40px;
}

.sub-title {
    font-size: 16px;
    color: var(--text-gray);
    margin-top: 20px;
    letter-spacing: 1px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* ========== 查询表单区 ========== */
.query-section {
    max-width: 650px;
    margin: 0 auto 50px;
    padding: 0 20px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.form-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-gold));
}

.form-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.form-label {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.form-row {
    margin-bottom: 24px;
}

.form-control {
    height: 48px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    padding: 8px 16px;
    transition: all 0.3s ease;
    background: var(--bg-light);
    color: var(--text-dark);
    font-weight: 500;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
    outline: none;
    background: white;
}

.form-control:hover {
    border-color: var(--primary-light);
}

.btn-primary {
    height: 48px;
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 2px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(196, 30, 58, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ========== 说明/结果区域 ========== */
.info-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px 60px;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.info-card {
    background: white;
    border-radius: 16px;
    padding: 36px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.info-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.info-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--primary-color);
}

.info-list {
    list-style: none;
    padding: 0;
}

.info-list li {
    margin-bottom: 28px;
    padding-left: 0;
    position: relative;
}

.info-list li:last-child {
    margin-bottom: 0;
}

.info-term {
    display: inline-block;
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    padding: 4px 12px;
    background: rgba(196, 30, 58, 0.08);
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.info-desc {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-gray);
    padding-left: 0;
    margin: 8px 0 0 0;
}

/* ========== 结果展示样式 ========== */
.result-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-gold), var(--primary-color));
}

.result-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 28px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.result-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--primary-color);
}

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

.result-item {
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.result-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-color);
}

.result-item-label {
    font-size: 13px;
    color: var(--text-gray);
    margin-bottom: 8px;
    font-weight: 500;
}

.result-item-value {
    font-size: 20px;
    color: var(--primary-color);
    font-weight: 700;
}

/* 八字显示 */
.bazi-display {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.bazi-pillar {
    text-align: center;
    padding: 24px 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    min-width: 100px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.bazi-pillar:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.pillar-label {
    font-size: 12px;
    color: var(--text-gray);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.pillar-chars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pillar-char {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1;
}

.pillar-char.heavenly {
    color: var(--primary-color);
}

.pillar-char.earthly {
    color: var(--accent-gold);
}

/* 五行显示 */
.wuxing-display {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    flex-wrap: wrap;
    gap: 20px;
}

.wuxing-item {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    min-width: 80px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.wuxing-item:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.wuxing-item.jin { 
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    border: 2px solid #d0d0d0;
}
.wuxing-item.mu { 
    background: linear-gradient(135deg, #c8e6c9, #a5d6a7);
    border: 2px solid #81c784;
}
.wuxing-item.shui { 
    background: linear-gradient(135deg, #b3e5fc, #81d4fa);
    border: 2px solid #4fc3f7;
}
.wuxing-item.huo { 
    background: linear-gradient(135deg, #ffccbc, #ffab91);
    border: 2px solid #ff8a65;
}
.wuxing-item.tu { 
    background: linear-gradient(135deg, #fff9c4, #fff59d);
    border: 2px solid #fff176;
}

.wuxing-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--secondary-color);
}

.wuxing-count {
    font-size: 11pt;
    font-weight: 700;
    color: var(--secondary-color);
}

/* 建议文本 */
.advice-text {
    font-size: 15px;
    line-height: 1.9;
    color: var(--text-dark);
    padding: 20px;
    background: var(--bg-light);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
}

.advice-text p {
    margin: 0;
}

.advice-text strong {
    color: var(--secondary-color);
    font-weight: 700;
}

.highlight {
    color: var(--primary-color);
    font-weight: 700;
    padding: 2px 6px;
    background: rgba(196, 30, 58, 0.08);
    border-radius: 4px;
}

.nword{
	text-decoration: none;
	padding: 6px 8px !important;
}


/* 页脚免责声明 */
.disclaimer {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 20px 24px;
    margin-top: 30px;
    box-shadow: var(--shadow-sm);
    font-size: 1.3rem;
    color: var(--text-secondary);
    text-align: center;
    animation: fadeIn 0.6s ease 0.5s both;
}

/* 页脚 */
.footer {
	text-align: center;
	padding: 20px 0;
	color: #595959;
	font-size: 0.9em;
	border-top: 1px solid #eee;
	margin-top: 58px;
	background: transparent;
	box-shadow: 0 0px 0px rgba(0,0,0,0);
}

.footer a {
	color: #595959;
}

/* 修正Bootstrap一些老的样式问题 */
.input-group-addon {
	border: 0;
	border-radius: 0 50px 50px 0;
}

/* ========== 动画效果 ========== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .main-title {
        font-size: 36px;
        letter-spacing: 2px;
    }
    
    .main-title::before,
    .main-title::after {
        display: none;
    }
    
    .sub-title {
        font-size: 14px;
    }
    
    .form-card {
        padding: 28px 20px;
    }
    
    .info-card,
    .result-card {
        padding: 24px 20px;
    }
    
    .form-control {
        height: 44px;
        font-size: 14px;
    }
    
    .btn-primary {
        height: 44px;
        font-size: 15px;
    }
    
    .info-title,
    .result-title {
        font-size: 20px;
    }
    
    .info-term {
        font-size: 15px;
    }
    
    .info-desc {
        font-size: 14px;
    }
    
    .bazi-display {
        gap: 15px;
    }
    
    .bazi-pillar {
        min-width: 58px;
        padding: 16px 12px;
    }
    
    .pillar-char {
        font-size: 24px;
    }
}

@media (max-width: 576px) {
    .main-header {
        padding: 40px 15px 30px;
    }
    
    .main-title {
        font-size: 28px;
    }
    
    .form-card {
        padding: 24px 16px;
        border-radius: 12px;
    }
    
    .col-xs-4 {
        margin-bottom: 8px;
    }
    
    .info-card,
    .result-card {
        padding: 20px 16px;
        border-radius: 12px;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .wuxing-display {
        gap: 10px;
    }
    
    .wuxing-item {
        padding: 15px;
    }
    
    .advice-text {
        font-size: 14px;
        padding: 15px;
    }
}

/* ========== 加载状态 ========== */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

.loading .btn-primary::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid white;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

/* ========== 可访问性优化 ========== */
.form-control:focus,
.btn-primary:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}