.governance-entry-panel { display: grid; gap: 12px; }
.import-help { margin-bottom: 14px; padding: 12px 14px; border-radius: 14px; background: #fff8ed; color: #7c563a; font-size: 14px; line-height: 1.8; }
#case-entry-text { min-height: 150px; }
.import-doc-actions { justify-content: center; align-items: center; }
.import-doc-actions > #case-entry-text-submit { flex: 0 1 210px; }
.case-entry-upload-settings { display: flex; flex: 0 1 auto; align-items: center; gap: 10px; min-width: 0; }
.import-doc-actions .case-entry-upload-settings .btn-ghost { flex: 0 0 auto; width: auto; min-width: 142px; height: 48px; }
.case-entry-target-wrap { display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 8px 0 12px; border: 1px solid #e2bd8c; border-radius: 12px; background: #fffaf2; box-sizing: border-box; white-space: nowrap; }
.case-entry-commentary-label { flex: 0 0 auto; margin: 0; color: #7b421f; font-size: 14px; line-height: 1; white-space: nowrap; }
.case-entry-commentary-target { width: auto; min-width: 104px; height: 42px; padding: 0 28px 0 5px; border: 0; outline: 0; background-color: transparent; color: #743b14; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.case-entry-target-wrap:focus-within { border-color: #c47a2f; box-shadow: 0 0 0 2px rgba(196, 122, 47, 0.12); }
@media (max-width: 1180px) {
  /*
   * 平板与手机：不增加容器，直接使用现有 card 作为案例录入区外框。
   * card 的左右边线与案例搜索页内容框对齐；边框占用的 1px 从内边距
   * 扣除，因此“八字排盘 / 案例录入”和导入卡片的位置保持不变。
   */
  body.pan-page .page {
    width: min(var(--page-width), calc(100% - (var(--page-gutter) * 2))) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  body.pan-page .hero {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  body.pan-page .card {
    width: 100% !important;
    padding-left: clamp(10px, 2vw, 16px) !important;
    padding-right: clamp(10px, 2vw, 16px) !important;
    border: 1px solid rgba(212, 165, 116, 0.58) !important;
    border-radius: 24px !important;
    background: transparent !important;
    box-shadow: none !important;
  }
}
@media (max-width: 720px) {
  /* Keep the case-entry page aligned with the mobile case-search shell. */
  body.pan-page { --page-gutter: 12px; }
  body.pan-page .hero {
    padding: 0 !important;
  }
  body.pan-page .card {
    width: 100% !important;
    padding: 10px clamp(10px, 2vw, 16px) 14px !important;
    border-left: 1px solid rgba(212, 165, 116, 0.58) !important;
    border-right: 1px solid rgba(212, 165, 116, 0.58) !important;
    border-radius: 20px !important;
  }
  body.pan-page .tabs {
    width: calc(100% - 4px) !important;
    margin: 0 2px 12px !important;
    border-radius: 16px !important;
  }
  body.pan-page .import-section { border-radius: 12px !important; }
  body.pan-page .import-header { padding: 10px 12px !important; }
  body.pan-page .import-body { padding: 8px 6px !important; }
  body.pan-page .import-help { margin-bottom: 8px; padding: 8px 10px; border-radius: 10px; line-height: 1.65; }
  body.pan-page #case-entry-text { min-height: 124px; }
  .import-doc-actions { flex-wrap: wrap; width: 100% !important; max-width: none !important; }
  .import-doc-actions > #case-entry-text-submit { flex-basis: 100%; }
  .case-entry-upload-settings { flex-direction: column; align-items: stretch; justify-content: center; gap: 8px; width: 100%; }
  .import-doc-actions .case-entry-upload-settings .btn-ghost { width: 100%; min-width: 0; }
  .case-entry-target-wrap { justify-content: center; width: 100%; height: 46px; padding-left: 7px; padding-right: 5px; }
  .case-entry-commentary-label, .case-entry-commentary-target { font-size: 13px; }
  .case-entry-commentary-target { min-width: 91px; padding-left: 3px; padding-right: 22px; }
}
@media (max-width: 520px) {
  body.pan-page .page {
    width: min(100%, calc(100% - (var(--page-gutter) * 2))) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}
.governance-upload-button { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; margin: 0; }
.governance-source-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #834514; }
.governance-source-head .btn-ghost { width: auto; min-height: 36px; padding: 6px 14px; }
.governance-source-table-wrap { width: 100%; overflow: hidden; border: 1px solid #ead0b2; border-radius: 12px; background: #fff; }
.governance-source-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.governance-source-table th, .governance-source-table td { padding: 8px 7px; border-bottom: 1px solid #f0deca; text-align: center; vertical-align: middle; color: #5f2f12; }
.governance-source-table th { background: #fff6e8; color: #8a4818; font-weight: 700; white-space: nowrap; }
.governance-source-table th:nth-child(1) { width: 6%; }
.governance-source-table th:nth-child(2) { width: 28%; }
.governance-source-table th:nth-child(3) { width: 22%; }
.governance-source-table th:nth-child(4), .governance-source-table th:nth-child(5), .governance-source-table th:nth-child(6) { width: 10%; }
.governance-source-table th:nth-child(7) { width: 14%; }
.governance-source-table tbody tr:last-child td { border-bottom: 0; }
.governance-source-row { cursor: pointer; }
.governance-source-row:hover, .governance-source-row.is-active { background: #fff0d2; }
.governance-source-name { text-align: left !important; }
.governance-source-name button { display: block; width: 100%; overflow: hidden; padding: 5px 8px; border: 1px solid #e3bd8c; border-radius: 9px; background: #fff; color: #82420f; font: inherit; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.governance-entry-status { min-height: 22px; color: #7b421f; font-size: 14px; }
.governance-entry-status.is-error { color: #c53b32; }
.governance-entry-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.governance-entry-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border: 1px solid #e7c69f; border-radius: 999px; background: #fffaf2; color: #854817; font-size: 14px; }
.governance-entry-table-wrap { width: 100%; overflow-x: hidden; border: 1px solid #ead0b2; border-radius: 12px; background: #fff; }
.governance-entry-table { width: 100%; min-width: 0; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.governance-entry-table th, .governance-entry-table td { padding: 7px 5px; border-bottom: 1px solid #f0deca; text-align: center; vertical-align: middle; color: #5f2f12; line-height: 1.45; }
.governance-entry-table th { background: #fff6e8; color: #8a4818; font-weight: 700; white-space: nowrap; }
.governance-entry-table th:nth-child(1) { width: 5%; }
.governance-entry-table th:nth-child(2) { width: 14%; }
.governance-entry-table th:nth-child(3) { width: 7%; }
.governance-entry-table th:nth-child(4) { width: 18%; }
.governance-entry-table th:nth-child(5) { width: 13%; }
.governance-entry-table th:nth-child(6) { width: 10%; }
.governance-entry-table th:nth-child(7) { width: 16%; }
.governance-entry-table th:nth-child(8) { width: 17%; }
.governance-entry-table tbody tr:last-child td { border-bottom: 0; }
.governance-entry-name { text-align: left !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.governance-entry-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 26px; padding: 2px 7px; border: 1px solid #d8c2a8; border-radius: 999px; background: #fffaf4; white-space: nowrap; }
.governance-entry-pill.is-clear { border-color: #a8d9b1; background: #effaf1; color: #167133; }
.governance-entry-pill.is-warning { border-color: #efc676; background: #fff8df; color: #9b5b00; }
.governance-entry-pill.is-danger { border-color: #efaaa6; background: #fff0ef; color: #bd3029; }
.governance-entry-actions { display: flex; justify-content: center; gap: 4px; white-space: nowrap; }
.governance-entry-actions button { min-height: 30px; padding: 4px 7px; border: 1px solid #dcaa70; border-radius: 9px; background: #fffdf9; color: #8b4513; cursor: pointer; font: inherit; font-size: 13px; }
.governance-entry-actions button.danger { border-color: #efb2ae; color: #d43d35; background: #fff7f6; }
.governance-entry-empty { padding: 28px !important; color: #9a765b !important; }
@media (max-width: 900px) {
  .governance-source-table-wrap, .governance-entry-table-wrap { overflow-x: auto; }
  .governance-source-table { min-width: 720px; }
  .governance-entry-table { min-width: 820px; }
}
@media (max-width: 720px) {
  body.pan-page .governance-entry-panel {
    padding: 12px clamp(10px, 2vw, 16px) 14px !important;
  }
  .governance-source-table-wrap,
  .governance-entry-table-wrap {
    width: 100%;
    margin-left: 0;
    border-radius: 10px;
  }
}
