html,
body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
}
* {
    box-sizing: border-box;
}
body {
    display: flex;
    flex-direction: column;
    background-color: lightGray;
}
ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
li {
    list-style: none;
    margin: 0;
    padding: 0;
}

button {
    background-color: transparent;
    border: none;
    font-weight: bold;
    cursor: pointer;
}

::-webkit-scrollbar {
    width: 4px;
    height: 4px;
    background-color: #f5f5f5;
}

 ::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.3);
}

 ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.4); /* 鼠标悬停时的滚动条颜色 */
}

.header {
    width: 100%;
    height: 65px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    padding: 10px 20px;
}
.header .header-left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 0;
}
.header .header-left .header-left-img {
    width: 28px;
    height: 28px;
}
.header .header-left .operate {
    display: flex;
    align-items: center;
}

.header .header-title {
    flex: 1;
    text-align: center;
    font-size: 14px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 20px;
}

.header .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.header .header-left .btn-nav-toggle {
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    border-radius: 6px;
    color: #4b5563;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: all 0.15s ease;
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.header .header-left .btn-nav-toggle:hover {
    background: #f3f4f6;
    color: #111827;
}

.header .header-left .btn-nav-toggle:active {
    background: #e5e7eb;
}

.header .header-left .btn-nav-toggle img {
    width: 15px;
    height: 15px;
    opacity: 0.55;
    transition: opacity 0.15s ease;
}

.header .header-left .btn-nav-toggle:hover img {
    opacity: 0.85;
}

.header .header-right .btn-theme,
.header .header-right .btn-language {
    margin: 0;
    padding: 0;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 15px;
    cursor: pointer;
}

.header .header-right .btn-theme img,
.header .header-right .btn-language img {
    width: 24px;
    height: 24px;
}

.header .header-right .control {
    display: flex;
    align-items: center;
    padding-left: 10px;
    padding-right: 10px;
    gap: 3px;
    background-color: #F3F3F5;
    border-radius: 4px;
    height: 44px;
}
.header .header-right .control button img {
    vertical-align: top;
}
.header .header-right #step {
    font-size: 14px;
    font-weight: 400;
}

/* ========== Timeline Section ========== */
.timeline-section {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.timeline-section.collapsed {
    border-bottom: none;
}

.timeline-section.collapsed .timeline-bar {
    height: 0;
    min-height: 0;
    padding: 0;
    opacity: 0;
}

.btn-timeline-toggle,
.btn-tracegraph-toggle {
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    border-radius: 4px;
    color: #6B7280;
    cursor: pointer;
    background-color: #F3F3F5;
    border: none;
    transition: background-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.btn-timeline-toggle svg,
.btn-tracegraph-toggle svg {
    transition: transform 0.3s;
}

.btn-timeline-toggle:hover,
.btn-tracegraph-toggle:hover {
    background-color: #E7E7EB;
    color: #374151;
}

body.timeline-hidden .btn-timeline-toggle svg {
    transform: rotate(180deg);
}

body.tracegraph-hidden .btn-tracegraph-toggle svg {
    transform: rotate(180deg);
}

.btn-toggle-label {
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
}

.timeline-bar {
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 0px 12px 8px;
    min-height: 80px;
    flex-shrink: 0;
    transition: height 0.25s ease, padding 0.25s ease, opacity 0.25s ease;
    overflow: hidden;
}

/* ── Branch Selector ── */
.branch-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    flex-shrink: 0;
    overflow-x: auto;
    white-space: nowrap;
}

.branch-selector:empty {
    display: none;
}

.branch-pill {
    height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 4px;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #6B7280;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.branch-pill:hover {
    border-color: #93b4f5;
    color: #374151;
}

.branch-pill.active {
    border-color: #155EEF;
    color: #155EEF;
    background: #EFF4FF;
    font-weight: 600;
}

.branch-pill.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.timeline-track-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    height: 68px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.timeline-track-wrapper::-webkit-scrollbar {
    height: 3px;
}
.timeline-track-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.12);
    border-radius: 4px;
}

.timeline-track {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    padding: 0 4px;
    height: 100%;
}

.timeline-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1;
    width: 90px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 6px;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    transition: all 0.2s ease;
    padding: 3px;
    overflow: hidden;
}

.timeline-frame:hover {
    border-color: #fbbf24;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.timeline-frame.active {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.25);
}

.timeline-frame.visited {
    border-color: #c7d8f5;
}

.timeline-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.timeline-thumb-badge {
    position: absolute;
    bottom: 1px;
    right: 3px;
    font-size: 8px;
    color: #9ca3af;
    font-weight: 600;
    line-height: 1;
    background: rgba(255,255,255,0.8);
    padding: 1px 2px;
    border-radius: 2px;
}

.timeline-frame.active .timeline-thumb-badge {
    color: #b45309;
}

.container {
    display: flex;
    flex-direction: row;
    width: 100vw;
    overflow: hidden;
    padding-top: 15px;
    flex: 1;
    min-height: 0;
    background: #F3F3F5 url('../image/bg-img.svg') repeat left top;
}

.left {
    height: calc(100% - 20px);
    overflow: hidden;
    flex:1 1 625px;
    background-color: #fff;
    border-radius: 4px;
    margin-left: 20px;
    margin-right: 20px;
    margin-bottom: 20px;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    min-width: 32%;
    display: flex;
    flex-direction: column;
}
.left_bottom {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}


.chat-container {
    display: flex;
    justify-content: space-between;
}
.chat_toggle_group {

}

#chat_title {
    font-size: 20px;
    height: 28px;
    line-height: 28px;
    font-weight: 600;
    margin-bottom: 20px;
}
#chat_history {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin-bottom: 8px;
    padding-right: 8px;
}
#chat_send {
    position: relative;
    height: auto;
    border-radius: 4px;
    padding: 14px 14px 56px 14px;
    border: 1px solid #E0E0E0;
}
#message_input_wrap {
    width: 100%;
    position: relative;
}
#message_input {
    width: 100%;
    min-height: 24px;
    max-height: 200px;
    border: none;
    resize: none;
    overflow-y: auto;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    padding: 0;
}
#message_input:focus {
    outline: none;
}
input::placeholder, textarea::placeholder {
  color: #B3B3B3; /* 设置为红色，可自定义 */
  opacity: 1; /* 确保颜色清晰，部分浏览器可能需要 */
}

#message_send {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 38px;
    height: 38px;
    background-color: gray;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#message_send .tooltip {
    display: none;
    padding: 10px;
    background-color: rgba(0, 0, 0, .8);
    border-radius: 4px;
    white-space: nowrap;
    position: absolute;
    top: -40px;
    right: -25px;
    z-index: 10;   
}

.message_send_active {
    background-color: #155EEE !important;
}

#message_addtional {
    position: absolute;
    left: 14px;
    bottom: 14px;
}
td {
    font-size: larger;
}

.center {
    flex:1 1 788px;
    height: 100%;
    position: relative;
    max-width: 60%;
    min-width: 300px;
    overflow: hidden;
}
.center-scroll {
    width: 100%;
    height: 100%;
    overflow: auto;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: transparent transparent; /* Firefox: thumb track */
}
.center-scroll:hover {
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent; /* Firefox hover */
}
.center-scroll::-webkit-scrollbar {
    width: 2px;
    height: 2px;
    background-color: transparent;
}
.center-scroll::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background-color: transparent;
}
.center-scroll:hover::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3);
}
.center-scroll:hover::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.4);
}

#org-zoom-wrapper {
    transform-origin: 0 0;
    display: inline-block;
    min-width: 100%;
    min-height: 100%;
    transition: transform 0.12s ease-out;
}

#org-minimap {
    position: absolute;
    right: 10px;
    bottom: 50px;
    width: 150px;
    height: 100px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 20;
    overflow: hidden;
    user-select: none;
}

#org-minimap-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#org-minimap-viewport {
    position: absolute;
    border: 2px solid #155EEE;
    background: rgba(21, 94, 238, 0.12);
    cursor: move;
    box-sizing: border-box;
    min-width: 6px;
    min-height: 6px;
}

#org-zoom-controls {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid #E0E0E0;
    border-radius: 6px;
    padding: 4px 6px;
    z-index: 20;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    user-select: none;
}

#org-zoom-controls button {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: #333;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#org-zoom-controls button:hover {
    background: #F3F4F6;
}

#org-zoom-level {
    font-size: 12px;
    color: #555;
    min-width: 40px;
    text-align: center;
}

.resize-handle {
    width: 4px;
    cursor: col-resize;
    flex-shrink: 0;
    background: transparent;
    transition: background-color 0.2s;
    border-radius: 2px;
    margin: 20px 0;
}

.resize-handle:hover,
.resize-handle.active {
    background-color: #155EEF;
}

.right {
    background-color: #fff;
    height: 100%;
    flex: 0 0 465px;
    /*margin-left: 20px;*/
    margin-right: 20px;
     overflow: hidden;
    border-radius: 4px;
    padding: 18px 20px;
    padding-right: 10px;
    min-width: 200px;
}

.right-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    position: relative;
}

#agent_log {
    overflow-y: auto;
    width: 100%;
    height: 100%;
    position: relative;
}

.output-toggle-group {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    gap: 0;
    flex-shrink: 0;
}

.output-toggle-btn {
    border: 1px solid #ddd;
    background: #f8f8f8;
    color: #999;
    font-size: 11px;
    padding: 1px 8px;
    cursor: pointer;
    line-height: 18px;
    transition: all 0.15s;
}

.output-toggle-btn:first-child {
    border-radius: 3px 0 0 3px;
    border-right: none;
}

.output-toggle-btn:nth-child(2) {
    border-radius: 0 3px 3px 0;
}

.output-toggle-btn.active {
    background: #155EEF;
    color: #fff;
    border-color: #155EEF;
}

.output-toggle-btn:hover:not(.active) {
    background: #eee;
    color: #333;
}

.output-detail-btn {
    color: #999;
    font-size: 12px;
    cursor: pointer;
    line-height: 18px;
    margin-left: 8px;
    margin-right: 12px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.output-detail-btn:hover {
    color: #155EEF;
}

.plannings-output-wrapper {
    margin-bottom: 4px;
}
.node-timeline-container {
    border-left: 1px solid rgba(0, 0, 0, 0.2);
    margin-left: 10px;
    margin-top: 6px;
}
#agent_log .agent-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.agent_name {
    display: flex;
    align-items: center;
    height: 46px;
    margin-bottom: 20px;
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 10;
}
.agent_log_img {
    width: 38px;
    height: 38px;
    border-radius: 4px;
    background-color: #FEEAD5;
    margin-right: 8px;
}
.job_desc {
    font-size: 14px;
    min-height: 20px;
    line-height: 20px;
    padding-left: 34px;
    position: relative;
}
.job_desc:before {
    content:"";
    position: absolute;
    top: 0;
    left: 0;
    background-image: url("../image/right-user.svg");
    background-repeat: no-repeat;
    width: 22px;
    height: 22px;
}
.job_desc_interval {
    margin-bottom: 6px;
    margin-top: 6px;
    height: 22px;
    width: 10px;
    margin-left: 10px;
    border-left: 1px solid rgba(0, 0, 0, 0.2);
}
.planning {
    overflow-x: auto;
    background-color: #F8F8F8;
    border-radius: 4px;
    font-size: 14px;
    padding: 10px;
}
.plannings-head {
    font-size: 14px;
    height: 20px;
    line-height: 20px;
    padding-left: 34px;
    position: relative;
}
.plannings-head:before {
    content:"";
    position: absolute;
    top: 0;
    left: 0;
    background-image: url("../image/llm-icon.svg");
    background-repeat: no-repeat;
    width: 22px;
    height: 22px;
}
.plannings-output-head {
    margin-top: 6px;
    margin-bottom: 6px;
    padding-left: 64px;
    min-height: 22px;
    font-size: 14px;
    line-height: 22px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.plannings-output-head:before {
    content:"";
    position: absolute;
    top: 3px;
    left: 2px;
    background-image: url("../image/group-up.svg");
    background-repeat: no-repeat;
    width: 18px;
    height: 18px;
    cursor: pointer;

}

.collapse.plannings-output-head:before {
    content:"";
    position: absolute;
    top: 3px;
    left: 2px;
    background-image: url("../image/group-down.svg");
    background-repeat: no-repeat;
    width: 18px;
    height: 18px;
    cursor: pointer;
    transition: 0.5s;
}

.plannings-output-head:after {
    content:"";
    position: absolute;
    top: 0;
    left: 34px;
    background-image: url("../image/output_icon.svg");
    background-repeat: no-repeat;
    width: 22px;
    height: 22px;
}
.plannings-link {
    padding-left: 20px;
    margin-top: 6px;
    padding-bottom: 2px;
    width: 100%;
    display: inline-block;
    font-size: 14px;
}
.observation-head {
    margin-top: 6px;
    margin-bottom: 6px;
    padding-left: 34px;
    height: 22px;
    font-size: 14px;
    line-height: 22px;
    position: relative;
}
.observation-head:before {
    content:"";
    position: absolute;
    top: 0;
    left: 0;
    background-image: url("../image/tool-icon.svg");
    background-repeat: no-repeat;
    width: 22px;
    height: 22px;
}
.observation-output-head {
    margin-top: 6px;
    margin-bottom: 6px;
    padding-left: 64px;
    height: 22px;
    font-size: 14px;
    line-height: 22px;
    position: relative;
}
.observation-output-head:before {
    content:"";
    position: absolute;
    top: 3px;
    left: 2px;
    background-image: url("../image/group-up.svg");
    background-repeat: no-repeat;
    width: 18px;
    height: 18px;
}
.collapse.observation-output-head:before {
    content:"";
    position: absolute;
    top: 3px;
    left: 2px;
    background-image: url("../image/group-down.svg");
    background-repeat: no-repeat;
    width: 18px;
    height: 18px;
    cursor: pointer;
    transition: 0.5s;
}
.observation-output-head:after {
    content:"";
    position: absolute;
    top: 0;
    left: 34px;
    background-image: url("../image/output_icon.svg");
    background-repeat: no-repeat;
    width: 22px;
    height: 22px;
}
.observation {
    padding-left: 20px;
    border-left: 1px solid rgba(0, 0, 0, 0.2);
    margin-top: 6px;
    padding-bottom: 2px;
    width: calc(100% - 10px);
    display: inline-block;
    margin-left: 10px;
    font-size: 14px;

}
.agent_chat {
    margin-top: 3%;
    background-color: white;
    width: 80%;
}
.user_chat {
    margin-top: 3%;
    background-color: white;
    width: 80%;
    margin-left: auto;
}

/* 响应式布局 - 确保 History 按钮在小屏幕上也可见 */
@media (max-width: 1200px) {
    .header .header-title {
        display: none;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 10px;
    }
    
    .header .header-left .btn-nav-toggle {
        padding: 0 8px;
        font-size: 12px;
        font-weight: 500;
        height: 30px;
    }

    .header .header-left .btn-nav-toggle img {
        width: 13px;
        height: 13px;
    }
    
    .header .header-right .control {
        padding-left: 5px;
        padding-right: 5px;
        gap: 2px;
        height: 36px;
    }
}