/* 对齐宣传站 intro 清爽浅色 */
:root {
  --xh-bg: #f6f8f9;
  --xh-bg-2: #f3faf7;
  --xh-panel: #ffffff;
  --xh-border: #e8e8e8;
  --xh-border-soft: #eef1f2;
  --xh-text: #1a1a1a;
  --xh-muted: #666666;
  --xh-green: #00c17c;
  --xh-green-2: #00a86a;
  --xh-green-soft: rgba(0, 193, 124, .12);
  --xh-red: #e5484d;
  --xh-blue: #2563eb;
  --xh-orange: #d97706;
  --xh-table-head: #f3faf7;
  --xh-table-head-text: #1a1a1a;
  --xh-sider: #ffffff;
  --xh-sider-w: 220px;
  --xh-radius: 8px;
  --xh-font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --xh-shadow: 0 8px 28px rgba(0, 0, 0, .06);
}

* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
body {
  font-family: var(--xh-font);
  background: var(--xh-bg);
  color: var(--xh-text);
  font-size: 13px;
}

a { color: var(--xh-green); text-decoration: none; cursor: pointer; }
button { font-family: inherit; }

/* Login — 对齐兄弟产品 TMS「按角色一键进入」布局 */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background:
    radial-gradient(900px 520px at 18% 12%, rgba(0, 193, 124, .22), transparent 58%),
    radial-gradient(700px 480px at 88% 78%, rgba(16, 185, 129, .16), transparent 55%),
    linear-gradient(145deg, #e8f5ef 0%, #f3faf6 42%, #eef6f2 100%);
}
.login-layout {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
}
.login-box {
  background: #fff;
  color: #1a1a1a;
  border-radius: 14px;
  padding: 36px 32px 28px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
}
.login-logo {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
}
.login-logo .mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(145deg, #1aa88a, #0d7a6a);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.12);
}
.login-brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #0f766e;
}
.login-title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  color: #111827;
  letter-spacing: .02em;
}
.login-sub {
  color: #6b7280;
  margin: 0 0 26px;
  font-size: 13px;
}
.login-field { margin-bottom: 16px; }
.login-field label {
  display: block;
  color: #374151;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 500;
}
.login-field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: #f8fafb;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #111827;
  font-size: 14px;
  outline: none;
}
.login-field input::placeholder { color: #9ca3af; }
.login-field input:focus {
  border-color: #0d9488;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .15);
  background: #fff;
}
.login-submit {
  width: 100%;
  height: 42px;
  margin-top: 6px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .12em;
  background: #0d9488 !important;
  border-color: #0d9488 !important;
}
.login-submit:hover { background: #0f766e !important; border-color: #0f766e !important; }
.login-links {
  margin-top: 18px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
  display: flex;
  justify-content: center;
  gap: 8px;
}
.login-links a { color: #0d9488; }
.login-links a:hover { color: #0f766e; text-decoration: underline; }

.login-roles {
  background: #fff;
  border: 1px solid #d7e3dc;
  border-radius: 14px;
  padding: 28px 24px 22px;
  color: #152018;
  box-shadow: 0 12px 36px rgba(15, 40, 30, .08);
}
.login-roles h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 700;
}
.login-roles-tip {
  margin: 0 0 20px;
  color: #5b6a60;
  font-size: 13px;
  line-height: 1.5;
}
.login-role-group + .login-role-group { margin-top: 18px; }
.login-role-group-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  color: #7a8a80;
  margin-bottom: 10px;
  text-transform: none;
}
.login-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.login-role-card {
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #d7e3dc;
  background: #f7fbf8;
  color: #152018;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.login-role-card:hover {
  border-color: rgba(0, 168, 106, .55);
  background: rgba(0, 168, 106, .08);
  transform: translateY(-1px);
}
.login-role-card.active {
  border-color: #00a86a;
  background: rgba(0, 168, 106, .14);
  box-shadow: inset 0 0 0 1px rgba(0, 168, 106, .2);
}
.login-role-card strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}
.login-role-cred {
  display: block;
  font-size: 12px;
  color: #3d4f45;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  margin-bottom: 6px;
}
.login-role-card em {
  display: block;
  font-style: normal;
  font-size: 12px;
  color: #5b6a60;
  line-height: 1.35;
}

@media (max-width: 860px) {
  .login-layout {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
  .login-role-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .login-box, .login-roles { padding: 24px 18px; }
  .login-role-grid { grid-template-columns: 1fr; }
}

/* Shell */
.shell { display: flex; min-height: 100vh; }
.sider {
  width: var(--xh-sider-w);
  background: var(--xh-sider);
  border-right: 1px solid var(--xh-border);
  box-shadow: 1px 0 0 rgba(0,0,0,.02);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sider-brand {
  padding: 18px 16px 14px;
  font-size: 15px;
  font-weight: 700;
  border-bottom: 1px solid var(--xh-border-soft);
  line-height: 1.4;
}
.sider-nav { padding: 10px 8px; overflow: auto; flex: 1; }
.nav-group { margin-bottom: 4px; }
.nav-group-title {
  width: 100%;
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 0; color: var(--xh-text);
  padding: 10px 12px; border-radius: 4px; cursor: pointer; text-align: left;
  font-size: 13px;
}
.nav-group-title:hover { background: var(--xh-green-soft); }
.nav-group-title .arrow { margin-left: auto; color: var(--xh-muted); font-size: 10px; }
.nav-sub { padding: 2px 0 6px 0; }
.nav-item {
  display: block; width: 100%;
  background: transparent; border: 0; color: #3d4f45;
  padding: 9px 12px 9px 36px; border-radius: 4px; cursor: pointer; text-align: left;
  font-size: 13px; margin-bottom: 2px;
}
.nav-item:hover { background: var(--xh-green-soft); color: var(--xh-text); }
.nav-item.active {
  background: var(--xh-green);
  color: #fff;
  font-weight: 600;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--xh-bg); }
.topbar {
  height: 48px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--xh-border-soft);
  background: #fff;
}
.crumb { color: var(--xh-muted); }
.crumb .current { color: var(--xh-green); }
.userbox { display: flex; align-items: center; gap: 8px; color: var(--xh-text); }
.userbox .avatar {
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--xh-border);
  background: var(--xh-bg-2);
  display: grid; place-items: center; font-size: 12px;
}

.content { padding: 14px 16px 24px; flex: 1; overflow: auto; }

/* Filter */
.filter-box {
  border: 1px solid var(--xh-border);
  border-radius: var(--xh-radius);
  padding: 14px 14px 8px;
  margin-bottom: 12px;
  background: var(--xh-panel);
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 12px 16px;
  align-items: end;
}
.filter-item label {
  display: block; color: var(--xh-muted); margin-bottom: 6px; font-size: 12px;
}
.filter-item input, .filter-item select, .xh-input, .xh-select {
  width: 100%;
  background: #fff;
  border: 1px solid var(--xh-border);
  color: var(--xh-text);
  border-radius: 2px;
  height: 32px;
  padding: 0 10px;
  outline: none;
}
.filter-item input::placeholder { color: #9aa8a0; }
.filter-item input:focus, .xh-input:focus, .xh-select:focus {
  border-color: var(--xh-green);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  height: 32px; padding: 0 14px; border-radius: 2px; cursor: pointer;
  font-size: 13px; border: 1px solid transparent; white-space: nowrap;
}
.btn-primary { background: var(--xh-green); color: #fff; border-color: var(--xh-green); }
.btn-primary:hover { background: var(--xh-green-2); }
.btn-ghost {
  background: #fff; color: var(--xh-text);
  border-color: var(--xh-border);
}
.btn-ghost:hover { border-color: var(--xh-green); color: var(--xh-green); }
.btn-outline-green {
  background: #fff; color: var(--xh-green);
  border-color: var(--xh-green);
}
.btn-text {
  background: transparent; border: 0; color: var(--xh-green);
  height: auto; padding: 0 6px; cursor: pointer;
}
.btn-text.danger { color: var(--xh-red); }
.btn + .btn { margin-left: 8px; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 8px; flex-wrap: wrap;
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* Table */
.table-wrap {
  border: 1px solid var(--xh-border);
  border-radius: var(--xh-radius);
  overflow: auto;
  background: #fff;
}
table.xh-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}
.xh-table thead th {
  background: var(--xh-table-head);
  color: var(--xh-table-head-text);
  font-weight: 600;
  text-align: left;
  padding: 10px 12px;
  white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
.xh-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--xh-border-soft);
  color: var(--xh-text);
  vertical-align: middle;
}
.xh-table tbody tr:hover { background: rgba(0,168,106,.05); }
.xh-link { color: var(--xh-green); cursor: pointer; }
.ops { display: flex; flex-wrap: wrap; gap: 6px 10px; max-width: 220px; }
.ops a, .ops button {
  background: none; border: 0; color: var(--xh-green);
  cursor: pointer; padding: 0; font-size: 13px;
}
.tag {
  display: inline-block; padding: 1px 6px; border-radius: 2px;
  font-size: 12px; line-height: 18px;
}
.tag-red { background: var(--xh-red); color: #fff; margin-left: 6px; }
.tag-blue { color: var(--xh-blue); }
.tag-green { color: var(--xh-green); }
.tag-gray { color: var(--xh-muted); }
.status-dot {
  display: inline-flex; align-items: center; gap: 6px;
}
.status-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 2px;
  background: currentColor;
}

/* Progress stepper */
.steps {
  display: flex; align-items: flex-start; gap: 0; min-width: 220px;
}
.step {
  display: flex; flex-direction: column; align-items: center; width: 64px; position: relative;
}
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 14px; left: 50%; width: 100%; height: 2px;
  background: #d5e0d9; z-index: 0;
}
.step-circle {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid #b8c9be;
  display: grid; place-items: center;
  font-size: 10px; background: #fff; z-index: 1; position: relative;
  color: var(--xh-muted);
}
.step.done .step-circle { border-color: var(--xh-green); background: var(--xh-green); color: #fff; }
.step.active .step-circle { border-color: var(--xh-blue); color: var(--xh-blue); background: #eff6ff; }
.step-name { margin-top: 4px; font-size: 11px; color: var(--xh-muted); }

/* Dashboard */
.dash-section {
  background: #fff;
  border: 1px solid var(--xh-border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: var(--xh-shadow);
}
.dash-section-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.dash-section-hd h3 { margin: 0; font-size: 15px; }
.chip-group { display: flex; gap: 6px; }
.chip {
  border: 1px solid var(--xh-border); background: #fff; color: var(--xh-text);
  border-radius: 2px; padding: 4px 10px; cursor: pointer; font-size: 12px;
}
.chip.on { background: var(--xh-green); border-color: var(--xh-green); color: #fff; }
.process-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.process-card {
  background: #fff; border: 1px solid var(--xh-border);
  border-radius: 12px; padding: 12px;
  box-shadow: 0 4px 14px rgba(0,0,0,.03);
}
.process-card .ptag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 12px; color: #fff; margin-bottom: 8px;
}
.process-card .big { font-size: 28px; font-weight: 700; line-height: 1.1; color: var(--xh-text); }
.process-card .sub { color: var(--xh-muted); font-size: 12px; margin-top: 2px; }
.process-card .stats { float: right; text-align: right; font-size: 12px; color: var(--xh-muted); line-height: 1.7; }
.process-card .bar {
  clear: both; margin-top: 10px; height: 4px; background: #e2ebe5;
  border-radius: 999px; overflow: hidden;
}
.process-card .bar > i { display: block; height: 100%; background: var(--xh-blue); }
.process-card .bar.done > i { background: var(--xh-green); }

.kpi-side {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.kpi-cell {
  background: #fff; border: 1px solid var(--xh-border);
  border-radius: 12px; padding: 14px 12px; text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.03);
}
.kpi-cell .v { font-size: 24px; font-weight: 700; margin-top: 4px; }
.kpi-cell .v.green { color: var(--xh-green); }
.kpi-cell .v.red { color: var(--xh-red); }
.kpi-cell .v.orange { color: var(--xh-orange); }
.kpi-cell .l { color: var(--xh-muted); font-size: 12px; }

.dash-bottom {
  display: grid; grid-template-columns: 1fr 280px; gap: 12px;
}

/* Modal / Form light overlay matching create page */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 100; padding: 40px 16px; overflow: auto;
}
.modal {
  width: min(920px, 100%);
  background: #fff; color: #111;
  border-radius: 4px; padding: 20px 24px 24px;
}
.modal h3 { margin: 0 0 16px; font-size: 16px; }
.form-row { margin-bottom: 14px; display: flex; align-items: flex-start; }
.form-row > label {
  width: 90px; flex-shrink: 0; padding-top: 8px; color: #374151; font-size: 13px;
}
.form-row > label .req { color: #ef4444; margin-right: 2px; }
.form-row .ctrl { flex: 1; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; border: 1px solid #d1d5db; border-radius: 2px;
  height: 34px; padding: 0 10px; font-size: 13px; color: #111; background: #fff;
}
.form-row textarea { height: 72px; padding: 8px 10px; resize: vertical; }
.modal-actions {
  display: flex; justify-content: center; gap: 12px; margin-top: 20px;
}
.modal .btn-cancel {
  height: 34px; padding: 0 28px; background: #fff; border: 1px solid #d1d5db;
  border-radius: 2px; cursor: pointer;
}
.modal .btn-save {
  height: 34px; padding: 0 28px; background: var(--xh-green); color: #fff;
  border: 0; border-radius: 2px; cursor: pointer;
}

.pager {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 8px; margin-top: 12px; color: var(--xh-muted);
}
.pager .page {
  min-width: 28px; height: 28px; border: 1px solid var(--xh-border);
  display: grid; place-items: center; border-radius: 2px; background: #fff;
}
.pager .page.on { background: var(--xh-green); border-color: var(--xh-green); color: #fff; }

.empty {
  padding: 48px; text-align: center; color: var(--xh-muted);
}

.toast-wrap {
  position: fixed; right: 20px; top: 20px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  min-width: 220px; max-width: 360px; padding: 10px 14px;
  border-radius: 6px; background: #fff; color: var(--xh-text);
  border: 1px solid var(--xh-border); box-shadow: 0 8px 24px rgba(15,40,30,.12);
  font-size: 13px; animation: toastIn .18s ease;
}
.toast.ok { border-color: rgba(0,168,106,.45); }
.toast.err { border-color: rgba(229,72,77,.45); background: #fff5f5; }
.toast.info { border-color: rgba(37,99,235,.35); }
@keyframes toastIn { from { opacity:0; transform: translateY(-6px);} to { opacity:1; transform:none;} }

.loading-mask {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(15,40,30,.18); display: grid; place-items: center;
}
.loading-box {
  background: #fff; border: 1px solid var(--xh-border); color: var(--xh-text);
  padding: 14px 22px; border-radius: 8px; font-size: 13px;
  box-shadow: 0 8px 24px rgba(15,40,30,.1);
}

@media (max-width: 1100px) {
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-bottom { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
}
