/* 手机端跟 PC 同四套皮：橙（默认）/ 绿 / 深蓝 / 墨绿，主色跟 PC 色块一致。
   --x8-m-head 是顶栏、底栏选中、弹层选中那一片实心色。SK78 手机绿皮是 #5c9c4b，正好是 PC 绿皮彩种条渐变的起色；
   其余三套 SK78 手机端没有，照同一个关系取 PC 彩种条的起色。
   --x8-dlg-grad 取 PC 同名变量，绿皮这条跟 SK78 手机端一字不差（公告选中项、改密按钮都用它）。 */
.theme-orange {
  --main-color: #c05d20;
  --main-color-rgb: 192, 93, 32;
  --header-bg: #c05d20;
  --card-bg: #fff;
  --text-color: #fff;
  --selected-color: #c05d20;
  --special-color: #012cf9;
  --x8-m-head: #351c0c;
  --x8-dlg-grad: linear-gradient(#6a3612, #351c0a);
}

.theme-green {
  --main-color: #54ab3c;
  --main-color-rgb: 84, 171, 60;
  --header-bg: #54ab3c;
  --card-bg: #fff;
  --text-color: #fff;
  --selected-color: #54ab3c;
  --special-color: #2f86f6;
  --x8-m-head: #5c9c4b;
  --x8-dlg-grad: linear-gradient(#7ac665 1%, #2d5125 99%);
}

.theme-deepblue {
  --main-color: #1e6cc7;
  --main-color-rgb: 30, 108, 199;
  --header-bg: #1e6cc7;
  --card-bg: #fff;
  --text-color: #fff;
  --selected-color: #1e6cc7;
  --special-color: #2f86f6;
  --x8-m-head: #1963b7;
  --x8-dlg-grad: linear-gradient(#1963b7, #023f77);
}

.theme-default {
  --main-color: #2b9d86;
  --main-color-rgb: 43, 157, 134;
  --header-bg: #2b9d86;
  --card-bg: #fff;
  --text-color: #fff;
  --selected-color: #2b9d86;
  --special-color: #2f86f6;
  --x8-m-head: #43a491;
  --x8-dlg-grad: linear-gradient(#5ccfb8 1%, #21554c 99%);
}

body[class^="theme-"] .header {
  background: linear-gradient(180deg,
      rgba(var(--main-color-rgb, 10, 169, 255), 0.8) 10%,
      var(--main-color) 90%) !important;
  color: var(--text-color) !important;
}

/* SK78 皮：手机顶栏栗棕 + 盘面暖化（令牌覆盖，只 theme-orange）。
   顶栏用 body.theme-orange 提到与上面同特异性、靠后写覆盖。 */
body.theme-orange .header {
  background: linear-gradient(180deg, #6b2f18 0%, #52200f 55%, #3d160d 100%) !important;
}
.theme-orange {
  --x8-line: #ecdcc9;
  --x8-line-2: #e0ccb3;
  --x8-ground: #faf4ec;
  --x8-surface-3: #f3e9dc;
}

body[class^="theme-"] .stats-cards,
body[class^="theme-"] .chart-container,
body[class^="theme-"] .data-tabs,
body[class^="theme-"] .table-container {
  background: var(--card-bg) !important;
  color: var(--text-color) !important;
}

/* 复选框和单选框勾选颜色跟随主题色 */
.theme-orange input[type="checkbox"]:checked,
.theme-orange input[type="radio"]:checked {
  accent-color: #c05d20;
  color: #c05d20;
}

.theme-green input[type="checkbox"]:checked,
.theme-green input[type="radio"]:checked {
  accent-color: #54ab3c;
  color: #54ab3c;
}

.theme-deepblue input[type="checkbox"]:checked,
.theme-deepblue input[type="radio"]:checked {
  accent-color: #1e6cc7;
  color: #1e6cc7;
}

.theme-default input[type="checkbox"]:checked,
.theme-default input[type="radio"]:checked {
  accent-color: #2b9d86;
  color: #2b9d86;
}

/* input/textarea placeholder 跟随主题色 */
input::placeholder,
textarea::placeholder {
  color: rgba(var(--main-color-rgb, 10, 169, 255), 0.3) !important;
  opacity: 1;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: rgba(var(--main-color-rgb, 10, 169, 255), 0.3) !important;
}

input::-moz-placeholder,
textarea::-moz-placeholder {
  color: rgba(var(--main-color-rgb, 10, 169, 255), 0.3) !important;
}

input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
  color: rgba(var(--main-color-rgb, 10, 169, 255), 0.3) !important;
}

input::-ms-input-placeholder,
textarea::-ms-input-placeholder {
  color: rgba(var(--main-color-rgb, 10, 169, 255), 0.3) !important;
}

/* 控制按钮主题色，主题切换时自动适配 */
body[class^="theme-"] .theme-btn-main {
  background: var(--main-color) !important;
  color: #fff !important;
  border-color: var(--main-color) !important;
  transition: background 0.2s, border-color 0.2s;
}

/* 控制按钮主题色，主题切换时自动适配 */
body[class^="theme-"] .theme-btn-main-1 {
  background: rgba(var(--main-color-rgb, 10, 169, 255), 0.58) !important;
  color: #fff !important;
  border-color: rgba(var(--main-color-rgb, 10, 169, 255), 0.3) !important;
  transition: background 0.2s, border-color 0.2s;
}

body[class^="theme-"] .theme-btn-main-optical {
  background: var(--main-color) !important;
  color: #fff !important;
  border-color: var(--main-color) !important;
  transition: background 0.2s, border-color 0.2s;
  opacity: 0.5;
}

body[class^="theme-"] .theme-text-main {
  color: var(--main-color) !important;
}

/* 横向渐变背景色，三段色区分：左深、中间适中、右浅，跟随主题色 */
.theme-gradient-bg {
  background: linear-gradient(to right,
      var(--main-color) 0%,
      rgba(var(--main-color-rgb, 10, 169, 255), 0.7) 40%,
      rgba(var(--main-color-rgb, 10, 169, 255), 0.3) 75%,
      rgba(var(--main-color-rgb, 10, 169, 255), 0.08) 100%) !important;
}

/* 纵向渐变背景色，跟随主题色：顶部-底部 浅色-深色 */
.theme-gradient-vertical-bg {
  background: linear-gradient(180deg,
      rgba(var(--main-color-rgb, 10, 169, 255), 0.6) 1%,
      var(--main-color) 99%) !important;
  border: rgba(var(--main-color-rgb, 10, 169, 255), 0.3) !important;
  color: #fff !important;
}

/* 底部边框 */
.theme-border-bottom {
  border-bottom: 0.05333rem solid var(--main-color) !important;
}

/* 跟随主题色的浅色背景色 */
.theme-background {
  background: var(--main-color) !important;
}

.theme-text {
  color: var(--main-color) !important;
}

/* 行高亮 */
.layui-table tr:hover,
.table-edit-flex .layui-table tr:hover {
  background: rgba(var(--main-color-rgb, 10, 169, 255), 0.1);
}

/* 所有 layui 表格边框跟随主题色，透明度 0.3 */
body[class^="theme-"] .layui-table,
body[class^="theme-"] .layui-table td,
body[class^="theme-"] .layui-input {
  border-color: rgba(var(--main-color-rgb, 10, 169, 255), 0.5) !important;
}

/* 表头底色可继续用浅灰色或自定义 */
body[class^="theme-"] .layui-table th {
  background: rgba(var(--main-color-rgb, 10, 169, 255), 0.1) !important;
  border-color: rgba(var(--main-color-rgb, 10, 169, 255), 0.5) !important;
}


.fixedColor {
  color: #012cf9;
  cursor: pointer;
}

.text-danger {
  color: red;
}

.text-blue {
  color: #1594f5;
}

.btn-disabled {
  background: #f5f5f5 !important;
  color: #bbb !important;
  border-color: #eee !important;
  cursor: not-allowed !important;
}

.theme-btn {
  width: 0.64rem;
  height: 0.64rem;
  border: none;
  margin-right: 0.08rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  vertical-align: middle;
  position: relative;
  cursor: pointer;
  transition: box-shadow 0.2s;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.theme-btn span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  color: #fff;
  font-size: 0.42667rem;
  line-height: 1;
  pointer-events: none;
}