/* ========== 全局字体 & 标题 ========== */
body {
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 1rem;
    color: #212529;
  }
  h3, h4 {
    font-weight: 600;
  }
  
  /* ========== 按钮 ========== */
  .btn {
    border-radius: .45rem;
    line-height: 1.15rem;
    transition: all .15s ease-in-out;
  }
  .btn-primary            { background: #146C94; border-color: #146C94; }
  .btn-outline-primary    { color: #146C94; border-color: #146C94; }
  .btn-outline-primary:hover { background: #146C94; color: #fff; }
  
  /* ========== 卡片结构 ========== */
  .card {
    border-radius: .8rem;
  }
  #projectPanel .card-header {
    background: #f9fafb;
    padding: 1rem 1.25rem;
  }
  #projectPanel .btn {
    padding: .55rem 1rem;
  }
  
  /* ========== 表格 ========== */
  .table {
    --bs-table-bg: #fff;
    --bs-table-striped-bg: #f2f6fa;
    --bs-table-hover-bg: #eef2f6;
    border-color: #dee2e6;
    font-size: 1rem;
  }
  .table thead th {
    white-space: nowrap;
    vertical-align: middle;
  }
  #tblProjects th, #tblProjects td {
    padding: .75rem .65rem;
  }
  
  /* ========== Panel 控件通用样式 ========== */
  .panel-control,
  .panel-control > .form-control,
  .panel-control > .btn {
    min-height: 38px;
    border-radius: .45rem;
  }
  .panel-control select,
  .panel-control input {
    font-size: 1rem;
  }
  
  /* 输入组圆角修正 */
  .input-group.panel-control > .form-control:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }
  .input-group.panel-control > .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
  
  /* ========== 响应式（≤576px） ========== */
  @media (max-width: 575.98px) {
    body {
      padding: .75rem;
    }
    .card {
      border-radius: .5rem;
    }
    #projectPanel .card-header {
      padding: .75rem .9rem;
      text-align: center;
    }
    #projectPanel .btn {
      width: 100%;
      margin-bottom: .5rem;
    }
  
    .table-responsive {
      overflow-x: auto;
    }
    .table {
      font-size: 0.96rem;
    }
  
    /* 控件折行为单列 */
    .panel-control {
      flex: 1 1 100%;
      max-width: 100% !important;
    }
    .input-group.panel-control {
      flex: 1 1 100%;
    }
  
    .search-panel .row > [class*="col-"] {
      flex: 0 0 100%;
      max-width: 100%;
    }
  
    .btn-group .btn {
      width: 100%;
    }
  
    /* 可选隐藏列示例（如合同额/更新时间） */
    /* 
    #tblProjects th:nth-child(8),
    #tblProjects td:nth-child(8),
    #tblProjects th:nth-child(9),
    #tblProjects td:nth-child(9) {
      display: none;
    } 
    */
  }
  
  /* ========== Modal 圆角与阴影 ========== */
  .modal-content {
    border-radius: .7rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
  }
  
  /* ========== 文件上传按钮隐藏 ========== */
  input[type="file"]::-webkit-file-upload-button {
    display: none;
  }
  
  
  @media (max-width: 575.98px) {
    .d-flex.flex-wrap.align-items-center.gap-2 {
      flex-direction: column !important;
      align-items: stretch !important;
    }
    .d-flex.flex-wrap .btn,
    .d-flex.flex-wrap .form-control {
      width: 100% !important;
    }
  }
  

  /* 聊天记录列表结构样式 */
    .session-item {
        background: #fff;
        transition: box-shadow 0.2s;
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }
    .session-item:hover {
        box-shadow: 0 0 8px rgba(0, 0, 0, 0.06);
    }
    .session-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: #146C94;
    }
    .session-meta {
        font-size: 0.9rem;
        color: #6c757d;
    }
    .btn-sm {
        font-size: 0.875rem;
        padding: .4rem .75rem;
    }
    .btn-sm i {
        font-size: 1.1rem;
    }  
  
  /* 分页按钮统一风格 */
  .pagination .page-link {
    color: #146C94;
    border-radius: .4rem;
  }
  .pagination .page-item.active .page-link {
    background-color: #146C94;
    border-color: #146C94;
  }

  
  .ai-card {
    border: 1px solid #ccc;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: #fff;
}

.ai-card-header {
    background-color: #f6f8fa;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    cursor: pointer;
}

.ai-card-header .right-actions a,
.ai-card-header .right-actions button {
    margin-left: 10px;
    font-size: 0.95em;
    padding: 5px 10px;
    border: none;
    background: none;
    color: #007bff;
    cursor: pointer;
    text-decoration: underline;
}

.ai-card-header .right-actions button:hover,
.ai-card-header .right-actions a:hover {
    color: #0056b3;
}

.ai-card-body {
    padding: 15px;
    max-height: 500px;
    overflow-y: auto;
    background-color: #fff;
}


.markdown-body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
}


.ai-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.ai-modal-content {
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.ai-modal-header {
    background-color: #f6f8fa;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    border-bottom: 1px solid #ccc;
}

.ai-modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow: hidden;
}

.ai-dialog-history {
    flex: 1;
    overflow-y: auto;
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 10px;
    background: #fdfdfd;
    max-height: 60vh;
}

#ai-dialog-input {
    width: 100%;
    height: 80px;
    margin-bottom: 10px;
    padding: 8px;
    resize: none;
    font-size: 1em;
}

.ai-dialog-section {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-top: 10px;
}

.ai-dialog-section select,
.ai-dialog-section input,
.ai-dialog-section button {
    height: 38px;
    border-radius: 6px;
}

.ai-dialog-section .form-select,
.ai-dialog-section .form-control {
  flex: 1;
  min-width: 160px;
  border-radius: .45rem;
  padding: 6px 10px;
}

.ai-dialog-section button {
  white-space: nowrap;
  padding: 8px 15px;
  border-radius: .45rem;
  border: none;
  background-color: #146C94;
  color: white;
  cursor: pointer;
}

.ai-dialog-section button:hover {
  background-color: #0f5470;
}

#input-tags {
  flex: 1.5;
}

.ai-modal-body button {
    align-self: flex-end;
    padding: 6px 15px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}


/* 智能对话模态窗口中的编辑区域样式 */
.message-edit-box {
  min-height: 100px;
  resize: vertical;
  padding-right: 100px; /* 避免文字被状态提示遮住 */
}

.save-status {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.noselect {
  -webkit-user-select: none;  /* Safari */
  -moz-user-select: none;     /* Firefox */
  -ms-user-select: none;      /* IE/Edge */
  user-select: none;          /* Standard */
}
