:root {
    --primary-color: #9e2a2b; /* 朱砂红 - 传统国学主色 */
    --secondary-color: #c8a950; /* 赭石黄 - 传统点缀色 */
    --tertiary-color: #3a5a40; /* 青绿色 - 辅助色 */
    --background-color: #f5f1e6; /* 宣纸色 - 背景色 */
    --text-color: #2d2a26; /* 墨黑色 - 文字主色 */
    --light-text: #5c5852; /* 浅墨色 - 次要文字 */
    --card-bg-color: #ffffff; /* 宣纸白 - 卡片背景 */
    --border-color: #d9c9a3; /* 仿古边框色 */
    --accent-color: #8c2f39; /* 暗红强调色 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Serif SC', 'KaiTi', 'STKaiti', 'SimKai', '宋体', serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    background-color: var(--card-bg-color);
    padding: 2rem 3rem;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-color);
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="%23ffffff" opacity="0.03"/><path d="M0 0h100v100H0z" fill="none" stroke="%23d9c9a3" stroke-width="0.5" stroke-dasharray="5,5"/></svg>');
}

h1 {
    text-align: center;
    color: var(--primary-color);
    margin: 2rem auto 1.5rem;
    font-size: 2.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--secondary-color);
    position: relative;
    font-weight: normal;
    letter-spacing: 0.15em;
}

h1::after {
    content: ""; 
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
}

h2 {
    color: var(--primary-color);
    margin: 20px 0;
    font-size: 1.8rem;
}

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

.divination-method {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.method-btn {
    padding: 10px 22px;
    margin: 0 12px;
    background-color: var(--card-bg-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background-image: linear-gradient(to bottom, #f9f6ef, #f0ece0);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.08);
    letter-spacing: 0.05em;
}

.method-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.setting-panel {
    background-color: var(--card-bg-color);
    padding: 20px;
    border-radius: 3px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="%23ffffff" opacity="0.02"/><path d="M0 0h100v100H0z" fill="none" stroke="%23d9c9a3" stroke-width="0.3" stroke-dasharray="8,8"/></svg>');
}

.hidden {
    display: none;
}

.trigram-selection,
.number-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.trigram-input,
.number-input,
.moving-line-input {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 150px;
}

label {
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 1.1rem;
}

select, input[type="number"], textarea, input[type="datetime-local"] {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-size: 1rem;
    width: 100%;
    max-width: 200px;
    background-color: var(--card-bg-color);
    font-family: 'Noto Serif SC', 'KaiTi', serif;
    transition: border-color 0.3s ease;
}

select:focus, input[type="number"]:focus, textarea:focus, input[type="datetime-local"]:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(200, 169, 80, 0.2);
}

textarea {
    min-height: 100px;
    resize: vertical;
    max-width: 100%;
}

.question-time {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.question-input,
.time-input {
    flex: 1;
    min-width: 300px;
    padding: 0 10px;
}

.primary-btn {
    display: block;
    margin: 2rem auto;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: white;
    border: 1px solid #842425;
    border-radius: 3px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.12);
    background-image: linear-gradient(to bottom, var(--primary-color), #8e2526);
    letter-spacing: 0.1em;
    font-weight: normal;
}

.primary-btn:hover {
    background-color: #8e0000;
    transform: translateY(-3px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15); /* 悬停时增强阴影 */
}

.hexagrams-display {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    margin-bottom: 40px;
}
/* 添加Markdown内容样式 */
.markdown-content {
    font-family: 'Microsoft YaHei', sans-serif;
    line-height: 1.8;
}

.markdown-content h1, 
.markdown-content h2, 
.markdown-content h3, 
.markdown-content h4 {
    color: var(--primary-color);
    margin: 1em 0 0.5em 0;
}

.markdown-content p {
    margin: 0.8em 0;
}

.markdown-content ul, 
.markdown-content ol {
    margin: 0.8em 0;
    padding-left: 2em;
}

.markdown-content blockquote {
    border-left: 4px solid var(--secondary-color);
    padding-left: 1em;
    margin: 1em 0;
    color: #666;
}
/* 完成状态样式 */
.completion-status {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
    color: #4caf50;
}

.status-line {
    height: 2px;
    background: #4caf50;
    margin-bottom: 10px;
}

.status-text {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-text:before {
    content: "✓";
    color: #4caf50;
    font-weight: bold;
}

.timestamp {
    font-size: 0.8em;
    color: #757575;
    font-weight: normal;
}

/* 错误状态样式 */
.error-status {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #ffebee;
    color: #f44336;
}

.error-status .status-line {
    background: #f44336;
}

.error-status .status-text:before {
    content: "✗";
    color: #f44336;
}
.upload-status {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.upload-status.success {
    color: #4caf50;
}

.upload-status.error {
    color: #f44336;
}

.upload-status .status-line {
    height: 2px;
    background: #e0e0e0;
    margin-bottom: 10px;
}

.upload-status.success .status-line {
    background: #4caf50;
}

.upload-status.error .status-line {
    background: #f44336;
}

.upload-status .status-text {
    font-weight: bold;
}

.upload-status.success .status-text:before {
    content: "✓";
    color: #4caf50;
    margin-right: 8px;
}

.upload-status.error .status-text:before {
    content: "✗";
    color: #f44336;
    margin-right: 8px;
}
.error-message {
    color: #d32f2f;
    font-size: 0.9em;
    margin-top: 5px;
    padding-left: 20px;
}
.markdown-content pre {
    background-color: #f5f5f5;
    padding: 1em;
    border-radius: 4px;
    overflow-x: auto;
}

.markdown-content code {
    font-family: 'Courier New', monospace;
    background-color: #f5f5f5;
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

.error {
    color: #d32f2f;
    font-weight: bold;
}
.hexagram-card {
    background-color: var(--card-bg-color);
    padding: 25px 20px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    min-width: 280px;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="%23ffffff" opacity="0.02"/><path d="M0 0h100v100H0z" fill="none" stroke="%23d9c9a3" stroke-width="0.3" stroke-dasharray="8,8"/></svg>');
    position: relative;
    overflow: hidden;
}

.hexagram-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(to right, transparent, var(--secondary-color), transparent);
}

.hexagram-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1); /* 悬停时增强阴影 */
}

.hexagram {
    margin-bottom: 15px;
    font-size: 1.5rem;
    line-height: 2;
}

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

.yin-line {
    color: var(--text-color);
    white-space: pre;
    font-family: \5B8B\4F53, 'Noto Serif SC', \5B8B\4F53, 'Courier New', monospace;
  }

.moving-line {
    text-decoration: underline;
    text-decoration-color: var(--secondary-color);
    text-decoration-thickness: 3px;
}

.ai-interpretation {
    background-color: #F9F9F9;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.interpretation-content {
    margin-top: 15px;
    padding: 25px 30px;
    background-color: var(--background-color);
    border-radius: 3px;
    min-height: 220px;
    white-space: pre-wrap;
    font-family: 'Noto Serif SC', 'KaiTi', 'STKaiti', serif;
    line-height: 2.0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
    position: relative;
    background-image: url('data:image/svg+xml;utf8,<svg width="180" height="180" viewBox="0 0 180 180" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="%23f5f1e6" opacity="0.05"/><path d="M0 30h180M0 60h180M0 90h180M0 120h180M0 150h180" stroke="%23d9c9a3" stroke-width="0.5" opacity="0.3"/></svg>');
    letter-spacing: 0.05em;
    text-align: justify;
}

.interpretation-content::first-letter {
    font-size: 1.8em;
    color: var(--primary-color);
    font-family: 'KaiTi', 'STKaiti', serif;
    float: left;
    line-height: 0.8;
    padding-right: 5px;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

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

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

.calculation-result {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background-color: white;
    border-radius: 5px;
    border: 1px solid var(--border-color);
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
        margin: 1rem auto;
    }

    h1 {
        font-size: 2.2rem;
        margin: 1.5rem auto;
    }

    .hexagrams-display {
        flex-direction: column;
        align-items: center;
    }

    .hexagram-card {
        width: 100%;
        margin-bottom: 1.5rem;
    }

    .method-btn {
        margin: 0 8px 10px;
        padding: 8px 16px;
        font-size: 1rem;
    }

    .question-input,
    .time-input {
        min-width: 100%;
        padding: 0 0 15px;
    }

    .primary-btn {
        padding: 10px 24px;
        font-size: 1.1rem;
    }
}
