backup: 完成 HR_position_ 表格前綴重命名與欄位對照表整理

變更內容:
- 所有資料表加上 HR_position_ 前綴
- 整理完整欄位顯示名稱與 ID 對照表
- 模組化 JS 檔案 (admin.js, ai.js, csv.js 等)
- 專案結構優化 (docs/, scripts/, tests/ 等)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-09 12:05:20 +08:00
parent a068ef9704
commit a6af297623
82 changed files with 8685 additions and 4933 deletions

View File

@@ -14,7 +14,39 @@
--green: #27ae60;
--green-dark: #1e8449;
/* 模組專屬色彩 */
/* 崗位基礎資料 - 藍色 (Primary) */
--module-position: #1a5276;
--module-position-dark: #0e3a53;
--module-position-shadow: rgba(26, 82, 118, 0.4);
/* 職務基礎資料 - 橘色 */
--module-job: #e67e22;
--module-job-dark: #d35400;
--module-job-shadow: rgba(230, 126, 34, 0.4);
/* 部門職責 - 紫色 */
--module-deptfunc: #8b5cf6;
--module-deptfunc-dark: #6d28d9;
--module-deptfunc-shadow: rgba(139, 92, 246, 0.4);
/* 崗位描述 - 綠色 */
--module-desc: #27ae60;
--module-desc-dark: #1e8449;
--module-desc-shadow: rgba(39, 174, 96, 0.4);
/* 崗位清單 - 青色 */
--module-list: #14b8a6;
--module-list-dark: #0d9488;
--module-list-shadow: rgba(20, 184, 166, 0.4);
/* 管理者頁面 - 玫紅色 */
--module-admin: #f43f5e;
--module-admin-dark: #e11d48;
--module-admin-shadow: rgba(244, 63, 94, 0.4);
/* 背景色 */
--bg: #f4f6f9;
--bg-main: #f4f6f9;
--bg-card: #ffffff;
--border: #d5dbdf;

View File

@@ -142,17 +142,25 @@ select {
/* ==================== Buttons ==================== */
.btn {
padding: 12px 24px;
padding: 10px 20px;
border: none;
border-radius: 6px;
border-radius: 8px;
font-family: inherit;
font-size: 0.9rem;
font-size: 0.875rem;
font-weight: 500;
cursor: pointer;
display: flex;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
transition: all 0.2s ease;
white-space: nowrap;
text-decoration: none;
line-height: 1.4;
}
.btn:active {
transform: scale(0.98);
}
.btn-primary {
@@ -162,8 +170,9 @@ select {
}
.btn-primary:hover {
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(26, 82, 118, 0.4);
transform: translateY(-2px);
box-shadow: 0 4px 16px rgba(26, 82, 118, 0.4);
filter: brightness(1.05);
}
.btn-secondary {
@@ -173,28 +182,107 @@ select {
}
.btn-secondary:hover {
background: rgba(26, 82, 118, 0.05);
background: var(--primary);
color: white;
transform: translateY(-1px);
}
.btn-success {
background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
color: white;
box-shadow: 0 2px 8px rgba(39, 174, 96, 0.3);
}
.btn-success:hover {
transform: translateY(-2px);
box-shadow: 0 4px 16px rgba(39, 174, 96, 0.4);
filter: brightness(1.05);
}
.btn-warning {
background: linear-gradient(135deg, #f39c12 0%, #d68910 100%);
color: white;
box-shadow: 0 2px 8px rgba(243, 156, 18, 0.3);
}
.btn-warning:hover {
transform: translateY(-2px);
box-shadow: 0 4px 16px rgba(243, 156, 18, 0.4);
filter: brightness(1.05);
}
.btn-danger {
background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
color: white;
box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}
.btn-danger:hover {
transform: translateY(-2px);
box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4);
filter: brightness(1.05);
}
.btn-cancel {
background: #f0f3f5;
color: var(--text-secondary);
border: 1px solid var(--border);
}
.btn-cancel:hover {
background: #e5e9ec;
color: var(--text-primary);
border-color: #d0d5da;
}
/* 特殊漸層按鈕 - 儲存至崗位清單 */
.btn-gradient-purple {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}
.btn-gradient-purple:hover {
transform: translateY(-2px);
box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
filter: brightness(1.05);
}
.btn svg {
width: 18px;
height: 18px;
fill: currentColor;
flex-shrink: 0;
}
/* 小尺寸按鈕 */
.btn-sm {
padding: 6px 12px;
font-size: 0.8rem;
border-radius: 6px;
}
.btn-sm svg {
width: 14px;
height: 14px;
}
/* 大尺寸按鈕 */
.btn-lg {
padding: 14px 28px;
font-size: 1rem;
border-radius: 10px;
}
.btn-lg svg {
width: 20px;
height: 20px;
}
.btn-lookup {
padding: 10px 16px;
border: 1.5px solid var(--border);
border-radius: 6px;
border-radius: 8px;
background: #f8fafc;
color: var(--text-secondary);
font-size: 0.85rem;
@@ -207,17 +295,19 @@ select {
background: var(--primary);
color: white;
border-color: var(--primary);
transform: translateY(-1px);
}
.btn-icon {
width: 38px;
height: 38px;
padding: 0;
border: 1.5px solid var(--border);
border-radius: 6px;
border-radius: 8px;
background: #f8fafc;
color: var(--text-secondary);
cursor: pointer;
display: flex;
display: inline-flex;
align-items: center;
justify-content: center;
transition: all 0.2s ease;
@@ -227,6 +317,7 @@ select {
background: var(--primary);
color: white;
border-color: var(--primary);
transform: translateY(-1px);
}
.btn-icon svg {
@@ -265,84 +356,139 @@ select {
fill: currentColor;
}
/* ==================== AI Bags (Three Fortune Bags) ==================== */
.ai-bags-container {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 8px;
margin-bottom: 16px;
/* ==================== AI Helper (AI 幫我想) ==================== */
.ai-helper-container {
display: flex;
flex-direction: column;
gap: 12px;
margin-bottom: 20px;
padding: 16px;
background: linear-gradient(135deg, rgba(155, 89, 182, 0.08) 0%, rgba(142, 68, 173, 0.05) 100%);
border: 1px solid rgba(155, 89, 182, 0.2);
border-radius: var(--radius);
}
.ai-bag {
position: relative;
padding: 8px 12px;
.ai-helper-btn {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
width: 100%;
padding: 14px 24px;
background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
border-radius: 6px;
color: white;
border: none;
border-radius: 8px;
font-family: inherit;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
transition: all 0.3s ease;
box-shadow: 0 2px 8px rgba(155, 89, 182, 0.3);
text-align: center;
}
.ai-bag:hover {
.ai-helper-btn:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(155, 89, 182, 0.5);
box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
}
.ai-bag:active {
.ai-helper-btn:active {
transform: translateY(-1px);
}
.ai-bag .bag-icon {
font-size: 1rem;
margin-bottom: 2px;
}
.ai-bag .bag-title {
color: white;
font-weight: 600;
font-size: 0.75rem;
margin-bottom: 2px;
}
.ai-bag .bag-subtitle {
color: rgba(255, 255, 255, 0.8);
font-size: 0.65rem;
margin-top: 2px;
}
.ai-bag .bag-edit-btn {
position: absolute;
top: 4px;
right: 4px;
background: rgba(255, 255, 255, 0.2);
border: none;
border-radius: 3px;
padding: 2px 4px;
cursor: pointer;
font-size: 0.7rem;
transition: all 0.2s ease;
line-height: 1;
}
.ai-bag .bag-edit-btn:hover {
background: rgba(255, 255, 255, 0.3);
transform: scale(1.1);
}
.ai-bag.loading {
pointer-events: none;
.ai-helper-btn:disabled {
opacity: 0.7;
cursor: not-allowed;
transform: none;
}
.ai-bag .spinner {
width: 14px;
height: 14px;
.ai-helper-btn svg {
flex-shrink: 0;
}
/* Prompt Editor */
.ai-prompt-editor {
display: flex;
flex-direction: column;
gap: 8px;
}
.prompt-header {
display: flex;
align-items: center;
justify-content: space-between;
}
.prompt-label {
font-size: 0.85rem;
font-weight: 500;
color: var(--text-secondary);
}
.prompt-reset-btn {
display: flex;
align-items: center;
justify-content: center;
width: 28px;
height: 28px;
padding: 0;
background: rgba(155, 89, 182, 0.1);
border: 1px solid rgba(155, 89, 182, 0.2);
border-radius: 6px;
color: #8e44ad;
cursor: pointer;
transition: all 0.2s ease;
}
.prompt-reset-btn:hover {
background: rgba(155, 89, 182, 0.2);
border-color: rgba(155, 89, 182, 0.3);
}
.prompt-textarea {
width: 100%;
padding: 12px;
border: 1px solid var(--border);
border-radius: 6px;
font-family: 'Monaco', 'Consolas', monospace;
font-size: 0.85rem;
line-height: 1.5;
resize: vertical;
background: white;
color: var(--text-primary);
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.prompt-textarea:focus {
outline: none;
border-color: #9b59b6;
box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.15);
}
.prompt-textarea::placeholder {
color: var(--text-secondary);
opacity: 0.6;
}
/* AI Helper Loading State */
.ai-helper-container.loading .ai-helper-btn {
pointer-events: none;
}
.ai-helper-container.loading .ai-helper-btn::after {
content: '';
width: 18px;
height: 18px;
border: 2px solid rgba(255, 255, 255, 0.3);
border-top-color: white;
border-radius: 50%;
animation: spin 0.8s linear infinite;
margin: 4px auto;
margin-left: 8px;
}
/* Legacy: Keep old styles for backward compatibility */
.ai-bags-container {
display: none; /* Hidden - replaced by ai-helper-container */
}
/* ==================== Old AI Button (Deprecated) ==================== */
@@ -640,3 +786,369 @@ select {
overflow-x: auto;
max-height: 300px;
}
/* ==================== Responsive Design for Components ==================== */
/* Large Tablets (1024px) */
@media (max-width: 1024px) {
.form-grid {
gap: 16px 24px;
}
.form-grid.three-cols {
grid-template-columns: repeat(2, 1fr);
}
.tab-btn {
padding: 14px 24px;
font-size: 0.9rem;
}
.ai-bags-container {
gap: 6px;
}
}
/* Tablets (768px) */
@media (max-width: 768px) {
/* Tabs */
.tabs {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.tab-btn {
padding: 12px 16px;
font-size: 0.85rem;
white-space: nowrap;
}
.tab-content {
padding: 20px 16px;
}
/* Form Grid */
.form-grid,
.form-grid.three-cols {
grid-template-columns: 1fr;
gap: 16px;
}
/* Form Actions */
.form-actions {
flex-direction: column;
gap: 16px;
padding: 16px;
}
.action-buttons {
width: 100%;
flex-wrap: wrap;
justify-content: center;
}
.action-buttons .btn {
flex: 1;
min-width: calc(50% - 6px);
justify-content: center;
}
/* Buttons */
.btn {
padding: 10px 16px;
font-size: 0.85rem;
}
.btn svg {
width: 16px;
height: 16px;
}
.nav-buttons {
gap: 6px;
}
.nav-btn {
width: 32px;
height: 32px;
}
/* AI Bags */
.ai-bags-container {
grid-template-columns: repeat(3, 1fr);
gap: 4px;
}
.ai-bag {
padding: 6px 8px;
}
.ai-bag .bag-title {
font-size: 0.7rem;
}
.ai-bag .bag-subtitle {
font-size: 0.6rem;
}
.ai-bag .bag-icon {
font-size: 0.9rem;
}
/* Toggle */
.toggle-group {
flex-wrap: wrap;
}
.toggle-switch {
width: 46px;
height: 24px;
}
.toggle-slider:before {
height: 18px;
width: 18px;
}
.toggle-switch input:checked + .toggle-slider:before {
transform: translateX(22px);
}
/* Checkbox */
.checkbox-group {
grid-template-columns: 1fr;
}
/* Modal */
.modal {
width: 95%;
max-width: none;
margin: 16px;
}
.modal-header {
padding: 16px;
}
.modal-header h3 {
font-size: 1rem;
}
.modal-body {
padding: 16px;
}
.modal-footer {
padding: 12px 16px;
flex-wrap: wrap;
}
.modal-footer .btn {
flex: 1;
min-width: calc(50% - 6px);
}
/* Toast */
.toast {
top: 12px;
right: 12px;
left: 12px;
padding: 12px 16px;
font-size: 0.9rem;
}
.toast svg {
width: 20px;
height: 20px;
}
/* Data Preview */
.data-preview {
padding: 16px;
margin-top: 16px;
}
.data-preview pre {
padding: 12px;
font-size: 0.75rem;
max-height: 200px;
}
}
/* Mobile Phones (480px) */
@media (max-width: 480px) {
/* Tabs */
.tab-btn {
padding: 10px 12px;
font-size: 0.8rem;
}
.tab-content {
padding: 16px 12px;
}
/* Form */
.form-group label {
font-size: 0.8rem;
}
input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
padding: 8px 12px;
font-size: 0.85rem;
}
.input-wrapper {
flex-direction: column;
align-items: stretch;
}
.btn-lookup {
padding: 8px 12px;
font-size: 0.8rem;
}
/* Form Actions */
.form-actions {
padding: 12px;
}
.action-buttons {
flex-direction: column;
}
.action-buttons .btn {
width: 100%;
min-width: 100%;
}
/* Buttons */
.btn {
padding: 10px 14px;
font-size: 0.8rem;
gap: 6px;
}
.btn-icon {
width: 34px;
height: 34px;
}
/* AI Bags */
.ai-bags-container {
grid-template-columns: 1fr 1fr 1fr;
gap: 4px;
}
.ai-bag {
padding: 6px 4px;
}
.ai-bag .bag-icon {
font-size: 0.85rem;
}
.ai-bag .bag-title {
font-size: 0.65rem;
}
.ai-bag .bag-subtitle {
display: none;
}
.ai-bag .bag-edit-btn {
padding: 1px 3px;
font-size: 0.6rem;
}
/* AI Generate Button */
.ai-generate-btn {
padding: 10px 16px;
font-size: 0.85rem;
}
/* Toggle */
.toggle-label {
font-size: 0.8rem;
}
/* Checkbox */
.checkbox-item {
padding: 8px 10px;
}
.checkbox-item input {
width: 16px;
height: 16px;
}
.checkbox-item label {
font-size: 0.85rem;
}
/* Modal */
.modal {
margin: 8px;
width: calc(100% - 16px);
}
.modal-header {
padding: 12px;
}
.modal-header h3 {
font-size: 0.95rem;
}
.modal-close {
width: 28px;
height: 28px;
}
.modal-body {
padding: 12px;
}
.modal-footer {
padding: 10px 12px;
gap: 8px;
}
.modal-footer .btn {
padding: 8px 12px;
font-size: 0.8rem;
}
/* Toast */
.toast {
top: 8px;
right: 8px;
left: 8px;
padding: 10px 14px;
font-size: 0.85rem;
gap: 8px;
}
.toast svg {
width: 18px;
height: 18px;
}
/* Data Preview */
.data-preview {
padding: 12px;
}
.data-preview h4 {
font-size: 0.85rem;
}
.data-preview pre {
padding: 10px;
font-size: 0.7rem;
max-height: 150px;
}
}

View File

@@ -1,25 +1,37 @@
/**
* Layout Styles - 布局樣式
* 包含容器、整體布局、Header、模組切換器
* Two-Column Layout: 左側導航 + 右側內容
*/
/* ==================== Container ==================== */
/* ==================== Main Layout ==================== */
.app-container {
max-width: 1200px;
margin: 0 auto;
padding: 24px;
display: flex;
min-height: 100vh;
background: var(--bg);
}
/* ==================== User Info Bar ==================== */
.user-info-bar {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: var(--radius);
padding: 12px 20px;
margin-bottom: 20px;
/* ==================== Sidebar (左側導航欄) ==================== */
.sidebar {
width: 240px;
min-width: 240px;
background: linear-gradient(180deg, #1a1f2e 0%, #2d3748 100%);
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: var(--shadow);
flex-direction: column;
position: fixed;
left: 0;
top: 0;
bottom: 0;
z-index: 100;
box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}
/* ==================== User Info (側邊欄頂部) ==================== */
.user-info-bar {
padding: 20px 16px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
display: flex;
flex-direction: column;
gap: 12px;
}
.user-info {
@@ -30,117 +42,147 @@
}
.user-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.2);
width: 44px;
height: 44px;
border-radius: 10px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
display: flex;
align-items: center;
justify-content: center;
font-weight: bold;
font-size: 1.1rem;
color: white;
}
.user-details {
display: flex;
flex-direction: column;
flex: 1;
overflow: hidden;
}
.user-name {
font-weight: 600;
font-size: 1rem;
font-size: 0.95rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.user-role {
font-size: 0.85rem;
opacity: 0.9;
font-size: 0.75rem;
opacity: 0.7;
color: #a0aec0;
}
.logout-btn {
padding: 8px 20px;
border: 2px solid rgba(255, 255, 255, 0.3);
border-radius: 6px;
background: rgba(255, 255, 255, 0.1);
color: #ffffff;
width: 100%;
padding: 10px 16px;
border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: 8px;
background: rgba(255, 255, 255, 0.05);
color: #e2e8f0;
font-family: inherit;
font-size: 0.9rem;
font-size: 0.85rem;
font-weight: 500;
cursor: pointer;
display: flex;
align-items: center;
gap: 8px;
transition: all 0.3s ease;
}
.logout-btn:hover {
background: rgba(255, 255, 255, 0.2);
border-color: rgba(255, 255, 255, 0.5);
transform: translateY(-2px);
}
.logout-btn svg {
width: 18px;
height: 18px;
fill: currentColor;
}
/* ==================== Module Selector ==================== */
.module-selector {
display: flex;
gap: 12px;
margin-bottom: 20px;
flex-wrap: wrap;
}
.module-btn {
flex: 1;
min-width: 200px;
padding: 14px 20px;
border: 2px solid var(--border);
border-radius: var(--radius);
background: var(--bg-card);
font-family: inherit;
font-size: 0.95rem;
font-weight: 500;
color: var(--text-secondary);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
transition: all 0.3s ease;
gap: 8px;
transition: all 0.2s ease;
}
.logout-btn:hover {
background: rgba(239, 68, 68, 0.2);
border-color: rgba(239, 68, 68, 0.4);
color: #fca5a5;
}
.logout-btn svg {
width: 16px;
height: 16px;
fill: currentColor;
}
/* ==================== Module Selector (垂直導航選單) ==================== */
.module-selector {
display: flex;
flex-direction: column;
padding: 16px 12px;
gap: 6px;
flex: 1;
overflow-y: auto;
}
.module-btn {
width: 100%;
padding: 12px 14px;
border: none;
border-radius: 8px;
background: transparent;
font-family: inherit;
font-size: 0.875rem;
font-weight: 500;
color: #a0aec0;
cursor: pointer;
display: flex;
align-items: center;
gap: 12px;
transition: all 0.2s ease;
text-align: left;
}
.module-btn:hover {
border-color: var(--primary-light);
color: var(--primary);
transform: translateY(-2px);
box-shadow: var(--shadow);
background: rgba(255, 255, 255, 0.08);
color: #e2e8f0;
}
.module-btn.active {
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
border-color: var(--primary);
background: linear-gradient(135deg, var(--module-position) 0%, var(--module-position-dark) 100%);
color: white;
box-shadow: 0 4px 15px rgba(26, 82, 118, 0.3);
box-shadow: 0 4px 12px var(--module-position-shadow);
}
.module-btn.active.job-active {
background: linear-gradient(135deg, var(--accent) 0%, #d35400 100%);
border-color: var(--accent);
box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3);
background: linear-gradient(135deg, var(--module-job) 0%, var(--module-job-dark) 100%);
box-shadow: 0 4px 12px var(--module-job-shadow);
}
.module-btn.active.deptfunc-active {
background: linear-gradient(135deg, var(--module-deptfunc) 0%, var(--module-deptfunc-dark) 100%);
box-shadow: 0 4px 12px var(--module-deptfunc-shadow);
}
.module-btn.active.desc-active {
background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
border-color: var(--green);
box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
background: linear-gradient(135deg, var(--module-desc) 0%, var(--module-desc-dark) 100%);
box-shadow: 0 4px 12px var(--module-desc-shadow);
}
.module-btn.active.list-active {
background: linear-gradient(135deg, var(--module-list) 0%, var(--module-list-dark) 100%);
box-shadow: 0 4px 12px var(--module-list-shadow);
}
.module-btn.active.admin-active {
background: linear-gradient(135deg, var(--module-admin) 0%, var(--module-admin-dark) 100%);
box-shadow: 0 4px 12px var(--module-admin-shadow);
}
.module-btn svg {
width: 22px;
height: 22px;
width: 20px;
height: 20px;
fill: currentColor;
flex-shrink: 0;
}
/* ==================== Main Content (右側內容區) ==================== */
.main-content {
flex: 1;
margin-left: 240px;
padding: 24px 32px;
min-height: 100vh;
background: var(--bg);
}
.module-content {
@@ -159,17 +201,29 @@
gap: 16px;
margin-bottom: 24px;
padding: 20px 28px;
background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
background: linear-gradient(135deg, var(--module-position) 0%, var(--module-position-dark) 100%);
border-radius: var(--radius);
box-shadow: var(--shadow);
}
.app-header.job-header {
background: linear-gradient(135deg, var(--accent) 0%, #d35400 100%);
background: linear-gradient(135deg, var(--module-job) 0%, var(--module-job-dark) 100%);
}
.app-header.deptfunc-header {
background: linear-gradient(135deg, var(--module-deptfunc) 0%, var(--module-deptfunc-dark) 100%);
}
.app-header.desc-header {
background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
background: linear-gradient(135deg, var(--module-desc) 0%, var(--module-desc-dark) 100%);
}
.app-header.list-header {
background: linear-gradient(135deg, var(--module-list) 0%, var(--module-list-dark) 100%);
}
.app-header.admin-header {
background: linear-gradient(135deg, var(--module-admin) 0%, var(--module-admin-dark) 100%);
}
.app-header .icon {
@@ -255,3 +309,214 @@
height: 1px;
background: linear-gradient(to right, var(--border), transparent);
}
/* ==================== Sidebar Footer ==================== */
.sidebar-footer {
padding: 16px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
font-size: 0.75rem;
color: #64748b;
text-align: center;
}
/* ==================== Responsive Design ==================== */
/* Large Tablets & Small Desktops (1024px) */
@media (max-width: 1024px) {
.sidebar {
width: 200px;
min-width: 200px;
}
.main-content {
margin-left: 200px;
padding: 20px 24px;
}
.app-header {
padding: 16px 20px;
}
.app-header h1 {
font-size: 1.3rem;
}
}
/* Tablets (768px) */
@media (max-width: 768px) {
.app-container {
flex-direction: column;
}
.sidebar {
position: relative;
width: 100%;
min-width: 100%;
flex-direction: row;
flex-wrap: wrap;
padding: 12px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.user-info-bar {
width: 100%;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding: 12px;
border-bottom: none;
}
.user-info {
flex: 1;
}
.logout-btn {
width: auto;
padding: 8px 16px;
}
.module-selector {
width: 100%;
flex-direction: row;
flex-wrap: wrap;
padding: 8px 0;
gap: 8px;
overflow-x: auto;
}
.module-btn {
flex: 1;
min-width: calc(33.33% - 8px);
padding: 10px;
justify-content: center;
font-size: 0.75rem;
}
.module-btn span {
display: none;
}
.main-content {
margin-left: 0;
padding: 16px;
}
.app-header {
padding: 16px;
margin-bottom: 16px;
flex-wrap: wrap;
}
.app-header .icon {
width: 40px;
height: 40px;
}
.app-header .icon svg {
width: 22px;
height: 22px;
}
.app-header h1 {
font-size: 1.1rem;
}
.app-header .subtitle {
display: none;
}
.sidebar-footer {
display: none;
}
.section-body {
padding: 16px;
}
}
/* Mobile Phones (480px) */
@media (max-width: 480px) {
.sidebar {
padding: 8px;
}
.user-info-bar {
padding: 8px;
gap: 8px;
}
.user-avatar {
width: 36px;
height: 36px;
font-size: 0.9rem;
}
.user-name {
font-size: 0.85rem;
}
.user-role {
font-size: 0.7rem;
}
.logout-btn {
padding: 6px 12px;
font-size: 0.8rem;
}
.logout-btn span {
display: none;
}
.module-selector {
gap: 6px;
}
.module-btn {
min-width: calc(50% - 6px);
padding: 8px;
}
.module-btn svg {
width: 18px;
height: 18px;
}
.main-content {
padding: 12px;
}
.app-header {
padding: 12px;
gap: 12px;
}
.app-header .icon {
width: 36px;
height: 36px;
border-radius: 8px;
}
.app-header .icon svg {
width: 20px;
height: 20px;
}
.app-header h1 {
font-size: 1rem;
}
.section-box {
margin-bottom: 12px;
}
.section-header {
padding: 10px 12px;
font-size: 0.85rem;
}
.section-body {
padding: 12px;
}
}

View File

@@ -3,25 +3,334 @@
* 包含各個頁籤/模組的特定樣式需求
*/
/* ==================== 共用模組樣式 ==================== */
/* 模組頂部工具列 */
.module-toolbar {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 12px;
margin-bottom: 20px;
padding: 16px 20px;
background: #f8fafc;
border-radius: var(--radius);
border: 1px solid var(--border);
}
.module-toolbar-left,
.module-toolbar-right {
display: flex;
align-items: center;
gap: 10px;
flex-wrap: wrap;
}
.module-toolbar h2 {
margin: 0;
color: var(--primary);
font-size: 1.1rem;
}
.module-toolbar .hint {
color: var(--text-secondary);
font-size: 0.85rem;
}
/* ==================== 崗位基礎資料模組 ==================== */
/* (目前使用共用元件,無特殊樣式) */
/* CSV 按鈕區塊 */
.csv-buttons {
display: flex;
gap: 10px;
flex-wrap: wrap;
margin-bottom: 15px;
}
/* ==================== 職務基礎資料模組 ==================== */
/* (目前使用共用元件,無特殊樣式) */
/* (使用共用元件) */
/* ==================== 部門職責模組 ==================== */
/* (目前使用共用元件,無特殊樣式) */
/* (使用共用元件) */
/* ==================== 崗位描述模組 ==================== */
/* (目前使用共用元件,無特殊樣式) */
/* (使用共用元件) */
/* ==================== 崗位清單模組 ==================== */
/* (目前使用共用元件,無特殊樣式) */
.position-list-module .module-toolbar {
background: linear-gradient(135deg, rgba(20, 184, 166, 0.05) 0%, rgba(13, 148, 136, 0.05) 100%);
border-color: rgba(20, 184, 166, 0.2);
}
/* 資料表格容器 */
.data-table-container {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
border-radius: var(--radius);
border: 1px solid var(--border);
}
/* 資料表格 */
.data-table {
width: 100%;
border-collapse: collapse;
background: white;
min-width: 700px;
}
.data-table thead {
position: sticky;
top: 0;
z-index: 10;
}
.data-table th {
padding: 14px 16px;
text-align: left;
font-weight: 600;
font-size: 0.85rem;
white-space: nowrap;
background: var(--primary);
color: white;
border-bottom: 2px solid var(--primary-dark);
}
.data-table th.sortable {
cursor: pointer;
user-select: none;
transition: background 0.2s ease;
}
.data-table th.sortable:hover {
background: var(--primary-dark);
}
.data-table th .sort-icon {
margin-left: 6px;
opacity: 0.7;
}
.data-table td {
padding: 12px 16px;
font-size: 0.9rem;
border-bottom: 1px solid var(--border);
vertical-align: middle;
}
.data-table tbody tr:hover {
background: rgba(41, 128, 185, 0.05);
}
.data-table tbody tr:last-child td {
border-bottom: none;
}
/* 空資料提示 */
.data-table .empty-row td {
padding: 48px 20px;
text-align: center;
color: var(--text-secondary);
font-size: 0.95rem;
}
/* 操作按鈕欄 */
.data-table .action-cell {
text-align: center;
white-space: nowrap;
}
.data-table .action-cell .btn {
padding: 6px 12px;
font-size: 0.8rem;
margin: 0 2px;
}
/* 崗位清單專用表格顏色 - 青色 */
.position-list-table thead {
background: linear-gradient(135deg, var(--module-list) 0%, var(--module-list-dark) 100%);
}
.position-list-table th {
background: transparent;
border-bottom-color: var(--module-list-dark);
}
.position-list-table th.sortable:hover {
background: rgba(0, 0, 0, 0.1);
}
/* ==================== 管理者頁面模組 ==================== */
/* (目前使用共用元件,無特殊樣式) */
.admin-module .module-toolbar {
background: linear-gradient(135deg, rgba(244, 63, 94, 0.05) 0%, rgba(225, 29, 72, 0.05) 100%);
border-color: rgba(244, 63, 94, 0.2);
}
/*
* 注意:如果未來各模組需要特定樣式,可在此添加
* 例如:特殊的表格樣式、卡片佈局等
*/
/* 管理者表格專用顏色 - 玫紅色 */
.admin-table thead {
background: linear-gradient(135deg, var(--module-admin) 0%, var(--module-admin-dark) 100%);
}
.admin-table th {
background: transparent;
border-bottom-color: var(--module-admin-dark);
}
/* 權限標籤 */
.permission-badge {
display: inline-block;
padding: 4px 10px;
border-radius: 12px;
font-size: 0.75rem;
font-weight: 500;
white-space: nowrap;
}
.permission-badge.admin-highest {
background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
color: white;
}
.permission-badge.admin {
background: linear-gradient(135deg, #f39c12 0%, #d68910 100%);
color: white;
}
.permission-badge.user {
background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
color: white;
}
.permission-badge.viewer {
background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
color: white;
}
/* ==================== 響應式設計 - 模組專屬 ==================== */
/* Large Tablets (1024px) */
@media (max-width: 1024px) {
.module-toolbar {
padding: 14px 16px;
}
.data-table {
min-width: 600px;
}
.data-table th,
.data-table td {
padding: 12px 14px;
}
}
/* Tablets (768px) */
@media (max-width: 768px) {
.module-toolbar {
flex-direction: column;
align-items: stretch;
gap: 12px;
padding: 12px;
}
.module-toolbar-left,
.module-toolbar-right {
justify-content: center;
}
.module-toolbar h2 {
text-align: center;
font-size: 1rem;
}
.module-toolbar .hint {
display: none;
}
.csv-buttons {
justify-content: center;
}
.data-table {
min-width: 500px;
}
.data-table th,
.data-table td {
padding: 10px 12px;
font-size: 0.85rem;
}
.data-table .action-cell .btn {
padding: 5px 10px;
font-size: 0.75rem;
}
/* 隱藏較不重要的欄位 */
.data-table .hide-tablet {
display: none;
}
.permission-badge {
padding: 3px 8px;
font-size: 0.7rem;
}
}
/* Mobile Phones (480px) */
@media (max-width: 480px) {
.module-toolbar {
padding: 10px;
gap: 10px;
}
.module-toolbar-left,
.module-toolbar-right {
width: 100%;
flex-direction: column;
}
.module-toolbar-left .btn,
.module-toolbar-right .btn {
width: 100%;
justify-content: center;
}
.csv-buttons {
flex-direction: column;
}
.csv-buttons .btn {
width: 100%;
justify-content: center;
}
.data-table {
min-width: 400px;
}
.data-table th,
.data-table td {
padding: 8px 10px;
font-size: 0.8rem;
}
.data-table th {
font-size: 0.75rem;
}
.data-table .action-cell {
display: flex;
flex-direction: column;
gap: 4px;
}
.data-table .action-cell .btn {
width: 100%;
padding: 6px 8px;
}
/* 隱藏更多欄位 */
.data-table .hide-mobile {
display: none;
}
}

View File

@@ -1,56 +1,244 @@
/**
* Utilities Styles - 工具類別與響應式設計
* 包含快速工具類別、響應式斷點
* Utilities Styles - 工具類別與額外響應式設計
* 包含快速工具類別、表格響應式、額外斷點調整
*/
/* ==================== Utility Classes ==================== */
/* (可按需添加工具類別,如 .mt-1, .text-center 等) */
/* ==================== Responsive Design ==================== */
/* Display */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
/* Flexbox */
.flex-wrap { flex-wrap: wrap !important; }
.flex-column { flex-direction: column !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.align-center { align-items: center !important; }
.gap-1 { gap: 4px !important; }
.gap-2 { gap: 8px !important; }
.gap-3 { gap: 12px !important; }
.gap-4 { gap: 16px !important; }
/* Margin */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 12px !important; }
.mt-4 { margin-top: 16px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.mb-4 { margin-bottom: 16px !important; }
/* Padding */
.p-0 { padding: 0 !important; }
.p-1 { padding: 4px !important; }
.p-2 { padding: 8px !important; }
.p-3 { padding: 12px !important; }
.p-4 { padding: 16px !important; }
/* Text */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-sm { font-size: 0.875rem !important; }
.text-xs { font-size: 0.75rem !important; }
.text-muted { color: var(--text-secondary) !important; }
.text-primary { color: var(--primary) !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.fw-bold { font-weight: 600 !important; }
.fw-normal { font-weight: 400 !important; }
/* Width */
.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }
/* Overflow */
.overflow-auto { overflow: auto !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-x-auto { overflow-x: auto !important; }
/* Visibility */
.visible { visibility: visible !important; }
.invisible { visibility: hidden !important; }
/* ==================== Table Responsive ==================== */
.table-responsive {
width: 100%;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.table-responsive table {
min-width: 600px;
}
/* ==================== Position List Specific ==================== */
.position-table {
width: 100%;
border-collapse: collapse;
}
.position-table th,
.position-table td {
padding: 12px 16px;
text-align: left;
border-bottom: 1px solid var(--border);
}
.position-table th {
background: #f8fafc;
font-weight: 600;
color: var(--text-secondary);
font-size: 0.85rem;
white-space: nowrap;
}
.position-table td {
font-size: 0.9rem;
}
.position-table tr:hover {
background: rgba(41, 128, 185, 0.05);
}
/* ==================== Responsive Hide/Show ==================== */
@media (min-width: 769px) {
.hide-desktop { display: none !important; }
}
@media (max-width: 768px) {
/* Form Grid */
.form-grid,
.form-grid.three-cols {
grid-template-columns: 1fr;
.hide-tablet { display: none !important; }
}
@media (max-width: 480px) {
.hide-mobile { display: none !important; }
}
@media (min-width: 481px) {
.show-mobile-only { display: none !important; }
}
/* ==================== Extra Responsive Adjustments ==================== */
/* Tablets (768px) */
@media (max-width: 768px) {
/* Table */
.position-table th,
.position-table td {
padding: 10px 12px;
font-size: 0.85rem;
}
/* Form Actions */
.form-actions {
flex-direction: column;
gap: 16px;
}
/* Utility overrides */
.text-sm { font-size: 0.8rem !important; }
.text-xs { font-size: 0.7rem !important; }
.action-buttons {
width: 100%;
/* Form wrapper for side-by-side elements */
.input-with-button {
flex-direction: column;
}
.btn {
justify-content: center;
}
/* Module Selector */
.module-selector {
flex-direction: column;
}
.module-btn {
min-width: 100%;
}
/* User Info Bar */
.user-info-bar {
flex-direction: column;
gap: 12px;
text-align: center;
}
.user-info {
justify-content: center;
}
.logout-btn {
.input-with-button .btn-lookup {
width: 100%;
justify-content: center;
}
}
/* Mobile Phones (480px) */
@media (max-width: 480px) {
/* Table */
.position-table th,
.position-table td {
padding: 8px 10px;
font-size: 0.8rem;
}
/* Stack buttons on very small screens */
.btn-group-vertical {
flex-direction: column;
width: 100%;
}
.btn-group-vertical .btn {
width: 100%;
}
/* Hide less important table columns */
.position-table .hide-xs {
display: none;
}
}
/* ==================== Print Styles ==================== */
@media print {
.sidebar,
.logout-btn,
.module-selector,
.form-actions,
.ai-bags-container,
.ai-generate-btn,
.nav-buttons,
.toast,
.modal-overlay {
display: none !important;
}
.main-content {
margin-left: 0 !important;
padding: 0 !important;
}
.app-container {
display: block;
}
.form-card {
box-shadow: none;
border: 1px solid #ddd;
}
.tab-content {
display: block !important;
page-break-inside: avoid;
}
.tabs {
display: none;
}
}
/* ==================== Safe Area for notched devices ==================== */
@supports (padding: max(0px)) {
.sidebar {
padding-left: max(12px, env(safe-area-inset-left));
padding-right: max(12px, env(safe-area-inset-right));
}
.main-content {
padding-left: max(16px, env(safe-area-inset-left));
padding-right: max(16px, env(safe-area-inset-right));
}
@media (max-width: 768px) {
.sidebar {
padding-bottom: max(12px, env(safe-area-inset-bottom));
}
}
}
/* ==================== Reduced Motion ==================== */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}