:root {
    --wf-bg: #f5f7fb;
    --wf-panel: #ffffff;
    --wf-border: #e2e8f0;
    --wf-text: #111827;
    --wf-text-muted: #64748b;
    --wf-primary: #4f46e5;
    --wf-primary-soft: #eef2ff;
    --wf-warning: #d97706;
    --wf-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--wf-bg);
    color: var(--wf-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

.workflow-shell {
    max-width: 1440px;
    margin: 0 auto;
    padding: 14px 16px 20px;
}

.page-header {
    background: linear-gradient(135deg, #f8f7ff 0%, #f1f5ff 100%);
    border: 1px solid var(--wf-border);
    border-radius: 14px;
    box-shadow: var(--wf-shadow);
    padding: 14px;
    margin-bottom: 12px;
}

.page-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.page-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
}

.page-subtitle {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--wf-text-muted);
}

.workflow-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.workflow-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 13px;
    color: #4b5563;
    background: rgba(255, 255, 255, 0.75);
    transition: all 0.15s ease;
}

.workflow-link:hover {
    border-color: #c7d2fe;
    background: #fff;
    color: #312e81;
}

.workflow-link.active {
    background: var(--wf-primary-soft);
    border-color: #c7d2fe;
    color: var(--wf-primary);
    font-weight: 600;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.wf-btn,
.button_select {
    height: 34px;
    border: 1px solid var(--wf-border);
    background: #fff;
    color: #374151;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 13px;
}

.wf-btn {
    cursor: pointer;
}

.wf-btn:hover,
.button_select:hover {
    border-color: #c7d2fe;
    background: #f8faff;
}

.wf-btn-primary {
    border-color: #4338ca;
    background: #4f46e5;
    color: #fff;
}

.wf-btn-primary:hover {
    background: #4338ca;
    border-color: #3730a3;
}

.status-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--wf-border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--wf-text-muted);
}

.status-item b {
    margin: 0;
    color: #334155;
    font-weight: 600;
}

.content-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1.25fr 1fr;
    gap: 12px;
}

#task-board.has-doing-focus {
    grid-template-columns: 260px minmax(0, 1fr) 260px;
}

#task-board.has-doing-focus .panel-doing {
    display: block;
}

#task-board.has-doing-focus .panel-side:not(.panel-expanded) .todo,
#task-board.has-doing-focus .panel-side:not(.panel-expanded) .pending {
    display: none;
}

#task-board.has-doing-focus .panel-side:not(.panel-expanded) {
    overflow: hidden;
}

#task-board:not(.has-doing-focus) {
    grid-template-columns: 1fr 1fr;
}

#task-board:not(.has-doing-focus) .panel-doing {
    display: none;
}

.card-panel {
    background: var(--wf-panel);
    border: 1px solid var(--wf-border);
    border-radius: 12px;
    box-shadow: var(--wf-shadow);
    overflow: hidden;
}

.card-panel h2 {
    margin: 0;
    padding: 12px 14px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--wf-border);
}

.panel-toggle-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.panel-toggle-indicator {
    font-size: 12px;
    color: var(--wf-text-muted);
}

.todo,
.doing,
.pending {
    width: 100%;
    min-height: calc(100vh - 300px);
    max-height: calc(100vh - 300px);
    overflow: auto;
    padding: 10px;
    background: #fff;
    float: none;
    margin-left: 0;
    border: 0;
}

.table-wrap {
    background: #fff;
    border: 1px solid var(--wf-border);
    border-radius: 12px;
    box-shadow: var(--wf-shadow);
    padding: 8px;
    overflow: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border: 1px solid var(--wf-border);
    padding: 8px;
    font-size: 13px;
    text-align: left;
    vertical-align: top;
}

thead th {
    background: #f8fafc;
    color: #334155;
}

.main-window {
    background: #fff;
    border: 1px solid var(--wf-border);
    border-radius: 12px;
    box-shadow: var(--wf-shadow);
    height: auto;
    min-height: calc(100vh - 250px);
    overflow: auto;
}

.search-wrapper {
    margin: 0;
    border: 1px solid var(--wf-border);
    border-radius: 8px;
    padding: 0 10px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    height: 34px;
}

.search-input {
    border: none;
    outline: none;
    font-size: 13px;
    width: 180px;
    background: transparent;
}

.dialog_outter {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 11;
}

.overlap {
    position: fixed;
    inset: 0;
    background: #000;
    opacity: 0.35;
    display: none;
    z-index: 10;
}

/* 任务按钮统一为白/灰/蓝体系，覆盖 common.css 中的旧色彩 */
.button_doing,
.button_todo,
.button_pending,
.button_repeat {
    border: 1px solid #d1d9e6;
    background: #ffffff;
    color: #334155;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1;
    padding: 6px 10px;
    margin: 4px 6px 4px 0;
    transition: all 0.15s ease;
}

.button_doing:hover,
.button_todo:hover,
.button_pending:hover,
.button_repeat:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.button_doing_bold,
.button_todo_bold,
.button_pending_bold,
.button_repeat_bold {
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #ffffff;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1;
    padding: 6px 10px;
    margin: 4px 6px 4px 0;
    font-weight: 600;
    transition: all 0.15s ease;
}

.button_doing_bold:hover,
.button_todo_bold:hover,
.button_pending_bold:hover,
.button_repeat_bold:hover {
    border-color: #1d4ed8;
    background: #1d4ed8;
}

@media (max-width: 1200px) {
    .content-grid-3 {
        grid-template-columns: 1fr;
    }

    #task-board.has-doing-focus,
    #task-board:not(.has-doing-focus) {
        grid-template-columns: 1fr;
    }

    .todo,
    .doing,
    .pending {
        min-height: 280px;
        max-height: 420px;
    }
}
