/* 基礎重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 主體結構 */
body {
    font-family: 'Microsoft JhengHei', 'Segoe UI', 'PingFang TC', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* 主要內容包裹器 */
.main-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* 導航欄 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100%;
}

.navbar-container {
    width: 95%;
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 5px 15px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
    font-size: 14px;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* 主容器 */
.container {
    width: 95%;
    max-width: 1600px;
    margin: 30px auto;
    padding: 0 20px;
    flex: 1;
}

/* 頁面標題 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.page-title {
    font-size: 24px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 按鈕 */
.btn {
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    font-size: 14px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-success { background: #28a745; color: white; }
.btn-warning { background: #ffc107; color: #212529; position: relative; }
.btn-danger { background: #dc3545; color: white; }
.btn-info { background: #17a2b8; color: white; }
.btn-secondary { background: #6c757d; color: white; }

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.warning-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* 警報 */
.alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* 統計卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    text-align: center;
    transition: all 0.3s;
    border: 1px solid #e9ecef;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
}

.stat-card.warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
    color: #212529;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-card.warning .stat-number {
    color: #212529;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
}

.stat-card.warning .stat-label {
    color: rgba(33, 37, 41, 0.9);
}

/* 篩選區域 */
.filters {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border 0.3s;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 專案容器 */
.projects-container {
    width: 100%;
    margin-top: 20px;
}

/* 專案網格 */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    width: 100%;
}

/* 專案卡片 - 只有灰色模糊陰影，沒有橙色背景 */
.project-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e9ecef;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.project-card.warning {
    background: white;
    border-top: 1px solid #e9ecef;
    border-right: 1px solid #e9ecef;
    border-bottom: 1px solid #e9ecef;
}

/* 警告卡片懸停 - 使用相同的灰色陰影 */
.project-card.warning:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    background: white;
}

/* 警告指示器 */
.warning-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff9800;
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* 卡片內部結構 */
.project-header {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: #f8f9fa;
}

/* 警告卡片頭部背景相同 */
.project-card.warning .project-header {
    background: #f8f9fa;
}

.project-code {
    font-family: 'Courier New', monospace;
    background: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.project-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 10px 0 5px 0;
    line-height: 1.3;
}

.project-client {
    color: #666;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.project-body {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 15px;
    background: white;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid rgba(233, 236, 239, 0.8);
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    color: #6c757d;
    margin-bottom: 2px;
    font-size: 12px;
}

.info-value {
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

/* 更新資訊 */
.update-info {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    border-left: 4px solid #17a2b8;
}

.update-info.warning {
    background: #fff3cd;
    border-left-color: #ffc107;
    border: 1px solid #ffeaa7;
}

.update-info.danger {
    background: #FFF7FF;
    border-left-color: #dc3545;
    border: 1px solid #f5c6cb;
}

.update-time {
    font-size: 12px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.update-time.warning {
    color: #856404;
    font-weight: bold;
}

.update-time.danger {
    color: #721c24;
    font-weight: bold;
}

.update-reason {
    font-size: 12px;
    color: #495057;
    margin-top: 5px;
    padding: 5px;
    background: white;
    border-radius: 3px;
    border: 1px dashed #dee2e6;
    line-height: 1.4;
}

.update-reason-title {
    font-weight: bold;
    color: #495057;
    margin-right: 5px;
}

.no-update {
    color: #6c757d;
    font-style: italic;
}

/* 進度條 */
.progress-section {
    margin-top: 15px;
}

.progress-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    border-radius: 3px;
}

.progress-text {
    font-size: 12px;
    color: #6c757d;
    text-align: right;
}

/* 卡片底部 */
.project-footer {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    margin-top: auto;
}

/* 警告卡片底部背景相同 */
.project-card.warning .project-footer {
    background: #f8f9fa;
}

.project-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 6px 12px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 12px;
    color: white;
    transition: all 0.3s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: none;
    cursor: pointer;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.action-btn-update {
    background: #6f42c1;
}

.action-btn-update:hover {
    background: #5a32a3;
}

.create-time {
    font-size: 12px;
    color: #6c757d;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ========== 狀態徽章 - 原始樣式（需要被覆蓋） ========== */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    text-align: center;
    min-width: 70px;
}

.status-planning { background: #6c757d; }
.status-in_progress { background: #007bff; }
.status-paused { background: #ffc107; color: #212529; }
.status-completed { background: #28a745; }
.status-cancelled { background: #dc3545; }

.priority-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    color: white;
    margin-left: 5px;
}

.priority-low { background: #6c757d; }
.priority-medium { background: #17a2b8; }
.priority-high { background: #ffc107; color: #212529; }
.priority-urgent { background: #dc3545; }

/* ====================================================
 * 緊急修復：專案狀態標籤樣式（添加在檔案末尾）
 * 添加時間：2024-01-19
 * 目的：修正狀態標籤為橢圓形、白字、漸層背景
 * ==================================================== */

/* 強制覆蓋所有狀態標籤 */
.project-card .project-header span[class*="status-"],
.project-card .project-header .status-badge {
    border-radius: 20px !important;
    padding: 5px 15px !important;
    font-weight: 600 !important;
    color: white !important;
    min-width: 70px !important;
    text-align: center !important;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    display: inline-block !important;
    line-height: 1.2 !important;
    vertical-align: middle !important;
}

/* 規劃中 - 藍色漸層 */
.project-card .project-header .status-planning {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important;
    border-color: #2980b9 !important;
}

/* 進行中 - 綠色漸層 */
.project-card .project-header .status-in_progress {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
    border-color: #27ae60 !important;
}

/* 暫停中 - 橙色漸層 */
.project-card .project-header .status-paused {
    background: linear-gradient(135deg, #f39c12 0%, #d35400 100%) !important;
    border-color: #d35400 !important;
    color: white !important;
}

/* 已完成 - 紫色漸層 */
.project-card .project-header .status-completed {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%) !important;
    border-color: #8e44ad !important;
}

/* 已取消 - 紅色漸層 */
.project-card .project-header .status-cancelled {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
    border-color: #c0392b !important;
}

/* 確保導航欄狀態標籤不受影響 */
.navbar .user-info .status-badge {
    /* 保持原樣 */
    border-radius: 12px !important;
    padding: 3px 10px !important;
    font-size: 11px !important;
}

/* 分頁 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 5px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    color: #667eea;
    transition: all 0.3s;
}

.pagination a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 空狀態 */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #666;
    grid-column: 1 / -1;
    background: white;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

/* 專案計數 */
.projects-count {
    margin-top: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e9ecef;
}

/* 頁腳 */
.footer {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
    font-size: 13px;
    width: 100%;
}

.footer-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer p {
    margin-bottom: 5px;
}

.footer-info {
    font-size: 11px;
    opacity: 0.8;
    margin-bottom: 5px;
    font-family: 'Microsoft JhengHei', monospace;
}

.footer-update {
    font-size: 10px;
    opacity: 0.6;
}

/* 回到頂部按鈕 */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6b4290 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

#back-to-top i {
    font-size: 1.2rem;
}

/* 工具類 */
.text-danger { color: #dc3545; }
.text-warning { color: #ffc107; }
.text-center { text-align: center; }
.mt-3 { margin-top: 1rem; }
.d-flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-grow-1 { flex-grow: 1; }
.gap-2 { gap: 0.5rem; }

/* ===== 消防設備類型編輯頁面專用樣式 ===== */

/* 專案資訊框增強 - 白色卡片 */
.project-info-box {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-left: 4px solid #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
    margin-bottom: 20px;
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s ease;
    border: none;
}

.project-info-box:hover {
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.2);
    transform: translateY(-2px);
}

.project-info-box h5 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f8ff;
    font-weight: 600;
}

.project-info-box .row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.project-info-box p {
    padding: 8px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #3498db;
    margin-bottom: 8px;
    font-size: 14px;
}

.project-info-box strong {
    font-weight: 600;
    color: #4a5568;
    font-size: 13px;
    margin-right: 4px;
}

/* 目前設備類型框 - 紫色漸層 */
.current-types {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.current-types::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.current-types h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    font-weight: 600;
}

.current-types .type-badge-large {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    margin: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.current-types .type-badge-large:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.current-types .type-badge-large i {
    margin-right: 6px;
    font-size: 12px;
}

/* 選擇設備類型框 - 白色卡片 */
.currentb-types {
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.currentb-types:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e0;
}

.currentb-types h4 {
    color: #2d3748;
    font-size: 1.1rem;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #edf2f7;
    font-weight: 600;
}

/* 設備類型網格布局 */
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.fire-type-option {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fire-type-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.fire-type-option.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.fire-type-option .type-color {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    margin-right: 12px;
    flex-shrink: 0;
}

.fire-type-option .type-info {
    flex-grow: 1;
}

.fire-type-option .type-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fire-type-option .type-description {
    color: #6c757d;
    font-size: 13px;
    line-height: 1.4;
}

.fire-type-option .checkbox-wrapper {
    margin-left: 8px;
    flex-shrink: 0;
}

.fire-type-option .checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

/* 使用說明框 - 藍紫漸層 */
.usage-instructions-box {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.3);
    position: relative;
    overflow: hidden;
}

.usage-instructions-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #a8edea 0%, #fed6e3 100%);
}

.usage-instructions-box h5 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
    font-weight: 600;
}

.usage-instructions-box ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.usage-instructions-box li {
    padding: 8px 0 8px 20px;
    font-size: 14px;
    line-height: 1.5;
    color: white;
    position: relative;
}

.usage-instructions-box li::before {
    content: "✓";
    color: #a8edea;
    font-weight: bold;
    font-size: 14px;
    position: absolute;
    left: 0;
    top: 8px;
}

/* 按鈕樣式優化 */
.form-actions {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-success {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f7fafc;
    color: #4a5568;
    border: 1px solid #cbd5e0;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #edf2f7;
    border-color: #a0aec0;
    transform: translateY(-2px);
}

/* 動畫效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-info-box,
.current-types,
.currentb-types,
.usage-instructions-box {
    animation: fadeInUp 0.5s ease-out forwards;
}

/* 延遲動畫效果 */
.current-types { animation-delay: 0.1s; }
.currentb-types { animation-delay: 0.2s; }
.usage-instructions-box { animation-delay: 0.3s; }

/* 警報樣式優化 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInDown 0.3s ease-out;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 1px solid #ffeaa7;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 頁面標題優化 */
.page-title {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.page-header {
    margin-bottom: 25px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .navbar-container,
    .container,
    .footer-container {
        width: 100%;
        padding: 0 15px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .filter-form {
        grid-template-columns: 1fr;
    }
    
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .project-info {
        grid-template-columns: 1fr;
    }
    
    .project-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    /* 消防設備編輯頁面響應式 */
    .current-types, .project-info-box, .currentb-types, .usage-instructions-box {
        padding: 14px;
        margin-bottom: 16px;
        border-radius: 10px;
    }
    
    .type-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-success,
    .btn-secondary {
        width: 100%;
        text-align: center;
    }
    
    .current-types .type-badge-large {
        margin: 3px;
        font-size: 12px;
        padding: 5px 10px;
    }
}

/* 頁腳樣式增強 */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    padding: 20px 0;
    margin-top: 40px;
    border-top: 4px solid #3498db;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.footer-update {
    font-size: 13px;
    color: #bdc3c7;
    background: rgba(0,0,0,0.2);
    padding: 6px 12px;
    border-radius: 20px;
}

.footer-links {
    display: flex;
    gap: 15px;
}

.footer-links a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-links a:hover {
    color: #3498db;
}

/* 通知動畫 */
@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
}

@keyframes notificationSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%) translateY(-20px);
    }
}

/* 通用表格樣式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
}

.data-table th {
    background: #667eea;
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* 載入動畫 */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 提示工具 */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    line-height: 1.4;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 滾動條美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* 使用者管理頁面專用樣式 */
.user-form-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

.form-group .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group .form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.form-check-label {
    color: #555;
    font-size: 14px;
}

.required::after {
    content: " *";
    color: #dc3545;
}

.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn {
    padding: 10px 24px;
    border-radius: 5px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.help-text {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
    font-style: italic;
}

/* 角色選擇樣式 */
.role-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.role-option {
    padding: 8px 16px;
    border: 2px solid #e9ecef;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 13px;
    font-weight: 500;
}

.role-option:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.role-option.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}