/*
 * 华睿 LIMS 中性实验室界面与品牌点缀。
 * 金色只用于真实LOGO、焦点和小范围导航强调；业务状态色继续独立。
 * 该文件必须在页面内联样式之后加载，以覆盖历史主壳规则。
 */
:root {
  --lims-primary: #0f6b5d;
  --lims-primary-deep: #084f46;
  --lims-primary-hover: #14816f;
  --lims-primary-soft: #e3f2ed;
  --lims-primary-pale: #f0f8f5;
  --lims-mint: #6bc5aa;
  --lims-brand-gold-dark: #6d4a2b;
  --lims-brand-gold: #a07e4d;
  --lims-brand-gold-light: #bc9569;
  --lims-brand-gold-soft: #f4ebdd;
  --lims-brand-gold-border: #d8c09a;
  --el-color-primary: #0f6b5d;
  --el-color-primary-light-3: #45988a;
  --el-color-primary-light-5: #78b6aa;
  --el-color-primary-light-7: #b3d6ce;
  --el-color-primary-light-8: #d2e8e2;
  --el-color-primary-light-9: #edf7f4;
  --el-color-primary-dark-2: #084f46;
  --smart-blue: #0f6b5d;
  --smart-cyan: #6bc5aa;
  --smart-navy: #092822;
  --smart-navy-2: #123c34;
}

body {
  background: #f3f4f6;
}

/* 所有主操作必须是深色底配白字；plain 不能再继承蓝色文字。 */
.el-button--primary:not(.is-link):not(.is-text),
.el-button--primary.is-plain:not(.is-link):not(.is-text) {
  --el-button-text-color: #fff;
  --el-button-bg-color: var(--lims-primary);
  --el-button-border-color: var(--lims-primary);
  --el-button-hover-text-color: #fff;
  --el-button-hover-bg-color: var(--lims-primary-hover);
  --el-button-hover-border-color: var(--lims-primary-hover);
  --el-button-active-text-color: #fff;
  --el-button-active-bg-color: var(--lims-primary-deep);
  --el-button-active-border-color: var(--lims-primary-deep);
  color: #fff !important;
  border-color: var(--lims-primary) !important;
  background: linear-gradient(110deg, #0b6255, #17806c) !important;
  box-shadow: 0 5px 14px rgba(15, 107, 93, .20) !important;
}
.el-button--primary:not(.is-link):not(.is-text) span,
.el-button--primary.is-plain:not(.is-link):not(.is-text) span {
  color: #fff !important;
}
.el-button--primary.is-link,
.el-button--primary.is-text,
.el-link.el-link--primary {
  color: var(--lims-primary-deep) !important;
  background: transparent !important;
  box-shadow: none !important;
}
.el-button--primary.is-link:hover,
.el-button--primary.is-text:hover,
.el-link.el-link--primary:hover {
  color: var(--lims-primary-hover) !important;
}

/* Element Plus 的选中与交互状态。 */
.el-tabs__item.is-active,
.el-tabs__item:hover,
.el-pagination button:hover,
.el-pagination .el-pager li:hover,
.el-pagination .el-pager li.is-active,
.el-select-dropdown__item.is-selected,
.el-dropdown-menu__item:not(.is-disabled):focus,
.el-dropdown-menu__item:not(.is-disabled):hover {
  color: var(--lims-primary-deep) !important;
}
.el-tabs__active-bar,
.el-checkbox__input.is-checked .el-checkbox__inner,
.el-checkbox__input.is-indeterminate .el-checkbox__inner,
.el-radio__input.is-checked .el-radio__inner,
.el-switch.is-checked .el-switch__core {
  border-color: var(--lims-primary) !important;
  background: var(--lims-primary) !important;
}
.el-checkbox__input.is-checked + .el-checkbox__label,
.el-radio__input.is-checked + .el-radio__label {
  color: var(--lims-primary-deep) !important;
}
.el-input__wrapper:hover,
.el-select__wrapper:hover {
  box-shadow: 0 0 0 1px #77ad9f inset !important;
}
.el-input__wrapper.is-focus,
.el-select__wrapper.is-focused {
  box-shadow: 0 0 0 1px var(--lims-primary) inset !important;
}
.el-table {
  --el-table-row-hover-bg-color: #eef8f4 !important;
  --el-table-current-row-bg-color: #e3f2ed !important;
}
.el-table th.el-table__cell,
.el-table th.el-table__cell > .cell {
  color: #315a50 !important;
}

/* 主导航与主内容使用同一中性灰白体系；品牌色只标识层级和选中态。 */
.sidebar {
  background:
    radial-gradient(circle at 18% 0%, rgba(188, 149, 105, .10), transparent 28%),
    linear-gradient(180deg, #fafafa 0%, #f2f3f5 100%) !important;
  border-right-color: #d9dfdc !important;
  box-shadow: 8px 0 26px rgba(42, 58, 53, .06) !important;
  color: #34443f !important;
}
.sidebar::-webkit-scrollbar-thumb { background:rgba(86,111,103,.22) !important; }
.sidebar .logo {
  gap:11px;
  border-bottom-color: #ddd6ca !important;
  background: linear-gradient(90deg, rgba(160, 126, 77, .12), rgba(255,255,255,.34)) !important;
}
.sidebar .logo::before {
  display:none !important;
}
.brand-logo {
  display:block;
  width:34px;
  height:34px;
  object-fit:contain;
  flex:0 0 auto;
}
.sidebar .logo .brand-title {
  margin:0 !important;
  color:#26342f !important;
}
.sidebar .logo .brand-title strong {
  margin-left:3px;
  color:var(--lims-brand-gold-dark);
  font-weight:700;
}
.sidebar .menu-item,
.sidebar .group-head {
  color:#40504a !important;
}
.sidebar .menu-item > .icon,
.sidebar .group-head .icon,
.sidebar .menu-group.open > .group-head,
.sidebar .menu-group.open > .group-head .arrow {
  color: #725837 !important;
}
.sidebar .menu-item:hover,
.sidebar .group-head:hover {
  color:#173e36 !important;
  background: #e8f1ed !important;
}
.sidebar .menu-item.active {
  color: #173e36 !important;
  background:#e2ece8 !important;
  box-shadow:inset 3px 0 0 var(--lims-brand-gold),inset 0 0 0 1px rgba(160,126,77,.10) !important;
}
.sidebar .menu-group.open > .group-head {
  background:#f2eadf !important;
  box-shadow:inset 2px 0 0 var(--lims-brand-gold) !important;
}
.sidebar .group-head .gcount {
  color: #245f52 !important;
  background: #dfeee9 !important;
  border-color: #c7ded7 !important;
}
.sidebar .group-head .arrow {
  color: #57746b !important;
}
.sidebar .submenu .menu-item > .icon {
  border-color: #7fa499 !important;
}
.sidebar .submenu .menu-item .label {
  color: #53665f !important;
}
.sidebar .submenu .menu-item.active .label {
  color:#173e36 !important;
}
.sidebar .submenu .menu-item.active > .icon {
  background: #73b9a4 !important;
  border-color: #4f9480 !important;
  box-shadow: 0 0 0 3px rgba(107, 197, 170, .16) !important;
}
.sidebar .step-no {
  border-color: #b8d3ca !important;
  background: #e1efea !important;
  color: #245f52 !important;
}
.header .collapse-btn:hover {
  color: var(--lims-primary-deep) !important;
}
.header .collapse-btn {
  color: #496a60 !important;
}
.main-area {
  background:
    radial-gradient(circle at 84% -12%, rgba(160,126,77,.055), transparent 31%),
    linear-gradient(180deg,#f7f7f8 0%,#f2f3f5 100%) !important;
}

/* 仪表盘、流程页和登录页统一去蓝。 */
.kpi-blue::before,
.dash-card .dc-title .bar,
.flow-section-title .bar {
  background: var(--lims-primary) !important;
}
.kpi-blue .kpi-num,
.flow-nav-btn .fn-arrow,
.fn-rel-arrow {
  color: var(--lims-primary-deep) !important;
}
.kpi-card::before {
  background: linear-gradient(90deg, #0f6b5d, #6bc5aa) !important;
}
.dash-banner,
.flow-hero {
  border-color: rgba(126, 214, 187, .22) !important;
  background:
    radial-gradient(circle at 82% 30%, rgba(107, 197, 170, .22), transparent 22%),
    linear-gradient(118deg, #092822 0%, #115145 58%, #17705e 100%) !important;
  box-shadow: 0 16px 38px rgba(7, 65, 53, .18) !important;
}
.login-page {
  background:
    radial-gradient(circle at 72% 22%,rgba(188,149,105,.14),transparent 24%),
    linear-gradient(145deg,#1b1d21 0%,#292c31 58%,#202226 100%) !important;
}
.login-page::before {
  background-image:
    linear-gradient(rgba(216,192,154,.11) 1px,transparent 1px),
    linear-gradient(90deg,rgba(216,192,154,.11) 1px,transparent 1px) !important;
}
.login-brand {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:9px;
}
.login-brand-logo {
  width:72px;
  height:72px;
}
.login-logo span {
  color:var(--lims-brand-gold-dark) !important;
}
.sidebar.collapsed .brand-title { display:none; }
.sidebar.collapsed .logo { justify-content:center !important; padding:0 !important; }
.sidebar.collapsed .brand-logo { width:34px; height:34px; }
@media (max-width:480px) {
  .login-card { width:min(400px,calc(100vw - 28px)) !important; }
  .login-brand-logo { width:64px; height:64px; }
}
.ai-badge {
  border-color: rgba(128, 216, 190, .38) !important;
  background: linear-gradient(115deg, #0b6255, #21977c) !important;
  box-shadow: 0 4px 14px rgba(15, 107, 93, .22) !important;
}
.tl-head {
  background: linear-gradient(105deg, #103c34, #176655) !important;
}

/* 电子表单、流程关系和历史内联蓝色文字统一成可读深青绿。 */
.ef-form .ef-section-title,
.ef-quick-title,
.ef-quick-cat,
.fn-role .role-chip,
[style*="color:#1890ff"],
[style*="color: #1890ff"],
[style*="color:#1677ff"],
[style*="color: #1677ff"],
[style*="color:#1d4ed8"],
[style*="color: #1d4ed8"],
[style*="color:#2563eb"],
[style*="color: #2563eb"] {
  color: var(--lims-primary-deep) !important;
}
.ef-form .ef-section-title {
  border-left-color: var(--lims-primary) !important;
}
.ef-quick-card:hover,
.flow-nav-btn:hover,
.fn-nav-btn:hover,
.fn-rel-item:hover {
  border-color: var(--lims-primary) !important;
  box-shadow: 0 6px 16px rgba(15, 107, 93, .16) !important;
}
.ef-quick-entry,
.fn-rel-main {
  border-color: #b9d9d0 !important;
  background: linear-gradient(135deg, #edf8f4, #f8fcfa) !important;
}
.fn-role .role-chip {
  border-color: #b8d9d0 !important;
  background: #e8f5f1 !important;
}
.qview-cell:hover {
  background-color: #eaf6f2 !important;
}

/* 键盘焦点必须清晰，不再使用浅蓝光圈。 */
:focus-visible {
  outline: 3px solid rgba(15, 107, 93, .42) !important;
  outline-offset: 2px;
}

/* 390px现场入口只承载主壳导航；完整后台仍保持桌面布局。 */
.mobile-sidebar-overlay { display:none; }
.mobile-tablet-entry {
  display:inline-flex;
  align-items:center;
  min-height:34px;
  padding:6px 10px;
  border:1px solid #9fcfc4;
  border-radius:8px;
  background:#eaf7f2;
  color:#17695f;
  font-size:13px;
  font-weight:700;
  text-decoration:none;
  white-space:nowrap;
}

@media (max-width:600px) {
  html, body, #app { width:100%; max-width:100%; overflow-x:hidden; }
  body { --lims-banner-height:0px; }
  body.development-environment { --lims-banner-height:34px; }
  .development-environment-banner { padding:0 8px; font-size:12px; text-align:center; letter-spacing:.03em; }
  .app-layout { width:100%; }
  body .app-layout .sidebar {
    position:fixed;
    z-index:3200;
    top:var(--lims-banner-height);
    bottom:0;
    left:0;
    width:min(84vw,320px);
    transform:translateX(-102%);
    transition:transform .22s ease;
    box-shadow:12px 0 34px rgba(2,20,34,.28);
  }
  body .app-layout .sidebar.mobile-open { transform:translateX(0); }
  body .app-layout .sidebar.collapsed { width:min(84vw,320px); }
  .mobile-sidebar-overlay {
    display:block;
    position:fixed;
    z-index:3100;
    inset:var(--lims-banner-height) 0 0 0;
    border:0;
    padding:0;
    background:rgba(8,29,39,.46);
    cursor:pointer;
  }
  .main-area { width:100%; min-width:0; }
  .header {
    height:auto;
    min-height:64px;
    padding:9px 12px;
    align-items:flex-start;
    flex-wrap:wrap;
    gap:7px;
  }
  .header .left { width:100%; min-width:0; gap:10px; align-items:center; }
  .header .collapse-btn {
    flex:0 0 40px;
    width:40px;
    height:40px;
    border:1px solid #d8e7e4;
    border-radius:9px;
    background:#f2faf8;
    cursor:pointer;
  }
  .header .breadcrumb { min-width:0; flex:1; font-size:15px; overflow-wrap:anywhere; }
  .header .right { width:100%; min-width:0; gap:6px; flex-wrap:wrap; justify-content:flex-start; }
  .header .user-info { max-width:145px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .header .right .el-select { display:none; }
  .system-version-chip { padding:6px 8px; }
  .system-version-panel { position:fixed; top:calc(var(--lims-banner-height) + 68px); left:12px; right:12px; width:auto; max-height:calc(100vh - 94px); overflow:auto; }
  .content { width:100%; min-width:0; padding:12px; overflow-x:hidden; }
  .page-card { padding:14px; }
}
