html {
  font-size: var(--app-font-size, 16px);
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgb(244 232 174 / 34%), transparent 28rem),
    radial-gradient(circle at 82% 0%, rgb(158 179 135 / 22%), transparent 26rem),
    linear-gradient(180deg, #fbf8ef 0%, #f5f3eb 52%, #f8f6f2 100%);
  color: #332f27;
}

button,
input,
select,
textarea {
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease, transform 0.16s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #7c9467;
  box-shadow: 0 0 0 3px rgb(124 148 103 / 18%);
}

.toast-stack {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 60;
  display: grid;
  gap: 0.65rem;
  width: min(22rem, calc(100vw - 2rem));
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.toast {
  border-radius: 0.9rem;
  border: 1px solid #d8d2bf;
  background: #fffef8;
  box-shadow: 0 22px 60px rgb(67 56 44 / 22%);
  color: #3f3b33;
  padding: 1rem 1.15rem;
  text-align: center;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  animation: toast-in 0.22s ease forwards;
}

.toast-ok {
  border-color: #b9c7a5;
  background: #f5f8ed;
}

.toast-error {
  border-color: #e8b4a8;
  background: #fff4f1;
  color: #9f3025;
}

.toast-leave {
  animation: toast-out 0.18s ease forwards;
}

@keyframes toast-in {
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes toast-out {
  to {
    transform: translateY(8px) scale(0.98);
    opacity: 0;
  }
}

.login-shell {
  background:
    radial-gradient(circle at 50% 18%, rgb(255 247 210 / 70%), transparent 18rem),
    linear-gradient(135deg, rgb(255 253 247 / 80%), rgb(235 241 224 / 48%));
}

.login-card,
#salaryPanel > .overflow-x-auto,
#subForm,
#adminPanel > div,
#settingsPanel {
  border-color: rgb(216 210 190 / 76%);
  background: rgb(255 254 249 / 86%);
  box-shadow: 0 18px 50px rgb(64 57 44 / 8%);
  backdrop-filter: blur(12px);
}

.app-header {
  box-shadow: 0 10px 30px rgb(64 57 44 / 7%);
}

.primary-button,
.ghost-button {
  border-radius: 0.55rem;
  font-weight: 600;
}

.primary-button {
  background: linear-gradient(135deg, #6f855d, #496f5d);
  color: #fff;
  box-shadow: 0 10px 24px rgb(73 111 93 / 18%);
}

.primary-button:hover {
  background: linear-gradient(135deg, #7d936b, #517964);
}

.ghost-button {
  border: 1px solid #d4ccb9;
  background: rgb(255 254 249 / 72%);
  color: #50483b;
  padding: 0.5rem 0.75rem;
}

.ghost-button:hover {
  border-color: #aebd99;
  background: #f4f6ea;
}

.salary-table th,
.salary-table td {
  border: 1px solid #e5dfd2;
  padding: 0.7rem 0.65rem;
  min-width: 7.2rem;
  text-align: center;
  white-space: nowrap;
}

.salary-table th {
  background: #f0eadc;
  color: #514a3d;
  font-weight: 700;
}

.salary-table th:first-child,
.salary-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 8.4rem;
  background: #f0eadc;
  text-align: center;
  font-weight: 600;
}

.salary-table tbody tr:hover td {
  background: #faf7ef;
}

.salary-table tbody tr:hover td:first-child {
  background: #ece5d5;
}

.salary-table input {
  width: 6.6rem;
  border-radius: 0.5rem;
  border: 1px solid #d6d0c4;
  background: #fffdf8;
  padding: 0.45rem 0.5rem;
  text-align: center;
}

.salary-table input:disabled {
  border-color: transparent;
  background: transparent;
  color: #57534e;
}

.mini-input,
.mini-select {
  border-radius: 0.5rem;
  border: 1px solid #d6d0c4;
  background: #fffdf8;
  padding: 0.5rem 0.65rem;
}

.rule-table th,
.rule-table td {
  border: 1px solid #e7e2d8;
  padding: 0.65rem;
  text-align: center;
}

.rule-table th {
  background: #f0eadc;
}

.tab-active {
  background: linear-gradient(135deg, #6f855d, #496f5d);
  color: white;
  border-color: transparent;
}

.soft-button {
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #7c9467, #607d4e);
  color: #fff;
  padding: 0.48rem 0.85rem;
}

.text-action {
  color: #5f7d4f;
}

.rules-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid #e4decf;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, rgb(248 246 236 / 94%), rgb(255 254 249 / 86%));
  padding: 0.9rem 1rem;
}

.maltese-assistant {
  position: fixed;
  right: 1.2rem;
  bottom: 1.1rem;
  z-index: 40;
  width: 260px;
  height: 210px;
  pointer-events: none;
}

.maltese-bubble {
  position: absolute;
  right: 0;
  bottom: 142px;
  width: 250px;
  border: 1px solid #eadfbf;
  border-radius: 0.75rem;
  background: #fffef8;
  padding: 0.8rem 1rem;
  box-shadow: 0 10px 30px rgb(67 56 44 / 14%);
  color: #5c4a2d;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: 0.2s ease;
  pointer-events: none;
}

.maltese-bubble:not(.hidden) {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.maltese-dog {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 230px;
  height: 145px;
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  transform-origin: 50% 100%;
  animation: maltese-breathe 3.8s ease-in-out infinite;
}

.maltese-dog:hover {
  transform: translateY(-2px);
}

.maltese-dog.awake {
  animation: maltese-wake 0.48s ease;
}

.maltese-shadow {
  position: absolute;
  right: 12px;
  bottom: 8px;
  width: 190px;
  height: 28px;
  border-radius: 999px;
  background: rgb(92 80 55 / 13%);
  filter: blur(6px);
}

.maltese-cushion {
  position: absolute;
  right: 6px;
  bottom: 16px;
  width: 205px;
  height: 56px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d9d59a, #c8ca86);
  border: 1px solid rgb(148 143 90 / 24%);
  box-shadow: inset 0 10px 18px rgb(255 255 255 / 34%);
}

.maltese-body,
.maltese-head,
.maltese-ear,
.maltese-paw,
.maltese-tail {
  position: absolute;
  background: radial-gradient(circle at 35% 30%, #fff, #f4efe4 60%, #eadfce);
  border: 1px solid rgb(210 198 178 / 36%);
  box-shadow: inset 0 8px 16px rgb(255 255 255 / 55%);
}

.maltese-body {
  right: 18px;
  bottom: 35px;
  width: 145px;
  height: 76px;
  border-radius: 58% 48% 48% 54%;
}

.maltese-tail {
  right: 4px;
  bottom: 87px;
  width: 46px;
  height: 38px;
  border-radius: 50%;
  transform: rotate(22deg);
}

.maltese-head {
  left: 18px;
  bottom: 39px;
  width: 94px;
  height: 82px;
  border-radius: 48% 48% 44% 46%;
  z-index: 3;
}

.maltese-ear {
  top: 39px;
  width: 39px;
  height: 54px;
  border-radius: 45% 45% 54% 54%;
  z-index: 2;
}

.maltese-ear.left {
  left: 8px;
  transform: rotate(16deg);
}

.maltese-ear.right {
  left: 89px;
  transform: rotate(-16deg);
}

.maltese-paw {
  bottom: 32px;
  width: 48px;
  height: 23px;
  border-radius: 999px;
  z-index: 4;
}

.maltese-paw.one {
  left: 82px;
}

.maltese-paw.two {
  left: 132px;
}

.maltese-eye {
  position: absolute;
  top: 75px;
  width: 22px;
  height: 4px;
  border-radius: 999px;
  background: #47372f;
  z-index: 5;
  transition: 0.18s ease;
}

.maltese-eye.left {
  left: 50px;
}

.maltese-eye.right {
  left: 80px;
}

.maltese-dog.awake .maltese-eye {
  top: 67px;
  width: 18px;
  height: 21px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff 0 12%, #1f1b18 28% 100%);
}

.maltese-nose {
  position: absolute;
  left: 66px;
  top: 85px;
  width: 18px;
  height: 14px;
  border-radius: 48% 48% 55% 55%;
  background: #27211e;
  z-index: 6;
}

.maltese-zzz {
  position: absolute;
  left: 92px;
  top: 0;
  color: #9aa97d;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 3px;
  animation: maltese-float-z 2.2s ease-in-out infinite;
}

.maltese-dog.awake .maltese-zzz {
  display: none;
}

@keyframes maltese-breathe {
  50% {
    transform: translateY(3px) scale(1.012);
  }
}

@keyframes maltese-wake {
  35% {
    transform: translateY(-8px) rotate(-1deg);
  }
  70% {
    transform: translateY(0) rotate(1deg);
  }
}

@keyframes maltese-float-z {
  50% {
    transform: translateY(-7px);
    opacity: 0.55;
  }
}

@media (max-width: 760px) {
  .maltese-assistant {
    transform: scale(0.82);
    transform-origin: right bottom;
  }
}

/* ===================================================================
   精修层 · 简约 / 高级 / 流畅（绿色勾选框 + 视觉打磨）
   =================================================================== */

/* 勾选框、单选框统一为主题绿 */
input[type="checkbox"],
input[type="radio"] {
  accent-color: #6f855d;
  width: 1.05rem;
  height: 1.05rem;
  cursor: pointer;
  vertical-align: -2px;
}

label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  cursor: pointer;
}

/* 卡片：更柔的圆角与有层次的阴影 */
.login-card,
#salaryPanel > .overflow-x-auto,
#subForm,
#fineForm,
#adminPanel > div,
#settingsPanel {
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgb(64 57 44 / 5%), 0 16px 44px rgb(64 57 44 / 7%);
}

/* 输入 / 下拉 / 文本域：统一更圆润的圆角 */
input,
select,
textarea,
.mini-input,
.mini-select {
  border-radius: 0.6rem;
}

/* 按钮：克制的阴影 + 顺滑回弹 */
.primary-button,
.ghost-button,
.soft-button {
  transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease,
    border-color 0.16s ease;
  letter-spacing: 0.01em;
}

.primary-button:active,
.ghost-button:active,
.soft-button:active {
  transform: translateY(0);
}

/* 表格：表头渐变、首列右缘投影、斑马纹 */
.salary-table th {
  background: linear-gradient(180deg, #f3eddf, #ece4d3);
  letter-spacing: 0.02em;
}

.salary-table th:first-child,
.salary-table td:first-child {
  box-shadow: 6px 0 12px -8px rgb(64 57 44 / 22%);
}

.salary-table tbody tr:nth-child(even) td {
  background: #fcfaf4;
}

.salary-table tbody tr:nth-child(even) td:first-child {
  background: #ece5d5;
}

/* 悬停规则置后，保证高亮始终压过斑马纹 */
.salary-table tbody tr:hover td {
  background: #f4efe2;
}

.salary-table tbody tr:hover td:first-child {
  background: #e7dfcd;
}

/* 汇总行：浅绿强调，呼应主题，且不被斑马纹/悬停覆盖 */
.salary-table tbody tr.bg-emerald-50 td {
  background: #eef3e6 !important;
  font-weight: 600;
  color: #3f5234;
}

.salary-table input {
  border-radius: 0.55rem;
}

.salary-table input:focus {
  border-color: #7c9467;
  box-shadow: 0 0 0 3px rgb(124 148 103 / 16%);
}

/* 顶部 tab 切换更顺滑 */
#tabs button {
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease,
    transform 0.16s ease;
}

/* 全局更顺滑的滚动与字体渲染 */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
