

:root {
    --bg-color: #1f2225; /* 深邃的背景色，如紫禁城的暗夜 */
    --panel-bg-color: rgba(30, 30, 40, 0.5); /* 面板背景，略带透明 */
    --text-color: #dcdde1; /* 柔和的白色，如月光下的奏章 */
    --text-color-muted: #8c8d8f; /* 次要文本颜色 */
    --accent-gold: #f1c40f; /* 皇权的金色，用于标题和高亮 */
    --accent-red: #c0392b; /* 朱砂的红色，用于警示或特殊按钮 */
    --action-green: #27ae60; /* “执行”的绿色，用于购买等操作 */
    --font-primary: 'KaiTi', 'STKaiti', 'SimSun', serif; /* 主字体，楷体/宋体，充满古风 */
    --border-color: rgba(140, 141, 143, 0.3); /* 边框颜色 */
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-primary);
    margin: 0;
    padding: 20px;
    font-size: 16px;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}



#status-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: center;
    background-color: var(--panel-bg-color);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#status-panel span {
    margin: 5px 15px;
    font-size: 1.1em;
    white-space: nowrap;
}

#status-panel #year-display {
    font-weight: bold;
    color: var(--accent-gold);
}



#event-display {
    background-color: var(--panel-bg-color);
    padding: 25px 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    max-width: 800px;
    margin: 20px auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: opacity 0.5s;
}

#welcome-message {
    text-align: center;
    font-size: 1.5em;
    color: var(--text-color-muted);
    margin-top: 10vh;
}

#event-title {
    color: var(--accent-gold);
    text-align: center;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 2em;
    text-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
}

#event-description {
    font-size: 1.25em;
    text-align: justify;
    margin-bottom: 25px;
}

#choices-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.choice-button {
    background-color: rgba(44, 62, 80, 0.8);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 15px;
    font-size: 1.1em;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: left;
    border-radius: 5px;
}

.choice-button:hover {
    background-color: #34495e;
    border-color: var(--accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}



.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.overlay-content {
    background-color: var(--bg-color);
    padding: 40px;
    border-radius: 10px;
    border: 2px solid var(--accent-gold);
    text-align: center;
    max-width: 700px;
    box-shadow: 0 0 30px rgba(241, 196, 15, 0.2);
}

.overlay-content h2 {
    margin-top: 0;
    font-size: 2.5em;
    color: var(--accent-red);
}

#game-over-title {
    color: var(--accent-gold);
}

.overlay-content p {
    font-size: 1.4em;
    line-height: 1.7;
    white-space: pre-wrap;
    margin-bottom: 30px;
}

.overlay-content button {
    background-color: var(--accent-gold);
    color: var(--bg-color);
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    font-family: var(--font-primary);
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
}

/* 修正：为动态添加的“再履皇图”按钮添加样式 */
.reload-button {
    background-color: var(--accent-gold);
    color: var(--bg-color);
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    font-family: var(--font-primary);
    font-weight: bold;
    cursor: pointer;
    border-radius: 5px;
    margin-top: 20px; /* <--- 新增：和上面的文本拉开一点距离 */
    transition: all 0.2s ease;
}

.reload-button:hover {
    background-color: #f39c12;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.4);
}

#main-actions {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 100;
}

#open-shop-button {
    padding: 15px 25px;
    font-size: 1.2em;
    background: linear-gradient(45deg, var(--accent-gold), #f39c12);
    color: #2c3e50;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(241, 196, 15, 0.4);
    font-family: var(--font-primary);
    font-weight: bold;
    transition: all 0.3s ease;
}

#open-shop-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(241, 196, 15, 0.6);
}

/* 模态框通用样式 (可以与Overlay共享部分样式) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* <--- 修改：加深背景，更有覆盖感 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* <--- 修改：确保层级最高 */
    backdrop-filter: blur(5px); /* <--- 新增：背景模糊效果，更具现代感 */
}

/* 商城特定样式 */
#shop-modal .modal-content {
    width: 95%;
    max-width: 1000px; /* <--- 修改：可以稍微加宽一点 */
    height: 90vh; /* <--- 修改：让其占据大部分屏幕高度 */
    overflow-y: auto;
    position: relative;
    background-color: #2c3e50;
    border-color: var(--accent-red);
}

#shop-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2em;
    line-height: 1;
    cursor: pointer;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

#shop-category-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.category-button {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-color-muted);
    font-family: var(--font-primary);
    font-size: 1em;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.category-button:hover {
    background-color: var(--panel-bg-color);
    color: var(--text-color);
}

.category-button.active {
    background-color: var(--accent-red);
    color: white;
    border-color: var(--accent-red);
    font-weight: bold;
}

.currency-info { font-size: 1.5em; font-weight: bold; }
#shop-currency-display { color: var(--accent-gold); }

.conversion-actions button {
    margin-left: 10px;
    padding: 8px 12px;
    background-color: #2980b9;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#shop-item-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.shop-item {
    background-color: var(--panel-bg-color);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    transition: all 0.2s ease;
}
.shop-item:hover {
    border-color: var(--accent-gold);
    transform: translateY(-5px);
}
.shop-item.disabled { opacity: 0.5; background-color: #333; pointer-events: none; }

.item-name { font-size: 1.3em; font-weight: bold; color: var(--accent-gold); margin-bottom: 5px; }
.item-cost { font-size: 0.9em; color: var(--text-color-muted); }
.item-type { font-size: 0.85em; color: #95a5a6; margin-bottom: 15px; font-style: italic; }
.item-description { flex-grow: 1; margin-bottom: 20px; }

.buy-button {
    padding: 12px;
    background-color: var(--action-green);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-family: var(--font-primary);
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.2s;
}
.buy-button:hover:not(:disabled) { background-color: #2ecc71; }
.buy-button:disabled { background-color: #555; cursor: not-allowed; }



@media (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 14px;
    }
    #status-panel {
        justify-content: flex-start;
        padding: 10px;
    }
    #status-panel span {
        margin: 5px 10px;
        font-size: 1em;
    }
    #event-title { font-size: 1.5em; }
    #event-description { font-size: 1.1em; }
    #main-actions { bottom: 15px; right: 15px; }
    #open-shop-button { padding: 12px 20px; font-size: 1em; }
    #shop-item-list { grid-template-columns: 1fr; } /* 在小屏幕上，商品列表变为单列 */
}
