/* ── 基础 ──────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f1117;
    color: #e1e4e8;
    min-height: 100vh;
}

.app-shell {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #141922 0%, #10151d 100%);
    border-right: 1px solid #30363d;
    padding: 20px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-brand h1 {
    font-size: 18px;
    color: #58a6ff;
    margin-bottom: 6px;
}

.sidebar-brand p {
    color: #8b949e;
    font-size: 12px;
    line-height: 1.5;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.content-shell {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content-header {
    padding: 20px 28px 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.content-header h2 {
    font-size: 24px;
    color: #f0f6fc;
    margin-bottom: 6px;
}

.content-header p {
    color: #8b949e;
    font-size: 13px;
}

.header-status-card {
    min-width: 320px;
    max-width: 420px;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 14px 16px;
}

.tab-btn {
    background: #11161f;
    border: 1px solid #202733;
    color: #8b949e;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}
.tab-btn:hover { color: #e1e4e8; background: #1a2230; border-color: #2b3646; }
.tab-btn.active {
    color: #8fd0ff;
    background: linear-gradient(180deg, #18324a 0%, #142535 100%);
    border-color: #2a4a66;
    box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.12);
}

main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 24px 28px 32px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── 统计卡片 ─────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #58a6ff;
}
.stat-label {
    display: block;
    font-size: 13px;
    color: #8b949e;
    margin-top: 4px;
}

/* ── 面板 ─────────────────────────────────────────── */
.panel {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}
.panel h3 {
    font-size: 15px;
    margin-bottom: 12px;
    color: #c9d1d9;
}
.panel h4 {
    font-size: 14px;
    margin: 12px 0 8px;
    color: #8b949e;
}
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

/* ── 工具栏 ───────────────────────────────────────── */
.toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

/* ── 按钮 ─────────────────────────────────────────── */
.btn {
    padding: 8px 16px;
    border: 1px solid #30363d;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    background: #21262d;
    color: #c9d1d9;
    transition: all 0.15s;
}
.btn:hover { background: #30363d; }
.btn-primary { background: #238636; border-color: #2ea043; color: #fff; }
.btn-primary:hover { background: #2ea043; }
.btn-danger { background: #da3633; border-color: #f85149; color: #fff; }
.btn-danger:hover { background: #f85149; }
.btn-secondary { background: #21262d; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ── 表格 ─────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 8px;
    overflow: hidden;
}
th, td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #21262d;
    font-size: 13px;
}
th {
    background: #1c2128;
    color: #8b949e;
    font-weight: 600;
}
tr:hover { background: #1c2128; }

/* ── 表单 ─────────────────────────────────────────── */
.form-panel { margin-bottom: 16px; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 12px; color: #8b949e; }
.form-group input,
.form-group select,
.form-group textarea {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 8px 10px;
    color: #e1e4e8;
    font-size: 13px;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #58a6ff;
}
.form-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* ── 日志 ─────────────────────────────────────────── */
.log-box {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 12px;
    height: 300px;
    overflow-y: auto;
    font-family: "Cascadia Code", "Fira Code", monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #8b949e;
}
.log-box .log-line { white-space: pre-wrap; word-break: break-all; }

/* ── 复选框网格 ───────────────────────────────────── */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
}
.checkbox-grid label {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

#workflow-account-grid,
#workflow-schedule-account-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
    max-height: 320px;
}

#workflow-account-grid .workflow-target-option,
#workflow-schedule-account-grid .workflow-target-option {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
    padding: 10px 12px;
    background: #11161d;
    border: 1px solid #30363d;
    border-radius: 8px;
}

#workflow-account-grid .workflow-target-option:hover,
#workflow-schedule-account-grid .workflow-target-option:hover {
    border-color: #58a6ff;
    background: #141b23;
}

.workflow-target-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}

.workflow-target-header input[type="checkbox"] {
    margin-top: 3px;
    flex: 0 0 auto;
}

.workflow-target-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.workflow-target-title {
    color: #c9d1d9;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    word-break: break-word;
}

.workflow-target-subtitle,
.workflow-target-meta {
    font-size: 11px;
    line-height: 1.4;
    word-break: break-word;
}

.workflow-target-pills {
    align-items: flex-start;
}

/* ── 状态标签 ─────────────────────────────────────── */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}
.status-pending { background: #30363d; color: #8b949e; }
.status-running { background: #1f3a5f; color: #58a6ff; }
.status-paused { background: #3d2e00; color: #d29922; }
.status-success { background: #1b3a2a; color: #3fb950; }
.status-failed { background: #3d1f20; color: #f85149; }
.status-cancelled { background: #3d2e00; color: #d29922; }

.muted { color: #484f58; font-size: 13px; }
.mono { font-family: "Cascadia Code", "Fira Code", monospace; }

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.summary-item {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 12px;
}
.summary-label {
    display: block;
    font-size: 11px;
    color: #8b949e;
    margin-bottom: 4px;
}
.summary-value {
    display: block;
    color: #c9d1d9;
    font-size: 13px;
    line-height: 1.5;
    word-break: break-word;
}

.inline-alert {
    margin-top: 12px;
    background: #3d1f20;
    border: 1px solid #f85149;
    color: #ffb3b3;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 12px;
}

.pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #1c2128;
    border: 1px solid #30363d;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 11px;
    color: #8b949e;
}
.pill.active {
    background: #1b3a2a;
    border-color: #2ea043;
    color: #3fb950;
}
.pill.warning {
    background: #3d2e00;
    border-color: #d29922;
    color: #d29922;
}
.pill.danger {
    background: #3d1f20;
    border-color: #f85149;
    color: #f85149;
}

/* ── 代理标签 ─────────────────────────────────────── */
.proxy-tag {
    display: inline-block;
    background: #1c2128;
    border: 1px solid #30363d;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    color: #8b949e;
    font-family: monospace;
    vertical-align: middle;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── 广告管理 ─────────────────────────────────────── */
#ads-account-status-panel .stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#ads-campaigns-table td, #ads-adsets-panel td {
    vertical-align: middle;
}

.ads-toggle-btn {
    min-width: 52px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.task-run-detail-panel {
    width: min(1280px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 24px;
}

.task-run-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.task-run-preview-card {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 16px;
}

.task-run-image {
    width: 100%;
    max-height: 420px;
    object-fit: contain;
    border: 1px solid #30363d;
    border-radius: 8px;
    background: #05070b;
}

.task-run-textarea {
    width: 100%;
    background: #05070b;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 10px 12px;
    color: #c9d1d9;
    font-size: 12px;
    line-height: 1.5;
    font-family: "Cascadia Code", "Fira Code", monospace;
    resize: vertical;
}

.code-textarea {
    width: 100%;
    min-height: 120px;
    background: #05070b;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 10px 12px;
    color: #c9d1d9;
    font-size: 12px;
    line-height: 1.5;
    font-family: "Cascadia Code", "Fira Code", monospace;
    resize: vertical;
}

.workflow-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.workflow-run-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.workflow-summary-box {
    min-height: 42px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 10px 12px;
}

.workflow-guide-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.workflow-guide-card {
    background: linear-gradient(180deg, #111821 0%, #0f141b 100%);
    border: 1px solid #283241;
    border-radius: 10px;
    padding: 14px;
    min-width: 0;
}

.workflow-guide-card strong {
    display: block;
    font-size: 13px;
    color: #c9d1d9;
    margin-bottom: 6px;
}

.workflow-guide-card p {
    color: #8b949e;
    font-size: 12px;
    line-height: 1.6;
}

.workflow-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 16px 0;
}

.workflow-mode-switch {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.workflow-mode-btn.is-active {
    background: linear-gradient(180deg, #18324a 0%, #142535 100%);
    border-color: #2a4a66;
    color: #8fd0ff;
}

.workflow-builder-shell {
    display: grid;
    gap: 16px;
}

.workflow-json-editor {
    margin-top: 8px;
}

.workflow-builder-section {
    background: linear-gradient(180deg, #10161e 0%, #0d1218 100%);
    border: 1px solid #283241;
    border-radius: 12px;
    padding: 16px;
}

.workflow-builder-section-header,
.workflow-builder-subheader,
.workflow-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.workflow-builder-section-header {
    margin-bottom: 12px;
}

.workflow-builder-section-header h4,
.workflow-builder-subheader h4 {
    margin: 0;
    color: #c9d1d9;
}

.workflow-builder-subheader {
    margin: 16px 0 10px;
}

.workflow-builder-section-header p,
.workflow-builder-subheader p {
    margin-top: 4px;
    font-size: 12px;
    color: #8b949e;
    line-height: 1.5;
}

.workflow-builder-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.workflow-builder-empty {
    padding: 16px;
    background: #0d1117;
    border: 1px dashed #30363d;
    border-radius: 10px;
    color: #8b949e;
    font-size: 12px;
    line-height: 1.6;
}

.workflow-builder-item {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 14px;
}

.workflow-step-card {
    border-color: #34404c;
}

.workflow-item-title {
    color: #f0f6fc;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.workflow-item-subtitle {
    margin-top: 4px;
    color: #8b949e;
    font-size: 12px;
    line-height: 1.5;
}

.workflow-item-actions {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
}

.workflow-item-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.workflow-item-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workflow-span-full {
    grid-column: 1 / -1;
}

.workflow-inline-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 10px;
    background: #11161d;
    border: 1px solid #2c3746;
    border-radius: 8px;
    color: #c9d1d9;
    font-size: 13px;
}

.workflow-inline-check input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
}

.workflow-builder-tip {
    padding: 10px 12px;
    background: #121923;
    border: 1px solid #2c3746;
    border-radius: 8px;
    color: #8b949e;
    font-size: 12px;
    line-height: 1.6;
}

.workflow-kv-row {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: flex-start;
}

.workflow-code-field textarea {
    min-height: 110px;
}

.workflow-advanced-note {
    margin-top: 10px;
    color: #8b949e;
    font-size: 12px;
    line-height: 1.6;
}

.workflow-editor-note {
    margin-top: 10px;
}

.workflow-flow-editor {
    margin-top: 8px;
    overflow: auto;
    padding-bottom: 4px;
}

.workflow-flow-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 16px;
    align-items: start;
}

.workflow-flow-stage {
    min-width: 0;
}

.workflow-flow-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 14px 16px;
    background: linear-gradient(180deg, #111821 0%, #0f141b 100%);
    border: 1px solid #283241;
    border-radius: 12px;
}

.workflow-flow-toolbar-main {
    display: grid;
    gap: 10px;
    min-width: 280px;
    flex: 1;
}

.workflow-flow-note {
    color: #8b949e;
    font-size: 12px;
    line-height: 1.6;
}

.workflow-flow-toolbar .workflow-item-actions select {
    min-width: 148px;
}

.workflow-flow-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.workflow-flow-stat {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #0d1117;
    border: 1px solid #2f3b4a;
    color: #8fd0ff;
    font-size: 11px;
}

.workflow-flow-canvas {
    position: relative;
    min-width: 100%;
    border: 1px solid #283241;
    border-radius: 18px;
    background-color: #0b1118;
    background-image:
        linear-gradient(rgba(143, 208, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(143, 208, 255, 0.05) 1px, transparent 1px);
    background-size: 32px 32px;
    box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.03);
    overflow: hidden;
}

.workflow-flow-canvas-shell {
    overflow: auto;
    padding-bottom: 4px;
}

.workflow-flow-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.workflow-flow-edge {
    fill: none;
    stroke: #5d7da2;
    stroke-width: 2.5;
    opacity: 0.92;
}

.workflow-flow-edge.is-conditional {
    stroke: #d29922;
    stroke-dasharray: 8 6;
}

.workflow-flow-edge-label {
    fill: #d29922;
    font-size: 12px;
    font-weight: 600;
}

.workflow-flow-node {
    position: absolute;
    display: flex;
    flex-direction: column;
    border: 1px solid #314055;
    border-radius: 16px;
    overflow: hidden;
    height: auto;
    background: linear-gradient(180deg, #121a24 0%, #0d1218 100%);
    box-shadow: 0 18px 32px rgba(3, 8, 16, 0.36);
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.workflow-flow-node:hover {
    border-color: #416181;
    box-shadow: 0 22px 40px rgba(3, 8, 16, 0.44);
}

.workflow-flow-node.is-conditional {
    border-color: #7d6524;
}

.workflow-flow-node.is-dragging {
    z-index: 4;
    transform: scale(1.01);
    box-shadow: 0 28px 44px rgba(3, 8, 16, 0.5);
}

.workflow-flow-node.is-selected {
    border-color: #58a6ff;
    box-shadow: 0 0 0 1px rgba(88, 166, 255, 0.32), 0 24px 42px rgba(3, 8, 16, 0.46);
}

.workflow-flow-node.is-link-source {
    border-color: #d29922;
    box-shadow: 0 0 0 1px rgba(210, 153, 34, 0.35), 0 24px 42px rgba(3, 8, 16, 0.46);
}

.workflow-flow-node-handle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(180deg, #1a2f43 0%, #152637 100%);
    border-bottom: 1px solid #29394c;
    color: #dce8f5;
    font-size: 13px;
    font-weight: 600;
    cursor: grab;
    user-select: none;
    touch-action: none;
}

.workflow-flow-node.is-conditional .workflow-flow-node-handle {
    background: linear-gradient(180deg, #3c2f0d 0%, #2b2208 100%);
    border-bottom-color: #5d4a17;
}

.workflow-flow-node-handle:active {
    cursor: grabbing;
}

.workflow-flow-node-type {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #33516c;
    background: #0f1f2e;
    color: #8fd0ff;
    font-size: 11px;
    font-weight: 500;
}

.workflow-flow-node-body {
    display: grid;
    gap: 10px;
    padding: 14px;
    flex: 1;
    cursor: pointer;
}

.workflow-flow-node-body:hover {
    background: rgba(255, 255, 255, 0.02);
}

.workflow-flow-node-id {
    color: #8fd0ff;
    font-size: 12px;
}

.workflow-flow-node-summary {
    color: #c9d1d9;
    font-size: 12px;
    line-height: 1.6;
    word-break: break-word;
}

.workflow-flow-node-condition {
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #5d4a17;
    background: rgba(210, 153, 34, 0.08);
    color: #d29922;
    font-size: 11px;
    line-height: 1.5;
}

.workflow-flow-node-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.workflow-flow-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid #2f3b4a;
    background: #111821;
    color: #8b949e;
    font-size: 11px;
}

.workflow-flow-pill.is-conditional {
    border-color: #7d6524;
    color: #d29922;
}

.workflow-flow-pill.is-optional {
    border-color: #416181;
    color: #8fd0ff;
}

.workflow-flow-pill.is-retry {
    border-color: #5a4a1f;
    color: #f2cc60;
}

.workflow-flow-pill.is-workflow {
    border-color: #31524a;
    color: #56d4b3;
}

.workflow-flow-pill.is-manual {
    border-color: #6d4b1f;
    color: #ffb86b;
}

.workflow-flow-pill.is-probe {
    border-color: #5a3d73;
    color: #c59dff;
}

.workflow-flow-pill.is-save {
    border-color: #2b5939;
    color: #62d48a;
}

.workflow-flow-node-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 0 14px 14px;
}

.workflow-flow-node-actions .btn {
    flex: 1 1 72px;
    min-width: 0;
}

.workflow-flow-inspector {
    display: grid;
    gap: 14px;
    align-self: start;
    position: sticky;
    top: 20px;
    padding: 16px;
    border: 1px solid #283241;
    border-radius: 14px;
    background: linear-gradient(180deg, #111821 0%, #0d1218 100%);
}

.workflow-flow-inspector-header,
.workflow-flow-inspector-subheader,
.workflow-flow-branch-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.workflow-flow-inspector-header h4,
.workflow-flow-inspector-subheader h5 {
    margin: 0;
    color: #f0f6fc;
}

.workflow-flow-inspector-header p,
.workflow-flow-inspector-subheader p {
    margin-top: 4px;
    color: #8b949e;
    font-size: 12px;
    line-height: 1.5;
}

.workflow-flow-inspector-section {
    display: grid;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px solid #212a36;
}

.workflow-flow-inspector-section:first-of-type {
    padding-top: 0;
    border-top: none;
}

.workflow-flow-inspector-section h5 {
    margin: 0;
    color: #c9d1d9;
    font-size: 13px;
}

.workflow-flow-reference-helper {
    display: grid;
    gap: 8px;
}

.workflow-flow-reference-title {
    color: #8fd0ff;
    font-size: 12px;
    font-weight: 600;
}

.workflow-flow-reference-group {
    display: grid;
    gap: 6px;
}

.workflow-flow-reference-label {
    color: #8b949e;
    font-size: 11px;
}

.workflow-flow-reference-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.workflow-flow-reference-pills .btn {
    min-width: 0;
}

.workflow-flow-empty {
    padding: 14px;
    background: #0d1117;
    border: 1px dashed #30363d;
    border-radius: 10px;
    color: #8b949e;
    font-size: 12px;
    line-height: 1.6;
}

.workflow-flow-branch-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #30363d;
    border-radius: 10px;
    background: #0d1117;
}

.workflow-flow-branch-header strong {
    color: #c9d1d9;
    font-size: 13px;
}

.workflow-page-panel {
    margin-top: 16px;
    margin-bottom: 16px;
    padding: 16px;
    background: linear-gradient(180deg, #111821 0%, #0f141b 100%);
    border-color: #283241;
}

.workflow-page-picker {
    display: grid;
    gap: 10px;
}

.workflow-page-picker-note {
    color: #8b949e;
    font-size: 12px;
    line-height: 1.6;
}

.workflow-page-picker select {
    width: 100%;
}

.workflow-page-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.workflow-page-stat {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    padding: 10px 12px;
}

.workflow-page-stat strong {
    display: block;
    color: #c9d1d9;
    font-size: 13px;
    margin-bottom: 4px;
}

.workflow-page-stat span {
    color: #8b949e;
    font-size: 12px;
    line-height: 1.5;
    word-break: break-word;
}

@media (max-width: 900px) {
    .app-shell {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #30363d;
    }
    main {
        padding: 16px;
    }
    .content-header {
        padding: 16px 16px 0;
        flex-direction: column;
    }
    .header-status-card {
        width: 100%;
        min-width: 0;
        max-width: none;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .task-run-preview-grid {
        grid-template-columns: 1fr;
    }
    .workflow-guide-grid,
    .workflow-editor-grid,
    .workflow-run-grid,
    .workflow-item-grid,
    .workflow-item-grid-2,
    .workflow-page-meta {
        grid-template-columns: 1fr;
    }
    .workflow-editor-toolbar,
    .workflow-builder-section-header,
    .workflow-builder-subheader,
    .workflow-item-header,
    .workflow-kv-row,
    .workflow-flow-toolbar,
    .workflow-flow-inspector-header,
    .workflow-flow-inspector-subheader,
    .workflow-flow-branch-header {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
    .workflow-flow-layout {
        grid-template-columns: 1fr;
    }
    .workflow-item-actions,
    .workflow-mode-switch,
    .workflow-flow-stats {
        width: 100%;
    }
    .workflow-flow-editor {
        overflow-x: auto;
    }
    .workflow-flow-canvas {
        min-width: 880px;
    }
    .workflow-flow-inspector {
        position: static;
    }
    #workflow-account-grid,
    #workflow-schedule-account-grid {
        grid-template-columns: 1fr;
    }
    th, td {
        padding: 8px 10px;
    }
}
