/* --- 專業藍色主題 --- */

/* * 色彩定義:
 * 主要藍 (標題): #34495e
 * 次要藍 (表格標頭背景): #f0f4f8
 * 邊框灰藍: #bdc3c7
 * 滑鼠懸停淡藍: #e8f7ff
 * 主要文字: #333
*/

/* --- 1. 通用與文字樣式 --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding-top: 70px; /* 為固定的導覽列預留空間 (縮小) */
    line-height: 1.5; /* (縮小) */
    background-color: #f4f7f6;
    color: #333;
}

h1, h2, h3, h4, h5, h6 {
    color: #34495e;
}

pre {
    white-space: pre-wrap;
    font-family: inherit;
}

a {
    color: #007bff;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* --- 2. 佈局與容器 --- */
.content {
    padding: 18px 25px; /* (縮小) */
    max-width: 1200px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 20px; /* (縮小) */
    padding: 20px; /* (縮小) */
    border: 1px solid #dadedf;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
}

.section-title {
    font-size: 1.2em; /* (縮小) */
    font-weight: 600;
    margin-bottom: 15px; /* (縮小) */
    color: #34495e;
    border-bottom: 1px solid #e0e6ec;
    padding-bottom: 12px; /* (縮小) */
}

/* --- 3. 表格樣式 --- */
table, .form-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px; /* (縮小) */
}

th, td {
    border: 1px solid #e0e6ec;
    padding: 9px; /* (縮小) */
    text-align: left;
    vertical-align: middle;
}

th {
    background-color: #f0f4f8;
    color: #34495e;
    font-weight: 600;
    text-align: center;
}

.form-table td {
    text-align: center;
}

tr:nth-child(even) {
    background-color: #fcfdfe;
}

tr:hover {
    background-color: #e8f7ff;
}

.action-cell {
    text-align: center;
}

/* --- 4. 表單與 Grid 樣式 --- */
label {
    display: block;
    margin-top: 10px;
    font-weight: 600;
    color: #34495e;
}

input[type="text"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 7px 10px; /* (縮小) */
    margin-top: 4px; /* (縮小) */
    margin-bottom: 4px; /* (縮小) */
    box-sizing: border-box;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    background-color: #fff;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    border-color: #4A90E2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
    outline: none;
}

textarea {
    height: 80px; /* (縮小) */
    resize: vertical;
}

.form-grid, .prelim-grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px 20px;
    align-items: center;
}
.form-grid label, .prelim-grid > span {
    font-weight: bold;
    text-align: right;
    color: #34495e;
}
.history-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.history-grid .full-width {
    grid-column: 1 / -1;
}

/* --- ✨ --- 新增：高亮報告欄位的輸入框 --- ✨ --- */
.report-input {
    background-color: #ffffe0 !important; /* 淺黃色 */
}

/* 確保在唯讀頁面，被禁用的輸入框也能顯示高亮 */
input.report-input:disabled,
textarea.report-input:disabled,
select.report-input:disabled {
    background-color: #ffffe0 !important;
    opacity: 1; /* 取消禁用時的半透明效果 */
    -webkit-text-fill-color: #333; /* 確保文字顏色正常 */
}


/* --- 5. 按鈕與連結樣式 --- */
.button-group {
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
}

.button, button {
    display: inline-block;
    color: white !important;
    padding: 6px 12px; /* (縮小) */
    font-size: 0.8rem; /* (縮小) */
    text-decoration: none;
    margin: 5px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    text-align: center;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.button:hover, button:hover {
    text-decoration: none;
    opacity: 0.9;
    transform: translateY(-1px);
}

.button { background-color: #4CAF50; }
.button-secondary { background-color: #2196F3; }
.button-draft { background-color: #f0ad4e; }
.button-draft:hover { background-color: #ec971f; }
.button-back { background-color: #f44336; }

/* --- 6. 特定元件樣式 --- */
.status-new, .status-draft, .status-done {
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: 500;
    display: inline-block;
}
.status-new { background-color: #FFF3CD; color: #856404; }
.status-draft { background-color: #D1ECF1; color: #0C5460; }
.status-done { background-color: #D4EDDA; color: #155724; }

/* --- 7. 導覽列 --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    border-bottom: 1px solid #ddd;
    padding: 8px 25px; /* (縮小) */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    z-index: 1000;
}

/* ✨ --- 更新 .nav-left 樣式 --- ✨ */
.nav-left {
    display: flex;
    align-items: center;
    gap: 10px; /* 在 Logo 和按鈕之間增加一些間距 */
}

/* ✨ --- 新增 Logo 樣式 --- ✨ */
.navbar-brand {
    margin-right: 15px; /* Logo 和第一個按鈕之間的距離 */
}
.navbar-logo {
    height: 40px; /* 控制導覽列中 Logo 的高度 */
    width: auto;
    display: block; /* 移除圖片下方的多餘空間 */
}


.navbar a {
    margin-right: 15px;
    text-decoration: none;
}
.navbar a.button {
    margin: 0; /* 移除按鈕的預設 margin，由 gap 控制 */
    color: white !important;
}

.navbar-page-title {
    color: #34495e;
    font-size: 1.0em; /* (縮小) */
    font-weight: 500;
    text-align: center;
    flex-grow: 1;
}

/* ✨ --- 新增 .nav-right 樣式 --- ✨ */
.nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.nav-right span {
    margin-right: 15px;
    font-weight: 500;
}


.navbar-page-title strong {
    font-weight: 700;
}

/* --- 8. Flash 訊息 --- */
.flash-messages {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}
.flash-messages li {
    padding: 12px; /* (縮小) */
    margin-bottom: 10px;
    border-radius: 5px;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.flash-success { background-color: #28a745; }
.flash-error { background-color: #dc3545; }
.flash-info { background-color: #17a2b8; }

