/* ============================================================
   UML 知识库 AI 学习助手 — 全局样式
   风格对齐原站 uml.org.cn 传统培训门户风格
   ============================================================ */

/* ---------- 重置 ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #1a5ca8;
    text-decoration: underline;
}
a:hover { color: #2c6cb0; }

/* ---------- 顶栏 ---------- */
.top-nav {
    background: #333;
    color: #fff;
    padding: 0;
    flex-shrink: 0;
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    padding: 6px 16px;
}
.nav-inner .logo {
    font-weight: bold;
    font-size: 15px;
    margin-right: 20px;
    white-space: nowrap;
}
.nav-inner .logo a {
    color: #fff;
    text-decoration: none;
}
.nav-inner nav a {
    color: #ddd;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 8px;
    white-space: nowrap;
}
.nav-inner nav a:hover { color: #fff; text-decoration: underline; }

/* ---------- 搜索 Tab（豆包风格：下划线指示器）--------- */
.search-tabs {
    padding: 12px 24px 0;
    display: flex;
    gap: 0px;
    flex-wrap: wrap;
    /* align-items: center; */
    flex-shrink: 0;
    /* border-bottom: 1px solid #1a1a1a; */
    padding-bottom: 0;
}
.tab-btn {
    padding: 8px 12px;    
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    border-radius: 0;
    border-left:none;
    border-right:none;
    border-top:none;
    border-bottom: 2px solid #1a1a1a;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
}
.tab-btn:hover { color: #333; }
.tab-btn.active {
    color: #1a1a1a;
    font-weight: 600;
    border-left:1px solid #1a1a1a;
    border-right:1px solid #1a1a1a;
    border-top:1px solid #1a1a1a;
    border-bottom: 2px solid transparent;
}
.tab-btn.active:hover { color: #1a1a1a; }

.tab-hint {
    font-size: 11px;
    color: #e8782c;
    background: #fffde7;
    border: 1px solid #ffe082;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    white-space: nowrap;
}

/* ---------- 主体布局 ---------- */
.main-container {
    /* max-width: 1200px; */
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex: 1;
    min-height: 0;
    position: relative;
}

/* --- 左栏：可折叠 --- */
.left-panel {
    width: 260px;
    min-width: 260px;
    max-width: 260px;
    border-right: 1px solid #e8e8e8;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
    transition: width 0.25s ease, min-width 0.25s ease, padding 0.25s ease, opacity 0.2s ease, border 0.25s ease;
}
.left-panel.collapsed {
    width: 0;
    min-width: 0;
    max-width: 0;
    border-right-width: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* 侧栏头部：新建按钮 + 折叠按钮 */
.sidebar-header {
    /* display: flex; */
    gap: 6px;
    padding: 12px 12px 8px;
    flex-shrink: 0;
}
.btn-new {
    flex: 1;
    padding: 8px 12px;
    background: #1a5ca8;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    border-radius: 8px;
    transition: background 0.2s;
}
.btn-new:hover { background: #15508f; }

.btn-toggle-sidebar {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    margin: 10px 0 0 10px;
}
.btn-toggle-sidebar:hover { background: #e8e8e8; color: #333; }

/* 侧栏折叠后的展开按钮 */
.btn-expand-sidebar {
    display: none;
    position: absolute;
    left: 0;
    top: 12px;
    z-index: 10;
    width: 28px;
    height: 28px;
    padding: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-left: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 11px;
    color: #888;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 2px 0 6px rgba(0,0,0,0.06);
}
.btn-expand-sidebar:hover { background: #f0f0f0; color: #333; }
.btn-expand-sidebar.visible { display: flex; }

.session-search {
    width: calc(100% - 24px);
    margin: 0 12px 8px;
    padding: 7px 12px;
    border: 1px solid #e0e0e0;
    font-size: 12px;
    border-radius: 8px;
    outline: none;
    background: #fff;
    flex-shrink: 0;
}
.session-search:focus { border-color: #1a5ca8; box-shadow: 0 0 0 2px rgba(26,92,168,0.1); }

.session-list-header {
    font-weight: 600;
    font-size: 12px;
    margin: 0 12px 6px;
    cursor: pointer;
    user-select: none;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.session-list-header .arrow {
    display: inline-block;
    width: 12px;
    font-size: 10px;
    transition: transform 0.15s;
    transform: rotate(90deg); /* 旋转90度 */
}
.session-list-header.collapsed .arrow {
    transform: rotate(0deg);
}
.session-list {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    padding: 0 8px;
}
.session-list li {
    padding: 9px 12px;
    cursor: pointer;
    font-size: 13px;
    border-radius: 8px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.15s;
}
.session-list li:hover { background: #e8f0fe; }
.session-list li.active { background: #d0e4fd; font-weight: 500; color: #1a5ca8; }

/* --- 右栏 --- */
.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    min-height: 0;
    min-width: 0;
    position: relative;
}

/* 输入区 — 顶部（豆包风格） */
.input-area {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 16px 20px 12px;
    flex-shrink: 0;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    /* position: sticky;
    bottom: 90px;
    width: 100%; */
}
#question-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #d0d5dd;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    /* border-radius: 12px; */
    outline: none;
    min-height: 48px;
    max-height: 120px;
    background: #f9fafb;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
#question-input:focus {
    border-color: #1a5ca8;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26,92,168,0.08);
}
#question-input::placeholder { color: #aab; }

.input-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    align-items: flex-end;
    position: relative;
}
.btn-send-img{
    position: absolute;
    right: 1rem;
    bottom: 5px;
}
.plan-options {
    display: flex;
    gap: 6px;
}
.plan-select {
    padding: 4px 8px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 12px;
    color: #555;
    background: #f9fafb;
    outline: none;
    cursor: pointer;
    font-family: inherit;
}
.plan-select:focus { border-color: #1a5ca8; }

.btn-send {
    padding: 10px 20px;
    background: #1a5ca8;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    border-radius: 10px;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}
.btn-send:hover { background: #15508f; }
.btn-send:active { transform: scale(0.97); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-plan-submit {
    background: #1a5ca8;
}
.btn-plan-submit:hover { background: #15508f; }

/* 回答区 */
.answer-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    scroll-behavior: smooth;
}
.placeholder-tip {
    color: #bbb;
    font-size: 15px;
    text-align: center;
    padding: 60px 0;
}

/* 回答标题 */
.answer-label {
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 12px;
    color: #333;
}

/* 引导语 */
.intro-text {
    margin-bottom: 16px;
    color: #555;
    font-size: 14px;
    line-height: 1.8;
}

/* 回答分组 */
.answer-group {
    margin-bottom: 20px;
}
.answer-group h3 {
    font-size: 15px;
    margin-bottom: 6px;
    color: #1a5ca8;
    font-weight: bold;
}
.answer-group ul {
    list-style: none;
    padding-left: 0;
}
.answer-group li {
    margin-bottom: 5px;
    line-height: 1.7;
    padding-left: 14px;
    position: relative;
}
.answer-group li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #333;
}
.answer-group .meta {
    color: #e8782c;
    font-size: 12px;
    margin-left: 4px;
}
.answer-group .meta span {
    margin-right: 8px;
}

/* 消息气泡 */
.message {
    margin-bottom: 20px;
}
.message .label {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 4px;
}
.message.user .label { color: #333; }
.message.assistant .label { color: #1a5ca8; }
.message .content {
    padding-left: 4px;
    line-height: 1.8;
}
.labelTitle{
    position: relative;
}
.message.user .labelTitle .label,.message.assistant .labelTitle .label{
    position: absolute;
    left: 2.4rem;
    top: 0.5rem;
}
.labelTitle .labelH3{
    position: absolute;
    left: 2.4rem;
    top: 0.5rem;
    color: #000;
    font-size: 1rem;
}
.labelH4{
    margin:2rem 0;
    font-size: 1rem;
}
.labelKecheng{
    color: #333;
    font-weight: 600;
    font-size: 1rem;
    /* margin-bottom: 1rem; */
}
/* ---------- 输入区（旧样式已移至上方，此处保留占位以兼容） ---------- */

/* ---------- 学习计划展示 ---------- */
.plan-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 16px;
}
.plan-card .plan-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #fef3c7;
}
.plan-card .plan-title {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 6px;
}
.plan-card .plan-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.7;
}
.plan-card .plan-meta {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}
.plan-card .plan-meta span {
    margin-right: 12px;
    padding: 2px 8px;
    background: #f5f5f5;
    border-radius: 4px;
}

/* 学习阶段 */
.plan-stage {
    margin-bottom: 20px;
    padding: 16px;
    background: #fafbfc;
    border-radius: 10px;
    /* border-left: 4px solid #1a5ca8; */
}
.plan-stage .stage-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.plan-stage .stage-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}
.plan-stage .stage-duration {
    font-size: 12px;
    color: #1a5ca8;
    background: #e8f0fe;
    padding: 2px 10px;
    border-radius: 12px;
}
.plan-stage .stage-detail {
    font-size: 13px;
    color: #555;
    line-height: 1.7;
    margin-bottom: 6px;
}
.plan-stage .stage-detail strong {
    color: #333;
    font-weight: 600;
}
.plan-stage .stage-resources {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e0e0e0;
}
.plan-stage .stage-resources .res-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}
.plan-stage .stage-resources a {
    display: inline-block;
    margin: 2px 8px 2px 0;
    font-size: 13px;
}
.plan-stage .stage-resources .res-type-tag {
    font-size: 11px;
    color: #888;
    background: #eee;
    padding: 1px 6px;
    border-radius: 3px;
    margin-left: 2px;
}

/* 资源推荐列表 */
.plan-recommendations {
    margin-top: 16px;
    /* padding: 16px; */
    /* background: #fffbeb; */
    border-radius: 10px;
    /* border: 1px solid #fde68a; */
}
.plan-recommendations h4 {
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 10px;
}
.plan-rec-group  {
    padding-left: 2rem;
    width: 100%;
}
.plan-rec-items {
    margin-top: 2rem;
}

.plan-rec-item {
    margin-top: 1rem;
    font-size: 13px;
    line-height: 1.6;
}
.plan-rec-header {
    /* display: flex; */
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #888;
    padding: 0 0 8px;
    border-bottom: 1px solid #C0C0C0;
    font-weight: 600;
    /* margin-top: 2rem; */
}
.plan-rec-item .rec-content { display: flex; gap: 6px; align-items: center; }
.plan-rec-item .rec-title { width: 40%; font-weight: 500; color: #333; }
.plan-rec-item .rec-tip { width: 60%; color: #333;  }
.plan-rec-header .rec-title,.plan-rec-header .rec-tip { font-weight: 600;font-size: 1rem; color: #333; }

.plan-rec-item .rec-title a{
    display: -webkit-box;
    -webkit-line-clamp: 1;    /* 控制显示行数 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 96%;
}

.plan-resources{
    display: flex;
    flex-wrap: wrap;
    gap: 0px; 
    margin-top: 12px;
    /* background: #F5F5F5; */
    border-top: 1px solid #C0C0C0;
    border-bottom: 1px solid #C0C0C0;
    /* border-radius: 8px; */
    padding: 1rem;
}
.plan-res-group {
    flex: 0 0 calc(25% - 0px);  /* 减去 gap 的一半 (20/2) */
    /* background: #fffbeb; */
    /* border-radius: 8px; */
    /* 限制宽度 */
    max-width: 25%;
    
    /* border: 1px solid #fde68a; */
}
.plan-res-group a,.plan-rec-item .rec-title a{
    /* 去除下划线 */
    text-decoration: none;
    /* 限制宽度 */
    /* max-width: 24%; */
}
.plan-res-item {
    margin-top: 6px;
    padding-left: 0rem;
}
.plan-res-item a{
    display: -webkit-box;
    -webkit-line-clamp: 1;    /* 控制显示行数 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 96%;
}

/* 模板回退提示 */
.plan-fallback-hint {
    font-size: 1rem;
    /* color: #999; */
    /* font-style: italic; */
    /* margin-top: 12px; */
    padding: 6px 10px;
    /* background: #f0f4ff; */
    border-radius: 6px;
    display: inline-block;
    font-weight: 600; 
}

/* ---------- 加载提示 ---------- */
.loading-tip {
    color: #999;
    font-style: italic;
    padding: 12px 0;
    font-size: 14px;
}

/* ---------- 页脚 ---------- */
.page-footer {
    text-align: center;
    padding: 16px;
    color: #999;
    font-size: 13px;
    border-top: 1px solid #e0e0e0;
    flex-shrink: 0;
}
.page-footer p { margin: 4px 0; }

/* ---------- 资源详情页 ---------- */
.detail-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    line-height: 1.8;
}
.detail-container h2 {
    font-size: 20px;
    margin-bottom: 12px;
    color: #333;
}
.detail-container .detail-meta {
    color: #888;
    font-size: 13px;
    margin-bottom: 16px;
}
.detail-container .detail-meta span {
    margin-right: 16px;
}
.detail-container .detail-section {
    margin-bottom: 16px;
}
.detail-container .detail-section h3 {
    font-size: 15px;
    color: #1a5ca8;
    margin-bottom: 6px;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}
.detail-container .detail-section p,
.detail-container .detail-section pre {
    font-size: 14px;
    color: #555;
    white-space: pre-wrap;
    font-family: inherit;
}
.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #1a5ca8;
}
.error-msg {
    color: #c0392b;
    background: #fdecea;
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

/* ---------- 关于页 ---------- */
.about-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    line-height: 1.8;
}
.about-container h2 {
    font-size: 20px;
    margin-bottom: 12px;
}
.about-container h3 {
    font-size: 16px;
    color: #1a5ca8;
    margin: 24px 0 8px;
    border-bottom: 1px solid #eee;
    padding-bottom: 4px;
}
.about-container ul {
    padding-left: 20px;
    margin-bottom: 12px;
}
.about-container li {
    margin-bottom: 6px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        border: none;
    }
    .left-panel {
        width: 100%;
        max-width: none;
        min-width: auto;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        max-height: 200px;
        transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.2s ease;
    }
    .left-panel.collapsed {
        width: 100%;
        min-width: auto;
        max-width: none;
        max-height: 0;
        border-bottom-width: 0;
    }
    .btn-expand-sidebar { top: 8px; }

    .right-panel { flex: 1; }
    .nav-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .nav-inner nav a {
        font-size: 12px;
        padding: 2px 4px;
    }
    .search-tabs { gap: 2px; padding: 8px 10px 6px; }
    .tab-btn { padding: 4px 10px; font-size: 12px; }
    .input-area { padding: 10px 12px 8px; }
    .answer-area { padding: 12px 14px; }
    .detail-container,
    .about-container {
        margin: 20px 10px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .nav-inner nav a { font-size: 11px; padding: 2px 3px; }
    .tab-btn { padding: 3px 8px; font-size: 11px; }
    .input-area { padding: 8px 10px; gap: 6px; }
    .btn-send { padding: 8px 14px; font-size: 13px; }
    #question-input { padding: 8px 12px; font-size: 13px; }
}
/* ============================================================
   header新改的样式
   ============================================================ */
.top-nav {
    width: 100%;
    height: 40px;             
    overflow: hidden;           
    background-color: #404040; 
    color: #ffffff;
    font-family: "微软雅黑";
    font-size: 15px;
}

.nav-inner {
    max-width: none;           
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    height: 40px;
    line-height: 40px;
}


.nav-left { width: 17px; height: 40px; }
.nav-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 40px;
    background-color: #404040;
}
.nav-logo img { display: block; height: 30px; }


.nav-inner .logo {
    font-weight: normal;
    font-size: 15px;
    font-family: "微软雅黑";
    margin-right: 0;
    padding: 0 18px;
    color: #ffffff;
}
.nav-inner .logo a { color: #ffffff; text-decoration: none; font-family: "微软雅黑"; font-size: 15px; }


nav { display: flex; }
.nav-inner nav a {
    display: block;
    width: 56px;               
    height: 40px;
    line-height: 40px;
    text-align: center;
    padding: 0;
    color: #ffffff;
    font-family: "微软雅黑";
    font-size: 15px;
    text-decoration: none;
    
    border-left: 1px solid #000000;  
    white-space: nowrap;
}
.nav-inner nav a:hover {
    color: #ffffff;
    text-decoration: none;
    background-color: #606268;       
}

.nav-inner nav a:nth-child(1)  { width: 63px; }   /* 求知 */
.nav-inner nav a:nth-child(6)  { width: 85px; }   /* iPerson */
.nav-inner nav a:nth-child(11) { width: 63px; }   /* 讲座 */
.nav-inner nav a:nth-child(12) { width: 120px; }  /* Model Center */
.nav-inner nav a:nth-child(13) { width: 120px; }  /* 汽车系统工程 */


.nav-gap { width: 100px; height: 40px; border-left: 1px solid #000000; }


.nav-model { width: 80px; height: 40px; background-color: #05a7f2; }
.nav-model:hover { background-color: #606268; }


.nav-gap2 { width: 77px; height: 40px; border-left: 1px solid #000000; }
.nav-assistant {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0 12px;
    color: #ffffff;
    font-family: "微软雅黑";
    font-size: 15px;
    text-decoration: none;
    white-space: nowrap;
}
.assistant-icon {  vertical-align: middle; margin-right: 6px; }


.nav-member {
    height: 40px;
    margin-left: auto;
    padding: 0 16px;
    color: #ffffff;
    font-family: "微软雅黑";
    font-size: 15px;
    text-decoration: none;
    white-space: nowrap;
}


@media (max-width: 768px) {
    .nav-inner { flex-direction: row; flex-wrap: nowrap; overflow-x: auto; }
    .nav-inner nav a { font-size: 15px; padding: 0; }
}
