:root {
    --primary-color: #8e44ad;
    --secondary-color: #9b59b6;
    --light-color: #f5f5f5;
    --dark-color: #333;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

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

body {
    font-family: 'Noto Serif SC', serif;
    background-color: #f9f5ff;
    color: var(--dark-color);
    line-height: 1.6;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #e0e0e0;
}

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.subtitle {
    color: var(--secondary-color);
    font-size: 1.1rem;
    font-weight: 400;
}

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

.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-title {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
}

.gua-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0;
    gap: 10px;
}

.yao {
    width: 120px;
    height: 20px;
    background-color: var(--dark-color);
    position: relative;
}

.yin {
    background-color: transparent;
    border: 2px solid var(--dark-color);
}

.yin::before, .yin::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--dark-color);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
}

.yin::before {
    left: 25%;
}

.yin::after {
    right: 25%;
}

.gua-info {
    text-align: center;
    margin-top: 20px;
}

.gua-name {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.gua-desc {
    color: #666;
    font-style: italic;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

button {
    padding: 12px 25px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

textarea {
    width: 100%;
    height: 120px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 15px;
    transition: border 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

#result {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 25px;
    margin-top: 20px;
    min-height: 200px;
}

.result-title {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.result-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
    color: #666;
}

.result-content {
    line-height: 1.8;
    font-size: 1rem;
}

.interpretation-text {
    text-indent: 2em;
    margin-bottom: 15px;
    line-height: 1.8;
}

.interpretation-text p {
    margin-bottom: 15px;
}

.loading {
    text-align: center;
    padding: 20px 0;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.error {
    color: #e74c3c;
    font-weight: bold;
}

/* 专业解卦结果样式 */
.section-title {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin: 30px 0 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.gua-pan {
    background-color: #f8f5ff;
    border-radius: var(--border-radius);
    padding: 15px;
    margin: 20px 0;
    border-left: 4px solid var(--primary-color);
}

.gua-pan-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.gua-pan-content {
    font-family: 'Courier New', Courier, monospace;
    white-space: pre;
    line-height: 1.6;
    background-color: white;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 1.1rem;
}

.analysis-list {
    padding-left: 25px;
    margin: 15px 0;
}

.analysis-list li {
    margin-bottom: 12px;
    position: relative;
    list-style-type: none;
}

.analysis-list li:before {
    content: "•";
    color: var(--secondary-color);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
    font-size: 1.2rem;
}

.advice-box {
    background-color: #f0ebff;
    border-radius: var(--border-radius);
    padding: 18px;
    margin: 25px 0;
    border: 1px dashed var(--secondary-color);
}

.advice-title {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.highlight {
    color: var(--primary-color);
    font-weight: bold;
}

.final-judgment {
    font-style: italic;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dotted #ccc;
}

.note {
    font-size: 0.9rem;
    color: #666;
    margin-top: 20px;
    font-style: italic;
}

footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    color: #666;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .result-header {
        flex-direction: column;
        gap: 5px;
    }
    
    button {
        width: 100%;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .gua-pan-content {
        font-size: 0.95rem;
    }
    
    .analysis-list {
        padding-left: 20px;
    }
    
    .advice-box {
        padding: 15px;
    }
}