:root {
  --canvas: #f5f6f8;
  --surface: #ffffff;
  --surface-soft: #fafbfc;
  --line: #e5e7eb;
  --line-strong: #d7dce5;
  --ink: #1f2329;
  --ink-2: #4e5969;
  --ink-3: #667085;
  --blue: #2f66e5;
  --blue-deep: #2454bd;
  --blue-weak: #eef3ff;
  --green: #16845b;
  --green-weak: #eaf8f2;
  --amber: #ad6800;
  --amber-weak: #fff7e8;
  --red: #c43e3e;
  --red-weak: #fff1f0;
  --sidebar: 220px;
  --topbar: 56px;
  --radius: 5px;
  --shadow-modal: 0 18px 48px rgba(31, 35, 41, .2);
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 1180px; height: 100%; margin: 0; overflow: hidden; }
#app { width: 100%; height: 100%; overflow: hidden; }
body {
  color: var(--ink);
  background: var(--canvas);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid rgba(51, 112, 255, .42);
  outline-offset: 2px;
}

.app-shell { display: flex; width: 100%; height: 100vh; overflow: hidden; }
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  height: 100%;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 20;
}
.brand {
  min-height: 72px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #f0f1f3;
}
.brand-mark {
  width: 40px;
  height: 40px;
  border: 1px solid #e2e5ea;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(31, 35, 41, .08);
  display: grid;
  place-items: center;
  color: var(--blue);
  font-weight: 750;
  font-size: 18px;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; transform: scale(1.32); }
.brand-name { font-size: 16px; font-weight: 650; white-space: nowrap; }
.env-tag {
  display: inline-flex;
  margin-top: 4px;
  padding: 1px 18px;
  border-radius: 2px;
  color: #b84058;
  background: #fff0f3;
  font-size: 11px;
  line-height: 16px;
}
.side-scroll { flex: 1; overflow: auto; padding: 9px 8px 66px; }
.nav-group { margin-bottom: 4px; }
.nav-group-title {
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 4px;
  color: #30343b;
  font-weight: 600;
}
.nav-icon { width: 19px; color: #7b828c; text-align: center; }
.nav-chevron { margin-left: auto; color: var(--ink-3); font-size: 11px; }
.nav-sublist { padding: 2px 0 4px; }
.nav-subitem {
  width: 100%;
  min-height: 38px;
  padding: 0 12px 0 43px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #3b3f46;
  text-align: left;
  cursor: pointer;
}
.nav-subitem:hover { background: #f6f7f9; }
.nav-subitem.active { color: #2f62de; background: #eef2ff; font-weight: 600; }
.sidebar-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 52px;
  padding: 0 18px;
  border-top: 1px solid #f0f1f3;
  background: rgba(255,255,255,.97);
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-2);
  font-size: 13px;
}

.workspace { min-width: 0; flex: 1; height: 100%; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar);
  flex: 0 0 var(--topbar);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: stretch;
  position: relative;
  z-index: 15;
}
.history-arrows {
  width: 76px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-right: 1px solid #f0f1f3;
  color: #a5abb4;
}
.icon-button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-button:hover { background: #f2f3f5; }
.icon-button:disabled { color: #c1c6ce; background: transparent; cursor: not-allowed; }
.workspace-tabs { flex: 1; display: flex; align-items: stretch; overflow: hidden; }
.workspace-tab {
  min-width: 168px;
  max-width: 220px;
  padding: 0 16px;
  border-right: 1px solid #f0f1f3;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--blue);
  background: #fcfdff;
  font-weight: 600;
  position: relative;
}
.workspace-tab::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 0;
  height: 2px;
  border-radius: 3px;
  background: var(--blue);
}
.tab-close { margin-left: auto; color: var(--ink-3); font-weight: 400; }
.top-actions { padding: 0 15px; display: flex; align-items: center; gap: 10px; }
.business-switch {
  min-width: 126px;
  height: 34px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
}
.avatar-user {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #2f62de;
  background: #e8edff;
  font-weight: 700;
}
.page-scroll {
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100vh - var(--topbar));
  overflow-x: auto;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.page-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.page-scroll::-webkit-scrollbar-track { background: #eef0f3; }
.page-scroll::-webkit-scrollbar-thumb { border: 2px solid #eef0f3; border-radius: 8px; background: #b9c0cb; }
.page-scroll::-webkit-scrollbar-thumb:hover { background: #98a1af; }
.page {
  width: 100%;
  max-width: 1560px;
  min-height: 100%;
  margin: 0 auto;
  padding: 22px 24px 32px;
  animation: page-in .16s ease-out;
}
@keyframes page-in { from { opacity: .65; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.breadcrumb { margin-bottom: 14px; color: var(--ink-3); font-size: 13px; }
.breadcrumb button { padding: 0; border: 0; background: none; color: var(--blue); cursor: pointer; }
.page-heading { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.page-heading h1 { margin: 0; font-size: 22px; line-height: 32px; font-weight: 650; }
.page-description { margin-top: 6px; color: var(--ink-3); font-size: 13px; }
.heading-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.btn {
  min-width: 72px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.btn:hover:not(:disabled) { color: var(--blue); border-color: var(--blue); }
.btn.primary { color: #fff; border-color: var(--blue); background: var(--blue); }
.btn.primary:hover:not(:disabled) { color: #fff; border-color: var(--blue-deep); background: var(--blue-deep); }
.btn.danger { color: var(--red); border-color: #edc4c4; background: #fff; }
.btn.danger:hover:not(:disabled) { color: #a92f2f; border-color: var(--red); background: var(--red-weak); }
.btn.small { min-width: 0; height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { color: #adb3bd; border-color: #dfe2e7; background: #f5f6f7; cursor: not-allowed; }
.text-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  line-height: 24px;
}
.text-btn:hover { color: var(--blue-deep); }
.text-btn.danger { color: var(--red); }
.text-btn:disabled { color: #abb1ba; cursor: not-allowed; }
.button-loading::before, .spinner {
  content: "";
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: .72;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.filter-panel {
  min-height: 74px;
  margin-bottom: 14px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px minmax(272px, .9fr) auto auto;
  align-items: flex-end;
  gap: 12px;
}
.filter-panel .control { min-width: 0; }
.event-filter, .status-filter, .time-filter { min-width: 0; }
.time-range { display: grid; grid-template-columns: minmax(118px, 1fr) 18px minmax(118px, 1fr); align-items: center; gap: 6px; }
.time-range span { color: var(--ink-3); text-align: center; }
.field { min-width: 0; }
.field.inline { display: flex; align-items: center; gap: 10px; }
.field-label { display: block; margin-bottom: 7px; color: var(--ink-2); font-size: 13px; }
.required::before { content: "*"; margin-right: 3px; color: var(--red); }
.control {
  width: 100%;
  min-width: 180px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
.control:hover { border-color: #aeb7c5; }
.control:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(51,112,255,.1); outline: 0; }
.control[readonly], .control:disabled { color: #7d8592; background: #f7f8fa; border-color: #e2e5eb; }
.control.search { width: 100%; }
.control.compact { min-width: 0; width: 150px; }
.field-error { margin-top: 6px; color: var(--red); font-size: 12px; }
.field-help { margin-top: 6px; color: var(--ink-3); font-size: 12px; line-height: 18px; }

.data-table { overflow: hidden; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th {
  height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: #5e6879;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
td {
  min-height: 54px;
  padding: 13px 14px;
  border-bottom: 1px solid #edf0f4;
  color: var(--ink-2);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfdff; }
.cell-main { color: var(--ink); font-weight: 600; }
.cell-sub { margin-top: 4px; color: var(--ink-3); font-size: 12px; line-height: 18px; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.table-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.pagination {
  min-height: 54px;
  padding: 0 16px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  color: var(--ink-3);
  font-size: 13px;
}
.empty-state, .loading-state {
  min-height: 260px;
  padding: 52px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  text-align: center;
}
.empty-mark {
  width: 46px;
  height: 46px;
  margin-bottom: 13px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fafbfc;
  display: grid;
  place-items: center;
  color: #a7aeb9;
  font-size: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 23px;
  padding: 1px 8px;
  border-radius: 12px;
  white-space: nowrap;
  font-size: 12px;
}
.badge.blue { color: var(--blue-deep); background: var(--blue-weak); }
.badge.green { color: var(--green); background: var(--green-weak); }
.badge.amber { color: var(--amber); background: var(--amber-weak); }
.badge.red { color: var(--red); background: var(--red-weak); }
.badge.gray { color: #6f7784; background: #f0f2f5; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }

.form-card { width: min(920px, 100%); margin: 0 auto; padding: 28px 34px; }
.form-card-title { margin: 0 0 6px; font-size: 18px; font-weight: 650; }
.form-card-subtitle { margin-bottom: 26px; color: var(--ink-3); font-size: 13px; }
.form-row {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-bottom: 20px;
}
.form-row > label { padding-top: 8px; color: var(--ink-2); text-align: right; }
.form-row .control { max-width: 480px; }
.form-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.summary-card { margin-bottom: 14px; }
.summary-head {
  min-height: 70px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.summary-title { font-size: 19px; font-weight: 650; line-height: 30px; }
.summary-actions { margin-left: auto; display: flex; gap: 9px; }
.summary-meta {
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 1.1fr 1.3fr .8fr .8fr;
  gap: 20px;
}
.meta-label { margin-bottom: 5px; color: var(--ink-3); font-size: 12px; }
.meta-value { color: var(--ink); font-weight: 550; line-height: 20px; }
.readiness-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.readiness-card { min-height: 86px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.readiness-card.current { border-color: #99b0fa; box-shadow: inset 0 0 0 2px #eff3ff; }
.readiness-top { display: flex; align-items: center; gap: 8px; }
.readiness-name { font-weight: 650; }
.readiness-top .badge { margin-left: auto; }
.readiness-detail { margin-top: 8px; color: var(--ink-3); font-size: 12px; }

.alert {
  margin-bottom: 14px;
  padding: 11px 13px;
  border: 1px solid;
  border-radius: 4px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 20px;
}
.alert.info { color: #3e5f9e; border-color: #cfdbfa; background: #f5f8ff; }
.alert.warning { color: #8c5b0b; border-color: #f2d29c; background: #fffaf0; }
.alert.error { color: #a23c3c; border-color: #efc7c7; background: #fff5f5; }
.alert.success { color: #247554; border-color: #cde6d9; background: #f1faf5; }
.alert strong { color: inherit; }
.error-summary { display: block; }
.error-summary-title { margin-bottom: 7px; font-weight: 650; }
.error-list { margin: 0; padding-left: 18px; }
.error-link { border: 0; padding: 0; background: transparent; color: inherit; text-decoration: underline; cursor: pointer; }

.config-layout { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 14px; }
.anchor-nav {
  align-self: start;
  position: sticky;
  top: 72px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.anchor-link {
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
}
.anchor-link:hover, .anchor-link.active { color: var(--blue); background: var(--blue-weak); }
.config-section { margin-bottom: 14px; scroll-margin-top: 72px; }
.section-head {
  min-height: 54px;
  padding: 0 17px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title { margin: 0; color: var(--ink); font-size: 15px; font-weight: 650; }
.section-help { color: var(--ink-3); font-size: 12px; }
.section-actions { margin-left: auto; display: flex; gap: 8px; }
.section-body { padding: 16px 17px; }
.room-line { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.room-line > label { min-width: 105px; color: var(--ink-2); }
.room-line .control { min-width: 0; width: 240px; }
.room-line.editing-line {
  margin: -4px;
  padding: 12px 12px 12px 15px;
  border-left: 3px solid var(--blue);
  background: #fbfcff;
  flex-wrap: wrap;
}
.saved-value { min-width: 150px; color: var(--ink); font-weight: 600; }
.room-name { min-width: 220px; color: var(--ink-2); }
.inline-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.validation-result { font-size: 13px; }
.validation-result.success { color: var(--green); }
.validation-result.error { color: var(--red); }
.validation-result.pending { color: var(--ink-3); }

.role-block { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.role-block:last-child { margin-bottom: 0; }
.role-head {
  min-height: 46px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  display: flex;
  align-items: center;
}
.role-title { font-weight: 650; }
.role-count { margin-left: 7px; color: var(--ink-3); font-size: 12px; }
.role-head .btn { margin-left: auto; }
.people-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.05fr) minmax(160px, 1fr) minmax(160px, 1fr) 112px 92px;
  align-items: center;
  border-bottom: 1px solid #edf0f4;
}
.people-grid:last-child { border-bottom: 0; }
.people-grid.head { min-height: 42px; color: #626d80; background: #fff; font-weight: 600; }
.people-grid.editing { background: #fbfcff; box-shadow: inset 3px 0 0 var(--blue); }
.people-cell { min-width: 0; padding: 10px 12px; }
.person-main { display: flex; align-items: center; gap: 9px; }
.account-profile { display: flex; align-items: flex-start; gap: 9px; min-width: 0; }
.account-copy { min-width: 0; }
.person-avatar { width: 30px; height: 30px; flex: 0 0 30px; border: 2px solid transparent; border-radius: 50%; background: #dfe7ff; color: var(--blue); display: grid; place-items: center; }
.person-avatar.synced { border-color: #9ed5bb; background: #e9f7ef; color: var(--green); }
.person-avatar.current { background: #eef0f4; color: #6f7784; }
.account-name { color: var(--ink); font-weight: 600; }
.account-note { margin-top: 3px; color: var(--ink-3); font-size: 11px; line-height: 16px; }
.account-note.synced { color: var(--green); }
.inline-editor { display: flex; align-items: center; gap: 7px; }
.inline-editor .control { min-width: 0; flex: 1; }
.editor-preview { margin-top: 9px; padding-top: 9px; border-top: 1px dashed #dce2eb; }
.pending-account { display: flex; align-items: center; gap: 9px; color: var(--ink-3); }
.pending-account-mark { width: 30px; height: 30px; flex: 0 0 30px; border: 1px dashed #c8cfda; border-radius: 50%; background: #f6f7f9; display: grid; place-items: center; }
.compact-error { max-width: 112px; line-height: 16px; }
.sync-summary { margin-bottom: 13px; }

.proxy-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.proxy-card { padding: 11px 13px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-soft); }
.proxy-title { margin-bottom: 5px; color: var(--ink); font-weight: 600; }
.proxy-meta { display: flex; align-items: center; gap: 9px; color: var(--ink-3); font-size: 12px; }
.gift-grid {
  display: grid;
  grid-template-columns: 44px minmax(120px, .75fr) minmax(145px, 1fr) minmax(145px, 1fr) minmax(210px, 1.35fr) 86px;
  align-items: center;
  border-bottom: 1px solid #edf0f4;
}
.gift-grid:last-child { border-bottom: 0; }
.gift-grid.head { min-height: 42px; color: #626d80; font-weight: 600; }
.gift-grid.editing { background: #fbfcff; box-shadow: inset 3px 0 0 var(--blue); }
.gift-cell { min-width: 0; padding: 10px 8px; }
.gift-grid .control { min-width: 0; }
.gift-grid .control.compact { width: 100%; }
.gift-validation { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.gift-check-line { max-width: 100%; color: var(--ink-2); font-size: 11px; line-height: 17px; }
.gift-check-label { display: inline-block; min-width: 32px; margin-right: 5px; color: var(--ink-3); }

.ranking-empty { min-height: 150px; padding: 28px; border: 1px dashed #d9dee7; border-radius: 4px; }
.ranking-section-body { padding: 12px; }
.ranking-table-scroll { border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.ranking-main-table { min-width: 720px; table-layout: fixed; }
.ranking-main-table .ranking-col-name { width: 22%; }
.ranking-main-table .ranking-col-object { width: 14%; }
.ranking-main-table .ranking-col-rule { width: 16%; }
.ranking-main-table .ranking-col-status { width: 16%; }
.ranking-main-table .ranking-col-actions { width: 32%; }
.ranking-main-table th, .ranking-main-table td { padding: 10px 12px; }
.ranking-main-table thead th:last-child { text-align: right; }
.ranking-main-row > td { height: 58px; vertical-align: middle; }
.ranking-main-row > td:first-child { white-space: nowrap; }
.ranking-main-row > td:first-child strong { margin-right: 7px; font-size: 14px; }
.ranking-main-table .cell-main, .ranking-main-table .cell-sub { display: block; }
.ranking-expand-button { width: 24px; height: 24px; margin: 0 6px 0 -4px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--ink-3); cursor: pointer; }
.ranking-expand-button span { display: inline-block; font-size: 20px; line-height: 20px; transform: rotate(0); transition: transform .16s ease; }
.ranking-expand-button[aria-expanded="true"] span { transform: rotate(90deg); }
.ranking-expand-button:hover, .ranking-expand-button:focus-visible { background: var(--blue-weak); color: var(--blue); outline: none; }
.ranking-row-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; white-space: nowrap; }
.ranking-expanded-row > td { height: auto; padding: 0 !important; background: #f8faff; }
.ranking-expanded-panel { padding: 12px 14px 14px 42px; }
.ranking-detail-table { width: 100%; table-layout: fixed; border-collapse: collapse; border: 1px solid #e4e8ef; background: #fff; }
.ranking-detail-table caption { text-align: left; }
.ranking-detail-table th, .ranking-detail-table td { min-width: 0; padding: 9px 10px; border-right: 1px solid #edf0f4; text-align: left; vertical-align: middle; font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.ranking-detail-table th:last-child, .ranking-detail-table td:last-child { border-right: 0; }
.ranking-detail-table thead th { height: 38px; padding-top: 0; padding-bottom: 0; background: #fafbfc; color: #626d80; font-weight: 600; }
.ranking-detail-table tbody tr { border-top: 1px solid #edf0f4; }
.ranking-detail-table tbody tr:hover td { background: #fbfcff; }
.ranking-detail-table tbody tr:hover .ranking-dimension-cell { background: #f8faff; }
.ranking-dimension-cell { background: #fbfcfe; color: var(--ink); font-weight: 600; vertical-align: top !important; }
.ranking-id-value { display: block; font-size: 13px; }
.ranking-number { color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ranking-expanded-table th:nth-child(1) { width: 14%; }
.ranking-expanded-table th:nth-child(2) { width: 9%; }
.ranking-expanded-table th:nth-child(3) { width: 11%; }
.ranking-expanded-table th:nth-child(4) { width: 20%; }
.ranking-expanded-table th:nth-child(5) { width: 11%; }
.ranking-expanded-table th:nth-child(6) { width: 12%; }
.ranking-expanded-table th:nth-child(7) { width: 23%; }
.success-text { color: var(--green) !important; }
.error-text { color: var(--red) !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.modal.ranking-rule-modal { width: min(980px, calc(100vw - 56px)); }
.modal.ranking-id-modal { width: min(700px, calc(100vw - 56px)); }
.ranking-basic-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(280px, 1fr); align-items: start; gap: 16px; }
.ranking-basic-grid .control { min-width: 0; }
.ranking-basic-grid .field-help { margin-top: 6px; line-height: 17px; }
.ranking-modal-section-head { min-height: 42px; margin-top: 16px; display: flex; align-items: center; }
.ranking-modal-section-head .btn { margin-left: auto; }
.ranking-modal-table { width: 100%; table-layout: fixed; border: 1px solid #dfe4ec; border-collapse: collapse; background: #fff; }
.ranking-modal-table th, .ranking-modal-table td { padding: 8px; border-right: 1px solid #edf0f4; border-bottom: 1px solid #edf0f4; text-align: left; vertical-align: top; font-size: 12px; }
.ranking-modal-table th:last-child, .ranking-modal-table td:last-child { border-right: 0; }
.ranking-modal-table thead th { height: 38px; padding-top: 0; padding-bottom: 0; background: #f5f6f8; color: #626d80; font-weight: 600; vertical-align: middle; }
.ranking-modal-table .control { width: 100%; min-width: 0; height: 32px; padding-left: 8px; padding-right: 8px; }
.ranking-rule-edit-table { min-width: 820px; }
.ranking-rule-edit-table .rule-col-dimension { width: 20%; }
.ranking-rule-edit-table .rule-col-weight { width: 10%; }
.ranking-rule-edit-table .rule-col-full { width: 12%; }
.ranking-rule-edit-table .rule-col-item { width: 24%; }
.ranking-rule-edit-table .rule-col-points { width: 11%; }
.ranking-rule-edit-table .rule-col-cap { width: 13%; }
.ranking-rule-edit-table .rule-col-action { width: 10%; }
.ranking-rule-group + .ranking-rule-group tr:first-child > * { border-top: 2px solid #dfe4ec; }
.ranking-rule-dimension-cell { background: #fbfcfe; }
.ranking-delete-dimension { display: block; margin-top: 7px; }
.ranking-add-item-row td { padding-top: 5px; padding-bottom: 5px; background: #fbfcfe; }
.suffix-control { position: relative; }
.suffix-control .control { min-width: 0; padding-right: 34px; }
.suffix-control span { position: absolute; right: 10px; top: 9px; color: var(--ink-3); font-size: 11px; pointer-events: none; }
.ranking-form-error { margin: 12px 0 0; padding: 9px 11px; border-radius: 4px; background: var(--red-weak); }
.ranking-id-table th:first-child { width: 52%; }
.ranking-id-table th:last-child { width: 48%; }
.ranking-id-input.error { border-color: var(--red); background: #fff8f7; }
.ranking-inline-result { margin-top: 5px; font-size: 12px; }
.ranking-inline-result.success { color: var(--green); }
.workbench-actions {
  position: sticky;
  top: 0;
  z-index: 35;
  min-height: 58px;
  margin-bottom: 14px;
  padding: 0 16px;
  border: 1px solid #cfd5df;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 6px 18px rgba(31, 35, 41, .08);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 14px;
}
.sticky-back {
  flex: 0 0 auto;
  height: 34px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 600;
  cursor: pointer;
}
.sticky-back:hover { color: var(--blue-deep); }
.sticky-divider { width: 1px; height: 24px; flex: 0 0 auto; background: var(--line-strong); }
.sticky-note { min-width: 0; margin-right: auto; overflow: hidden; color: var(--ink-3); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sticky-buttons { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }

.modal-layer { position: fixed; inset: 0; z-index: 200; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(24,29,37,.46); }
.modal {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(620px, calc(100vw - 80px));
  max-height: calc(100vh - 72px);
  transform: translate(-50%, -50%);
  border-radius: 7px;
  background: #fff;
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal.wide { width: min(820px, calc(100vw - 80px)); }
.modal-head { min-height: 58px; padding: 0 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-title { margin: 0; font-size: 17px; font-weight: 650; }
.modal-close { margin-left: auto; font-size: 20px; }
.modal-body { padding: 20px 22px 24px; overflow: auto; }
.modal-footer { min-height: 62px; padding: 0 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.modal-copy { color: var(--ink-2); line-height: 22px; }
.modal-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 15px; }
.check-card { padding: 12px; border: 1px solid var(--line); border-radius: 4px; background: #fafbfc; }
.check-title { margin-bottom: 8px; font-weight: 650; }
.check-item { margin-top: 5px; color: var(--ink-2); font-size: 12px; }
.check-item.ok { color: var(--green); }
.check-item.fail { color: var(--red); }

.toast-stack {
  position: fixed;
  top: 74px;
  left: 50%;
  z-index: 400;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  min-width: 240px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31,35,41,.14);
  color: var(--ink-2);
  animation: toast-in .16s ease-out;
}
.toast.success { border-color: #cfe7dc; color: var(--green); }
.toast.error { border-color: #efcdcd; color: var(--red); }
@keyframes toast-in { from { transform: translateY(-7px); opacity: 0; } to { transform: none; opacity: 1; } }

.demo-panel { position: fixed; right: 18px; bottom: 18px; z-index: 80; }
.demo-trigger {
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 18px;
  background: #26324d;
  color: #fff;
  box-shadow: 0 7px 20px rgba(30,40,62,.24);
  cursor: pointer;
}
.demo-card {
  width: 290px;
  margin-bottom: 9px;
  border-radius: 7px;
  border: 1px solid #d8dce5;
  background: #fff;
  box-shadow: 0 12px 32px rgba(31,35,41,.18);
  overflow: hidden;
}
.demo-head { min-height: 46px; padding: 0 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.demo-head strong { font-size: 14px; }
.demo-label { margin-left: 7px; color: var(--amber); font-size: 11px; }
.demo-head button { margin-left: auto; }
.demo-body { padding: 13px 14px; }
.demo-time { margin-bottom: 11px; padding: 8px 10px; border-radius: 4px; background: #f6f7f9; color: var(--ink-2); font-size: 12px; }
.demo-group { margin-top: 12px; }
.demo-group-title { margin-bottom: 7px; color: var(--ink-3); font-size: 12px; }
.demo-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.demo-buttons .btn { flex: 1 0 120px; }
.demo-select { width: 100%; min-width: 0; }

.readonly-cover { color: var(--ink-3); }
.muted { color: var(--ink-3); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }


@media (max-width: 1280px) {
  :root { --sidebar: 202px; }
  .page { padding-left: 20px; padding-right: 20px; }
  .summary-meta { grid-template-columns: 1fr 1.2fr .8fr .8fr; }
  .people-grid { grid-template-columns: 170px 1fr 1fr 104px 82px; }
  .workbench-actions { gap: 10px; padding: 0 12px; }
  .sticky-buttons { gap: 7px; }
  .sticky-buttons .btn { padding: 0 11px; }
  .ranking-detail-table th, .ranking-detail-table td { padding-left: 7px; padding-right: 7px; font-size: 11px; }
  .ranking-main-table th, .ranking-main-table td { padding-left: 9px; padding-right: 9px; }
  .ranking-row-actions { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
