/* 基础样式 */
body {
    font-family: "SimSun", "宋体", serif;
    background-color: #f5f0e0; /* 更浅的米黄色背景 */
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background-color: #f9f5e8; /* 淡米黄色容器背景 */
    border: 1px solid #e0d8c0;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* 顶部提醒 */
.header-notice {
    background-color: #f5f2e9;
    padding: 8px 15px;
    border-bottom: 1px solid #e0d8c0;
    font-size: 14px;
}

/* 标题样式 - 使用已有的梅花图片 */
.logo-container {
    position: relative;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #e0d8c0;
    background-color: #f9f5e8; /* 淡米黄色背景 */
}

/* 梅花图片样式 */
.plum-left, .plum-right {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    object-fit: cover;
    z-index: 1;
}

.plum-left {
    left: 0;
}

.plum-right {
    right: 0;
}

/* 标题文字样式 */
.logo-container h1 {
    position: relative;
    z-index: 2;
    text-align: center;
    margin: 0;
    padding: 5px 15px;
    font-weight: normal;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 5px;
}

.logo-red {
    color: #9B1B30; /* 朱砂红 */
    font-weight: bold;
    font-size: 32px;
}

.logo-black {
    color: #333;
    font-size: 28px;
    margin-left: 10px;
}

/* 导航菜单 */
.main-nav, .secondary-nav {
    background-color: #f5f2e9;
    border-bottom: 1px solid #e0d8c0;
}

.main-nav ul, .secondary-nav ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 10px 5px;
    justify-content: center;
}

.main-nav li, .secondary-nav li {
    margin: 0 5px;
}

.main-nav a, .secondary-nav a {
    color: #333;
    text-decoration: none;
    padding: 0 5px;
    font-size: 14px;
    position: relative;
}

.main-nav a:before {
    content: "• ";
    color: #9B1B30; /* 朱砂红 */
}

.secondary-nav a:before {
    content: "• ";
    color: #2D2D2D; /* 玄武黑 */
}

.main-nav a:hover, .secondary-nav a:hover {
    text-decoration: underline;
}

/* 内容标题 */
.content-header {
    background-color: #f0e6cc; /* 浅棕黄色 */
    padding: 10px 15px;
    border-bottom: 1px solid #6B4423;
}

.content-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: normal;
    color: #9B1B30;
}

/* 表单样式 */
.calculator-form {
    padding: 20px;
    background-color: #f9f5e8;
    display: flex;
    justify-content: center;
}

.primary-btn {
    background-color: #9B1B30;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 15px;
    margin-top: 15px;
}

.primary-btn:hover {
    background-color: #7a1525;
}

/* 内容描述 */
.content-description {
    padding: 20px;
    background-color: #f9f5e8; /* 淡米黄色背景 */
    border-top: 1px solid #e0d8c0;
}

.content-description h3 {
    color: #9B1B30; /* 朱砂红 */
    font-size: 16px;
    margin-top: 0;
    border-bottom: 1px solid #6B4423; /* 蓍草棕 */
    padding-bottom: 10px;
}

.description-text {
    font-size: 14px;
    line-height: 1.8;
}

/* 页脚 */
footer {
    background-color: #f5f2e9;
    padding: 15px;
    text-align: center;
    border-top: 1px solid #e0d8c0;
    font-size: 14px;
    color: #666;
}

/* 呼吸引导样式 */
.breathing-guide {
    text-align: center;
    padding: 30px;
    background-color: #f9f5e8;
    border: 1px solid #e0d8c0;
    border-radius: 5px;
    margin: 20px 0;
}

.breathing-guide h3 {
    color: #9B1B30;
    margin-top: 0;
}

.breath-animation {
    position: relative;
    height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 30px 0;
}

.breath-circle {
    width: 100px;
    height: 100px;
    background-color: rgba(155, 27, 48, 0.2);
    border: 2px solid #9B1B30;
    border-radius: 50%;
    margin-bottom: 15px;
}

@keyframes breathe {
    0% {
        transform: scale(1);
        background-color: rgba(155, 27, 48, 0.2);
    }
    50% {
        transform: scale(1.5);
        background-color: rgba(155, 27, 48, 0.4);
    }
    100% {
        transform: scale(1);
        background-color: rgba(155, 27, 48, 0.2);
    }
}

.breath-text {
    font-size: 18px;
    color: #6B4423;
    margin: 10px 0;
}

.countdown {
    font-size: 24px;
    font-weight: bold;
    color: #9B1B30;
}

.tip {
    font-style: italic;
    margin-top: 30px;
    font-size: 14px;
    color: #6B4423;
    opacity: 0.8;
}

/* 卦象展示区 */
.hexagram-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 40px 0;
}

.yao {
    position: relative;
    height: 20px;
}

.yang {
    width: 100%;
    background-color: #2D2D2D;
}

.yin {
    width: 45%;
    background-color: #2D2D2D;
    margin: 0 5px;
}

/* 添加卦象结果样式 */
.result-box {
    padding: 20px;
    background-color: #f9f5e8; /* 淡米黄色背景 */
    border: 1px solid #6B4423;
    margin: 20px;
}

.result-box h3 {
    color: #9B1B30;
    text-align: center;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #6B4423;
}

.interpretation {
    margin: 20px 0;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #e0d8c0;
}

.interpretation h4 {
    color: #9B1B30;
    margin-top: 0;
}

.tip {
    color: #6B4423;
    font-style: italic;
}

/* 骰子相关样式 */
.dice-container {
    text-align: center;
    padding: 20px;
    background-color: #f9f5e8;
    border: 1px solid #e0d8c0;
    margin: 20px 0;
}

.dice-area {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
}

.dice {
    width: 80px;
    height: 80px;
    background-color: #fff;
    border: 2px solid #6B4423;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.dice.rolling {
    animation: roll 0.5s infinite;
}

@keyframes roll {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-5deg); }
    100% { transform: rotate(0deg); }
}

.dice-face {
    font-size: 32px;
    font-weight: bold;
    color: #9B1B30;
}

.dice-controls {
    margin-top: 20px;
}

.roll-count {
    margin-top: 15px;
    font-weight: bold;
}

.dice-instruction {
    font-style: italic;
    color: #6B4423;
    margin: 10px 0;
}

.primary-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 卦象图示样式优化 */
.hexagram-image {
    margin: 30px auto;
    width: 120px;
    text-align: center;
}

.hexagram-title {
    font-size: 18px;
    color: #9B1B30;
    margin-bottom: 15px;
    font-weight: bold;
}

.hexagram-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yao {
    position: relative;
    height: 20px;
}

.yang-line {
    height: 6px;
    background-color: #333;
    width: 100%;
}

.yin-line {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.yin-line div {
    height: 6px;
    background-color: #333;
    width: 45%;
}

/* 变爻标记 */
.changing:after {
    content: "○";
    position: absolute;
    right: -25px;
    color: #9B1B30;
    font-size: 16px;
}

/* 结果容器样式 */
.result-container {
    background-color: #f9f5e8;
    padding: 20px;
    border: 1px solid #e0d8c0;
    margin-top: 20px;
}

.result-container h3 {
    color: #9B1B30;
    text-align: center;
    margin-bottom: 20px;
    font-size: 20px;
}

.interpretation, .ai-interpretation {
    margin: 20px 0;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #e0d8c0;
}

.interpretation-header, .ai-interpretation-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0d8c0;
}

.ai-interpretation-header img {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

.interpretation-header h5, .ai-interpretation-header h5 {
    margin: 0;
    color: #6B4423;
    font-size: 16px;
}

/* 加载动画 */
.loading-animation {
    text-align: center;
    padding: 40px 0;
}

.loading-spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #9B1B30;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 2s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 按钮容器 */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

/* 表格布局样式 - 调整为同一排 */
.form-table {
    border-collapse: collapse;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

.label-cell {
    width: 100px;
    text-align: right;
    padding: 10px 10px 10px 0;
    vertical-align: middle;
    white-space: nowrap;
    font-size: 15px;
}

.input-cell {
    padding: 10px 0;
    vertical-align: middle;
    width: calc(100% - 100px);
}

.input-cell input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 3px;
    font-size: 15px;
}

/* 日期选择器样式优化 */
.date-selects {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    width: 100%;
}

.date-selects select {
    padding: 8px;
    border: 1px solid #ccc;
    background-color: #fff;
    border-radius: 3px;
    margin-right: 3px;
    font-size: 15px;
}

.date-selects .year-select {
    width: 80px;
}

.date-selects .month-select,
.date-selects .day-select {
    width: 65px;
}

.date-selects .hour-select {
    width: 150px;
}

.date-label {
    margin: 0 3px 0 0;
    color: #666;
    white-space: nowrap;
    font-size: 15px;
}

/* 优化AI解释样式 */
.ai-interpretation {
    margin-top: 20px;
    padding: 20px;
    background-color: #f5f0e0;
    border-left: 4px solid #9B1B30;
    font-style: normal;
    line-height: 1.8;
    text-align: justify;
    color: #333;
}

.ai-interpretation-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0d8c0;
}

.ai-interpretation-header img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.ai-interpretation-header h5 {
    margin: 0;
    color: #9B1B30;
    font-size: 18px;
    font-weight: bold;
}

/* 段落样式 */
.ai-interpretation p {
    margin-bottom: 15px;
    text-indent: 2em;
}

.interpretation-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0d8c0;
}

.interpretation-header h5 {
    margin: 0;
    color: #9B1B30;
    font-size: 18px;
    font-weight: bold;
}

/* 红能显示样式 */
.red-energy {
    margin: 20px 0;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #e0d8c0;
    text-align: center;
}

.red-energy h4 {
    color: #9B1B30;
    margin: 0 0 10px 0;
}

.energy-bar {
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    margin: 10px auto;
    width: 80%;
    overflow: hidden;
}

.energy-fill {
    height: 100%;
    background: linear-gradient(to right, #ffcc00, #ff6600, #9B1B30);
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

.energy-description {
    font-size: 14px;
    color: #666;
    margin: 10px 0 0 0;
}

.red-energy-interpretation {
    margin: 20px 0;
    padding: 15px;
    background-color: #fff;
    border: 1px solid #e0d8c0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .form-table td {
        display: block;
        width: 100%;
        padding: 8px 0;
    }
    
    .label-cell {
        text-align: left;
        padding: 8px 0 4px 0;
        width: 100%;
    }
    
    .input-cell {
        width: 100%;
        padding: 4px 0 8px 0;
    }
    
    .input-cell input[type="text"] {
        width: 100%;
    }
    
    .date-selects {
        flex-wrap: wrap;
    }
    
    .date-selects select {
        width: calc(50% - 15px) !important;
        margin-bottom: 8px;
    }
}

/* 历史记录样式 */
.history-container {
    background-color: #f9f5e8;
    padding: 20px;
    border: 1px solid #e0d8c0;
    margin-top: 20px;
}

.history-list {
    max-height: 500px;
    overflow-y: auto;
    margin: 20px 0;
}

.history-item {
    background-color: #fff;
    border: 1px solid #e0d8c0;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 5px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0d8c0;
}

.history-date {
    color: #666;
    font-size: 14px;
}

.history-question {
    font-weight: bold;
    color: #333;
}

.history-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.view-detail-btn {
    background-color: #9B1B30;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.view-detail-btn:hover {
    background-color: #7a1525;
}

/* 每日运势样式 */
.daily-fortune {
    background-color: #f9f5e8;
    padding: 20px;
    border: 1px solid #e0d8c0;
}

.fortune-overview {
    background-color: #fff;
    padding: 15px;
    border: 1px solid #e0d8c0;
    margin: 20px 0;
    text-align: center;
}

.fortune-level {
    font-size: 18px;
    font-weight: bold;
    color: #9B1B30;
}

.lucky-color, .lucky-number {
    font-weight: bold;
    color: #6B4423;
}

.fortune-details {
    background-color: #fff;
    padding: 15px;
    border: 1px solid #e0d8c0;
    margin: 20px 0;
}

.fortune-bar-item {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.fortune-bar-label {
    width: 100px;
    text-align: right;
    padding-right: 15px;
}

.fortune-bar-container {
    flex-grow: 1;
    height: 15px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.fortune-bar-fill {
    height: 100%;
    background: linear-gradient(to right, #ffcc00, #ff6600, #9B1B30);
    border-radius: 10px;
}

.fortune-bar-value {
    width: 50px;
    text-align: left;
    padding-left: 15px;
}

.fortune-advice {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.fortune-good, .fortune-bad {
    flex: 1;
    background-color: #fff;
    padding: 15px;
    border: 1px solid #e0d8c0;
}

.fortune-good h4 {
    color: #4CAF50;
}

.fortune-bad h4 {
    color: #9B1B30;
}

.fortune-tip {
    background-color: #fff;
    padding: 15px;
    border: 1px solid #e0d8c0;
    margin: 20px 0;
}

.fortune-tip h4 {
    color: #6B4423;
    margin-bottom: 10px;
}

/* 联系作者链接样式 */
.contact-link {
    color: #9B1B30 !important; /* 朱砂红色 */
}

.contact-link:hover {
    text-decoration: underline;
}