/* FundCost UI — login (fig1) + admin shell (fig2) */
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --ink: #303133;
  --muted: #909399;
  --line: #ebeef5;
  --line-dark: #dcdfe6;
  --primary: #409eff;
  --primary-deep: #337ecc;
  --primary-soft: #ecf5ff;
  --success: #67c23a;
  --danger: #f56c6c;
  --warning: #e6a23c;
  --sidebar: #ffffff;
  --sidebar-w: 220px;
  --rail-w: 280px;
  --radius: 5px;
  --radius-lg: 12px;
  --shadow: 0 0 12px rgba(0, 0, 0, 0.05);
  --shadow-btn: 0 8px 16px rgba(64, 158, 255, 0.28);
  --table-th-bg: #f8f9fa;
  --table-th-color: #222;
  --font: "IBM Plex Sans", "Noto Sans SC", system-ui, sans-serif;
  --z-sidebar: 40;
  --z-top: 30;
  --z-overlay: 50;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 15px; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  text-wrap: balance;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

p { text-wrap: pretty; }

.tabular {
  font-family: var(--font);
}

/* ========== Login · 工程气质 ========== */
.auth-page {
  min-height: 100dvh;
  height: 100dvh;
  width: 100%;
  margin: 0;
  padding: 0;
  display: block;
  background: #0f172a;
}

.auth-shell {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 7fr 3fr;
  background: #fff;
  overflow: hidden;
}

.auth-visual {
  --auth-mist: rgba(226, 232, 240, 0.78);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: clamp(1.5rem, 3.5vw, 2.5rem) clamp(1.75rem, 4vw, 3rem);
  color: #f8fafc;
  background:
    radial-gradient(1200px 600px at 12% 18%, rgba(59, 130, 246, 0.22), transparent 55%),
    radial-gradient(900px 500px at 88% 82%, rgba(14, 165, 233, 0.12), transparent 50%),
    linear-gradient(165deg, #0b1220 0%, #152238 48%, #0f172a 100%);
  overflow: hidden;
}

.auth-visual-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.09) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 92%);
  pointer-events: none;
}

.auth-visual-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  right: -120px;
  bottom: -140px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.16);
  filter: blur(40px);
  pointer-events: none;
}

.auth-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.auth-brand-mark {
  width: 56px;
  height: 62px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 4px;
  box-sizing: border-box;
}

.auth-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.auth-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.auth-brand-text strong {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.auth-brand-text span {
  font-size: 0.8125rem;
  color: var(--auth-mist);
}

.auth-visual-center {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem 1rem 0.5rem;
}

.auth-title {
  margin: 0;
  font-size: clamp(2.25rem, 4.2vw, 3.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #fff;
  text-wrap: balance;
}

.auth-lead {
  margin: 1.1rem 0 0;
  max-width: 36rem;
  font-size: clamp(0.9rem, 1.35vw, 1.05rem);
  line-height: 1.65;
  color: var(--auth-mist);
  text-wrap: pretty;
}

.auth-structure {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 1rem;
  color: #cbd5e1;
}

.auth-structure svg {
  width: 100%;
  max-width: none;
  height: auto;
  display: block;
  opacity: 0.95;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 2.5vw, 2rem);
  background:
    linear-gradient(180deg, #f8fafc 0%, #ffffff 40%, #ffffff 100%);
  min-height: 100%;
  min-width: 0;
}

.auth-card {
  width: 100%;
  max-width: 340px;
}

.auth-card-head {
  margin-bottom: 1.75rem;
}

.auth-card-head h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #0f172a;
  text-align: center;
  text-wrap: balance;
}

.auth-card .alert {
  margin-bottom: 1.15rem;
}

.auth-form .field {
  margin-bottom: 1.1rem;
}

.auth-form .field:last-of-type {
  margin-bottom: 1.5rem;
}

.auth-card label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #475569;
  margin-bottom: 0.4rem;
}

.auth-card input[type="text"],
.auth-card input[type="password"] {
  height: 44px;
  border-radius: 8px;
  border-color: #cbd5e1;
  background: #fff;
  padding: 0.7rem 0.95rem;
}

.auth-card input[type="text"]:hover:not(:disabled):not(:focus),
.auth-card input[type="password"]:hover:not(:disabled):not(:focus) {
  border-color: #94a3b8;
}

.auth-card input[type="text"]:focus,
.auth-card input[type="password"]:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 2.75rem;
}

.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.3rem;
  display: inline-flex;
  border-radius: 6px;
}

.password-toggle:hover { color: #334155; }
.password-toggle:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.btn-login {
  width: 100%;
  height: 44px;
  padding: 0 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 20px rgba(37, 99, 235, 0.22);
}

.btn-login:hover {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 10px 24px rgba(37, 99, 235, 0.28);
}

@media (prefers-reduced-motion: reduce) {
  .auth-card input[type="text"],
  .auth-card input[type="password"],
  .btn-login {
    transition: none;
  }
}

/* ========== Forms / buttons ========== */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

/* 覆盖 .field 的 display，确保 show_when 显隐生效 */
.field[hidden],
.form-grid [hidden] {
  display: none !important;
}

.field label {
  font-size: 0.8125rem;
  font-weight: 400;
  color: #8c8c8c;
}

.field .hint { font-size: 0.75rem; color: var(--muted); }
.field .error-text { font-size: 0.75rem; color: #ff4d4f; }

input:not([type]),
input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea {
  font: inherit;
  font-size: 0.875rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  width: 100%;
  height: 40px;
  line-height: 1.2;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out, background 0.15s ease-out;
}

textarea {
  border-radius: 16px;
  height: auto;
  min-height: 88px;
  padding: 0.75rem 1rem;
  resize: vertical;
}

input:not([type])::placeholder,
input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="number"]::placeholder,
input[type="search"]::placeholder,
input[type="email"]::placeholder,
textarea::placeholder {
  color: #bfbfbf;
}

input:not([type]):hover:not(:disabled):not(:focus),
input[type="text"]:hover:not(:disabled):not(:focus),
input[type="password"]:hover:not(:disabled):not(:focus),
input[type="number"]:hover:not(:disabled):not(:focus),
input[type="search"]:hover:not(:disabled):not(:focus),
input[type="email"]:hover:not(:disabled):not(:focus),
textarea:hover:not(:disabled):not(:focus) {
  border-color: #bfbfbf;
}

input:not([type]):focus,
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
textarea:focus {
  outline: none;
  border-color: #69b1ff;
  box-shadow: 0 0 0 3px rgba(105, 177, 255, 0.28);
}

input:not([type]):disabled,
input[type="text"]:disabled,
input[type="password"]:disabled,
input[type="number"]:disabled,
input[type="search"]:disabled,
input[type="email"]:disabled,
textarea:disabled {
  background: #f5f5f5;
  border-color: #e8e8e8;
  color: #bfbfbf;
  cursor: not-allowed;
}

.field.is-error label {
  color: #ff4d4f;
}

.field.is-error input,
.field.is-error textarea,
.field.is-error .ui-select-trigger {
  border-color: #ff4d4f;
  box-shadow: none;
}

.field.is-error input:focus,
.field.is-error textarea:focus {
  box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.18);
}

/* Native select hidden when enhanced; fallback style */
select:not(.ui-select-native) {
  font: inherit;
  font-size: 0.875rem;
  color: var(--ink);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23595959' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M2.5 4.5 L6 8 l3.5-3.5'/%3E%3C/svg%3E") no-repeat right 1rem center;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  padding: 0.65rem 2.4rem 0.65rem 1rem;
  width: 100%;
  height: 40px;
  appearance: none;
  box-shadow: none;
}

select:not(.ui-select-native):focus {
  outline: none;
  border-color: #69b1ff;
  box-shadow: 0 0 0 3px rgba(105, 177, 255, 0.28);
}

/* Custom dropdown — match normal input border */
.ui-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.ui-select.is-inline {
  width: auto;
  min-width: 180px;
}

.ui-select-native {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.ui-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  min-height: 40px;
  padding: 0.5rem 1rem 0.5rem 1.1rem;
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  box-shadow: none;
  font: inherit;
  font-size: 0.875rem;
  color: #303133;
  cursor: pointer;
  text-align: left;
  transition: box-shadow 0.15s ease-out, border-color 0.15s ease-out;
}

.ui-select-trigger:hover {
  border-color: #c0c4cc;
}

.ui-select.is-open .ui-select-trigger {
  border-color: var(--primary);
  border-radius: 12px 12px 0 0;
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.ui-select-trigger .ui-select-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-select-trigger .ui-select-chevron {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  color: #606266;
  transition: transform 0.15s ease-out;
}

.ui-select.is-open .ui-select-chevron {
  transform: rotate(180deg);
}

.ui-select-menu {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  right: 0;
  z-index: 70;
  background: #fff;
  border: 1px solid var(--primary);
  border-top: 1px solid #ebeef5;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  padding: 6px 8px 10px;
  display: none;
  max-height: 260px;
  overflow-y: auto;
}

.ui-select.is-open .ui-select-menu {
  display: block;
}

.ui-select-search {
  padding: 4px 4px 8px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.ui-select-search input {
  height: 32px;
  border-radius: 999px;
  padding: 0 12px;
  font-size: 0.8125rem;
}

.ui-select-options {
  display: grid;
  gap: 2px;
}

input[readonly] {
  background: #f5f7fa;
  color: #606266;
  cursor: default;
}

.ui-select-option {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 0.875rem;
  color: #303133;
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease-out, color 0.12s ease-out;
}

.ui-select-option:hover {
  background: #ecf5ff;
  color: #409eff;
}

.ui-select-option.is-selected {
  background: #ecf5ff;
  color: #409eff;
  font-weight: 500;
}

.ui-select.is-disabled .ui-select-trigger {
  background: #f5f7fa;
  color: #c0c4cc;
  cursor: not-allowed;
  box-shadow: none;
}

.search-box input {
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  height: auto;
  padding: 0;
  background: transparent;
}

.search-box input:focus {
  box-shadow: none !important;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  font: inherit;
  font-weight: 500;
  font-size: 0.9375rem;
  border-radius: 4px;
  border: 1px solid transparent;
  padding: 0.5rem 0.95rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease-out, border-color 0.15s ease-out, transform 0.1s ease-out;
}

.btn svg { flex-shrink: 0; }

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-deep);
  color: #fff;
  text-decoration: none;
}

.btn-ghost {
  background: #fff;
  border-color: #dcdfe6;
  color: #606266;
}

.btn-ghost:hover {
  background: #f5f7fa;
  color: #409eff;
  border-color: #c6e2ff;
  text-decoration: none;
}

.btn-success {
  background: #67c23a;
  border-color: #67c23a;
  color: #fff;
}

.btn-success:hover {
  background: #5daf34;
  border-color: #5daf34;
  color: #fff;
  text-decoration: none;
}

.btn-warning {
  background: #e6a23c;
  border-color: #e6a23c;
  color: #fff;
}

.btn-warning:hover {
  background: #cf9236;
  border-color: #cf9236;
  color: #fff;
  text-decoration: none;
}

.btn-danger {
  background: transparent;
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  color: var(--danger);
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 8%, white);
  text-decoration: none;
}

.btn-block { width: 100%; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.8125rem; }

.link-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  padding: 2px 0;
  margin: 0;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.link-action svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.link-action:hover { opacity: 0.85; text-decoration: none; }
.link-action.is-disabled,
.link-action:disabled {
  color: #c0c4cc;
  cursor: not-allowed;
  opacity: 1;
}
.link-view { color: #909399; }
.link-primary { color: var(--primary); }
.link-edit { color: var(--warning); }
.link-select { color: #67c23a; }
.link-success { color: #67c23a; }
.link-in { color: #67c23a; }
.link-out { color: #f56c6c; }
.link-cancel { color: #e6a23c; }
.link-delete { color: var(--danger); }

.form-section {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px 16px;
  background: #fafbfc;
  margin-top: 0.25rem;
}

.form-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.form-section-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.form-section-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.form-section-actions .btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
}

.form-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
}

.form-section-grid .full {
  grid-column: 1 / -1;
}

.labor-person-section input.is-labor-locked,
.labor-person-section textarea.is-labor-locked,
.labor-person-section select.is-labor-locked {
  background: #f5f7fa;
  color: #606266;
  cursor: default;
}

.labor-person-section [data-labor-name-input-wrap][hidden],
.labor-person-section [data-labor-name-select-wrap][hidden],
.labor-person-section [data-party-name-input-wrap][hidden],
.labor-person-section [data-party-name-select-wrap][hidden] {
  display: none !important;
}

@media (max-width: 640px) {
  .form-section-grid {
    grid-template-columns: 1fr;
  }
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  border: 1px solid var(--line);
}

.alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
}

.alert-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #15803d;
}

.alert-info {
  background: var(--primary-soft);
  border-color: #bfdbfe;
  color: var(--ink);
}

/* ========== App shell (图2) ========== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100dvh;
  background: var(--bg);
  transition: grid-template-columns 0.2s ease;
}

.app-shell.is-sidebar-collapsed {
  grid-template-columns: 1fr;
}

.app-shell.is-sidebar-collapsed .sidebar {
  display: none;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 1.25rem 0.85rem 1rem;
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  box-sizing: border-box;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.65rem 1.25rem;
}

.sidebar-brand .logo {
  width: 40px;
  height: 44px;
  border-radius: 6px;
  background: transparent;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-brand .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-width: 0;
}

.sidebar-brand .brand-line1,
.sidebar-brand .brand-line2 {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink);
  display: block;
}

.sidebar-brand .brand-line1 {
  text-align: center;
  white-space: nowrap;
}

.sidebar-brand .brand-line2 {
  text-align: center;
  margin-top: 0.1rem;
}

.nav-scroll { flex: 1; overflow-y: auto; }

.nav-group { margin-bottom: 1rem; }

.nav-group-title {
  padding: 0.35rem 0.75rem;
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.15rem;
  color: #64748b;
  font-size: 0.9375rem;
  border-radius: 8px;
  text-decoration: none;
  border: 0;
  position: relative;
}

.nav-link svg,
.nav-link .ep-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #9aa4b2;
  display: block;
}

.nav-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-link:hover {
  background: var(--bg);
  color: var(--ink);
  text-decoration: none;
}

.nav-link:hover svg,
.nav-link:hover .ep-icon {
  color: var(--primary);
}

.nav-link.is-active {
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-weight: 500;
}

.nav-link.is-active svg,
.nav-link.is-active .ep-icon {
  color: var(--primary);
}

.nav-link.is-active::after {
  content: "";
  position: absolute;
  right: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px 0 0 2px;
  background: var(--primary);
}

.sidebar-foot {
  padding: 0.75rem 0.5rem 0.25rem;
  border-top: 1px solid var(--line);
  margin-top: 0.5rem;
}

.sidebar-foot .nav-link { margin: 0; }

.main-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding: 16px 16px 24px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  background: var(--bg);
  flex: 1;
}

.workspace.has-rail {
  grid-template-columns: minmax(0, 1fr) clamp(260px, 22vw, 340px);
  align-items: start;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 50px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid #ebeef5;
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.04);
  flex-wrap: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.topbar-fold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #606266;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.topbar-fold:hover {
  color: var(--primary);
  background: #f5f7fa;
}

.topbar-fold.is-collapsed {
  color: var(--primary);
  background: var(--primary-soft);
}

.topbar-fold .ep-icon {
  transition: transform 0.2s ease;
}

.topbar-fold.is-collapsed .ep-icon {
  transform: scaleX(-1);
}

.topbar .breadcrumb {
  margin: 0;
  font-size: 14px;
  color: #909399;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar .breadcrumb a {
  color: #909399;
  text-decoration: none;
}

.topbar .breadcrumb a:hover {
  color: var(--primary);
}

.topbar .breadcrumb .sep {
  color: #c0c4cc;
  margin: 0 2px;
}

.topbar .breadcrumb .current {
  color: #303133;
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex-shrink: 0;
  margin-right: 28px;
}

.topbar-project {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.topbar-project label {
  font-size: 13px;
  color: #909399;
  white-space: nowrap;
}

.topbar-project.is-accent label {
  color: #ea580c;
  font-weight: 600;
  font-size: 15px;
}

.topbar-project .ui-select,
.topbar-project select,
.topbar-project .project-switch-select,
.topbar-project-fixed {
  min-width: 320px;
  width: min(420px, 36vw);
}

.topbar-project .ui-select-trigger,
.topbar-project.is-accent .ui-select-trigger,
.topbar-project-fixed {
  height: 36px;
  border-radius: 6px;
  border: 1px solid #dcdfe6;
  background: #fff;
  color: #303133;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
}

.topbar-project.is-accent .ui-select-trigger:hover {
  background: #f5f7fa;
  border-color: #c0c4cc;
}

.topbar-project-fixed {
  display: flex;
  align-items: center;
  cursor: default;
}

.topbar-project-fixed-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-project-fixed.status-pending .topbar-project-fixed-name {
  color: #e6a23c;
}

.topbar-project-fixed.status-active .topbar-project-fixed-name {
  color: #67c23a;
}

.topbar-project-fixed.status-ended .topbar-project-fixed-name {
  color: #909399;
}

.topbar-project-tag.is-accent {
  background: #fff;
  border-color: #dcdfe6;
  color: #303133;
  font-weight: 500;
  min-width: 200px;
  justify-content: center;
}

.topbar-project-tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 13px;
  white-space: nowrap;
}

.topbar-tools {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.topbar-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #606266;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
}

.topbar-tool:hover {
  color: var(--primary);
  background: #f5f7fa;
}

.topbar-tool .fs-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-tool .fs-icon[hidden] {
  display: none;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  font-size: 14px;
  color: #303133;
  cursor: pointer;
  font: inherit;
}

.user-chip:hover .user-chip-name {
  color: var(--primary);
}

.user-chip-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip-caret {
  display: inline-flex;
  align-items: center;
  color: #909399;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.user-chip-caret .ep-icon {
  width: 12px;
  height: 12px;
}

.user-chip[aria-expanded="true"] .user-chip-caret,
.user-menu.is-open .user-chip-caret {
  transform: rotate(180deg);
  color: var(--primary);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #79bbff, #409eff);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.avatar-img {
  object-fit: cover;
  background: #e5e7eb;
  padding: 0;
}

.user-menu {
  position: relative;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 160px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 6px;
  z-index: 80;
}

.user-dropdown::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 28px;
  width: 12px;
  height: 12px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: -2px -2px 4px rgba(15, 23, 42, 0.04);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 6px;
  color: #303133;
  font: inherit;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
}

.user-dropdown-item:hover {
  background: #f5f7fa;
  color: var(--primary);
}

.user-dropdown-item .ep-icon {
  width: 16px;
  height: 16px;
  color: #606266;
  flex-shrink: 0;
}

.user-dropdown-item:hover .ep-icon {
  color: var(--primary);
}

.user-dropdown-divider {
  height: 1px;
  background: #ebeef5;
  margin: 4px 8px;
}

/* 修改密码弹窗 */
.pwd-modal-root {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pwd-modal-root[hidden] {
  display: none;
}

.pwd-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.pwd-modal-panel {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  padding: 20px 24px 20px;
  z-index: 1;
}

.pwd-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.pwd-modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #303133;
}

.pwd-field {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.pwd-field label {
  text-align: right;
  font-size: 14px;
  color: #606266;
}

.pwd-field .req {
  color: #f56c6c;
  margin-right: 2px;
}

.pwd-field input {
  height: 36px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  padding: 0 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

.pwd-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.pwd-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
  padding-top: 4px;
}

/* 个人信息页 */
.profile-page {
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.profile-summary {
  padding: 32px 24px 28px;
  text-align: center;
}

.profile-avatar-lg {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 28px;
  display: block;
}

.profile-avatar-lg.is-letter {
  background: linear-gradient(145deg, #f6d365, #fda085);
  color: #fff;
  font-size: 36px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.profile-meta {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
  display: grid;
  gap: 16px;
}

.profile-meta li {
  display: grid;
  grid-template-columns: 20px 72px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.pm-icon {
  color: #909399;
  display: inline-flex;
}

.pm-icon .ep-icon {
  width: 16px;
  height: 16px;
}

.pm-label {
  color: #909399;
}

.pm-value {
  color: #303133;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-edit {
  padding: 0;
  overflow: hidden;
}

.profile-edit-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.profile-edit-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #303133;
}

.profile-form {
  padding: 20px 24px 24px;
  max-width: 560px;
}

.profile-form .field {
  margin-bottom: 18px;
}

.profile-form .field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #606266;
}

.profile-form .field .req {
  color: #f56c6c;
  margin-right: 2px;
}

.profile-form .field input[type="text"],
.profile-form .field input[type="email"],
.profile-form .field input:disabled {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  padding: 0 12px;
  font: inherit;
  box-sizing: border-box;
}

.profile-form .field input:disabled {
  background: #f5f7fa;
  color: #909399;
  cursor: not-allowed;
}

.profile-form .field input:not(:disabled):focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.profile-form .field.is-soft-select .ui-select-trigger {
  min-height: 44px;
  padding: 0 16px;
  background: #f5f5f5;
  border: 1px solid transparent;
  border-radius: 12px;
  box-shadow: none;
  color: #303133;
}

.profile-form .field.is-soft-select .ui-select-trigger:hover {
  border-color: transparent;
  background: #f0f0f0;
}

.profile-form .field.is-soft-select .ui-select.is-open .ui-select-trigger {
  border-color: transparent;
  border-radius: 12px 12px 0 0;
  box-shadow: none;
  background: #f5f5f5;
}

.profile-form .field.is-soft-select .ui-select-chevron {
  color: #c0c4cc;
}

.profile-form .field.is-soft-select .ui-select-menu {
  border: 1px solid #ebeef5;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.profile-form .field.is-soft-select select:not(.ui-select-native) {
  width: 100%;
  height: 44px;
  padding: 0 36px 0 16px;
  background: #f5f5f5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' stroke='%23c0c4cc' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center / 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  appearance: none;
  -webkit-appearance: none;
}

.avatar-upload {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 6px;
  border: 1px dashed #dcdfe6;
  overflow: hidden;
  background: #fafafa;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
}

.avatar-preview:hover {
  border-color: var(--primary);
}

.avatar-upload-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.avatar-hint {
  font-size: 12px;
  color: #909399;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  font-size: 28px;
  font-weight: 600;
  color: #c0c4cc;
}

.profile-form .form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

@media (max-width: 900px) {
  .profile-page {
    grid-template-columns: 1fr;
  }
}

/* —— 多页面缓存标签 —— */
.tags-view {
  height: 40px;
  min-height: 40px;
  border-bottom: 1px solid #ebeef5;
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.06);
  background: #fff;
  display: flex !important;
  align-items: center;
  padding: 0 12px;
  flex-shrink: 0;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative;
  z-index: 15;
}

.tags-view-scroll {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  width: 100%;
  height: 100%;
  scrollbar-width: thin;
}

.tags-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 40px;
  padding: 0 16px;
  color: #666;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  overflow: visible;
  transition:
    color 0.3s cubic-bezier(0.645, 0.045, 0.355, 1),
    padding 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.tags-item:hover {
  color: var(--primary);
  text-decoration: none;
}

.tags-item.is-active {
  color: var(--primary);
  font-weight: 600;
}

.tags-item.is-closable:hover,
.tags-item.is-closable.is-active {
  padding-right: 10px;
}

.tags-item::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.35s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.tags-item.is-active::after {
  transform: scaleX(1);
}

.tags-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 140px;
}

.tags-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.tags-icon .ep-icon,
.tags-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.tags-title {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tags-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0;
  height: 16px;
  margin-left: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #909399;
  cursor: pointer;
  opacity: 0;
  overflow: hidden;
  flex-shrink: 0;
  transform: scale(0.75);
  transform-origin: 100% 50%;
  transition:
    width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1),
    margin-left 0.3s cubic-bezier(0.645, 0.045, 0.355, 1),
    opacity 0.25s ease,
    background 0.2s ease,
    color 0.2s ease,
    transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.tags-item.is-closable:hover .tags-close,
.tags-item.is-closable.is-active .tags-close {
  width: 16px;
  margin-left: 6px;
  opacity: 1;
  transform: scale(1);
}

.tags-close:hover {
  background: #c0c4cc;
  color: #fff;
}

.tags-close .ep-icon,
.tags-close svg {
  width: 12px;
  height: 12px;
  display: block;
  flex-shrink: 0;
}

.tags-close-x {
  font-size: 12px;
  line-height: 1;
}

/* 标签右键菜单 */
.tags-ctx-menu {
  position: fixed;
  z-index: 3000;
  min-width: 148px;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.12));
}

.tags-ctx-menu[hidden] {
  display: none !important;
}

.tags-ctx-arrow {
  width: 0;
  height: 0;
  margin: 0 0 -1px 16px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #fff;
}

.tags-ctx-panel {
  background: #fff;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  padding: 6px 0;
}

.tags-ctx-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 8px 16px;
  border: 0;
  background: transparent;
  color: #606266;
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}

.tags-ctx-item:hover:not(:disabled):not(.is-disabled) {
  background: #ecf5ff;
  color: var(--primary);
}

.tags-ctx-item:disabled,
.tags-ctx-item.is-disabled {
  color: #c0c4cc;
  cursor: not-allowed;
}

.tags-ctx-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: inherit;
}

.tags-ctx-icon .ep-icon,
.tags-ctx-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}

.ep-icon {
  display: block;
  width: 1em;
  height: 1em;
  fill: currentColor;
}

.topbar-fold .ep-icon,
.topbar-tool .ep-icon,
.icon-btn .ep-icon,
.link-action .ep-icon,
.btn .ep-icon,
.icon-tool-btn .ep-icon {
  width: 16px;
  height: 16px;
}

/* Project status colors in topbar select */
.ui-select.status-pending .ui-select-label,
.ui-select-option.opt-status-pending {
  color: #e6a23c;
}

.ui-select.status-active .ui-select-label,
.ui-select-option.opt-status-active {
  color: #67c23a;
}

.ui-select.status-ended .ui-select-label,
.ui-select-option.opt-status-ended {
  color: #909399;
}

.ui-select-option.opt-status-pending.is-selected,
.ui-select-option.opt-status-active.is-selected,
.ui-select-option.opt-status-ended.is-selected {
  background: #ecf5ff;
}

.pill-status-pending {
  color: #e6a23c;
  background: #fdf6ec;
  border-color: #f5dab1;
}

.pill-status-active {
  color: #67c23a;
  background: #f0f9eb;
  border-color: #c2e7b0;
}

.pill-status-ended {
  color: #909399;
  background: #f4f4f5;
  border-color: #e9e9eb;
}

.dashboard-month-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0;
}

.dashboard-month-filter input {
  width: 9rem;
  height: 32px;
}

.dashboard-month-hint {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
}

.dashboard-month-hint strong {
  color: var(--ink);
  font-weight: 600;
}

/* Category tree table */
.tree-table .tree-cell {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.tree-table .tree-indent {
  padding-left: 1.75rem;
}

.tree-caret {
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: #c0c4cc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease-out;
}

.tree-parent[data-open="0"] .tree-caret {
  transform: rotate(-90deg);
}

.tree-name {
  font-weight: 500;
  color: var(--ink);
}

.tree-child .tree-name {
  font-weight: 400;
}

.tree-parent:hover,
.tree-child:hover {
  background: #f5f7fa;
}

.tree-child.is-active {
  background: #ecf5ff;
}

.import-form {
  display: inline-flex;
  margin: 0;
}

/* Category tree (legacy cards removed from use) */
.cat-tree {
  display: grid;
  gap: 0.85rem;
}


.search-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  min-width: min(320px, 55vw);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.search-box input {
  border: 0;
  outline: none;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.search-box input:focus {
  outline: none;
  border: 0;
}

.search-box svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
}

.page-bar {
  display: none;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--primary); }

.breadcrumb .sep { color: #c0c4cc; }

.breadcrumb .current {
  color: var(--ink);
  font-weight: 500;
}

.content-main {
  min-width: 0;
  overflow: hidden;
}

/* AsyncTable-style list shell (device-repair) */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-box {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.search-card {
  padding: 16px 20px;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.search-field input {
  min-width: 220px;
}

.table-card {
  padding: 20px;
}

.table-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.table-toolbar .left,
.table-toolbar .right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-main-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar-hint {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.icon-tool-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-dark);
  background: #fff;
  color: #606266;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.icon-tool-btn:hover {
  color: var(--primary);
  border-color: #c6e2ff;
  background: var(--primary-soft);
}

.panel-note {
  padding: 4px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.panel-note p { margin: 0; }

.pagination-container {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #606266;
}

.pagination-total strong {
  font-weight: 600;
  color: var(--ink);
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination-size select,
.pagination-jumper input {
  height: 28px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  padding: 0 8px;
  font: inherit;
  color: inherit;
  background: #fff;
}

.pagination-jumper {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}

.pagination-jumper input {
  width: 48px;
  text-align: center;
}

.pager-btn,
.pager-num {
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  color: #606266;
  font: inherit;
  cursor: pointer;
}

.pager-btn:hover:not(:disabled),
.pager-num:hover {
  color: var(--primary);
}

.pager-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pager-num.is-active {
  color: var(--primary);
  font-weight: 600;
  cursor: default;
}

.pager-pages {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1;
  border-radius: 4px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-tag.status-pending {
  color: #e6a23c;
  background: #fdf6ec;
  border-color: #f5dab1;
}

.status-tag.status-active {
  color: #67c23a;
  background: #f0f9eb;
  border-color: #c2e7b0;
}

.status-tag.status-ended {
  color: #909399;
  background: #f4f4f5;
  border-color: #e9e9eb;
}

.status-tag.status-wait {
  color: #409eff;
  background: #ecf5ff;
  border-color: #b3d8ff;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.page-header h1 { font-size: 1.35rem; margin: 0; }
.page-header .desc {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0.25rem 0 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.toolbar form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Cards */
.card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 1.15rem;
  overflow: hidden;
}

.card-head {
  padding: 1rem 1.15rem 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-head h2 {
  font-size: 0.95rem;
  margin: 0;
}

.card-body { padding: 0.75rem 1.15rem 1.15rem; }

.panel {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 1.15rem;
  overflow: hidden;
}

.panel-head {
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

.panel-head h2 {
  font-size: 0.95rem;
  margin: 0;
}

/* Dashboard KPIs */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.metric-item {
  text-align: center;
  padding: 0.5rem 0.25rem;
}

.metric-item .label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.metric-item .value {
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font);
}

.trend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.trend-block .label {
  font-size: 0.8rem;
  color: var(--muted);
}

.trend-block .value {
  font-size: 1.5rem;
  font-weight: 700;
  font-family: var(--font);
  margin: 0.2rem 0 0.35rem;
}

.trend-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

.spark {
  width: 100%;
  height: 48px;
  margin-top: 0.35rem;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.kpi {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.15rem;
}

.kpi .label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.kpi .value {
  font-size: 1.25rem;
  font-weight: 600;
  font-family: var(--font);
}

.kpi .sub {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.split-2 {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.15rem;
}

.funnel-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1.25rem;
  align-items: center;
}

.funnel-bars { display: grid; gap: 0.65rem; }

.funnel-item .row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
  color: var(--muted);
}

.funnel-item .track {
  height: 28px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
}

.funnel-item .fill {
  height: 100%;
  background: var(--primary);
  border-radius: 6px;
  opacity: 0.95;
}

.bar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.bar-list li { margin-bottom: 0.85rem; }

.bar-list .row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  margin-bottom: 0.3rem;
}

.bar-list .track {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}

.bar-list .fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
}

/* Right rail */
.rail .card { margin-bottom: 1rem; }

.rail-project {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}

.rail-project .mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.rail-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
}

.rail-stat .label {
  font-size: 0.75rem;
  color: var(--muted);
}

.rail-stat .value {
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font);
}

.rail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.donut-wrap {
  display: grid;
  place-items: center;
  padding: 0.5rem 0 0.75rem;
  position: relative;
  min-height: 170px;
}

.donut-css {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  mask: radial-gradient(circle, transparent 52%, #000 53%);
  -webkit-mask: radial-gradient(circle, transparent 52%, #000 53%);
}

.donut-center {
  position: absolute;
  text-align: center;
  pointer-events: none;
}

.donut-center .big {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font);
}

.donut-center .small {
  font-size: 0.7rem;
  color: var(--muted);
}

.legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.legend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  gap: 0.5rem;
}

.legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 0.4rem;
}

.month-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  box-shadow: var(--shadow);
  margin-bottom: 0.75rem;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 280px);
  min-height: 200px;
}

.table-wrap table.data thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f5f7fa;
}

.table-card .pagination-container {
  display: none;
}

.field-with-action {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-with-action > select,
.field-with-action > .ui-select,
.field-with-action > input {
  flex: 1;
  min-width: 0;
}

.personnel-name-field .field-with-action > input {
  flex: 0 0 calc((100% - 1.25rem) / 2);
  width: calc((100% - 1.25rem) / 2);
  max-width: calc((100% - 1.25rem) / 2);
}

.personnel-name-field .field-with-action .btn-inline-add {
  margin-left: auto;
}

.field-with-action .btn-inline-add {
  flex-shrink: 0;
  white-space: nowrap;
  height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.inv-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  padding: 0 4px;
}

.inv-tab {
  appearance: none;
  border: none;
  background: transparent;
  padding: 10px 18px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.inv-tab.is-active {
  color: var(--primary, #1677ff);
  font-weight: 600;
  border-bottom-color: var(--primary, #1677ff);
}

.inv-tab:hover {
  color: var(--primary, #1677ff);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  background: #f0f2f5;
  color: #5b6b82;
}

.status-pill.is-ok {
  background: #e6f7ef;
  color: #0d7a45;
}

.status-pill.is-warn {
  background: #fff7e6;
  color: #b76e00;
}

.status-pill.is-danger {
  background: #fff1f0;
  color: #cf1322;
}

.tree-indent .tree-caret {
  margin-right: 4px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: var(--ink);
}

table.data th,
table.data td {
  padding: 12px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

table.data th {
  background: var(--table-th-bg);
  font-weight: 600;
  font-size: 14px;
  color: var(--table-th-color);
  border-bottom: 2px solid var(--line);
}

table.data.is-bordered {
  border: 1px solid var(--line);
}

table.data.is-bordered th,
table.data.is-bordered td {
  border: 1px solid var(--line);
}

table.data.is-bordered th {
  border-bottom: 2px solid var(--line);
}

table.data tbody tr:hover { background: #f5f7fa; }

table.data td.num,
table.data th.num {
  text-align: right;
  font-family: var(--font);
}

table.data th.col-actions,
table.data td.col-actions,
table.data td.actions {
  text-align: center !important;
  vertical-align: middle;
  white-space: nowrap;
  max-width: none;
  width: 1%;
  padding-left: 16px;
  padding-right: 16px;
}

/* 内层居中：单按钮居中，多按钮整组居中并向两侧均匀拉开 */
table.data .actions-inner {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: nowrap;
  vertical-align: middle;
  max-width: 100%;
}

table.data .actions-inner .inline-form {
  display: inline-flex;
  margin: 0;
}

table.data tr.is-summary {
  background: #fafafa;
  font-weight: 500;
}

table.data tfoot .list-total-row {
  background: #f5f7fa;
  border-top: 1px solid var(--line, #e4e7ed);
}

table.data tfoot .list-total-row td {
  font-weight: 600;
  color: #303133;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

table.data tfoot .list-total-label {
  color: #606266;
}

table.data tfoot .list-total-num {
  color: #1677ff;
  font-variant-numeric: tabular-nums;
}

table.data tfoot .list-total-num.is-neg {
  color: #f56c6c;
}

table.data tfoot .list-total-num.is-pos {
  color: #67c23a;
}

table.data td.is-amt-pos {
  color: #67c23a;
}

table.data td.is-amt-neg {
  color: #f56c6c;
}

.labor-status.is-normal {
  color: #16a34a;
  font-weight: 600;
}

.labor-status.is-left {
  color: #dc2626;
  font-weight: 600;
}

table.data tr.is-empty td {
  text-align: center;
  padding: 2rem 1rem;
  max-width: none;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.25rem;
  max-width: 860px;
}

.form-grid .full { grid-column: 1 / -1; }

.form-grid .alone {
  grid-column: 1 / -1;
}

.form-grid .alone > input,
.form-grid .alone > select,
.form-grid .alone > .dt-field,
.form-grid .alone > .ui-select {
  width: calc((100% - 1.25rem) / 2);
  max-width: calc((100% - 1.25rem) / 2);
}

.form-grid-compact {
  /* 字段较少时仍两列，更紧凑 */
  max-width: none;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.empty-state {
  text-align: left;
  padding: 2.5rem 1.5rem;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.empty-state h2 { font-size: 1.25rem; }
.empty-state p {
  color: var(--muted);
  margin: 0.5rem 0 1.25rem;
}

.flash-stack { margin-bottom: 1rem; }

/* Toast — top right, auto dismiss */
.toast-root {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  border: 1px solid var(--line);
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink);
  animation: toast-in 0.22s ease-out;
}

.toast.is-leaving {
  animation: toast-out 0.2s ease-in forwards;
}

.toast-msg { flex: 1; min-width: 0; }

.toast-close {
  border: 0;
  background: transparent;
  color: #909399;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.toast-close:hover { color: #606266; }

.toast-success {
  border-color: #c2e7b0;
  background: #f0f9eb;
  color: #67c23a;
}

.toast-error {
  border-color: #fbc4c4;
  background: #fef0f0;
  color: #f56c6c;
}

.toast-info {
  border-color: #b3d8ff;
  background: #ecf5ff;
  color: #409eff;
}

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

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

/* MessageBox — 系统风格确认/提示 */
.msgbox-root {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.msgbox-root[hidden] {
  display: none !important;
}

.msgbox-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.msgbox-panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  padding: 20px 20px 16px;
  animation: toast-in 0.18s ease-out;
}

.msgbox-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.msgbox-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

.msgbox-icon.is-warning {
  background: #e6a23c;
}

.msgbox-icon.is-warning::before {
  content: "!";
}

.msgbox-icon.is-info {
  background: #409eff;
}

.msgbox-icon.is-info::before {
  content: "i";
  font-style: italic;
  font-family: Georgia, "Times New Roman", serif;
}

.msgbox-icon.is-error {
  background: #f56c6c;
}

.msgbox-icon.is-error::before {
  content: "!";
}

.msgbox-icon.is-success {
  background: #67c23a;
}

.msgbox-icon.is-success::before {
  content: "✓";
  font-size: 12px;
}

.msgbox-head h3 {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.msgbox-body {
  padding-left: 32px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #606266;
  white-space: pre-wrap;
  word-break: break-word;
}

.msgbox-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.inline-form { display: inline; }
.muted { color: var(--muted); }

.mobile-toggle {
  display: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}

@media (max-width: 1100px) {
  .workspace.has-rail { grid-template-columns: 1fr; }
  .metric-strip { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 960px) {
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: 100dvh;
    height: auto;
  }
  .auth-page {
    height: auto;
    min-height: 100dvh;
  }
  .auth-visual {
    min-height: 42dvh;
    padding-bottom: 0.75rem;
  }
  .auth-visual-center {
    padding: 1.25rem 0.5rem 0.75rem;
  }
  .auth-title {
    font-size: clamp(1.75rem, 7vw, 2.25rem);
  }
  .auth-structure {
    max-height: 120px;
    overflow: hidden;
  }
  .auth-panel {
    padding: 1.75rem 1.25rem 2.5rem;
  }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .split-2,
  .trend-grid,
  .funnel-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease-out;
    width: min(280px, 85vw);
    box-shadow: var(--shadow);
  }
  .sidebar.is-open { transform: translateX(0); }
  .mobile-toggle { display: inline-flex; }
  .workspace { padding: 1rem; }
  .topbar, .page-bar { padding-left: 1rem; padding-right: 1rem; }
  .table-card { padding: 14px; }
  .pagination-container { justify-content: flex-start; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .kpi-row { grid-template-columns: 1fr; }
  .search-box { min-width: 0; flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ========== Center modal (原抽屉改为居中弹窗) ========== */
.drawer-root {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  pointer-events: none;
  visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.drawer-root.is-open {
  pointer-events: auto;
  visibility: visible;
}

.drawer-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease-out;
}

.drawer-root.is-open .drawer-mask {
  opacity: 1;
}

.drawer-panel,
.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(86vh, 800px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateY(12px) scale(0.98);
  opacity: 0;
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}

.drawer-panel.is-tall {
  width: min(560px, 100%);
  min-height: 420px;
  max-height: min(92vh, 880px);
}

.drawer-panel.is-tall .drawer-body {
  overflow: visible;
  min-height: 280px;
  padding-bottom: 48px;
}

.drawer-root.is-open .drawer-panel,
.drawer-root.is-open .modal-dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.drawer-head h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}

.drawer-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.drawer-form.is-readonly .form-grid {
  pointer-events: none;
}

.drawer-form.is-readonly .voucher-preview,
.drawer-form.is-readonly [data-voucher-thumb] {
  pointer-events: auto;
}

tr[data-row-open] {
  cursor: pointer;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.drawer-body .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: none;
  gap: 1rem 1.25rem;
}

@media (max-width: 640px) {
  .drawer-body .form-grid {
    grid-template-columns: 1fr;
  }
}

.drawer-body .form-actions {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, #fff 70%, transparent);
  padding-top: 1rem;
  margin-top: 0.5rem;
  justify-content: flex-end;
}

.drawer-loading {
  color: var(--muted);
  font-size: 0.9375rem;
  padding: 2.5rem 0;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .drawer-mask,
  .drawer-panel,
  .modal-dialog {
    transition: none !important;
  }
}

/* Plain selects in forms (category / currency) */
select[data-no-ui-select] {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  padding: 0 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

select[data-no-ui-select]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

select[data-no-ui-select]:disabled {
  background: #f5f7fa;
  color: #c0c4cc;
  cursor: not-allowed;
}

/* ========== DateTime picker ========== */
.dt-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.dt-field .dt-icon {
  position: absolute;
  left: 10px;
  z-index: 1;
  color: #c0c4cc;
  display: inline-flex;
  pointer-events: none;
}

.dt-field .dt-input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

.dt-field.has-clear .dt-input {
  padding-right: 30px;
}

.dt-field .dt-clear {
  position: absolute;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #c0c4cc;
  cursor: pointer;
}

.dt-field .dt-clear:hover {
  color: #909399;
  background: #f2f3f5;
}

.dt-clear-act {
  border: 0;
  background: transparent;
  color: #909399;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 0 4px;
}

.dt-clear-act:hover {
  color: var(--primary);
}

/* Month filter: match list date cell typography (IBM Plex digits) */
.dt-field .dt-input[data-dt-mode="month"],
.module-filter-bar .dt-field .dt-input[data-dt-mode="month"],
.dashboard-month-filter .dt-field .dt-input[data-dt-mode="month"] {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.dt-field .dt-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.dt-panel {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1300;
  width: 420px;
  max-width: min(420px, 92vw);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 8px;
}

.dt-panel.is-month {
  width: 280px;
  max-width: min(280px, 92vw);
}

.dt-panel-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.dt-panel.is-month .dt-panel-head {
  grid-template-columns: 1fr;
}

.dt-panel-head input {
  height: 32px;
  border: 1px solid var(--line-dark);
  border-radius: 4px;
  padding: 0 8px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
}

.dt-panel-body {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
}

.dt-panel.is-month .dt-panel-body,
.dt-month-body {
  display: block;
  grid-template-columns: none;
}

.dt-months {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px 0 8px;
}

.dt-month-cell {
  border: 0;
  background: transparent;
  height: 40px;
  border-radius: 4px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}

.dt-month-cell:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.dt-month-cell.is-selected {
  color: #fff;
  background: var(--primary);
}

.dt-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.dt-cal-nav button {
  border: 0;
  background: transparent;
  color: #606266;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

.dt-cal-nav button:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.dt-week,
.dt-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.dt-week span {
  font-size: 12px;
  color: #909399;
  padding: 4px 0;
}

.dt-day {
  border: 0;
  background: transparent;
  height: 28px;
  border-radius: 50%;
  font: inherit;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
}

.dt-day.is-other {
  color: #c0c4cc;
}

.dt-day:hover {
  color: var(--primary);
}

.dt-day.is-selected {
  background: var(--primary);
  color: #fff;
}

.dt-time {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  border-left: 1px solid var(--line);
  padding-left: 6px;
  max-height: 240px;
}

.dt-time-col {
  overflow-y: auto;
  max-height: 240px;
  scrollbar-width: thin;
}

.dt-time-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 4px 0;
  font: inherit;
  font-size: 12px;
  color: #606266;
  cursor: pointer;
  border-radius: 2px;
}

.dt-time-item:hover {
  background: #f5f7fa;
}

.dt-time-item.is-active {
  color: var(--primary);
  font-weight: 600;
  background: var(--primary-soft);
}

.dt-panel-foot {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.dt-now {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  margin-right: auto;
}

.dt-ok {
  border: 1px solid var(--line-dark);
  background: #fff;
  color: #606266;
  border-radius: 3px;
  padding: 4px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.dt-ok:hover {
  color: var(--primary);
  border-color: #c6e2ff;
  background: var(--primary-soft);
}

.dashboard-month-filter .dt-field {
  width: 11rem;
}

.dashboard-month-filter .dt-input {
  height: 32px;
}

/* —— 管理驾驶舱 —— */
.cockpit {
  display: grid;
  gap: 16px;
}

.cockpit-meta-card .card-body,
.cockpit-meta-card {
  padding: 0;
}

.cockpit-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 14px 18px;
  align-items: center;
}

.cockpit-meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-right: 12px;
}

.cockpit-meta-item .label {
  flex-shrink: 0;
  color: #909399;
  font-size: 0.8125rem;
}

.cockpit-meta-item .value {
  font-weight: 600;
  color: #303133;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cockpit-meta-month .dashboard-month-filter {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px;
  background: #fafbfc;
}

.kpi-item .label {
  font-size: 0.8125rem;
  color: #909399;
  margin-bottom: 8px;
}

.kpi-item .value {
  font-size: 1.25rem;
  font-weight: 600;
  color: #303133;
  font-family: var(--font);
  line-height: 1.2;
}

.cockpit-row-split {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.cockpit-cost-table thead th {
  background: #409eff;
  color: #fff;
  border-color: #409eff;
}

.cockpit-cost-table th,
.cockpit-cost-table td {
  text-align: center !important;
}

.cockpit-pie {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 36px;
  min-height: 320px;
  /* 整体居中偏下 */
  padding: 40px 24px 20px;
  box-sizing: border-box;
  width: 100%;
}

.cockpit-pie .donut-wrap {
  width: 280px;
  height: 280px;
  margin: 0;
  flex-shrink: 0;
  position: relative;
  min-height: 0;
  padding: 0;
  display: block;
}

.cockpit-pie .donut-svg {
  width: 280px;
  height: 280px;
  display: block;
  overflow: visible;
}

.cockpit-pie .donut-seg {
  cursor: pointer;
  transform-box: view-box;
  transform-origin: 140px 140px;
  transition:
    transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.2s ease,
    filter 0.2s ease;
  stroke: #fff;
  stroke-width: 1.5;
}

.cockpit-pie .donut-wrap.is-hovering .donut-seg:not(.is-hover) {
  opacity: 0.45;
  filter: saturate(0.85);
}

.cockpit-pie .donut-seg.is-hover {
  filter: brightness(1.06);
  stroke-width: 2;
}

.cockpit-pie .donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
  z-index: 1;
}

.cockpit-pie .donut-center .big {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  max-width: 9.5em;
  margin: 0 auto;
  word-break: break-all;
}

.cockpit-pie .donut-center .small {
  font-size: 0.7rem;
  margin-top: 2px;
  color: var(--muted);
}

.donut-tip {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -120%);
  min-width: 110px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(48, 49, 51, 0.92);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 2px;
}

.donut-tip[hidden] {
  display: none !important;
}

.donut-tip strong {
  font-weight: 600;
}

.donut-tip span,
.donut-tip em {
  font-style: normal;
  color: #e5e7eb;
}

.cockpit-legend {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 8px;
  max-height: none;
  overflow: visible;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 0 1 220px;
  min-width: 180px;
  max-width: 260px;
  width: auto;
}

.cockpit-legend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.8125rem;
  color: #606266;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

.cockpit-legend li > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.cockpit-legend .legend-pct {
  flex-shrink: 0;
  min-width: 3.2em;
  text-align: right;
  color: #303133;
}

.cockpit-legend li.is-active {
  background: #ecf5ff;
  color: #303133;
  font-weight: 600;
}

.cockpit-legend li.is-dim {
  opacity: 0.45;
}

.line-chart-legend {
  display: flex;
  gap: 20px;
  margin-bottom: 8px;
  font-size: 0.8125rem;
  color: #606266;
}

.line-chart-legend .lg-line {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
  position: relative;
}

.line-chart-legend .lg-line.blue { background: #3b82f6; }
.line-chart-legend .lg-line.orange { background: #f59e0b; }

.line-chart-legend .lg-line.blue::after,
.line-chart-legend .lg-line.orange::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: inherit;
  left: 5px;
  top: -2.5px;
}

.line-chart-legend .lg-line.orange::after {
  border-radius: 1px;
}

.line-chart-wrap {
  width: 100%;
  overflow: hidden;
}

.line-chart-wrap canvas {
  width: 100%;
  height: 280px;
  display: block;
}

@media (max-width: 1100px) {
  .cockpit-meta { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .cockpit-row-split { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .cockpit-meta { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }
}

/* —— 导入弹窗 —— */
.import-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.import-modal[hidden] {
  display: none !important;
}

.import-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.import-modal-panel {
  position: relative;
  z-index: 1;
  width: min(480px, 100%);
  max-height: min(90vh, 640px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

/* 更换项目：加高并允许下拉菜单溢出，避免选项被裁切 */
.import-modal-panel.is-reassign {
  min-height: 480px;
  max-height: min(92vh, 720px);
  overflow: visible;
}

.import-modal-panel.is-reassign .import-modal-body {
  min-height: 360px;
  padding-bottom: 28px;
}

.import-modal-panel.is-reassign .import-file-field {
  margin-bottom: 28px;
}

.import-modal-panel.is-reassign .ui-select {
  position: relative;
  z-index: 2;
}

.import-modal-panel.is-reassign .ui-select.is-open {
  z-index: 5;
}

.import-modal-panel.is-reassign .ui-select-menu {
  max-height: 280px;
}

.import-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.import-modal-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #303133;
}

.import-modal-close {
  border: 0;
  background: transparent;
  font-size: 1.35rem;
  line-height: 1;
  color: #909399;
  cursor: pointer;
  padding: 0 4px;
}

.import-modal-close:hover {
  color: #303133;
}

.import-modal-body {
  padding: 18px;
}

.import-tip {
  margin: 0 0 12px;
  font-size: 0.875rem;
  color: #606266;
  line-height: 1.5;
}

.import-template-btn {
  margin-bottom: 16px;
}

.import-file-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 0.875rem;
  color: #606266;
}

.import-file-field input[type="file"] {
  font: inherit;
  font-size: 0.8125rem;
}

.import-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.import-result {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
}

.import-result-summary {
  margin: 0 0 8px;
  line-height: 1.5;
}

.import-result-summary .ok {
  color: #67c23a;
  font-weight: 600;
}

.import-result-summary .fail {
  color: #f56c6c;
  font-weight: 600;
}

.import-result-errors {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 180px;
  overflow: auto;
  background: #fef0f0;
  border-radius: 4px;
  border: 1px solid #fde2e2;
}

.import-result-errors li {
  padding: 8px 10px;
  border-bottom: 1px solid #fde2e2;
  color: #f56c6c;
  line-height: 1.4;
}

.import-result-errors li:last-child {
  border-bottom: 0;
}

.import-result-msg {
  margin: 0;
  color: #f56c6c;
}

/* Module filter bar */
.filter-bar-card {
  margin-bottom: 12px;
  padding: 14px 16px;
}

.module-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 16px;
}

.module-filter-bar .filter-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8125rem;
  color: #606266;
  min-width: 140px;
}

.module-filter-bar .filter-field span {
  font-weight: 500;
}

.module-filter-bar .dt-field {
  min-width: 160px;
}

.module-filter-bar select,
.module-filter-bar input[type="text"] {
  height: 34px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 0 10px;
  font: inherit;
  background: #fff;
}

/* 月份选择保留左侧图标、右侧清除按钮的内边距，避免与占位文字重叠 */
.module-filter-bar .dt-field .dt-input {
  padding: 0 12px 0 32px;
}

.module-filter-bar .dt-field.has-clear .dt-input {
  padding-right: 30px;
}

.module-filter-bar .ui-select-trigger {
  min-height: 34px;
  height: 34px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 0 10px;
  font-size: 0.875rem;
  box-shadow: none;
}

.module-filter-bar .ui-select.is-open .ui-select-trigger {
  border-radius: var(--radius) var(--radius) 0 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.module-filter-bar .ui-select-menu {
  border-radius: 0 0 var(--radius) var(--radius);
}

.module-filter-bar .ui-select-option {
  border-radius: var(--radius);
  padding: 0.4rem 0.65rem;
}

.module-filter-bar .filter-field .ui-select {
  min-width: 140px;
}

.analytics-month-filter {
  margin-bottom: 0;
}

/* Image upload / voucher preview */
.image-upload-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.image-upload-field .image-file-input {
  font-size: 0.8125rem;
}

.voucher-preview {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px;
  border: 1px dashed var(--line-dark);
  border-radius: var(--radius);
  background: #fafafa;
  cursor: pointer;
}

.voucher-preview.is-empty {
  cursor: default;
  color: var(--muted);
}

.voucher-preview img {
  max-width: 180px;
  max-height: 120px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
}

.voucher-hint,
.voucher-placeholder {
  font-size: 0.75rem;
  color: var(--muted);
}

.voucher-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voucher-lightbox[hidden] {
  display: none !important;
}

.voucher-lightbox-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.voucher-lightbox img {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 960px);
  max-height: 88vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.dt-panel.is-date-only {
  width: 320px;
}

.dt-panel.is-date-only .dt-date-body {
  padding: 8px 12px 4px;
}

.dt-panel.is-date-only .dt-panel-body {
  display: block;
}

tr[data-row-open] { cursor: pointer; }
tr[data-row-open]:hover td { background: color-mix(in srgb, var(--primary) 6%, white); }

.account-create-block {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}
.account-create-block[hidden] {
  display: none !important;
}
.account-create-block .field {
  min-width: 0;
}
.account-create-block .field label {
  display: block;
  margin-bottom: 6px;
}
@media (max-width: 720px) {
  .account-create-block {
    grid-template-columns: 1fr;
  }
}

.att-thumb {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fff;
  vertical-align: middle;
}
.att-thumb.is-lg { width: 160px; height: auto; max-height: 120px; object-fit: contain; }
.att-filename { color: var(--text); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
  padding: 8px 16px 20px;
}
.detail-item.is-full { grid-column: 1 / -1; }
.detail-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.detail-value { font-size: 14px; word-break: break-all; }
.detail-attachments { padding: 0 16px 20px; }
.detail-attachments h3 { font-size: 14px; margin: 8px 0 10px; }
.att-list { display: flex; flex-wrap: wrap; gap: 8px; }
.att-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  max-width: 280px;
}
.att-chip img { width: 40px; height: 30px; object-fit: cover; border-radius: 3px; }
.voucher-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.voucher-filename { font-size: 12px; color: var(--muted); }

@media (max-width: 720px) {
  .detail-grid { grid-template-columns: 1fr; }
}


