/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
select, option {
  appearance: none; /* 移除默认样式 */
  -webkit-appearance: none;
  -moz-appearance: none;
}
body {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    font-family: 'Microsoft YaHei', 'SimHei', sans-serif;
    position: relative;
    overflow-x: hidden;
}

/* 背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(218, 165, 32, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(218, 165, 32, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(255, 215, 0, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}
/* 中文缩进 */
.indent-chinese {
    text-indent: 2em;
}

/* 金色系变量 */
:root {
    --gold-primary: #DAA520;
    --gold-light: #FFD700;
    --gold-dark: #B8860B;
    --gold-gradient: linear-gradient(135deg, #FFD700 0%, #DAA520 50%, #B8860B 100%);
}

/* 玻璃态卡片 */
.glass-card {
    background: rgba(20, 20, 30, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(218, 165, 32, 0.2);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 215, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.05), transparent);
    transition: left 0.8s ease;
}

.glass-card:hover::before {
    left: 100%;
}

.glass-card:hover {
    border-color: rgba(218, 165, 32, 0.4);
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 215, 0, 0.15);
    /*transform: translateY(-2px);*/
}

/* 金色文字 */
.text-gold {
    color: var(--gold-primary);
    text-shadow: 0 0 20px rgba(218, 165, 32, 0.3);
    font-weight: 600;
}

/* 金色边框 */
.border-gold {
    border-color: rgba(218, 165, 32, 0.3) !important;
}

.border-gold:focus {
    border-color: var(--gold-primary) !important;
    box-shadow: 0 0 0 0.25rem rgba(218, 165, 32, 0.25) !important;
}

/* 表单控件 */
.form-select.is-valid:not([multiple]):not([size]), .form-select.is-valid:not([multiple])[size="1"], .was-validated .form-select:valid:not([multiple]):not([size]), .was-validated .form-select:valid:not([multiple])[size="1"]{
    padding-right: 2.25rem !important;
    background-position: right .75rem center, center right .75rem;
}
.form-select {
    --bs-form-select-bg-img: none !important;
    text-align: center;
}
.form-select, .form-control {
    font-size: small;
    background-color: rgba(30, 30, 40, 0.8) !important;
    border: 1px solid rgba(218, 165, 32, 0.3);
    color: #fff !important;
    border-radius: 10px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-select:hover, .form-control:hover {
    border-color: rgba(218, 165, 32, 0.5);
}

.form-select:focus, .form-control:focus {
    background-color: rgba(30, 30, 40, 0.9) !important;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 0.25rem rgba(218, 165, 32, 0.25);
    outline: none;
}

.form-select option {
    background-color: #1e1e28;
    color: #fff;
}

.form-label {
    font-weight: 500;
    margin-bottom: 8px;
}

/* 按钮样式 */
.btn-gold {
    background: var(--gold-gradient);
    border: none;
    color: #0a0a0a;
    font-weight: 600;
    border-radius: 12px;
    padding: 14px 24px;
    transition: all 0.3s ease;
    box-shadow: 
        0 4px 15px rgba(218, 165, 32, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-gold::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.btn-gold:hover::before {
    left: 100%;
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(218, 165, 32, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    color: #0a0a0a;
}

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

/* 金色轮廓按钮 */
.btn-outline-gold {
    border: 2px solid var(--gold-primary);
    color: var(--gold-primary);
    background: transparent;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.btn-outline-gold:hover, .btn-check:checked + .btn-outline-gold {
    background: var(--gold-gradient);
    color: #0a0a0a;
    border-color: var(--gold-primary);
    box-shadow: 0 4px 15px rgba(218, 165, 32, 0.3);
}

/* 按钮组 */
.btn-group .btn {
    margin: 0 4px;
    border-radius: 10px !important;
}

.btn-group .btn:first-child {
    border-top-right-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
}

.btn-group .btn:last-child {
    border-top-left-radius: 10px !important;
    border-bottom-left-radius: 10px !important;
}

/* 卦象卡片 */
.gua-card {
    background: rgba(30, 30, 40, 0.6);
    border: 1px solid rgba(218, 165, 32, 0.2);
    border-radius: 16px;
    padding: 24px 16px;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.gua-card:hover {
    border-color: rgba(218, 165, 32, 0.4);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.gua-card.highlight {
    background: rgba(218, 165, 32, 0.1);
    border-color: var(--gold-primary);
    box-shadow: 
        0 0 30px rgba(218, 165, 32, 0.2),
        inset 0 0 30px rgba(218, 165, 32, 0.05);
}

.gua-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gua-name {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold-primary);
    text-shadow: 0 0 20px rgba(218, 165, 32, 0.5);
}

/* 解释部分 */
.explanation-section {
    background: rgba(30, 30, 40, 0.5);
    border-radius: 12px;
    padding: 24px;
    border-left: 4px solid var(--gold-primary);
}

.explanation-content {
    line-height: 1.8;
    font-size: 1.05rem;
}

/* 详情卡片 */
.detail-card {
    text-align: center;
    background: rgba(30, 30, 40, 0.5);
    border: 1px solid rgba(218, 165, 32, 0.2);
    border-radius: 12px;
    padding: 20px;
    height: 100%;
    transition: all 0.3s ease;
}

.detail-card:hover {
    border-color: rgba(218, 165, 32, 0.4);
    background: rgba(30, 30, 40, 0.7);
}

/* 分割线 */
hr.border-gold {
    border-top: 1px solid rgba(218, 165, 32, 0.3);
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px 16px;
    }
    
    .glass-card .card-body {
        padding: 30px 20px !important;
    }
    
    h1.display-4 {
        font-size: 2.5rem;
    }
    
    .gua-name {
        font-size: 1.5rem;
    }
    
    .row.g-4 {
        gap: 16px;
    }
    
    .btn-group .btn {
        padding: 12px 24px;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .form-select, .form-control {
        padding: 14px 16px;
        min-height: 48px;
        font-size: 1rem;
    }
    
    .btn-gold {
        padding: 16px 24px;
        min-height: 56px;
        font-size: 1.1rem;
    }
    
    .btn-outline-gold {
        padding: 12px 20px;
        min-height: 48px;
    }
}

@media (max-width: 576px) {
    h1.display-4 {
        font-size: 2rem;
    }
    
    .glass-card .card-body {
        padding: 24px 16px !important;
    }
    
    .gua-card {
        padding: 20px 12px;
        min-height: 100px;
    }
    
    .gua-name {
        font-size: 1.3rem;
    }
    
    .explanation-section {
        padding: 16px;
    }
    
    .row.g-4 {
        gap: 12px;
    }
    
    .detail-card {
        padding: 16px;
    }
    
    .accordion-button {
        padding: 16px;
        font-size: 1rem;
        min-height: 56px;
    }
    
    .accordion-body {
        padding: 16px;
        font-size: 0.95rem;
    }
    
    /* 确保输入框在移动端不会被缩放 */
    input, select, textarea {
        font-size: 16px !important;
    }
}

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

#resultCard.show {
    display: block !important;
    animation: fadeInUp 0.6s ease forwards;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a1a2e;
}

::-webkit-scrollbar-thumb {
    background: var(--gold-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-light);
}

/* 选择聚焦动画 */
.form-select:focus, .form-control:focus {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0.25rem rgba(218, 165, 32, 0.25);
    }
    70% {
        box-shadow: 0 0 0 0.4rem rgba(218, 165, 32, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(218, 165, 32, 0);
    }
}

/* 手风琴样式 */
.accordion-item {
    background: rgba(30, 30, 40, 0.6) !important;
    border: 1px solid rgba(218, 165, 32, 0.2) !important;
    border-radius: 12px !important;
    margin-bottom: 12px;
    overflow: hidden;
}

.accordion-item:last-child {
    margin-bottom: 0;
}

.accordion-button {
    background: rgba(30, 30, 40, 0.6) !important;
    color: var(--gold-primary) !important;
    font-weight: 600 !important;
    padding: 16px 20px !important;
    border: none !important;
    box-shadow: none !important;
    transition: all 0.3s ease;
}

.accordion-button:hover {
    background: rgba(30, 30, 40, 0.8) !important;
}

.accordion-button:not(.collapsed) {
    background: rgba(218, 165, 32, 0.1) !important;
    color: var(--gold-primary) !important;
    border-bottom: 1px solid rgba(218, 165, 32, 0.2) !important;
}

.accordion-button::after {
    filter: invert(70%) sepia(70%) saturate(500%) hue-rotate(10deg) brightness(90%) contrast(90%);
}

.accordion-body {
    background: rgba(20, 20, 30, 0.5) !important;
    padding: 20px !important;
    line-height: 1.8;
}