/* 基礎設定與無印風變數 */
:root {
    --bg-color: #F7F7F5; /* 溫和的米灰背景 */
    --surface-color: #FFFFFF; /* 卡片白 */
    --text-primary: #3E3E3E; /* 深灰文字，非純黑 */
    --text-secondary: #7A7A7A; /* 次要文字 */
    --accent-color: #8C8276; /* 木質/大地色點綴 */
    --accent-hover: #756B5F;
    --border-color: #E6E6E6;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    background-color: var(--bg-color);
}

/* --- 側邊導覽列 --- */
.sidebar {
    width: 260px;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    z-index: 10;
}

.brand {
    margin-bottom: 48px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    background: none;
    border: none;
    text-align: left;
    padding: 14px 16px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.nav-item:hover {
    background-color: var(--bg-color);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--accent-color);
    color: #FFF;
}

.sidebar-footer {
    font-size: 12px;
    color: #ccc;
    text-align: center;
}

/* --- 主要內容區 --- */
.main-content {
    flex: 1;
    padding: 40px 60px;
    overflow-y: auto;
}

.content-section {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.content-section.active {
    display: block;
}

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

.section-header {
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.section-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* --- 卡片共用樣式 --- */
.card {
    background-color: var(--surface-color);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.02);
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.task-list {
    list-style: none;
}

.task-list li {
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
    font-size: 15px;
    color: var(--text-primary);
}

.task-list li:last-child {
    border-bottom: none;
}

/* --- 新人指南 Grid --- */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.guide-card {
    background-color: var(--surface-color);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.guide-card h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--accent-color);
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 8px;
}

/* --- 工作時程 Grid --- */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.schedule-column {
    background-color: var(--surface-color);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.schedule-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
}
.daily { background-color: #E8F3ED; color: #4A8C6A; }
.monthly { background-color: #F0EAF5; color: #7B5C96; }
.yearly { background-color: #FDF2E3; color: #B5843A; }
.irregular { background-color: #F2F2F2; color: #666666; }

/* --- SOP 區塊 --- */
.search-bar {
    margin-top: 16px;
}

.search-bar input {
    width: 100%;
    max-width: 400px;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.search-bar input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(140, 130, 118, 0.1);
}

.sop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.sop-card {
    background-color: var(--surface-color);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent-color);
}

.sop-card h4 {
    font-size: 16px;
    margin-bottom: 8px;
}

.sop-card p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* --- 表單庫 --- */
.forms-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--surface-color);
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.form-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-hover);
}

.form-info {
    flex: 1;
}

.form-name {
    font-weight: 500;
    font-size: 16px;
    margin-bottom: 4px;
}

.form-path {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: monospace;
    background: var(--bg-color);
    padding: 2px 6px;
    border-radius: 4px;
}

.copy-btn {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}

.copy-btn:hover {
    background-color: var(--accent-color);
    color: #FFF;
}

/* --- 工具類 --- */
.hidden { display: none !important; }
.loading-text { color: var(--text-secondary); font-size: 14px; font-style: italic; }

/* 提示框 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: rgba(51, 51, 51, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- 按鈕樣式 --- */
.add-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    margin-left: 8px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.add-btn:hover {
    background-color: var(--accent-color);
    color: white;
}

.header-add-btn {
    margin-left: 12px;
    font-size: 24px;
    width: 32px;
    height: 32px;
    vertical-align: middle;
}

.inline-add-btn {
    margin-left: 6px;
    font-size: 16px;
    width: 20px;
    height: 20px;
    color: inherit; /* 繼承 badge 的顏色 */
    opacity: 0.6;
}

.inline-add-btn:hover {
    opacity: 1;
    background-color: rgba(0,0,0,0.1);
    color: inherit;
}

.delete-btn {
    background: none;
    border: none;
    color: #FF6B6B;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    opacity: 0.5;
    transition: var(--transition);
}

.delete-btn:hover {
    opacity: 1;
    background-color: #FFF0F0;
}

/* 為了讓 li 裡的刪除按鈕排版好看 */
.task-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* SOP 卡片內的刪除按鈕排版 */
.sop-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
