/* --- 全域與基本樣式 --- */
body {
    font-family: 'Noto Serif TC', serif;
    background-color: #2c3e50; /* 深藍灰色背景 */
    color: #ecf0f1; /* 柔和的白色文字 */
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    box-sizing: border-box;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

h1, h2, h3 {
    font-weight: 700;
    color: #f1c40f; /* 金黃色標題 */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.container {
    width: 100%;
    max-width: 800px;
    background-color: #34495e;
    padding: 25px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #4a627a;
}

button {
    background-color: #c0392b; /* 深紅色 */
    color: #ffffff;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-family: 'Noto Serif TC', serif;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

button:hover {
    background-color: #e74c3c;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.hidden {
    display: none !important;
}


body.page-battle {
    background-image: url('../pict/battle.png');
}

body.page-gamble {
    background-image: url('../pict/賭場.png');
}

body.page-stable {
    background-image: url('../pict/馬廄.png');
}

body.page-book {
    background-image: url('../pict/書房.png'); /* 您可以準備一張書房背景圖 */
}

body.page-index {
    background-image: url('../pict/open.png');
}

body.page-recruit {
    background-image: url('../pict/茶館.png');
}

body.page-weapon {
    background-image: url('../pict/兵工廠.png');
}

body.page-workshop {
    background-image: url('../pict/工房.png');
}

body.page-training {
    background-image: url('../pict/練兵場.png');
}

body.page-hinterland {
    background-image: url('../pict/內政背景.png');
}

body.page-status {
    background-image: url('../pict/內政.png');
}

body.page-tax-game {
    background-image: url('../pict/金庫.png');
    overflow: hidden; /* 防止出現滾動條 */
}


/* --- 首頁 (index.html) 樣式 --- */
#creation-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#creation-form label {
    font-size: 18px;
    color: #f1c40f;
}

#creation-form input[type="text"] {
    padding: 10px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #7f8c8d;
    background-color: #2c3e50;
    color: #ecf0f1;
}

.country-selection {
    display: flex;
    gap: 15px;
}

.country-selection input[type="radio"] {
    display: none;
}

.country-selection label {
    padding: 10px 20px;
    border: 2px solid #7f8c8d;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #bdc3c7;
}

.country-selection input[type="radio"]:checked + label {
    background-color: #c0392b;
    border-color: #f1c40f;
    color: #ffffff;
    font-weight: bold;
}

/* --- 主城頁面 (country.html) 樣式 --- */
#status-bar {
    display: flex;
    justify-content: space-around;
    padding: 15px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    margin-bottom: 20px;
}

#status-bar b {
    color: #f1c40f;
    margin-left: 5px;
}

#action-panel {
    display: grid;
    grid-template-columns: repeat(7, 1fr); 
    gap: 15px;
    margin: 25px 0;
}
#hero-list {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(0,0,0,0.15);
    border-radius: 8px;
}

.hero-card-small {
    background-color: rgba(0,0,0,0.2);
    border-left: 4px solid #f1c40f;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hero-card-small.main-hero {
    border-left-color: #e74c3c; /* 主將使用更醒目的紅色邊框 */
    background-color: rgba(231, 76, 60, 0.1); /* 主將卡片帶有淡淡的紅色背景 */
}

.hero-card-small .avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 2px solid #f1c40f;
    margin-right: 15px;
    object-fit: cover;
}

.hero-card-small .info {
    flex-grow: 1;
}
.hero-card-small .info p:first-child {
    font-weight: bold;
}

.hero-card-small p {
    margin: 0;
}

.set-main-hero-btn {
    background-color: #27ae60; /* 綠色按鈕 */
    padding: 8px 12px;
    width: 120px;
}
.set-main-hero-btn:hover {
    background-color: #2ecc71;
}

.hero-stats-grid-small {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2x2 格線 */
    gap: 5px 15px; /* 上下間距5px, 左右間距15px */
    margin: 10px 0; /* 與上下元素的間距 */
    max-width: 300px; /* 限制最大寬度，避免過於分散 */
}

.stat-item-small {
    background-color: rgba(0,0,0,0.3);
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.95em;
    color: #bdc3c7; /* 屬性名稱顏色 */
}

.stat-item-small b {
    color: #ffffff; /* 數值顏色 */
    float: right; /* 讓數值靠右對齊 */
}


/* --- 戰鬥頁面 (battle.html) 樣式 --- */
.battle-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    max-width: 1400px;
}

.hero-card {
    flex: 1;
    background-color: rgba(44, 62, 80, 0.8);
    border: 2px solid #7f8c8d;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

#player-side { border-color: #3498db; }
#enemy-side { border-color: #c0392b; }

.hero-image {
    width: 250px; /* 戰鬥頁面頭像大小 */
    height: 250px;
    border-radius: 50%; /* 圓形 */
    border: 3px solid #bdc3c7; /* 邊框加粗一點更顯眼 */
    margin: 15px auto;
    overflow: hidden; /* 隱藏超出圓形範圍的圖片部分 */
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 關鍵！讓圖片填滿容器，同時保持比例，多餘部分會被裁切 */
}

.hero-card p {
    margin: 8px 0;
    font-size: 16px;
    background-color: rgba(0,0,0,0.2);
    padding: 5px;
    border-radius: 4px;
}

.hero-card p span {
    color: #f1c40f;
    font-weight: bold;
}

#battle-log-container {
    flex: 1.2;
    padding: 0 20px;
    text-align: center;
}

#battle-log {
    width: 100%;
    height: 400px;
    background-color:#34495e;
    border: 1px solid #7f8c8d;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    overflow-y: auto;
    text-align: left;
    line-height: 1.6;
    box-sizing: border-box;
}

.attacked { animation: shake 0.3s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.skill-button {
    width: 80%;
    padding: 10px;
    margin-top: 10px;
    font-size: 1.1em;
    font-weight: bold;
}
.skill-button:disabled {
    background-color: #7f8c8d;
    border-color: #95a5a6;
    cursor: not-allowed;
    box-shadow: none;
}
.morale-bar {
    width: 80%;
    height: 15px;
    -webkit-appearance: none;
    appearance: none;
}
.morale-bar::-webkit-progress-bar {
    background: #555;
    border-radius: 5px;
    border: 1px solid #333;
}
#player-morale::-webkit-progress-value { background: #3498db; border-radius: 5px; }
#enemy-morale::-webkit-progress-value { background: #c0392b; border-radius: 5px; }

.fullscreen-video {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    z-index: 999;
}
.battle-result-text {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 8em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 1000;
    pointer-events: none;
}

#battle-final-result {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(44, 62, 80, 0.95);
    border: 2px solid #f1c40f;
    border-radius: 12px;
    padding: 30px 40px;
    z-index: 500;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    width: 300px;
}
#battle-final-result h2 {
    margin-top: 0;
    margin-bottom: 25px;
}
#battle-final-result button {
    padding: 10px 30px;
    font-size: 16px;
}

#final-rewards-display {
    margin: 20px 0;
    text-align: left;
    border-top: 1px solid #4a627a;
    border-bottom: 1px solid #4a627a;
    padding: 15px 10px;
    background-color: rgba(0,0,0,0.2);
}
#final-rewards-display p {
    font-size: 18px;
    color: #ecf0f1;
    margin: 10px 0;
}
#final-rewards-display p b {
    color: #f1c40f;
    float: right;
    font-weight: normal;
}


/* --- Modal (彈出視窗) 樣式 --- */
#modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
#modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}
#modal-box {
    background-color: #34495e;
    padding: 25px 40px;
    border-radius: 12px;
    border: 1px solid #4a627a;
    width: 90%;
    max-width: 500px;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
#modal-overlay:not(.hidden) #modal-box { transform: scale(1); }
#modal-title { margin-top: 0; text-align: center; }
#modal-content { margin: 20px 0; line-height: 1.6; }
#modal-input {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #7f8c8d;
    background-color: #2c3e50;
    color: #ecf0f1;
    box-sizing: border-box;
}
/* --- Modal (彈出視窗) 樣式優化 --- */
#modal-actions {
    display: flex; /* 啟用 Flexbox 佈局 */
    flex-wrap: wrap; /* 當按鈕過多時，自動換行，避免擠出視窗 */
    justify-content: center; /* 讓所有按鈕在容器中水平居中 */
    gap: 15px; /* 設定按鈕之間的統一間距 */
    margin-top: 20px;
    border-top: 1px solid #4a627a; /* 在按鈕區上方新增一條分隔線 */
    padding-top: 20px; /* 增加分隔線與按鈕之間的空間 */
}
#modal-actions button:not(:last-child):not(:nth-last-child(2)) { / 排除最後兩個 (取消, 普通攻擊) /
background-color: #c0392b; / 您可以調整為您喜歡的紅色 */
color: white;
border: none;
padding: 10px 15px;
border-radius: 5px;
cursor: pointer;
font-size: 1em;
}

#modal-actions button:not(:last-child):not(:nth-last-child(2)):disabled {
background-color: #7f8c8d; /* 禁用時的顏色 */
cursor: not-allowed;
}

#modal-actions button {
padding: 10px 20px;
font-size: 1em;
cursor: pointer;
border: none;
border-radius: 5px;
background-color: #5cb85c; /* 一個預設的按鈕顏色 */
color: white;
transition: background-color 0.3s ease;
}

#modal-actions button:hover {
background-color: #4cae4c;
}

#modal-actions button:disabled {
background-color: #cccccc;
cursor: not-allowed;
}.modal-content-with-image { display: flex; align-items: center; gap: 20px; }
.modal-content-with-image img { max-width: 150px; max-height: 150px; height: auto; border-radius: 8px; border: 2px solid #c9b38b; }
.modal-content-with-image p { margin: 0; flex-grow: 1; }

/* --- 賭場頁面 (gamble.html) 樣式 --- */
.gamble-container {
    max-width: 700px;
    margin: 50px auto;
    padding: 30px;
    background-color: rgba(217, 193, 166, 0.9);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    text-align: center;
    border: 2px solid #c9b38b;
}
.gamble-container h1, .gamble-container p, .gamble-container span, .gamble-container label {
    color: #4a3c2f;
}
.divider { border-top: 2px dashed #b08d5f; margin: 20px 0; }
.bet-input { padding: 10px; border: 1px solid #b08d5f; border-radius: 8px; font-size: 1.1em; width: 300px; text-align: center; }
.choice-section { display: flex; gap: 20px; margin-top: 10px; justify-content: center; }
.bet-btn { padding: 12px 30px; font-size: 1.2em; border: none; border-radius: 10px; cursor: pointer; color: #333; }
#bet-small-btn { background-color: #a7d1eb; }
#bet-big-btn { background-color: #f0ad4e; }
.dice-wrapper { display: flex; gap: 15px; justify-content: center; margin-bottom: 15px; }
.dice { display: inline-block; width: 40px; height: 40px; line-height: 40px; border: 2px solid #8b6942; border-radius: 8px; font-size: 1.5em; font-weight: bold; background-color: #fff; color: #333; text-align: center; }
.back-btn { padding: 10px 25px; font-size: 1.1em; border: 1px solid #b08d5f; border-radius: 8px; background-color: #f8f0e3; color: #5e4d3b; cursor: pointer; margin-top: 30px; }
.gamble-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #b08d5f;
    padding-bottom: 15px;
}
.tab-btn {
    padding: 10px 25px;
    font-size: 1.1em;
    border: 2px solid transparent;
    border-radius: 8px;
    background-color: #f8f0e3;
    color: #5e4d3b;
    cursor: pointer;
    transition: all 0.3s ease;
}
.tab-btn:hover {
    background-color: #e8dccb;
}
.tab-btn.active {
    background-color: #d9c1a6;
    border-color: #8b6942;
    color: #4a3c2f;
    font-weight: bold;
}
.game-content {
    display: none;
}
.game-content.active {
    display: block;
}
#bet-odd-btn {
    background-color: #8e44ad;
    color: white;
}
#bet-even-btn {
    background-color: #27ae60;
    color: white;
}

/* --- 地圖樣式 --- */
#map-container {
    position: relative;
    display: inline-block;
    line-height: 0;
    max-width: 100%;
}
#map-container img {
    display: block;
    max-width: 100%;
    height: auto;
}
.city-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    text-align: center;
    z-index: 10;
}
.city-marker::before {
    content: '';
    display: block;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    margin: 0 auto 4px;
}
.city-marker span {
    color: white;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}
.city-marker.enemy::before {
    background-color: #e74c3c;
}
.city-marker.player::before {
    background-color: #3498db;
}
.city-marker:hover::before {
    transform: scale(1.3);
    box-shadow: 0 0 12px #f1c40f;
}

/* --- 軍師面板樣式 --- */
#adviser-panel {
    margin-top: 25px;
    padding: 20px;
    background-color: rgba(0,0,0,0.2);
    border-left: 4px solid #3498db;
    border-radius: 4px;
}
.adviser-card {
    display: flex;
    align-items: center;
    gap: 20px;
}
.adviser-card .avatar {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #f1c40f;
    flex-shrink: 0;
}
.adviser-card .info p {
    margin: 4px 0;
}
.adviser-card .info .title {
    font-size: 1.3em;
    font-weight: bold;
    color: #f1c40f;
    margin-bottom: 8px;
}

/* --- 技能按鈕樣式 --- */
#heal-btn {
    background-color: #27ae60;
}
#heal-btn:hover {
    background-color: #2ecc71;
}

/* --- 書局/武器/工房/馬廄 等列表頁面通用樣式 --- */
.book-container, .weapon-container, .workshop-container, .stable-container {
    max-width: 700px;
}
.book-intro, .weapon-intro, .workshop-intro, .stable-intro {
    text-align: center;
    color: #bdc3c7;
    font-size: 1.1em;
}
#book-list, #weapon-list, #workshop-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.book-item, .weapon-item, .workshop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0,0,0,0.2);
    padding: 15px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.book-item { border-left: 4px solid #f1c40f; }
.weapon-item { border-left: 4px solid #c0392b; }
.workshop-item { border-left: 4px solid #e67e22; }
.weapon-item.equipped {
    border-left-color: #2ecc71;
    background-color: rgba(46, 204, 113, 0.1);
}
.book-info .book-title, .weapon-info .weapon-title, .workshop-info .workshop-title {
    margin: 0 0 5px 0;
    color: #ffffff;
}
.book-info .book-desc, .weapon-info .weapon-desc, .workshop-info .workshop-desc {
    margin: 0;
    color: #bdc3c7;
    font-size: 14px;
}
.book-btn-buy, .book-btn-owned, .weapon-btn-buy, .weapon-btn-equip, .weapon-btn-equipped, .ws-btn-develop, .ws-btn-developing, .ws-btn-owned {
    font-size: 1em;
    padding: 10px 15px;
    text-align: center;
}
.book-btn-buy { background-color: #27ae60; }
.book-btn-buy:hover { background-color: #2ecc71; }
.book-btn-owned { background-color: #7f8c8d; cursor: not-allowed; }
.weapon-btn-buy { background-color: #e67e22; width: 150px; }
.weapon-btn-buy:hover { background-color: #f39c12; }
.weapon-btn-equip { background-color: #2980b9; width: 150px; }
.weapon-btn-equip:hover { background-color: #3498db; }
.weapon-btn-equipped { background-color: #27ae60; cursor: not-allowed; width: 150px; }
.ws-btn-develop, .ws-btn-developing, .ws-btn-owned { width: 180px; }
.ws-btn-develop { background-color: #2980b9; }
.ws-btn-develop:hover { background-color: #3498db; }
.ws-btn-develop:disabled { background-color: #7f8c8d; cursor: not-allowed; }
.ws-btn-developing { background-color: #f39c12; cursor: not-allowed; }
.ws-btn-owned { background-color: #27ae60; cursor: not-allowed; }


/* --- BGM 控制按鈕樣式 --- */
#bgm-control-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #f1c40f;
    border: 2px solid #f1c40f;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    cursor: pointer;
    z-index: 2000;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}
#bgm-control-btn:hover {
    transform: scale(1.1);
    background-color: rgba(44, 62, 80, 0.8);
}

/* --- 計策顯示樣式 --- */
#tactic-display {
    text-align: center;
    margin: 10px 0;
}
#tactic-icon {
    width: 300px;
    height: 300px;
    object-fit: contain;
    border-radius: 8px;
    background-color: rgba(0,0,0,0.3);
    padding: 5px;
    border: 1px solid #7f8c8d;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
#tactic-display p {
    margin-top: 8px;
    font-size: 1.1em;
    color: #f1c40f;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

/* --- 徵才頁面 (recruit.html) 樣式 --- */
.recruit-container {
    max-width: 900px;
    text-align: center;
}
#recruit-card-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    perspective: 1000px;
}
.recruit-card {
    width: 160px;
    height: 240px;
    position: relative;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
.recruit-card.is-flipped {
    transform: rotateY(180deg);
}
.card-back, .card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.card-back {
    background-color: #4a627a;
    border: 2px solid #7f8c8d;
    color: #f1c40f;
    font-size: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.card-front {
    background-color: #34495e;
    border: 2px solid #f1c40f;
    transform: rotateY(180deg);
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.card-front .hero-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid #f1c40f;
    margin-top: 10px;
    object-fit: cover;
}
.card-front h4 {
    margin: 10px 0 5px 0;
}
.card-front h4.famous {
    color: #e74c3c;
}
.card-front .hero-stats p {
    margin: 2px 0;
    font-size: 14px;
    color: #bdc3c7;
}
.card-front .select-hero-btn {
    margin-top: auto;
    margin-bottom: 10px;
    padding: 6px 12px;
    font-size: 14px;
    background-color: #2980b9;
}
#recruit-action-btn, #draw-action-btn {
    padding: 15px 30px;
    font-size: 18px;
}
#recruit-result-text {
    margin-top: 20px;
    font-size: 1.2em;
    color: #f1c40f;
}

/* --- 馬廄頁面卡牌翻轉樣式 --- */
.stable-container {
    max-width: 900px;
    text-align: center;
}
#horse-card-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    min-height: 240px;
    perspective: 1000px;
}
.horse-draw-card {
    width: 160px;
    height: 240px;
    position: relative;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}
.horse-draw-card.is-flipped {
    transform: rotateY(180deg);
}
.card-back {
    background: url('../pict/馬牌.png') no-repeat center center;
    background-size: cover;
    border: 2px solid #a4825d;
}
.card-front.famous-horse {
    border-color: #e74c3c;
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.5);
}
.card-front .horse-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid #f1c40f;
    margin-top: 5px;
    object-fit: cover;
}
.card-front.famous-horse h4 {
    color: #e74c3c;
}
.card-front .horse-effect {
    font-size: 13px;
    color: #bdc3c7;
    flex-grow: 1;
    margin: 5px 0;
}
.card-front .equip-horse-btn {
    margin-bottom: 5px;
    padding: 6px 12px;
    font-size: 14px;
    background-color: #2980b9;
    width: 90%;
}
.card-front .equip-horse-btn:disabled {
    background-color: #7f8c8d;
    cursor: not-allowed;
}
#hero-selection-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}
.hero-select-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.hero-select-item:hover {
    background-color: rgba(0,0,0,0.4);
}
.hero-select-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}
.hero-select-item .info .current-horse {
    font-size: 12px;
    color: #f1c40f;
}

/* --- 馬廄頁面「我的馬匹」區塊樣式 --- */
#my-horses-section {
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid #4a627a;
    border-radius: 8px;
    padding: 20px 25px;
    margin-top: 30px;
}
#my-horses-section h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #4a627a;
    color: #f1c40f;
    font-size: 1.5em;
}
#my-horses-container {
    margin-top: 15px;
}
.inventory-item.manageable {
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}
.inventory-item.manageable:hover {
    background-color: rgba(0,0,0,0.5);
    transform: translateY(-2px);
}

/* --- 勢力狀態頁面 (status.html) 樣式 v2 --- */
body.page-status {
    background-image: url('../pict/內政.png');
    align-items: flex-start;
    padding: 30px 20px;
}
.status-container {
    max-width: 1000px;
    width: 100%;
}
.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: -10px;
}
.status-header .back-btn {
    padding: 10px 20px;
    font-size: 15px;
}
.status-container section {
    background-color: rgba(0, 0, 0, 0.25);
    border: 1px solid #4a627a;
    border-radius: 8px;
    padding: 20px 25px;
    margin-top: 25px;
}
.status-container section h2 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #4a627a;
    color: #f1c40f;
    font-size: 1.5em;
}
#overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    font-size: 1.1em;
}
#overview-grid .overview-item b {
    color: #ffffff;
    font-weight: bold;
    margin-left: 8px;
}
#overview-grid .full-width {
    grid-column: 1 / -1;
}
#hero-details-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.status-hero-card {
    display: grid;
    grid-template-columns: 2fr 5fr;
    gap: 20px;
    align-items: center;
    background-color: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #f1c40f;
}
.hero-card-left { text-align: center; }
.hero-card-left .hero-avatar {
    width: 100px; height: 100px; border-radius: 50%;
    border: 2px solid #f1c40f; object-fit: cover; margin-bottom: 10px;
}
.hero-card-left h4 { margin: 0; font-size: 1.3em; }
.hero-card-left p { margin: 5px 0 0 0; color: #bdc3c7; }
.hero-exp-bar {
    width: 90%; height: 20px; background-color: #2c3e50; border-radius: 10px;
    margin: 10px auto 0; position: relative; overflow: hidden;
}
.exp-fill { background-color: #f1c40f; height: 100%; }
.exp-text {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    color: #000; font-size: 12px; font-weight: bold;
}
.hero-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-item { background-color: rgba(0,0,0,0.3); padding: 8px 12px; border-radius: 4px; }
.stat-item b { float: right; color: #ffffff; }
.equipment-section { margin-top: 15px; border-top: 1px dashed #4a627a; padding-top: 15px; display: flex; flex-direction: column; gap: 10px; }
.equipment-slot { background-color: rgba(0,0,0,0.3); padding: 8px 12px; border-radius: 4px; }
.equipment-slot .equip-label { color: #f1c40f; }
.equipment-slot b { color: #ffffff; margin-left: 5px; }
.equipment-slot .equip-effect { color: #bdc3c7; font-size: 0.9em; margin-left: 10px; }
.equipment-slot.books .book-list div { margin-top: 5px; }
.equipment-slot.books .book-list div:first-child { margin-top: 0; }
.city-status-list {
    list-style: none; padding: 0; display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
}
.city-status-list li {
    background-color: #2980b9; color: white; text-align: center;
    padding: 10px; border-radius: 4px; font-weight: bold;
}
#inventory-container { display: flex; flex-direction: column; gap: 20px; }
.inventory-subsection h3 { margin: 0 0 10px 0; font-size: 1.2em; color: #ecf0f1; padding-bottom: 5px; border-bottom: 1px solid #4a627a;}
.inventory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.inventory-item { background-color: rgba(0,0,0,0.3); padding: 8px 12px; border-radius: 4px; }
.inventory-item.tech-item { background-color: #27ae60; color: white; cursor: help; }
.inventory-item .equipped-status { color: #f1c40f; font-size: 0.9em; margin-left: 5px; }
p.no-item-text { color: #7f8c8d; margin: 0; }
.developing-item {
    background-color: #e67e22 !important;
    color: white;
}
.dev-progress-bar {
    width: 100%;
    margin-top: 5px;
    height: 18px;
}
.dev-progress-bar .exp-text {
    color: white;
    text-shadow: 1px 1px 1px black;
}
.dev-progress-bar .exp-fill {
    background-color: #27ae60;
}
.equipment-type-selection {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}
.equipment-type-selection button {
    flex-grow: 1;
    background-color: #2980b9;
}
#book-selection-list {
    margin-top: 15px;
    border-top: 1px solid #4a627a;
    padding-top: 15px;
    max-height: 250px;
    overflow-y: auto;
}
.book-select-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 4px;
}
.book-select-item:hover {
    background-color: rgba(0,0,0,0.2);
}
.book-select-item input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
}
.book-select-item label {
    font-size: 1.1em;
    cursor: pointer;
}
.book-select-item label small {
    color: #bdc3c7;
    margin-left: 8px;
}

/* --- 鍛鍊頁面 (training.html) 樣式 --- */
.training-container {
    max-width: 900px;
}
.training-intro {
    text-align: center;
    color: #bdc3c7;
    font-size: 1.1em;
}
#hero-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.training-hero-card {
    background-color: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #4a627a;
}
.training-hero-card:hover {
    transform: translateY(-5px);
    border-color: #f1c40f;
}
.training-hero-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f1c40f;
}
.training-hero-card p {
    margin: 10px 0 0 0;
    font-weight: bold;
    font-size: 1.1em;
}
.training-hero-card small {
    color: #bdc3c7;
}
#training-panel h2 {
    text-align: center;
}
#video-container {
    width: 100%;
    max-width: 480px;
    margin: 20px auto;
    border: 2px solid #f1c40f;
    border-radius: 8px;
    overflow: hidden;
    background-color: #000;
}
#training-process-video {
    width: 100%;
    display: block;
}
#training-status-display {
    text-align: center;
    font-size: 1.3em;
    margin: 20px 0;
    padding: 15px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
}
.training-progress {
    color: #2ecc71;
    margin: 0;
}
.countdown-timer {
    color: #f1c40f;
    font-weight: bold;
    margin: 5px 0 0 0;
}
#stats-training-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 25px;
}
.training-stat-item {
    background-color: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #4a627a;
}
.training-stat-item .stat-info {
    display: flex;
    justify-content: space-between;
    font-size: 1.2em;
    margin-bottom: 8px;
}
.stat-name { font-weight: bold; }
.stat-value { color: #f1c40f; }
.stat-time { color: #bdc3c7; margin-bottom: 15px; }
.train-stat-btn {
    width: 100%;
    background-color: #2980b9;
}
.train-stat-btn:disabled {
    background-color: #7f8c8d;
    cursor: not-allowed;
}

/* --- 內政頁面 (hinterland.html) 樣式 --- */
.hinterland-container {
    display: flex;
    gap: 30px;
    width: 100%;
    max-width: 1000px;
    background-color: #34495e;
    padding: 25px 40px;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #4a627a;
}
.hinterland-left-panel {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.hinterland-right-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.hinterland-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}
.hinterland-actions button {
    width: 100%;
    font-size: 1.2em;
    padding: 15px;
}
.tax-timer-box {
    margin-top: auto;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}
.tax-timer-box h3 {
    margin: 0 0 10px 0;
    color: #bdc3c7;
}
#tax-timer {
    font-size: 3em;
    font-weight: bold;
    color: #f1c40f;
    margin-bottom: 10px;
}
#tax-amount {
    font-weight: bold;
    color: #ffffff;
}
#visual-display-box {
    flex-grow: 1;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
#visual-image {
    max-width: 70%;
    max-height: 70%; /* 確保圖片最大高度不超過其容器 */
    border-radius: 6px;
    margin-bottom: 20px;
    object-fit: contain; /* 確保圖片完整顯示並保持長寬比 */
}
#visual-text {
    font-size: 1.1em;
    line-height: 1.6;
    color: #ecf0f1;
}
.hinterland-status {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
}
.hinterland-status .status-item {
    font-size: 1.2em;
}
.hinterland-status .status-item b {
    color: #f1c40f;
    margin-left: 8px;
}


/* --- 納稅小遊戲頁面 (tax-game.html) 樣式 --- */
.tax-game-container {
    width: 90vw;
    height: 90vh;
    max-width: 1200px;
    background-color: rgba(0,0,0,0.5);
    border: 2px solid #f1c40f;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}
#game-stats {
    width: 100%;
    display: flex;
    justify-content: space-around;
    font-size: 1.5em;
    color: #ecf0f1;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1c40f;
}
#game-stats b {
    color: #f1c40f;
}
#game-area {
    width: 100%;
    flex-grow: 1;
    position: relative;
    border: 1px dashed #7f8c8d;
    border-radius: 8px;
    background-color: rgba(44, 62, 80, 0.5);
}
.tax-target {
    position: absolute;
    width: 40px;
    height: 40px;
    font-size: 30px;
    color: #f1c40f;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    text-shadow: 0 0 10px #e67e22;
    animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}
#start-game-btn {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 1.5em;
}
#custom-cursor {
    position: fixed;
    width: 60px;
    height: 60px;
    border: 2px solid #f1c40f;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    display: none;
    background-color: rgba(241, 196, 15, 0.2);
}
#custom-cursor.visible {
    display: block;
}


/* --- 建築等級與升級系統樣式 --- */
.building-status-box {
    background-color: rgba(0,0,0,0.2);
    border: 1px solid #4a627a;
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#building-level {
    font-size: 1.3em;
    font-weight: bold;
    color: #f1c40f;
}
#upgrade-section {
    display: flex;
    align-items: center;
    gap: 15px;
}
#upgrade-timer {
    font-size: 1.2em;
    color: #e67e22;
    font-weight: bold;
}
#upgrade-btn {
    background-color: #27ae60;
    padding: 10px 20px;
    font-size: 1em;
}
#upgrade-btn:disabled {
    background-color: #7f8c8d;
    cursor: not-allowed;
}

/* --- 戰鬥中技能視覺效果容器樣式 --- */
.skill-visual-container {
    width: 100%;
    height: 250px;
    background-color: rgba(0,0,0,0.4);
    border: 1px solid #7f8c8d;
    border-radius: 8px;
    margin: 20px 0;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}
#skill-visual-container img,
#skill-visual-container video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 6px;
    object-fit: contain;
}

/* --- 單挑 (計量條模式) 視窗樣式 --- */
#meter-duel-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(44, 62, 80, 0.95);
    border: 2px solid #c0392b;
    border-radius: 12px;
    padding: 20px 30px;
    z-index: 600;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.5);
    width: 500px;
}
#meter-duel-modal h3 {
    color: #e74c3c;
    font-size: 2em;
    margin-bottom: 15px;
}
.duel-arena {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 20px 0;
}
.duel-meter-container {
    text-align: center;
}
.duel-meter-container h4 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
}
.duel-meter {
    width: 60px;
    height: 200px;
    background: linear-gradient(to top, #2ecc71, #f1c40f, #e74c3c);
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}
.duel-pointer {
    position: absolute;
    bottom: 0;
    left: -5px;
    width: 70px;
    height: 4px;
    background-color: #ffffff;
    box-shadow: 0 0 5px #000;
}
.meter-max-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-weight: bold;
    color: #f1c40f;
    background-color: rgba(0,0,0,0.5);
    padding: 2px 5px;
    border-radius: 3px;
}
.duel-score {
    font-size: 1.5em;
    font-weight: bold;
    margin-top: 10px;
}
.duel-vs {
    font-size: 2em;
    font-weight: bold;
    color: #c0392b;
}
#duel-result-text {
    min-height: 1.5em;
    font-size: 1.2em;
    font-weight: bold;
    color: #f1c40f;
    margin-top: 15px;
}
#duel-attack-btn {
    padding: 10px 30px;
    font-size: 1.2em;
    margin-top: 15px;
}
/* --- 招募武將卡片星級樣式 --- */
.hero-tier {
    color: #f1c40f; /* 使用主題的金色 */
    font-size: 20px; /* 調整星星大小 */
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}



/* --- 狀態頁面 - 計時器總覽樣式 --- */
#timers-container {
    display: flex;
    flex-direction: column;
    gap: 15px; /* 分類之間增加間距 */
}

.task-category-header {
    margin: 10px 0 5px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid #4a627a;
    color: #ecf0f1;
    font-size: 1.2em;
}

.task-item-new {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0,0,0,0.2);
    padding: 10px 15px;
    border-radius: 6px;
    border-left: 4px solid #3498db; /* 使用藍色來標示進行中的任務 */
    margin-bottom: 5px; /* 每個項目之間的小間距 */
}

.task-name-new {
    font-size: 1.1em;
    color: #bdc3c7;
}

.task-timer-new {
    font-size: 1.2em;
    font-weight: bold;
    color: #f1c40f; /* 金黃色倒數計時 */
    font-family: monospace; /* 使用等寬字體讓數字更好看 */
}


/* --- 軍師頁面 (adviser.html) 樣式 --- */
body.page-adviser {
    background-image: url('../pict/書房.png');
}
.adviser-container {
    max-width: 900px;
    text-align: center;
}
.adviser-intro {
    color: #bdc3c7;
    font-size: 1.1em;
    min-height: 40px;
}
#adviser-selection-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    margin-top: 20px;
}
.adviser-card {
    background-color: rgba(0,0,0,0.3);
    border: 2px solid #4a627a;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}
.adviser-card:hover {
    transform: translateY(-5px);
    border-color: #f1c40f;
}
.adviser-card .avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid #f1c40f;
    object-fit: cover;
}
.adviser-card .title {
    color: #f1c40f;
    font-size: 1.3em;
    font-weight: bold;
}
.adviser-card .effect {
    color: #2ecc71;
    font-weight: bold;
}
.adviser-card button {
    margin-top: 15px;
    width: 100%;
}
#main-adviser-view {
    margin-top: 20px;
}
.current-adviser-info {
    display: flex;
    align-items: center;
    gap: 30px;
    background-color: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #f1c40f;
    text-align: left;
}
.current-adviser-info .avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid #f1c40f;
    object-fit: cover;
}
.current-adviser-info .info .title {
    color: #f1c40f;
    font-size: 1.5em;
    font-weight: bold;
}
.current-adviser-info .info .effect {
    font-size: 1.2em;
    font-weight: bold;
    color: #2ecc71;
}
#proposal-section {
    margin-top: 30px;
}
#proposal-btn {
    padding: 15px 40px;
    font-size: 1.3em;
}
#proposal-btn:disabled {
    background-color: #7f8c8d;
    cursor: not-allowed;
}
#proposal-cooldown {
    font-size: 1.1em;
    color: #e67e22;
    margin-top: 10px;
}
#proposal-result-box {
    margin-top: 20px;
    padding: 20px;
    background-color: rgba(0,0,0,0.3);
    border-radius: 8px;
    min-height: 60px;
    font-size: 1.2em;
    line-height: 1.6;
    color: #ecf0f1;
}


/* --- 軍師頁面 - 招募卡片排版優化 --- */

/* 啟用 Flexbox 佈局，讓卡片內容垂直排列 */
.adviser-card {
    display: flex;
    flex-direction: column;
    text-align: center; /* 讓頭像和標題置中 */
}

/* 新增的文字內容容器，設定為自動伸展，佔滿中間的可用空間 */
.adviser-card-body {
    flex-grow: 1; /* 讓此區塊自動填滿剩餘空間，將按鈕推向底部 */
    display: flex;
    flex-direction: column;
    justify-content: center; /* 讓內容在垂直方向上盡量居中 */
    margin: 15px 0;
}

/* 描述文字樣式微調 */
.adviser-card .description {
    color: #bdc3c7;
    font-size: 0.95em;
    min-height: 70px; /* 設定一個最小高度，避免卡片因文字少而過短 */
    flex-grow: 1; /* 同樣讓它有伸展性 */
}

/* 效果文字樣式強化 */
.adviser-card .effect {
    background-color: rgba(46, 204, 113, 0.1);
    border: 1px solid #2ecc71;
    color: #2ecc71;
    padding: 8px;
    border-radius: 6px;
    margin-top: 10px;
}

/* 關鍵！讓按鈕自動推至卡片底部，實現對齊 */
.adviser-card .recruit-adviser-btn {
    margin-top: auto; /* 魔法屬性！自動占據頂部所有可用空間 */
    flex-shrink: 0; /* 防止按鈕被壓縮 */
}


/* --- 內政頁面 - 總管區塊通用樣式 --- */
.manager-section-box {
    margin-top: 15px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.manager-section-box .manager-title {
    color: #bdc3c7;
    font-size: 1.1em;
}
.manager-section-box b {
    color: #ffffff;
    font-size: 1.2em;
    margin: 0 10px;
}
.manager-section-box small {
    color: #2ecc71; /* 綠色效果文字 */
    font-weight: bold;
}
.manager-section-box button {
    padding: 8px 18px;
    font-size: 1em;
    background-color: #2980b9;
    flex-shrink: 0; /* 防止按鈕被壓縮 */
}

/* --- 內政頁面 (hinterland.html) 新版排版樣式 --- */

/* 移除舊的 flex 佈局，改為由內部元素自行排列 */
.hinterland-container-reformed {
    max-width: 1100px; /* 稍微加寬以容納新佈局 */
}

/* 頂部狀態區 */
.hinterland-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #4a627a;
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.hinterland-header h1 {
    margin: 0;
}
.hinterland-status-reformed {
    display: flex;
    gap: 25px;
    background-color: rgba(0,0,0,0.2);
    padding: 10px 20px;
    border-radius: 8px;
}
.hinterland-status-reformed .status-item {
    font-size: 1.1em;
}
.hinterland-status-reformed .status-item b {
    color: #f1c40f;
    margin-left: 8px;
}

/* 中部主內容區 */
.hinterland-main-content {
    display: flex;
    gap: 30px;
}

/* 中部左側：操作面板 */
.main-action-panel {
    flex: 2; /* 佔據 2/3 寬度 */
    display: flex;
    flex-direction: column;
}
.main-action-panel #visual-display-box {
    height: 350px; /* 固定高度 */
}
.hinterland-actions-reformed {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}
.hinterland-actions-reformed button {
    font-size: 1.2em;
    padding: 15px;
}

/* 中部右側：管理面板 */
.management-panel {
    flex: 1; /* 佔據 1/3 寬度 */
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 8px;
}
.management-panel h3 {
    margin: 0 0 5px 0;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #4a627a;
}
.management-panel .manager-section-box.reformed {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 10px;
    padding: 15px;
}
.management-panel .manager-section-box.reformed div {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.management-panel .manager-section-box.reformed small {
    font-size: 0.9em;
    color: #bdc3c7;
}
.management-panel .back-btn {
    margin-top: auto; /* 將返回按鈕推到底部 */
}


/* 底部稅收區 */
.hinterland-footer {
    margin-top: 20px;
    border-top: 1px solid #4a627a;
    padding-top: 20px;
}
.hinterland-footer .tax-timer-box {
    max-width: 400px;
    margin: 0 auto; /* 置中 */
}

/* --- 內政頁面 (hinterland.html) 第三版排版樣式 --- */

/* 基礎二欄式佈局 */
.hinterland-container-style3 {
    display: flex;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
}
.left-panel-style3 {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background-color: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 8px;
}
.right-panel-style3 {
    flex: 2;
    display: flex;
}
.right-panel-style3 #visual-display-box {
    width: 100%;
    height: auto; /* 高度自動 */
    min-height: 500px; /* 最小高度 */
}

/* 左側面板內部群組樣式 */
.left-panel-style3 > div {
    background-color: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 6px;
}
.left-panel-style3 h1 {
    text-align: center;
    margin: 0 0 10px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #4a627a;
}
.left-panel-style3 h3 {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: #f1c40f;
}

/* 狀態總覽 */
.status-group .status-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

/* 主要操作 */
.actions-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.actions-group button {
    width: 100%;
    padding: 12px;
}

/* 計時器狀態 */
.timers-group .timer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background-color: rgba(0,0,0,0.3);
    border-radius: 4px;
    margin-top: 5px;
}
.timers-group .timer-item:not(.hidden) + .timer-item {
    margin-top: 8px; /* 項目間距 */
}
.timers-group .timer-item b {
    font-size: 1.1em;
    color: #e67e22;
}
.timers-group .timer-item small {
    color: #bdc3c7;
    margin-left: 5px;
}

/* 人事指派 */
.management-group .manager-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}
.management-group .manager-item + .manager-item {
    border-top: 1px dashed #4a627a;
}
.management-group .manager-item b {
    color: #ffffff;
    margin: 0 5px;
}
.management-group .manager-item button {
    padding: 5px 15px;
    font-size: 0.9em;
}

/* 返回按鈕 */
.left-panel-style3 .back-btn {
    margin-top: auto; /* 推至底部 */
    padding: 12px;
}

body.page-recruit-soldiers {
    background-image: url('../pict/徵兵場.png'); /* 您可以準備一張兵營的背景圖 */
}

/* --- 工房頁面 v2 - 管理員與頁籤樣式 --- */
.manager-section-box {
    margin-bottom: 15px;
    background-color: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.manager-section-box .manager-title {
    color: #bdc3c7;
    font-size: 1.1em;
}
.manager-section-box b {
    color: #ffffff;
    font-size: 1.2em;
    margin: 0 10px;
}
.manager-section-box small {
    color: #2ecc71;
    font-weight: bold;
}
.manager-section-box button {
    padding: 8px 18px;
    font-size: 1em;
    background-color: #2980b9;
    flex-shrink: 0;
}
.workshop-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}
.workshop-tabs .tab-btn {
    flex-grow: 1;
    padding: 12px;
    font-size: 1.1em;
    background-color: yellow;
    border: 1px solid #4a627a;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    opacity: 0.6;
}
.workshop-tabs .tab-btn.active {
    background-color: #4a627a;
    opacity: 1;
}
.workshop-list {
    display: none;
    flex-direction: column;
    gap: 15px;
}
.workshop-list.active {
    display: flex;
}


/* --- 募兵所 - 軍費按鈕排版優化 --- */
#gold-options-grid {
    display: grid;
    /* 建立一個響應式的網格佈局，每行最多4個按鈕 */
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    
    /* 關鍵：設定按鈕之間的水平與垂直間距為 10px */
    gap: 10px;

    /* 增加此區塊的上下邊距，讓整體佈局更好看 */
    margin: 20px 0;
}


/* --- 戰備確認 - 攻城武器選擇樣式 v2 --- */
#siege-selection-grid {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #4a627a;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.siege-option {
    display: flex;
    align-items: center;
    gap: 15px;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1em;
    cursor: pointer;
}

.siege-option:has(input:disabled) {
    cursor: not-allowed;
    opacity: 0.5;
}

.siege-option input {
    width: 20px;
    height: 20px;
}

.siege-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.siege-name {
    font-weight: bold;
    color: #eee;
}

.siege-stock {
    color: #ccc;
    font-size: 0.9em;
}

.siege-effect {
    color: #2ecc71;
    font-size: 0.9em;
}

/* --- 國家內政頁 - 浮動任務視窗樣式 --- */
#floating-task-panel {
    position: fixed; /* 關鍵：設定為固定定位，使其浮動 */
    top: 100px;      /* 距離頂部 100px */
    right: 20px;     /* 距離右側 20px */
    width: 280px;    /* 設定一個合適的寬度 */
    background-color: rgba(44, 62, 80, 0.9); /* 半透明深色背景 */
    border: 1px solid #4a627a;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    padding: 15px;
    z-index: 999; /* 確保它在最上層 */
    color: #ecf0f1;
}

#floating-task-panel h3 {
    margin: 0 0 10px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #4a627a;
    text-align: center;
    font-size: 1.2em;
}

#floating-task-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px; /* 設定最大高度，超出部分會產生捲軸 */
    overflow-y: auto;
}

/* 我們可以沿用 status.js 頁面的計時器樣式 */
#floating-task-list .task-item-new {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0,0,0,0.2);
    padding: 8px 12px;
    border-radius: 4px;
}

#floating-task-list .task-name-new {
    font-size: 1em;
    color: #bdc3c7;
}

#floating-task-list .task-timer-new {
    font-size: 1.1em;
    font-weight: bold;
    color: #f1c40f;
    font-family: monospace;
}

/* --- 國家內政頁 - 浮動任務視窗樣式優化 (移除卷軸) --- */

/* 移除最大高度限制與捲軸 */
#floating-task-list {
    max-height: none; /* 移除最大高度限制 */
    overflow-y: visible; /* 禁用垂直捲軸 */
    gap: 6px; /* 稍微縮小項目間距 */
}

/* 縮小每個任務項目本身的高度 */
#floating-task-list .task-item-new {
    padding: 6px 10px; /* 減少上下內邊距 */
}

/* 縮小任務名稱的字體 */
#floating-task-list .task-name-new {
    font-size: 0.9em; 
}

/* 縮小計時器的字體 */
#floating-task-list .task-timer-new {
    font-size: 1em;
}