/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "SimSun", "宋体", serif;
    background-color: #f5f2eb;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: rgba(255, 249, 240, 0.95);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #d4af37;
}

h1 {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 30px;
    color: #8b0000;
    padding-bottom: 15px;
    border-bottom: 2px solid #d4af37;
}

.intro-text {
    text-align: center;
    margin: 0 auto 30px;
    max-width: 800px;
    font-size: 1.1rem;
    color: #555;
    line-height: 1.8;
    padding: 15px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border-left: 4px solid #d4af37;
}

/* 桌面端选择区域 */
.selection-area.desktop {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    gap: 30px;
}

.selector {
    flex: 1;
    padding: 25px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e6dcc0;
}

.selector-title {
    font-size: 1.7rem;
    margin-bottom: 20px;
    color: #8b0000;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px dashed #d4af37;
}

.gua-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.gua-button {
    padding: 15px;
    font-size: 1.1rem;
    background-color: #fff9f0;
    border: 2px solid #d4af37;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gua-button:hover {
    background-color: #f0e6d2;
    box-shadow: 0 5px 10px rgba(212, 175, 55, 0.2);
}

.gua-button.selected {
    background-color: #d4af37;
    color: white;
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

.gua-symbol {
    font-size: 2.2rem;
    margin-bottom: 5px;
    color: #8b0000;
}

.gua-button.selected .gua-symbol {
    color: white;
}

.gua-description {
    font-size: 0.9rem;
    color: #666;
}

/* 移动端选择区域 */
.mobile-selector.mobile {
    display: none;
    margin-bottom: 30px;
}

.gua-select {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    border: 2px solid #d4af37;
    border-radius: 8px;
    background-color: #fff9f0;
    margin-bottom: 20px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238b0000'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
}

.gua-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
}

/* 结果区域 */
.result-area {
    margin-top: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    border: 1px solid #d4af37;
}

.no-selection {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 50px;
    font-size: 1.2rem;
}

.empty-hexagram-symbol {
    font-size: 3rem;
    margin-top: 20px;
    opacity: 0.2;
}

.result-content {
    padding: 30px;
}

.result-title {
    font-size: 1.9rem;
    margin-bottom: 25px;
    color: #8b0000;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.result-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: #d4af37;
}

.result-gua-combination {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}

.result-gua-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15px;
    background: rgba(212, 175, 55, 0.1);
    padding: 20px;
    border-radius: 10px;
    border: 1px dashed #d4af37;
}

.result-gua {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 15px 0;
}

.result-gua-symbol-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.result-gua-symbol {
    font-size: 4rem;
    color: #d4af37;
    line-height: 1;
}

.result-gua-name {
    font-size: 2.2rem;
    margin-top: 15px;
    color: #8b0000;
    font-weight: bold;
    letter-spacing: 3px;
}

.gua-combination-note {
    margin-top: 15px;
    font-size: 1rem;
    color: #777;
    text-align: center;
    font-style: italic;
}

.result-mingci {
    font-size: 1.8rem;
    margin: 30px 0;
    text-align: center;
    color: #8b0000;
    font-weight: bold;
    padding: 15px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 8px;
    border-left: 4px solid #d4af37;
}

.result-description {
    font-size: 1.3rem;
    margin-bottom: 30px;
    text-align: center;
    color: #666;
    line-height: 1.8;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.result-yao-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px dashed #d4af37;
}

.result-yao-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #8b0000;
    text-align: center;
    position: relative;
}

.result-yao-title::before {
    content: "⚋ ⚊";
    letter-spacing: 10px;
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: #d4af37;
    opacity: 0.3;
}

.result-yaos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.result-yao {
    margin-bottom: 16px;
    padding: 15px;
    background: rgba(139, 0, 0, 0.04);
    border-radius: 8px;
    border-left: 3px solid #8b0000;
}

.result-yao:nth-child(odd) {
    background: rgba(212, 175, 55, 0.05);
}

.yao-number {
    font-weight: bold;
    margin-right: 8px;
    color: #8b0000;
    font-size: 1.2rem;
    display: block;
    margin-bottom: 5px;
}

/* 页脚样式 */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    color: #888;
    font-size: 0.9rem;
    border-top: 1px solid #e6dcc0;
}

footer p {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

footer a {
    color: #8b0000;
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #d4af37;
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .selection-area.desktop {
        display: none;
    }
    
    .mobile-selector.mobile {
        display: block;
    }
    
    .gua-select {
        font-size: 1rem;
        padding: 12px;
    }
    
    .result-gua-symbol {
        font-size: 3.5rem;
    }
    
    .result-gua-name {
        font-size: 1.8rem;
    }
    
    .result-mingci {
        font-size: 1.5rem;
    }
    
    .result-description {
        font-size: 1.1rem;
    }
    
    .result-yaos {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .mobile-selector.mobile {
        display: none;
    }
    
    .selection-area.desktop {
        display: flex;
    }
}