/* ============================================================
   Taskpedia 全域樣式與設計權杖（Tailwind 3 基底 + 靛紫主色）
   亮/暗主題以 html[data-theme] 切換
   ============================================================ */

:root {
    --tp-primary: #4f46e5;
    --tp-primary-hover: #4338ca;
    --tp-primary-soft: #eef2ff;

    --tp-bg: #f5f6f8;
    --tp-surface: #ffffff;
    --tp-surface-alt: #f7f8fa;
    --tp-border: #e5e7eb;
    --tp-text: #111827;
    --tp-text-muted: #6b7280;

    --tp-sidebar-bg: #ffffff;
    --tp-topbar-bg: #ffffff;

    --tp-success: #16a34a;
    --tp-success-soft: #dcfce7;
    --tp-danger: #dc2626;
    --tp-danger-soft: #fee2e2;
    --tp-info: #2563eb;
    --tp-info-soft: #dbeafe;

    --tp-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --tp-radius: 12px;
}

html[data-theme="dark"] {
    --tp-primary: #6366f1;
    --tp-primary-hover: #818cf8;
    --tp-primary-soft: #312e81;

    --tp-bg: #0f1117;
    --tp-surface: #1a1d27;
    --tp-surface-alt: #20242f;
    --tp-border: #2b2f3a;
    --tp-text: #e5e7eb;
    --tp-text-muted: #9ca3af;

    --tp-sidebar-bg: #161922;
    --tp-topbar-bg: #161922;

    --tp-success: #4ade80;
    --tp-success-soft: #14532d;
    --tp-danger: #f87171;
    --tp-danger-soft: #7f1d1d;
    --tp-info: #60a5fa;
    --tp-info-soft: #1e3a8a;

    --tp-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

html, body {
    font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, 'Noto Sans TC', sans-serif;
    background-color: var(--tp-bg);
    color: var(--tp-text);
}

h1:focus {
    outline: none;
}

a {
    color: var(--tp-primary);
    text-decoration: none;
}

a:hover {
    color: var(--tp-primary-hover);
}

/* ---------- 卡片 ---------- */
.tp-card {
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    box-shadow: var(--tp-shadow);
    padding: 20px;
}

/* ---------- 統計卡片 ---------- */
.tp-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.tp-stat-card {
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    box-shadow: var(--tp-shadow);
    padding: 18px 20px;
}

.tp-stat-card .tp-stat-label {
    font-size: 13px;
    color: var(--tp-text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.tp-stat-card .tp-stat-value {
    font-size: 30px;
    font-weight: 700;
    margin-top: 6px;
    color: var(--tp-text);
}

/* ---------- 狀態徽章 ---------- */
.tp-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.tp-badge-success { background: var(--tp-success-soft); color: var(--tp-success); }
.tp-badge-danger { background: var(--tp-danger-soft); color: var(--tp-danger); }
.tp-badge-info { background: var(--tp-info-soft); color: var(--tp-info); }
.tp-badge-muted { background: var(--tp-surface-alt); color: var(--tp-text-muted); }

/* ---------- 頁面標題列 ---------- */
.tp-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 16px;
}

.tp-page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

.tp-page-header .tp-subtitle {
    color: var(--tp-text-muted);
    margin: 4px 0 0;
    font-size: 14px;
}

/* ---------- 內嵌操作面板 ---------- */
.tp-panel {
    background: var(--tp-surface-alt);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    padding: 18px;
}

/* ---------- Syncfusion 元件圓角微調，貼齊整體風格 ---------- */
.e-grid, .e-dropdownlist, .e-input-group, .e-dialog {
    border-radius: 8px;
}

/* ---------- 驗證/錯誤訊息 ---------- */
.tp-error { color: var(--tp-danger); font-size: 14px; }
.validation-message { color: var(--tp-danger); }

.invalid { outline: 1px solid var(--tp-danger); }

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 1rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "發生未預期的錯誤。"
    }

/* 啟動載入動畫：以文字逐字填色的 "Loading" 動畫取代原本的圓形進度。
   亮主題用黑色、暗主題用白色（主題在 Blazor 載入前即由 index.html 套用 html[data-theme]，故啟動畫面即正確配色）。 */
.loader {
    --loader-color: #000;
    position: absolute;
    inset: 0;
    margin: auto;
    width: fit-content;
    height: fit-content;
    font-size: 40px;
    font-family: monospace;
    font-weight: bold;
    text-transform: uppercase;
    color: #0000;
    -webkit-text-stroke: 1px var(--loader-color);
    --g: conic-gradient(var(--loader-color) 0 0) no-repeat text;
    background: var(--g) 0, var(--g) 1ch, var(--g) 2ch, var(--g) 3ch, var(--g) 4ch, var(--g) 5ch, var(--g) 6ch;
    animation:
        l17-0 0.6s linear infinite alternate,
        l17-1 1.2s linear infinite;
}

html[data-theme="dark"] .loader {
    --loader-color: #fff;
}

.loader:before {
    content: "Loading";
}

@keyframes l17-0 {
    0%   { background-size: 1ch 0; }
    100% { background-size: 1ch 100%; }
}

@keyframes l17-1 {
    0%, 50%    { background-position-y: 100%, 0; }
    50.01%, to { background-position-y: 0, 100%; }
}

/* ===== Phase 4~6：看板 / 卡片 ===== */
.tp-board-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
}

.tp-list-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--tp-surface-alt);
    border: 1px solid var(--tp-border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--tp-text);
}

/* ===== 自訂拖曳看板版面 ===== */
.tp-board-scroll {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 12px;
}

.tp-column {
    flex: 0 0 290px;
    width: 290px;
    background: var(--tp-surface-alt);
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 280px);
    user-select: none;
    -webkit-user-select: none;
}

/* 拖曳來源於拖曳期間隱藏（拖曳影像仍由瀏覽器顯示），避免占位干擾落點計算與閃爍 */
.tp-dragging { display: none !important; }

/* 插入式佔位區塊：卡片落點（不可攔截事件，否則游標會落在佔位塊上造成來回閃爍） */
.tp-card-placeholder {
    min-height: 44px;
    border: 2px dashed var(--tp-primary);
    border-radius: 10px;
    background: var(--tp-primary-soft);
    box-sizing: border-box;
    pointer-events: none;
}

/* 插入式佔位區塊：列落點 */
.tp-col-placeholder {
    flex: 0 0 290px;
    width: 290px;
    align-self: stretch;
    min-height: 120px;
    border: 2px dashed var(--tp-primary);
    border-radius: 12px;
    background: var(--tp-primary-soft);
    box-sizing: border-box;
    pointer-events: none;
}

.tp-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--tp-border);
    cursor: grab;
}

.tp-column-header:active { cursor: grabbing; }

.tp-column-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--tp-text);
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tp-column-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--tp-text-muted);
    background: var(--tp-surface);
    border-radius: 999px;
    padding: 1px 8px;
}

.tp-column-actions { display: inline-flex; gap: 2px; flex: 0 0 auto; align-items: center; }

/* 列表頭的圖示按鈕（獨立命名，避免與版面配置全域 .tp-icon-btn 衝突） */
.tp-col-icon {
    cursor: pointer;
    color: var(--tp-text-muted);
    font-size: 15px;
    line-height: 1;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.tp-col-icon:hover { background: var(--tp-surface); color: var(--tp-text); }
.tp-col-icon.tp-danger:hover { color: var(--tp-danger); }

.tp-column-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    overflow-y: auto;
    min-height: 60px;
    flex: 1 1 auto;
}

.tp-column-empty {
    color: var(--tp-text-muted);
    font-size: 13px;
    text-align: center;
    padding: 18px 8px;
    border: 1px dashed var(--tp-border);
    border-radius: 8px;
}

.tp-column-footer { padding: 8px 10px 12px; }

.tp-addcard-link {
    cursor: pointer;
    color: var(--tp-text-muted);
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 8px;
    display: block;
}

.tp-addcard-link:hover { background: var(--tp-surface); color: var(--tp-primary); }

/* 看板卡片自訂版面 */
.tp-kanban-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: var(--tp-shadow);
    user-select: none;
    -webkit-user-select: none;
}

.tp-kanban-card:hover { border-color: var(--tp-primary); }

/* 卡片優先度：以頂部色條表示（高=紅、中=藍、低=灰），其餘邊維持淡框 */
.tp-kanban-card.tp-priority-high,
.tp-kanban-card.tp-priority-high:hover { border-top: 3px solid var(--tp-danger); }
.tp-kanban-card.tp-priority-medium,
.tp-kanban-card.tp-priority-medium:hover { border-top: 3px solid #3b82f6; }
.tp-kanban-card.tp-priority-low,
.tp-kanban-card.tp-priority-low:hover { border-top: 3px solid #9ca3af; }

/* 到期日固定顯示於卡片右上角 */
.tp-card-due {
    align-self: flex-end;
    font-size: 12px;
    color: var(--tp-text-muted);
    line-height: 1.2;
}
.tp-card-due.tp-overdue { color: var(--tp-danger); font-weight: 600; }

.tp-kanban-card .tp-card-title {
    font-weight: 600;
    color: var(--tp-text);
    font-size: 14px;
    word-break: break-word;
}

/* 知識庫：分類 > 文件 目錄 */
.kb-category { border-bottom: 1px solid var(--tp-border); }
.kb-category:last-child { border-bottom: none; }

.kb-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 4px;
    cursor: pointer;
    user-select: none;
}
.kb-category-header:hover { background: var(--tp-surface); }
.kb-category-name { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--tp-text); }
.kb-category-actions { display: inline-flex; gap: 6px; }

.kb-doc-list { padding: 0 4px 8px 24px; display: flex; flex-direction: column; gap: 2px; }

.kb-doc {
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--tp-text);
    word-break: break-word;
}
.kb-doc:hover { background: var(--tp-surface); }
.kb-doc-active { background: var(--tp-primary-soft); color: var(--tp-primary); font-weight: 600; }
.kb-doc-empty { padding: 4px 8px; font-size: 12px; color: var(--tp-text-muted); }

.tp-label-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.tp-label-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    color: #fff;
    line-height: 1.4;
}

.tp-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    color: var(--tp-text-muted);
}

.tp-card-meta .tp-overdue { color: var(--tp-danger); font-weight: 600; }

/* 卡片底部：左側為其他資訊，留言指標固定靠右下 */
.tp-card-bottom {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.tp-card-comments {
    margin-left: auto;
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--tp-text-muted);
}

.tp-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--tp-primary-soft);
    color: var(--tp-primary);
    font-size: 11px;
    font-weight: 600;
}

.tp-avatar-row { display: inline-flex; gap: 2px; }

/* 卡片詳情面板區段 */
.tp-detail-section { margin-bottom: 20px; }
.tp-detail-section h4 { font-size: 14px; margin-bottom: 8px; color: var(--tp-text); }

.tp-checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
}

.tp-checklist-item.tp-done .tp-checklist-text { text-decoration: line-through; color: var(--tp-text-muted); }

.tp-comment {
    border: 1px solid var(--tp-border);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
    background: var(--tp-surface-alt);
}

.tp-comment .tp-comment-meta { font-size: 12px; color: var(--tp-text-muted); margin-bottom: 4px; }

.tp-attachment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed var(--tp-border);
}

.tp-progress-track {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: var(--tp-surface-alt);
    overflow: hidden;
}

.tp-progress-fill { height: 100%; background: var(--tp-success); }

/* 卡片詳情對話框內容過長時可捲動 */
.tp-card-dialog .e-dlg-content { max-height: 68vh; overflow-y: auto; }

/* ── 首頁儀表板 ───────────────────────────────────────── */

/* KPI 數字卡網格 */
.tp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.tp-kpi {
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-top: 3px solid var(--tp-border);
    border-radius: var(--tp-radius);
    box-shadow: var(--tp-shadow);
    padding: 16px 18px;
}

.tp-kpi-value { font-size: 30px; font-weight: 700; line-height: 1.1; color: var(--tp-text); }
.tp-kpi-label { margin-top: 4px; font-size: 13px; color: var(--tp-text-muted); }

.tp-kpi-primary { border-top-color: var(--tp-primary); }
.tp-kpi-info { border-top-color: var(--tp-info); }
.tp-kpi-danger { border-top-color: var(--tp-danger); }
.tp-kpi-danger .tp-kpi-value { color: var(--tp-danger); }

/* 清單三欄（待辦 / 到期 / 通知） */
.tp-dash-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

/* 圖表兩欄 */
.tp-dash-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.tp-dash-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--tp-text);
    margin-bottom: 12px;
}

/* 清單項目 */
.tp-dash-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    cursor: pointer;
    border-bottom: 1px solid var(--tp-border);
    transition: background 0.12s ease;
}

.tp-dash-item:last-child { border-bottom: none; }
.tp-dash-item:hover { background: var(--tp-surface-alt); }

.tp-dash-item-main { flex: 1; min-width: 0; }
.tp-dash-item-title {
    font-size: 14px;
    color: var(--tp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 儀表板卡片項目：專案+看板（小、深灰）→ 標題（粗、深色）→ 描述（一般、次要色），各自單行截斷 */
.tp-dash-item-meta {
    font-size: 12px;
    color: var(--tp-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 1px;
}
.tp-dash-card-item .tp-dash-item-title { font-weight: 700; }
.tp-dash-item-desc {
    font-size: 13px;
    color: var(--tp-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.tp-dash-item-unread .tp-dash-item-title { font-weight: 700; }
.tp-dash-item-unread { background: var(--tp-primary-soft); }

.tp-dash-due { font-size: 12px; color: var(--tp-text-muted); white-space: nowrap; }
.tp-dash-due.tp-overdue { color: var(--tp-danger); font-weight: 600; }

/* 優先度小圓點 */
.tp-priority-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--tp-text-muted);
}

.tp-priority-dot.tp-priority-high { background: var(--tp-danger); }
.tp-priority-dot.tp-priority-medium { background: var(--tp-info); }
.tp-priority-dot.tp-priority-low { background: var(--tp-text-muted); }

/* ── RichTextEditor 暗色主題內容文字修正 ─────────────────── */
/* Markdown 模式的內容區（textarea）在暗色主題下文字仍為黑色，強制套用主題文字色 */
html[data-theme="dark"] .e-richtexteditor .e-rte-content,
html[data-theme="dark"] .e-richtexteditor .e-rte-content .e-content {
    background: var(--tp-surface);
    color: var(--tp-text);
}

/* ── 單色圖示系統 ─────── */
.tp-ico {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    background-color: rgb(107 114 128);
    -webkit-mask: var(--tp-ico) no-repeat center / contain;
    mask: var(--tp-ico) no-repeat center / contain;
    flex-shrink: 0;
}

.tp-ico-moon { --tp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z'/%3E%3C/svg%3E"); }
.tp-ico-sun { --tp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0 1a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z'/%3E%3C/svg%3E"); }
.tp-ico-bell { --tp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 16a2 2 0 0 0 2-2H6a2 2 0 0 0 2 2zM8 1.918l-.797.161A4.002 4.002 0 0 0 4 6c0 .628-.134 2.197-.459 3.742-.16.767-.376 1.566-.663 2.258h10.244c-.287-.692-.502-1.49-.663-2.258C12.134 8.197 12 6.628 12 6a4.002 4.002 0 0 0-3.203-3.92L8 1.917zM14.22 12c.223.447.481.801.78 1H1c.299-.199.557-.553.78-1C2.68 10.2 3 6.88 3 6c0-2.42 1.72-4.44 4.005-4.901a1 1 0 1 1 1.99 0A5.002 5.002 0 0 1 13 6c0 .88.32 4.2 1.22 6z'/%3E%3C/svg%3E"); }
.tp-ico-chart { --tp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 11H2v3h2v-3zm5-4H7v7h2V7zm5-5v12h-2V2h2zm-2-1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1h-2zM6 7a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V7zm-5 4a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1v-3z'/%3E%3C/svg%3E"); }
.tp-ico-calendar { --tp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E"); }
.tp-ico-calendar-event { --tp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M11 6.5a.5.5 0 0 1 .5-.5h1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-1a.5.5 0 0 1-.5-.5v-1z'/%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E"); }
.tp-ico-journal { --tp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 10.5a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 0 1h-2a.5.5 0 0 1-.5-.5Zm0-2a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5Zm0-2a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5Zm0-2a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5Z'/%3E%3Cpath d='M3 0h10a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2Zm0 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H3Z'/%3E%3C/svg%3E"); }
.tp-ico-kanban { --tp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M13.5 1a.5.5 0 0 1 .5.5v13a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-13a.5.5 0 0 1 .5-.5h11zM2.5 0A1.5 1.5 0 0 0 1 1.5v13A1.5 1.5 0 0 0 2.5 16h11a1.5 1.5 0 0 0 1.5-1.5v-13A1.5 1.5 0 0 0 13.5 0h-11z'/%3E%3Cpath d='M6.5 3a1 1 0 0 0-1 1v4a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-3zM4 4a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1V4zm8 0v4a1 1 0 0 0 1-1V5a1 1 0 0 0-1-1z'/%3E%3C/svg%3E"); }
.tp-ico-check { --tp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z'/%3E%3Cpath d='m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z'/%3E%3C/svg%3E"); }
.tp-ico-paperclip { --tp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 3a2.5 2.5 0 0 1 5 0v9a1.5 1.5 0 0 1-3 0V5a.5.5 0 0 1 1 0v7a.5.5 0 0 0 1 0V3a1.5 1.5 0 1 0-3 0v9a2.5 2.5 0 0 0 5 0V5a.5.5 0 0 1 1 0v7a3.5 3.5 0 1 1-7 0V3z'/%3E%3C/svg%3E"); }
.tp-ico-chat { --tp-ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.678 11.894a1 1 0 0 1 .287.801 10.97 10.97 0 0 1-.398 2c1.395-.323 2.247-.697 2.634-.893a1 1 0 0 1 .71-.074A8.06 8.06 0 0 0 8 14c3.996 0 7-2.807 7-6 0-3.192-3.004-6-7-6S1 4.808 1 8c0 1.468.617 2.83 1.678 3.894zm-.493 3.905a21.682 21.682 0 0 1-.713.129c-.2.032-.352-.176-.273-.362a9.68 9.68 0 0 0 .244-.637l.003-.01c.248-.72.45-1.548.524-2.319C.743 11.37 0 9.76 0 8c0-3.866 3.582-7 8-7s8 3.134 8 7-3.582 7-8 7a9.06 9.06 0 0 1-2.347-.306c-.52.263-1.639.742-3.468 1.105z'/%3E%3C/svg%3E"); }

/* ── 清單頁「啟動卡片」格線（看板/甘特/行事曆/知識庫入口）──────── */
.tp-launch-section { margin-bottom: 24px; }
.tp-launch-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--tp-text);
    margin: 0 0 12px;
}

.tp-launch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.tp-launch-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    box-shadow: var(--tp-shadow);
    padding: 16px;
    cursor: pointer;
    transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.tp-launch-card:hover {
    border-color: var(--tp-primary);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.tp-launch-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--tp-surface-alt);
    color: var(--tp-text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    transition: background 0.12s ease, color 0.12s ease;
}

.tp-launch-card:hover .tp-launch-icon {
    background: var(--tp-primary-soft);
    color: var(--tp-primary);
}

.tp-launch-body { min-width: 0; flex: 1; }
.tp-launch-title {
    font-weight: 700;
    color: var(--tp-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tp-launch-desc {
    font-size: 13px;
    color: var(--tp-text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Markdown 描述預覽：呈現由 Markdown 轉出的 HTML，收斂區塊元素邊距以免破壞版面 */
.tp-md-preview > :first-child { margin-top: 0; }
.tp-md-preview > :last-child { margin-bottom: 0; }
.tp-md-preview p { margin: 0 0 6px; }
.tp-md-preview ul, .tp-md-preview ol { margin: 0 0 6px; padding-left: 20px; }
.tp-md-preview a { color: var(--tp-primary); }
/* 主題感知的次要文字色（取代 Bootstrap .text-muted，確保暗色可讀） */
.tp-md-muted { color: var(--tp-text-muted); }
.tp-md-preview img { max-width: 100%; height: auto; }
/* 行內情境（如看板標題下方副標）：壓平段落邊距，與徽章同列 */
.tp-md-inline { display: inline-block; vertical-align: middle; }
.tp-md-inline p { margin: 0; display: inline; }

/* 看板卡片底部 meta 圖示與文字間距 */
.tp-card-due .tp-ico, .tp-card-meta .tp-ico, .tp-card-comments .tp-ico { margin-right: 3px; }

/* 顏色選擇器：與相鄰輸入框/按鈕同高並對齊 */
.tp-color-input {
    width: 48px;
    height: 38px;
    padding: 3px;
    border: 1px solid var(--tp-border);
    border-radius: 8px;
    background: var(--tp-surface);
    cursor: pointer;
    flex-shrink: 0;
}
