:root {
  --bg: #f5f6f8;
  --panel: #ffffff;
  --border: #d9dee8;
  --border-soft: #e4e8ef;
  --text: #1f2530;
  --muted: #6b7280;
  --primary: #2468f2;
  --primary-soft: #eaf2ff;
  --success: #1e8750;
  --warning: #c07a1a;
  --danger: #d24b4b;
  --danger-soft: #fff0f0;
  --header: #f4f6fa;
  --hover: #f8fbff;
  --shadow: 0 10px 28px rgba(31, 42, 58, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  padding: 12px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
}

.app-shell.embedded-shell {
  grid-template-rows: minmax(0, 1fr);
}

.topbar,
.panel,
.statusbar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.topbar {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
}

.title-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.title-block h1 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
}

.title-block span,
.statusbar {
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.panel {
  min-width: 0;
  min-height: 0;
}

.panel-head {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--header);
}

.panel-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.data-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.data-panel[hidden] {
  display: none;
}

.embedded-shell:not(.survey-shell) {
  padding: 0 8px 0 0;
  background: #f3f6fb;
}

.embedded-shell:not(.survey-shell) .data-panel {
  overflow: hidden;
  border-color: #dbe3ee;
  border-radius: 6px;
  box-shadow: none;
}

.detail-mask {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(31, 42, 58, 0.28);
}

.detail-mask[hidden] {
  display: none;
}

.detail-page {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 31;
  width: min(1040px, calc(100vw - 36px));
  min-height: 0;
  display: grid;
  grid-template-rows: 42px 1fr;
  border-width: 0 0 0 1px;
  border-radius: 0;
  box-shadow: -8px 0 24px rgba(31, 42, 58, 0.12);
}

.detail-page[hidden] {
  display: none;
}

.detail-page.editing {
  grid-template-rows: 42px 1fr auto;
}

.detail-page.editing .detail-toolbar-left,
.detail-page.editing #detailPosition,
.detail-page.editing #prevDetailButton,
.detail-page.editing #nextDetailButton {
  display: none;
}

.detail-page.editing .detail-toolbar {
  justify-content: flex-end;
}

.detail-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border-soft);
  background: #ffffff;
}

.detail-toolbar-left,
.detail-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-toolbar-left {
  gap: 8px;
}

.detail-toolbar-right {
  color: var(--muted);
  font-size: 12px;
}

.detail-toolbar-right #detailPosition {
  min-width: 44px;
  padding: 0 6px;
  color: #536176;
  font-weight: 600;
  text-align: center;
}

.detail-toolbar-right .icon-button {
  width: 30px;
  min-height: 30px;
  border-color: #dbe3ee;
  border-radius: 4px;
  background: #ffffff;
}

.detail-toolbar .icon-button {
  width: 32px;
  min-height: 30px;
  border-color: transparent;
  background: transparent;
  color: #435066;
}

.detail-toolbar .detail-toolbar-right .icon-button {
  width: 30px;
  min-height: 30px;
  border-color: #dbe3ee;
  border-radius: 4px;
  background: #ffffff;
}

.detail-close-button,
.detail-action-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbe3ee;
  border-radius: 4px;
  background: #ffffff;
  color: #344154;
  font-size: 13px;
}

.detail-close-button {
  width: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-action-button {
  padding: 0 10px;
  gap: 5px;
}

.detail-action-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-edit-action {
  font-weight: 600;
}

.detail-close-button:hover,
.detail-action-button:hover:not(:disabled),
.detail-toolbar .icon-button:hover:not(:disabled) {
  border-color: transparent;
  color: var(--primary);
  background: #edf4ff;
}

.detail-toolbar .detail-toolbar-right .icon-button:hover:not(:disabled) {
  border-color: #b9d4ff;
}

.detail-action-button:hover:not(:disabled) {
  border-color: #cbd6e5;
}

.detail-toolbar .icon-button:disabled {
  border-color: transparent;
  background: transparent;
}

.detail-toolbar .detail-toolbar-right .icon-button:disabled {
  color: #b8c1ce;
  border-color: #edf1f6;
  background: #f8fafc;
}

.detail-action-button.danger-icon {
  color: #344154;
  border-color: #dbe3ee;
  background: #ffffff;
}

.detail-action-button.danger-icon:hover:not(:disabled),
.detail-toolbar .icon-button.danger-icon:hover:not(:disabled) {
  color: var(--primary);
  background: #edf4ff;
}

.detail-toolbar .detail-cancel-edit {
  font-size: 22px;
  line-height: 1;
  color: var(--primary);
  background: var(--primary-soft);
}

.detail-body {
  min-height: 0;
  padding: 16px;
  overflow: auto;
}

.detail-field span {
  color: var(--muted);
  font-size: 13px;
}

.detail-grid {
  max-width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px 16px;
  align-items: start;
}

.detail-field {
  min-width: 0;
  display: grid;
  gap: 6px;
  align-content: start;
}

.detail-value {
  min-height: 34px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  color: var(--text);
  background: #f3f6fa;
  border: 1px solid #eef2f7;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-field.wide {
  grid-column: span 2;
}

.detail-meta {
  margin-top: 18px;
  padding-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 16px 72px;
  border-top: 1px solid var(--border-soft);
}

.detail-meta-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-width: 0;
  font-size: 13px;
}

.detail-meta-item span {
  color: var(--muted);
}

.detail-meta-item strong {
  min-width: 0;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-meta-item:first-child strong {
  color: var(--primary);
}

.qr-detail-field .detail-value {
  width: fit-content;
  min-width: 220px;
  min-height: 132px;
  padding: 6px;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  overflow: visible;
  white-space: normal;
}

.qr-preview {
  width: 120px;
  min-height: 120px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.qr-status-side {
  min-width: 72px;
  display: grid;
  gap: 8px;
  align-content: center;
}

.qr-status-side span {
  color: var(--muted);
  font-size: 12px;
}

.qr-status-side strong {
  font-weight: 500;
}

.detail-page.editing .detail-value {
  min-height: 32px;
  padding: 0;
  background: transparent;
  border: 0;
}

.detail-page.editing .qr-detail-field .detail-value {
  width: fit-content;
  min-width: 220px;
  min-height: 132px;
  padding: 6px;
  background: #f3f6fa;
  border: 1px solid #eef2f7;
}

.detail-input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
}

.detail-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 121, 234, 0.12);
}

.detail-input:disabled {
  color: #8a96a8;
  background: #f1f4f8;
}

.activity-date-field {
  position: relative;
  width: 100%;
}

.activity-date-field::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 10px;
  width: 16px;
  height: 16px;
  pointer-events: none;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23344554' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Z'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

.activity-date-input {
  color-scheme: light;
  position: relative;
  padding-right: 34px;
  cursor: pointer;
  background: #ffffff;
  -webkit-text-fill-color: var(--text);
  caret-color: transparent;
  user-select: none;
}

.activity-date-field .activity-date-input {
  width: 100%;
}

.activity-date-input::placeholder {
  -webkit-text-fill-color: var(--muted);
}

.activity-date-picker-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(31, 42, 58, 0.28);
}

.activity-date-picker-mask.is-contained {
  position: absolute;
}

.activity-date-picker-mask[hidden] {
  display: none;
}

.activity-date-picker {
  width: min(356px, 100%);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.activity-date-picker-head {
  min-height: 46px;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
}

.activity-date-picker-head strong {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}

.activity-date-picker-head button,
.activity-date-picker-shortcuts button {
  height: 34px;
  color: var(--primary);
  background: transparent;
  border: 0;
}

.activity-date-picker-head button:first-child {
  color: var(--muted);
  text-align: left;
}

.activity-date-picker-head button:last-child {
  text-align: right;
  font-weight: 600;
}

.activity-date-calendar {
  position: relative;
  padding: 10px 14px 12px;
}

.activity-date-calendar-nav {
  display: grid;
  grid-template-columns: 32px 32px minmax(0, 1fr) 32px 32px;
  align-items: center;
  gap: 6px;
  min-height: 40px;
}

.activity-date-calendar-nav button {
  width: 32px;
  height: 32px;
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: #ffffff;
}

.activity-date-calendar-nav button:hover {
  color: var(--primary);
  border-color: #bcd2ff;
  background: #f3f7ff;
}

.activity-date-calendar-nav .activity-date-calendar-title {
  width: 100%;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: var(--text);
  border-color: transparent;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.activity-date-calendar-nav .activity-date-calendar-title::after {
  content: "";
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-top: 5px solid var(--muted);
}

.activity-date-calendar-nav .activity-date-calendar-title:hover {
  color: var(--primary);
  border-color: #bcd2ff;
  background: #f3f7ff;
}

.activity-date-calendar-nav span {
  text-align: center;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.activity-date-month-year-panel {
  position: absolute;
  top: 48px;
  left: 50%;
  z-index: 2;
  width: min(224px, calc(100% - 72px));
  max-height: 190px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(31, 42, 58, 0.12);
  transform: translateX(-50%);
}

.activity-date-year-options,
.activity-date-month-options {
  max-height: 188px;
  overflow-y: auto;
  padding: 5px;
}

.activity-date-year-options {
  border-right: 1px solid var(--border-soft);
}

.activity-date-year-option,
.activity-date-month-option {
  position: relative;
  width: 100%;
  height: 30px;
  padding: 0 22px 0 9px;
  color: var(--text);
  border: 0;
  border-radius: 4px;
  background: transparent;
  font-size: 13px;
  text-align: left;
}

.activity-date-year-option:hover,
.activity-date-month-option:hover {
  color: var(--primary);
  background: #f3f7ff;
}

.activity-date-year-option.is-selected,
.activity-date-month-option.is-selected {
  color: var(--primary);
  background: #eef4ff;
  font-weight: 600;
}

.activity-date-year-option.is-selected::after,
.activity-date-month-option.is-selected::after {
  content: "✓";
  position: absolute;
  top: 50%;
  right: 9px;
  transform: translateY(-50%);
}

.activity-date-weekdays,
.activity-date-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.activity-date-weekdays {
  padding: 6px 0 4px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.activity-date-calendar-grid {
  gap: 2px 0;
  min-height: calc(34px * 6 + 2px * 5);
}

.activity-date-day,
.activity-date-day-placeholder {
  height: 34px;
  min-width: 0;
}

.activity-date-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  width: 34px;
  color: var(--text);
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 14px;
}

.activity-date-day:hover {
  background: #f3f7ff;
}

.activity-date-day.is-today {
  color: var(--primary);
  background: #eef4ff;
}

.activity-date-day.is-selected {
  color: #ffffff;
  background: var(--primary);
  font-weight: 600;
}

.activity-date-day.is-selected:hover {
  background: var(--primary-hover);
}

.activity-date-picker-shortcuts {
  padding: 0 14px 14px;
  display: flex;
  justify-content: flex-end;
}

.activity-date-picker-shortcuts button {
  min-width: 72px;
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  background: #f8fafc;
}

.detail-qr-img {
  width: 118px;
  height: 118px;
  display: block;
}

.detail-edit-footer {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px dashed var(--border);
  background: #ffffff;
}

.detail-edit-footer[hidden] {
  display: none;
}

.toolbar {
  position: relative;
  min-height: 50px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-soft);
  background: #ffffff;
}

.data-panel .toolbar {
  min-height: 56px;
  padding: 10px 14px;
  border-bottom-color: #edf1f6;
  background: #ffffff;
}

.toolbar-left,
.toolbar-right,
.pager-left,
.pager-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-left {
  flex: 0 0 auto;
}

.toolbar-right {
  margin-left: auto;
}

.toolbar-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 10px;
  z-index: 12;
  color: var(--text);
  background: #ffffff;
  border: 1px solid #e6e9f0;
  border-radius: 4px;
  box-shadow: var(--shadow);
}

.filter-popover {
  width: min(390px, calc(100vw - 24px));
  padding: 16px;
}

.sort-popover {
  width: min(490px, calc(100vw - 44px));
  padding: 16px 20px;
  border-color: var(--primary);
}

.toolbar-popover h3,
.sort-title {
  margin: 0 0 18px;
  font-size: 14px;
  font-weight: 600;
}

.condition-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin-bottom: 16px;
}

.condition-copy select,
.filter-fields select,
.filter-fields input,
.sort-rule select {
  height: 32px;
  padding: 0 10px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
}

.condition-copy select {
  width: 78px;
}

.filter-builder {
  position: relative;
  min-height: 30px;
  margin-bottom: 10px;
}

.filter-add-button {
  min-height: 30px;
  padding: 0;
  color: var(--primary);
  border: 0;
  background: transparent;
  font-size: 13px;
}

.filter-add-button:hover {
  color: #1f5cc8;
}

.filter-field-picker {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 14;
  width: 230px;
  overflow: hidden;
  border: 1px solid #e4e9f2;
  border-radius: 5px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(31, 42, 58, 0.16);
}

.filter-field-search {
  height: 34px;
  padding: 0 9px;
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  border-bottom: 1px solid #edf1f6;
}

.filter-field-search svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.filter-field-search input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0;
  border: 0;
  outline: none;
}

.filter-field-list {
  max-height: 220px;
  overflow: auto;
}

.filter-field-option {
  width: 100%;
  min-height: 34px;
  padding: 0 12px;
  display: block;
  color: #253044;
  text-align: left;
  border: 0;
  background: #ffffff;
}

.filter-field-option:hover {
  color: var(--primary);
  background: #edf4ff;
}

.filter-field-empty,
.filter-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
}

.filter-conditions {
  display: grid;
  gap: 8px;
}

.filter-rule {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 8px;
}

.filter-rule select,
.filter-rule input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 9px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
}

.filter-rule select:focus,
.filter-rule input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(36, 104, 242, 0.12);
}

.filter-remove-button {
  width: 30px;
  height: 30px;
  color: #6f7d93;
  border: 1px solid #dbe3ee;
  border-radius: 4px;
  background: #ffffff;
  font-size: 18px;
  line-height: 1;
}

.filter-remove-button:hover {
  color: var(--danger);
  border-color: #f1c7c7;
  background: var(--danger-soft);
}

.filter-fields {
  display: grid;
  gap: 12px;
}

.filter-fields label {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.filter-fields select,
.filter-fields input {
  width: 100%;
}

.popover-actions {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sort-rule {
  padding: 10px 0;
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 166px 32px;
  align-items: center;
  gap: 14px;
}

.sort-rule select {
  width: 100%;
}

.sort-direction {
  height: 32px;
  padding: 2px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  background: #f0f2f7;
  border-radius: 4px;
}

.sort-direction button {
  border: 0;
  border-radius: 3px;
  color: #445064;
  background: transparent;
}

.sort-direction button.active {
  color: var(--primary);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(31, 42, 58, 0.18);
}

.text-button {
  border-color: transparent;
  background: transparent;
}

.button,
.icon-button,
.link-button {
  min-height: 32px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  text-decoration: none;
}

.button {
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.button.primary {
  color: #ffffff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(36, 104, 242, 0.18);
}

.button.ghost {
  color: #3a4658;
  border-color: #e3e8f1;
  background: #ffffff;
}

.button svg,
.tool-icon-button svg,
.search-box svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f1c7c7;
}

.button.compact {
  min-height: 28px;
  padding: 0 9px;
}

.button:disabled,
.icon-button:disabled {
  color: #a6b0c0;
  cursor: not-allowed;
  background: #f3f6fa;
}

.button:hover:not(:disabled),
.icon-button:hover:not(:disabled),
.link-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.button.primary:hover:not(:disabled) {
  color: #ffffff;
  background: #216bd6;
}

.icon-button {
  width: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

.icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button.danger-icon {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f1c7c7;
}

.tool-icon-button {
  color: #253044;
  border-color: transparent;
  background: transparent;
}

.tool-icon-button:hover:not(:disabled),
.tool-icon-button.active {
  color: var(--primary);
  border-color: transparent;
  background: var(--primary-soft);
}

.link-button {
  min-width: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.control,
.form-field input:not([type="radio"]):not([type="checkbox"]),
.form-field select,
.form-field textarea {
  height: 32px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
}

.control {
  padding: 0 9px;
}

.search-box {
  width: 232px;
  height: 32px;
  padding: 0 9px;
  display: grid;
  grid-template-columns: 18px 1fr 14px;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.data-panel .search-box {
  width: 282px;
  border-color: #e4e9f2;
  background: #ffffff;
}

.search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(36, 104, 242, 0.12);
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
}

.search-box input::placeholder {
  color: #9aa3b2;
}

.search-control {
  width: 240px;
}

.compact-select {
  width: 92px;
  height: 28px;
  font-size: 12px;
}

.control:focus,
.form-field input:not([type="radio"]):not([type="checkbox"]):focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 121, 234, 0.12);
}

.table-wrap {
  position: relative;
  min-height: 0;
  padding: 0 10px;
  overflow: auto;
  background: #ffffff;
}

.data-panel .table-wrap {
  padding: 0 12px;
  background: #ffffff;
}

.data-table {
  width: 100%;
  min-width: 1160px;
  border-collapse: separate;
  border-spacing: 0;
}

.data-panel .data-table {
  min-width: 1360px;
}

.data-table th,
.data-table td {
  height: 34px;
  padding: 0 10px;
  border-right: 1px solid #dde2eb;
  border-bottom: 1px solid #dde2eb;
  color: #243044;
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  text-align: left;
}

.data-panel .data-table th,
.data-panel .data-table td {
  height: 40px;
  padding: 0 12px;
  border-right: 0;
  border-bottom-color: #e8eef6;
  color: #263246;
  font-size: 13px;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 36px;
  color: #1f2530;
  background: var(--header);
  font-weight: 500;
}

.data-panel .data-table th {
  height: 40px;
  color: #536176;
  background: #f8fafc;
  font-size: 12.5px;
  font-weight: 600;
}

.data-panel .data-table td {
  font-weight: 400;
}

.data-table tr:hover td {
  background: var(--hover);
}

.data-panel .data-table tr:hover td {
  background: #f7fbff;
}

.data-table tr.selected td {
  background: var(--primary-soft);
}

.data-panel .data-table tr.selected td {
  background: #edf4ff;
}

.data-panel .data-table tr.selected td:first-child {
  box-shadow: inset 3px 0 0 var(--primary);
}

.check-col {
  width: 42px;
  text-align: center;
}

.action-col {
  width: 84px;
  text-align: center;
}

.data-panel .data-table th.action-col {
  color: #43536a;
  background: #eef3fa;
  border-left: 1px solid #d8e2ef;
}

.data-panel .data-table td.action-col {
  background: #f8fbff;
  border-left: 1px solid #e0e7f1;
}

.data-panel .data-table tr:hover td.action-col {
  background: #f2f7ff;
}

.data-panel .data-table tr.selected td.action-col {
  background: #e7f1ff;
}

.table-action-button {
  height: 28px;
  min-width: 0;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  color: var(--primary);
  background: transparent;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 28px;
  white-space: nowrap;
}

.table-action-button svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.table-action-button.enable {
  color: var(--primary);
  background: transparent;
}

.table-action-button.disable {
  color: var(--danger);
  background: transparent;
}

.table-action-button:hover:not(:disabled) {
  color: var(--primary);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.table-action-button.enable:hover:not(:disabled) {
  color: #175ed6;
  background: transparent;
}

.table-action-button.disable:hover:not(:disabled) {
  color: #b93636;
  background: transparent;
}

.table-action-button:disabled {
  color: #a9b4c4;
  background: transparent;
  cursor: not-allowed;
}

.data-table input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  vertical-align: middle;
  accent-color: var(--primary);
}

.number-col {
  text-align: right;
}

.qr-cell {
  width: 96px;
  min-width: 96px;
  text-align: center;
}

.direction-preset-col {
  width: 118px;
  min-width: 118px;
}

.table-muted {
  color: #8a96a8;
}

.qr-thumb {
  width: 28px;
  height: 28px;
  display: inline-block;
  vertical-align: middle;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: #ffffff;
  padding: 2px;
}

.link-text {
  color: var(--primary);
}

.empty-state {
  position: absolute;
  inset: 42px 0 0;
  display: grid;
  place-items: center;
  color: #52627a;
  font-size: 13px;
  background: #ffffff;
}

.empty-state[hidden] {
  display: none;
}

.pager {
  min-height: 44px;
  padding: 7px 10px 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-soft);
  background: #ffffff;
  color: var(--muted);
  font-size: 12px;
}

.pager-left {
  min-width: 0;
  gap: 10px;
}

.page-size-select {
  width: 96px;
  height: 30px;
  background-color: #ffffff;
}

.page-jump {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #536176;
}

.page-jump input {
  width: 42px;
  height: 30px;
  padding: 0 6px;
  text-align: center;
}

.page-jump input::-webkit-outer-spin-button,
.page-jump input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.pager-button {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #536176;
  border: 1px solid #dbe3ee;
  border-radius: 4px;
  background: #ffffff;
  font-size: 18px;
  line-height: 1;
}

.pager-button:hover:not(:disabled) {
  color: var(--primary);
  border-color: #b9d4ff;
  background: #edf4ff;
}

.pager-button:disabled {
  color: #b8c1ce;
  cursor: not-allowed;
  background: #f8fafc;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: #f7f9fc;
}

.tag.info {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: #cfe0fb;
}

.tag.success {
  color: var(--success);
  background: #edf8f1;
  border-color: #c8e5d2;
}

.tag.warning {
  color: var(--warning);
  background: #fff7e8;
  border-color: #efd8ae;
}

.tag.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f1c7c7;
}

.tag.muted {
  color: var(--muted);
}

.form-field textarea {
  width: 100%;
  min-height: 76px;
  padding: 7px 8px;
  resize: vertical;
  line-height: 1.5;
}

.statusbar {
  height: 28px;
  display: flex;
  align-items: center;
  padding: 0 10px;
}

.status-text {
  color: var(--muted);
  font-size: 12px;
}

.status-text.success {
  color: var(--success);
}

.status-text.warning,
.status-text.error {
  color: var(--danger);
  font-weight: 600;
}

.danger-text {
  color: var(--danger);
  font-weight: 600;
}

.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(31, 42, 58, 0.18);
}

.editor-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  width: min(980px, calc(100vw - 28px));
  display: grid;
  grid-template-rows: 45px 1fr 48px;
  background: #ffffff;
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.16s ease;
}

.editor-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
}

.drawer-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.form-grid {
  align-content: start;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 16px 18px;
  padding: 18px;
  overflow: auto;
}

.form-field {
  min-width: 0;
}

.form-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.form-field.required > label::before {
  content: "*";
  margin-right: 2px;
  color: var(--danger);
}

.form-field input:not([type="radio"]):not([type="checkbox"]),
.form-field select,
.form-field textarea {
  width: 100%;
  min-width: 0;
  padding: 0 10px;
}

.form-field select {
  overflow: hidden;
  padding-right: 28px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-field input.activity-date-input:not([type="radio"]):not([type="checkbox"]) {
  padding-right: 34px;
}

.form-field .field-hint {
  min-height: 16px;
  margin-top: 5px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.35;
}

.form-field .field-hint:empty {
  display: none;
}

.form-field input.is-soft-invalid:not([type="radio"]):not([type="checkbox"]) {
  border-color: var(--danger);
  background: #fffafa;
}

.form-field input.is-soft-invalid:not([type="radio"]):not([type="checkbox"]):focus {
  box-shadow: 0 0 0 3px rgba(210, 75, 75, 0.12);
}

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

.select-picker {
  position: relative;
  width: 100%;
}

.select-trigger {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 28px 0 10px;
  overflow: hidden;
  color: var(--text);
  line-height: 30px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
}

.select-trigger::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 7px;
  height: 7px;
  color: #7a8798;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  pointer-events: none;
  transform: translateY(-65%) rotate(45deg);
}

.select-trigger.placeholder {
  color: #8a96a8;
}

.select-trigger:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 121, 234, 0.12);
}

.select-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 25;
  padding: 6px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.select-menu[hidden] {
  display: none;
}

.select-search {
  width: 100%;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  outline: none;
}

.select-options {
  max-height: 220px;
  margin-top: 5px;
  overflow: auto;
}

.select-option {
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  display: block;
  color: var(--text);
  text-align: left;
  border: 0;
  border-radius: 3px;
  background: #ffffff;
}

.select-option:hover,
.select-option.selected {
  color: var(--primary);
  background: var(--primary-soft);
}

.select-empty {
  padding: 10px 8px;
  color: var(--muted);
  font-size: 12px;
}

.survey-select-picker .select-trigger {
  font-size: 13px;
}

.survey-select-picker .select-menu {
  font-size: 13px;
  box-shadow: 0 8px 18px rgba(31, 42, 58, 0.12);
}

.survey-select-picker .select-menu.is-floating {
  position: fixed;
  z-index: 80;
}

.survey-select-picker .select-options {
  max-height: 230px;
  margin-top: 0;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.survey-select-picker .select-option {
  min-height: 34px;
  padding: 6px 8px;
  color: #1f2530;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  background: #ffffff;
  white-space: normal;
}

.survey-select-picker .select-option:hover,
.survey-select-picker .select-option.selected {
  color: #1f2530;
  background: #edf4ff;
}

.address-cascader {
  position: relative;
  width: 100%;
}

.address-cascader > input[readonly] {
  color: var(--text);
  cursor: pointer;
  background: #ffffff;
}

.address-cascader-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 82;
  width: min(520px, 100vw - 24px);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(31, 42, 58, 0.14);
}

.survey-form .address-cascader-panel {
  position: static;
  width: 100%;
  margin-top: 6px;
  max-height: none;
}

.address-cascader-panel[hidden] {
  display: none;
}

.address-cascader-search {
  position: relative;
  height: 40px;
  border-bottom: 1px solid var(--border-soft);
}

.address-cascader-search span::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 12px;
  width: 14px;
  height: 14px;
  border: 2px solid #8a96a8;
  border-radius: 50%;
}

.address-cascader-search span::after {
  content: "";
  position: absolute;
  top: 25px;
  left: 24px;
  width: 7px;
  height: 2px;
  background: #8a96a8;
  transform: rotate(45deg);
  transform-origin: left center;
}

.address-cascader-search input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 38px;
  border: 0;
  outline: none;
  font-size: 13px;
}

.address-cascader-columns {
  display: grid;
  grid-template-columns: minmax(150px, 42%) minmax(160px, 58%);
  height: min(310px, 48vh);
  max-height: min(310px, 48vh);
}

.address-cascader-list {
  min-height: 0;
  overflow: auto;
  border-right: 1px solid var(--border-soft);
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.address-cascader-list + .address-cascader-list {
  border-right: 0;
}

.address-cascader-option {
  position: relative;
  width: 100%;
  min-height: 36px;
  padding: 0 30px 0 10px;
  display: flex;
  align-items: center;
  color: #344154;
  text-align: left;
  background: #ffffff;
  border: 0;
}

.address-cascader-option::after {
  content: "›";
  position: absolute;
  right: 10px;
  color: #8a96a8;
  font-size: 18px;
  line-height: 1;
}

.address-cascader-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.address-cascader-option:hover,
.address-cascader-option.active {
  color: #ffffff;
  background: var(--primary);
}

.address-cascader-option:hover::after,
.address-cascader-option.active::after {
  color: #ffffff;
}

.address-cascader-empty {
  padding: 12px 10px;
  color: var(--muted);
  font-size: 13px;
}

.direction-preset-field {
  grid-column: 1 / -1;
}

.form-field.questionnaire-field-rules-field {
  grid-column: 1 / -1;
}

.form-field.application-form-field {
  grid-column: 1 / -1;
}

.questionnaire-field-rules {
  min-height: 64px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid #dfe5ef;
  border-radius: 6px;
  background: #fbfcff;
}

.questionnaire-field-rule {
  min-width: 0;
  min-height: 68px;
  padding: 10px 12px;
  margin-bottom: 0;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  align-content: center;
  gap: 10px;
  color: #2d3748;
  font-size: 13px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #edf1f6;
  border-radius: 6px;
}

.form-field .questionnaire-field-rule {
  margin-bottom: 0;
  display: grid;
}

.experience-day-visibility-rules,
.detail-experience-day-visibility-rules {
  display: contents;
}

.application-form-panel {
  min-height: 64px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
  border: 1px solid #dfe5ef;
  border-radius: 6px;
  background: #fbfcff;
}

.application-form-rule {
  min-width: 0;
  min-height: 68px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  align-content: center;
  gap: 10px;
  color: #2d3748;
  font-size: 13px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid #edf1f6;
  border-radius: 6px;
}

.application-form-rule > span {
  color: #536176;
}

.application-form-segment {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.application-form-segment button {
  height: 28px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #536176;
  font-size: 12px;
  line-height: 1;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.application-form-segment button:hover {
  color: var(--primary);
}

.application-form-segment button.active {
  color: #253044;
  font-weight: 600;
}

.application-form-pill {
  min-width: 32px;
  height: 24px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #667386;
  font-size: 12px;
  border-radius: 999px;
  background: #f2f5f9;
}

.application-form-segment button[data-application-form-value="否"] .application-form-pill {
  color: #7b6a23;
  background: #fff5ca;
}

.application-form-segment button[data-application-form-value="是"] .application-form-pill {
  color: #2768c7;
  background: #eaf3ff;
}

.application-form-segment button.active[data-application-form-value="否"] .application-form-pill {
  color: #ffffff;
  background: #f4bd00;
}

.application-form-segment button.active[data-application-form-value="是"] .application-form-pill {
  color: #ffffff;
  background: var(--primary);
}

.application-form-upload {
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0, 320px);
  align-items: center;
  align-content: center;
  gap: 12px;
  color: #667386;
  background: #ffffff;
  border: 1px solid #edf1f6;
  border-radius: 6px;
}

.application-form-upload[hidden] {
  display: none;
}

.application-form-upload input[type="file"] {
  width: 100%;
  max-width: 320px;
  height: 32px;
  min-width: 0;
  color: #344154;
  font-size: 13px;
  line-height: 32px;
}

.application-form-attachments {
  min-height: 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.application-form-attachments a,
.application-form-attachments span {
  max-width: 100%;
  padding: 4px 8px;
  overflow: hidden;
  color: var(--primary);
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #bcd2ff;
  border-radius: 4px;
  background: #f3f7ff;
}

.application-form-current-list {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 6px;
}

.application-form-current-card {
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  padding: 5px 10px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  overflow: hidden;
  color: #344154;
  text-decoration: none;
  border: 1px solid #dfe5ef;
  border-radius: 5px;
  background: #ffffff;
}

.application-form-current-card:hover {
  border-color: #bcd2ff;
  background: #f8fbff;
}

.application-form-file-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7a90;
}

.application-form-file-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.application-form-file-meta {
  min-width: 0;
  display: block;
  overflow: hidden;
}

.application-form-file-meta strong {
  display: block;
  overflow: hidden;
  color: #2d3748;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.questionnaire-field-rule span {
  color: #536176;
}

.questionnaire-field-rule select {
  height: 32px;
}

.field-status-segment {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.field-status-segment button {
  height: 28px;
  min-width: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #536176;
  font-size: 12px;
  line-height: 1;
  text-align: center;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.field-status-segment button:hover {
  color: var(--primary);
}

.field-status-segment button.active {
  color: #253044;
  font-weight: 600;
}

.field-status-segment button:focus-visible {
  outline: none;
}

.field-status-segment button:focus-visible .status-radio-dot {
  box-shadow: 0 0 0 3px rgba(44, 121, 234, 0.14);
}

.status-radio-dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #a8b3c2;
  border-radius: 50%;
  background: #ffffff;
}

.status-radio-dot::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
}

.field-status-segment button.active .status-radio-dot {
  border-color: var(--primary);
}

.field-status-segment button.active .status-radio-dot::after {
  background: var(--primary);
}

.application-form-segment button.active .status-radio-dot {
  border-color: var(--primary);
}

.application-form-segment button.active .status-radio-dot::after {
  background: var(--primary);
}

.status-radio-pill {
  min-width: 38px;
  height: 24px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #667386;
  font-size: 12px;
  border-radius: 999px;
  background: #f2f5f9;
}

.field-status-segment button[data-field-status-value="隐藏"] .status-radio-pill {
  color: #7b6a23;
  background: #fff5ca;
}

.field-status-segment button[data-field-status-value="显示（选填）"] .status-radio-pill {
  color: #2768c7;
  background: #eaf3ff;
}

.field-status-segment button[data-field-status-value="显示（必填）"] .status-radio-pill {
  color: #b7473c;
  background: #ffece8;
}

.field-status-segment button.active[data-field-status-value="隐藏"] .status-radio-pill {
  color: #ffffff;
  background: #f4bd00;
}

.field-status-segment button.active[data-field-status-value="显示（选填）"] .status-radio-pill {
  color: #ffffff;
  background: var(--primary);
}

.field-status-segment button.active[data-field-status-value="显示（必填）"] .status-radio-pill {
  color: #ffffff;
  background: #f06457;
}

.detail-field-status-segment {
  width: 100%;
}

.field-status-value {
  min-height: 34px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
}

.detail-field.detail-field-full {
  grid-column: 1 / -1;
}

.detail-page.editing .direction-detail-field {
  grid-column: 1 / -1;
}

.detail-inline-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.detail-page.editing .detail-inline-panel {
  min-height: 64px;
  padding: 10px 12px;
  align-items: stretch;
  border: 1px solid #dfe5ef;
  border-radius: 6px;
  background: #fbfcff;
}

.detail-page.editing .detail-inline-panel .detail-field {
  min-width: 0;
  min-height: 68px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  align-content: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #edf1f6;
  border-radius: 6px;
}

.detail-page.editing .detail-inline-panel .detail-field > span {
  margin-bottom: 0;
  color: #536176;
  font-weight: 600;
}

.detail-page.editing .detail-inline-panel .detail-value {
  width: 100%;
  min-height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.detail-page.editing .detail-inline-panel .application-form-upload {
  width: 100%;
  min-height: auto;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 8px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.detail-page.editing .detail-inline-panel .application-form-upload[hidden] {
  display: none;
}

.direction-preset-panel {
  min-height: 220px;
  overflow: hidden;
  border: 1px solid #dfe5ef;
  border-radius: 6px;
  background: #fbfcff;
}

.direction-preset-head,
.direction-preset-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.direction-preset-head {
  color: #5f6d80;
  font-size: 12px;
  border-bottom: 1px solid #edf1f6;
  background: #ffffff;
}

.direction-preset-actions {
  display: flex;
  gap: 6px;
}

.direction-preset-groups {
  max-height: 320px;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  overflow: auto;
}

.direction-preset-group {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e5eaf2;
  border-radius: 6px;
  background: #ffffff;
}

.direction-preset-group-head {
  min-height: 34px;
  padding: 0 8px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #2d3748;
  background: #f7f9fc;
  border-bottom: 1px solid #edf1f6;
}

.direction-preset-group-head > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.direction-preset-group-head strong {
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.direction-preset-group-head span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.direction-group-select {
  flex: 0 0 auto;
  align-self: stretch;
  min-height: 34px;
  width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #536176;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.form-field .direction-group-select {
  margin-bottom: 0;
  display: inline-flex;
}

.direction-group-select input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.direction-group-select .direction-preset-check {
  width: 15px;
  height: 15px;
  margin-top: 0;
  border-radius: 3px;
}

.direction-group-select input:checked + .direction-preset-check,
.direction-group-select input:indeterminate + .direction-preset-check {
  border-color: var(--primary);
  background: var(--primary);
}

.direction-group-select input:checked + .direction-preset-check::after,
.direction-group-select input:indeterminate + .direction-preset-check::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.direction-group-select input:indeterminate + .direction-preset-check::after {
  height: 0;
  border-left: 0;
  transform: none;
}

.direction-group-select:hover {
  color: var(--primary);
}

.direction-preset-options {
  display: grid;
}

.direction-preset-option {
  min-height: 36px;
  margin-bottom: 0;
  padding: 7px 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #253044;
  font-weight: 400;
  border-bottom: 1px solid #f0f3f7;
  cursor: pointer;
}

.form-field .direction-preset-option {
  margin-bottom: 0;
  display: flex;
  font-weight: 400;
}

.direction-preset-option:last-child {
  border-bottom: 0;
}

.direction-preset-option:hover {
  background: #f8fbff;
}

.direction-preset-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.direction-preset-check {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #aeb8c6;
  border-radius: 3px;
  background: #ffffff;
}

.direction-preset-option input:checked + .direction-preset-check {
  border-color: var(--primary);
  background: var(--primary);
}

.direction-preset-option input:checked + .direction-preset-check::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.direction-preset-option input:focus-visible + .direction-preset-check {
  box-shadow: 0 0 0 3px rgba(36, 104, 242, 0.16);
}

.direction-preset-option > span:last-child {
  min-width: 0;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.direction-preset-summary {
  align-items: flex-start;
  border-top: 1px solid #edf1f6;
  background: #ffffff;
}

.direction-preset-summary strong {
  flex: 0 0 auto;
  color: #2d3748;
  font-size: 13px;
}

.direction-preset-summary > div,
.direction-detail-value {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.direction-detail-value {
  min-height: 34px;
  align-items: flex-start;
  overflow: visible;
  white-space: normal;
}

.detail-page.editing .direction-detail-value {
  display: block;
}

.direction-detail-value .direction-preset-panel {
  width: 100%;
}

.detail-direction-preset-panel {
  min-height: 200px;
}

.detail-direction-preset-panel .direction-preset-groups {
  max-height: 260px;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.direction-preset-tag {
  min-height: 24px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  color: #1f5cc8;
  background: #eef5ff;
  border: 1px solid #d5e4ff;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.35;
}

.direction-preset-muted,
.direction-preset-empty {
  color: var(--muted);
  font-size: 12px;
}

.direction-preset-empty {
  min-height: 96px;
  display: grid;
  place-items: center;
  grid-column: 1 / -1;
  border: 1px dashed #d8dee9;
  border-radius: 6px;
  background: #ffffff;
}

.radio-pill-group {
  min-height: 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.radio-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.radio-pill input {
  width: 14px;
  height: 14px;
  margin: 0;
  padding: 0;
}

.radio-pill span {
  min-width: 34px;
  height: 26px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border-radius: 13px;
  background: #f4f6fa;
}

.radio-pill input:checked + span {
  color: #ffffff;
  background: var(--primary);
}

.radio-pill.female input:checked + span {
  background: #ee6a55;
}

.plain-radio-group {
  min-height: 32px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.plain-radio-group.inline-radio-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.plain-radio-group label {
  min-width: 0;
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
  line-height: 1.5;
  cursor: pointer;
}

.plain-radio-group input {
  width: 14px;
  height: 14px;
  margin: 3px 0 0;
  flex: 0 0 auto;
  accent-color: var(--primary);
}

.plain-radio-group span {
  min-width: 0;
  white-space: normal;
}

.direction-option-list {
  display: grid;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.experience-option-list {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.direction-option {
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
  cursor: pointer;
  border-bottom: 1px solid var(--border-soft);
}

.form-field .direction-option {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
}

.direction-option:last-child {
  border-bottom: 0;
}

.direction-option > span:last-child {
  min-width: 0;
}

.direction-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.direction-check {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid #aeb6c2;
  border-radius: 2px;
  background: #ffffff;
}

.direction-option input:checked + .direction-check {
  border-color: var(--primary);
  background: var(--primary);
}

.direction-option input:checked + .direction-check::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.direction-option input:focus-visible + .direction-check {
  box-shadow: 0 0 0 3px rgba(44, 121, 234, 0.16);
}

.survey-confirm-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  padding: 18px;
  display: grid;
  place-items: center;
  background: rgba(31, 42, 58, 0.42);
}

.survey-confirm-card {
  width: min(520px, 100%);
  padding: 20px;
  display: grid;
  gap: 16px;
  color: var(--text);
  background: #ffffff;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.survey-confirm-card h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.survey-confirm-content {
  display: grid;
  gap: 10px;
  color: #2a3342;
  font-size: 14px;
  line-height: 1.65;
}

.survey-confirm-content p {
  margin: 0;
}

.survey-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-field input:not([type="radio"]):not([type="checkbox"]):disabled,
.form-field input:not([type="radio"]):not([type="checkbox"])[readonly],
.form-field textarea[readonly] {
  color: #8a96a8;
  background: #f1f4f8;
}

.survey-form .form-field .address-cascader > input#originAddressInput[readonly] {
  color: var(--text);
  background: #ffffff;
}

.survey-form .form-field .address-cascader-search input#originAddressSearch:not([type="radio"]):not([type="checkbox"]) {
  padding: 0 12px 0 38px;
  border: 0;
  background: #ffffff;
}

.form-field.wide {
  grid-column: span 2;
}

.form-field.questionnaire-field-rules-field {
  grid-column: 1 / -1;
}

.form-field.application-form-field {
  grid-column: 1 / -1;
}

.form-field.direction-preset-field {
  grid-column: 1 / -1;
}

.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  background: #fbfcff;
}

.drawer-foot > div {
  display: flex;
  gap: 8px;
}

.survey-shell {
  max-width: 1360px;
  margin: 0 auto;
}

.survey-layout {
  min-height: 0;
}

.survey-panel {
  min-height: calc(100vh - 24px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.survey-form {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.survey-form .intention-field {
  align-content: start;
}

.survey-form .form-field.wide {
  grid-column: 1 / -1;
}

.survey-declaration {
  padding: 10px 12px;
  color: var(--text);
  line-height: 1.75;
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  background: #f8fafd;
}

.survey-download-link {
  min-height: 38px;
  width: fit-content;
  max-width: 100%;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  text-decoration: none;
  border: 1px solid #bcd2ff;
  border-radius: 5px;
  background: #f3f7ff;
}

.survey-download-link:hover {
  color: #1551d6;
  border-color: #8eb8ff;
  background: #edf4ff;
}

.survey-success-page {
  min-height: 100vh;
  padding: 24px;
  display: grid;
  place-items: center;
  background: #ffffff;
}

.survey-success-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  color: var(--text);
  text-align: center;
}

.survey-success-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--success);
  border-radius: 50%;
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.survey-success-card h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.survey-invalid-icon {
  background: var(--danger);
}

.survey-invalid-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.inline-foot {
  min-height: 48px;
}

.sms-shell {
  min-width: 0;
}

.sms-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(620px, 1fr) 380px;
  grid-template-rows: minmax(0, 1fr) minmax(180px, 240px);
  gap: 8px;
}

.sms-recipient-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.recipient-workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  background: #ffffff;
}

.recipient-workspace.lead-mode {
  grid-template-columns: minmax(0, 1fr);
}

.recipient-workspace.lead-mode .recipient-list-pane {
  grid-column: 1;
}

.activity-sms-sidebar {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  border-right: 1px solid var(--border-soft);
  background: #fbfcfe;
}

.activity-sms-head {
  min-height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
  color: var(--muted);
}

.activity-sms-head span {
  color: var(--text);
  font-weight: 600;
}

.activity-sms-head strong {
  color: var(--primary);
  font-size: 12px;
  font-weight: 500;
}

.activity-sms-list {
  min-height: 0;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
}

.activity-sms-item {
  width: 100%;
  min-height: 70px;
  padding: 9px 10px;
  display: grid;
  gap: 4px;
  color: var(--text);
  text-align: left;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
}

.activity-sms-item:hover,
.activity-sms-item.active {
  border-color: #cfe0fb;
  background: var(--primary-soft);
}

.activity-sms-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.activity-sms-meta,
.activity-sms-item > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.recipient-list-pane {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.recipient-list-head {
  min-height: 42px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border-soft);
}

.recipient-list-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.recipient-list-head strong,
.recipient-list-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recipient-list-head strong {
  font-weight: 600;
}

.recipient-list-head span {
  color: var(--muted);
  font-size: 12px;
}

.sms-composer-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.sms-log-panel {
  min-height: 0;
  grid-column: 1 / -1;
  display: grid;
  grid-template-rows: auto 1fr;
}

.segmented-control {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 2px;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #f7f9fc;
}

.segmented-control.full {
  width: 100%;
}

.segment-button {
  min-height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 3px;
  color: var(--muted);
  background: transparent;
}

.segment-button.active {
  color: #ffffff;
  background: var(--primary);
}

.sms-table {
  min-width: 980px;
}

.invalid-phone {
  color: var(--danger);
  background: var(--danger-soft);
}

.sms-composer-body {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  padding: 14px;
  overflow: auto;
}

.sms-composer-body > .form-field {
  width: 100%;
  display: block;
}

.sms-composer-body > .form-field[hidden] {
  display: none;
}

.sms-composer-body .segmented-control.full {
  width: max-content;
  max-width: 100%;
  flex-wrap: wrap;
}

.sms-composer-body .segment-button,
.template-row .button {
  min-width: 74px;
  white-space: nowrap;
  line-height: 1.2;
}

.field-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.template-row,
.variable-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.variable-row .tag {
  cursor: pointer;
}

.sms-preview {
  min-height: 92px;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  background: #f7f9fc;
}

.sms-preview-title {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.sms-preview p {
  margin: 0;
  color: var(--text);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.sms-log-list {
  min-height: 0;
  padding: 8px;
  display: grid;
  grid-auto-rows: min-content;
  gap: 8px;
  overflow: auto;
}

.sms-log-item {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  background: #ffffff;
}

.sms-log-main,
.sms-log-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sms-log-main strong {
  font-size: 13px;
}

.sms-log-main span:not(.tag),
.sms-log-meta {
  color: var(--muted);
  font-size: 12px;
}

.sms-log-item p {
  margin: 7px 0 0;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}

.sms-log-empty {
  min-height: 96px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.lead-panel {
  min-height: calc(100vh - 24px);
}

.lead-table {
  min-width: 1540px;
}

.lead-table th:nth-child(2),
.lead-table td:nth-child(2),
.lead-table th:nth-child(3),
.lead-table td:nth-child(3),
.lead-table th:nth-child(4),
.lead-table td:nth-child(4),
.lead-table th:nth-child(5),
.lead-table td:nth-child(5) {
  width: 110px;
}

.lead-table th:nth-child(6),
.lead-table td:nth-child(6),
.lead-table th:nth-child(7),
.lead-table td:nth-child(7),
.lead-table th:nth-child(12),
.lead-table td:nth-child(12),
.lead-table th:nth-child(13),
.lead-table td:nth-child(13),
.lead-table th:nth-child(14),
.lead-table td:nth-child(14) {
  width: 130px;
}

.lead-detail-page {
  width: min(1240px, calc(100vw - 36px));
}

.lead-detail-body {
  padding: 14px 16px 18px;
}

.lead-title-line {
  min-height: 78px;
  padding-bottom: 14px;
  display: grid;
  align-content: center;
  gap: 8px;
  border-bottom: 4px solid #eef2f7;
}

.lead-title-line span {
  color: var(--muted);
  font-size: 13px;
}

.lead-title-line strong {
  color: #1f2530;
  font-size: 15px;
  font-weight: 600;
}

.lead-detail-grid {
  padding-top: 16px;
}

.lead-detail-grid .detail-value {
  min-height: 34px;
}

.lead-editor-drawer {
  z-index: 41;
  width: min(1120px, calc(100vw - 28px));
}

#leadDrawerMask {
  z-index: 40;
}

.follow-drawer {
  z-index: 43;
  width: min(980px, calc(100vw - 28px));
}

#followDrawerMask {
  z-index: 42;
  background: rgba(31, 42, 58, 0.24);
}

.follow-section {
  margin-top: 22px;
  display: grid;
  gap: 8px;
}

.follow-section-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.follow-section-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.follow-table-wrap {
  position: relative;
  min-height: 96px;
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
}

.follow-table {
  min-width: 820px;
}

.follow-table th,
.follow-table td {
  height: 32px;
  font-size: 13px;
}

.wrap-cell {
  max-width: 420px;
  white-space: normal !important;
  word-break: break-word;
  line-height: 1.45;
}

.follow-empty {
  min-height: 60px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(31, 42, 58, 0.32);
}

.modal-card {
  width: min(420px, 100%);
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.modal-head {
  min-height: 44px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-soft);
}

.modal-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.modal-body {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.modal-actions {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--border-soft);
  background: #fbfcff;
}

.inline-notice-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(31, 42, 58, 0.28);
}

.inline-notice-mask.is-contained {
  position: absolute;
}

.inline-notice-card {
  width: min(340px, 100%);
  background: #ffffff;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  box-shadow: var(--shadow);
}

.inline-notice-body {
  padding: 22px 22px 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.inline-notice-actions {
  padding: 10px 14px 14px;
  display: flex;
  justify-content: flex-end;
}

.muted-line {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.ai-shell {
  padding: 8px;
}

.ai-layout {
  min-height: calc(100vh - 16px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 8px;
}

.ai-main-panel,
.ai-side-panel {
  min-height: 0;
  overflow: hidden;
}

.ai-main-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.ai-head,
.ai-side-head {
  min-height: 52px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.ai-head h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.ai-head span,
.ai-side-head span,
.ai-kpi-card span,
.ai-kpi-card em,
.ai-answer-note {
  color: var(--muted);
  font-size: 12px;
}

.ai-kpi-grid {
  padding: 10px 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 8px;
  border-bottom: 1px solid var(--border-soft);
}

.ai-kpi-card {
  min-height: 76px;
  padding: 10px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: #f8fbff;
}

.ai-kpi-card strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.ai-kpi-card em {
  font-style: normal;
}

.ai-chat-shell {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.ai-chat-stream {
  min-height: 0;
  padding: 14px 16px;
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  background: #ffffff;
}

.ai-message {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.ai-message.user {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.ai-message.user .ai-avatar {
  grid-column: 2;
}

.ai-message.user .ai-bubble {
  grid-column: 1;
  justify-self: end;
  background: var(--primary-soft);
  border-color: #cfe0ff;
}

.ai-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--primary);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.ai-message.user .ai-avatar {
  background: #6f7d93;
}

.ai-bubble {
  width: fit-content;
  max-width: min(820px, 100%);
  padding: 10px 12px;
  color: #243044;
  background: #f8fbff;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}

.ai-bubble p {
  margin: 0 0 8px;
  line-height: 1.65;
}

.ai-bubble p:last-child {
  margin-bottom: 0;
}

.ai-quick-list,
.ai-answer-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-quick-list button,
.ai-answer-suggestions button,
.ai-suggestion-block button {
  min-height: 28px;
  padding: 0 9px;
  color: #245ebf;
  background: #edf4ff;
  border: 1px solid #d5e4ff;
  border-radius: 4px;
}

.ai-answer-suggestions {
  margin-top: 10px;
}

.ai-answer-suggestions strong {
  width: 100%;
  font-size: 13px;
}

.ai-alert-list {
  margin: 10px 0;
  display: grid;
  gap: 6px;
}

.ai-alert-list span,
.ai-warning-item {
  padding: 8px 10px;
  color: #9a4b17;
  background: #fff7e8;
  border: 1px solid #f2d6a8;
  border-radius: 4px;
  font-size: 13px;
}

.ai-result-table {
  margin-top: 12px;
  max-width: 100%;
  overflow: auto;
}

.ai-result-table strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.ai-result-table table {
  min-width: 420px;
  border-collapse: collapse;
  background: #ffffff;
}

.ai-result-table th,
.ai-result-table td {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border-soft);
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
}

.ai-result-table th {
  background: var(--header);
  font-weight: 600;
}

.ai-input-bar {
  min-height: 58px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
  border-top: 1px solid var(--border-soft);
  background: #ffffff;
}

.ai-input-bar input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
}

.ai-input-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(36, 104, 242, 0.12);
}

.ai-side-panel {
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr) auto auto;
}

.ai-side-head strong,
.ai-suggestion-block strong {
  font-size: 14px;
  font-weight: 600;
}

.ai-warning-list {
  min-height: 0;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
}

.ai-empty-side {
  padding: 16px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 4px;
  background: #fbfcff;
}

.ai-suggestion-block {
  padding: 12px;
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--border-soft);
}

.ai-suggestion-block button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.ai-readonly-note {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  border-top: 1px solid var(--border-soft);
  background: #fbfcff;
}

.ai-error {
  color: var(--danger);
}

.permission-shell {
  padding: 8px;
}

.permission-layout {
  min-height: calc(100vh - 16px);
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 8px;
}

.permission-group-panel {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
}

.permission-side-head,
.permission-side-foot,
.permission-main-head,
.permission-section-head,
.permission-actions,
.permission-preview-actions {
  display: flex;
  align-items: center;
}

.permission-side-head {
  min-height: 48px;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
}

.permission-side-head strong,
.permission-section-head strong {
  font-size: 14px;
  font-weight: 600;
}

.permission-side-search {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-soft);
}

.permission-side-search input {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
}

.permission-side-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(36, 104, 242, 0.12);
}

.permission-group-list {
  min-height: 0;
  padding: 6px;
  overflow: auto;
}

.permission-group-item {
  width: 100%;
  min-height: 68px;
  margin-bottom: 4px;
  padding: 8px 10px;
  display: grid;
  gap: 2px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
}

.permission-group-item:hover,
.permission-group-item.active {
  border-color: #d9e7ff;
  background: var(--primary-soft);
}

.permission-group-item span {
  font-size: 13px;
  font-weight: 600;
}

.permission-group-item strong,
.permission-group-item em {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permission-group-item em.is-disabled {
  color: var(--danger);
}

.permission-list-empty {
  padding: 18px 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.permission-side-foot {
  min-height: 42px;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border-soft);
}

.permission-main-panel {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  overflow: hidden;
}

.permission-main-head {
  min-height: 54px;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
}

.permission-main-head h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.permission-main-head span,
.permission-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.permission-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.permission-basic-form {
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(190px, 240px) minmax(220px, 1fr) 160px;
  gap: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.permission-basic-form .form-field,
.permission-inline-form label,
.permission-field-toolbar label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.permission-basic-form .form-field > span,
.permission-inline-form label > span,
.permission-field-toolbar label > span {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.permission-basic-form .form-field.required > span::before {
  content: "*";
  margin-right: 2px;
  color: var(--danger);
}

.permission-basic-form input,
.permission-basic-form select,
.permission-inline-form select,
.permission-field-toolbar select {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  background: #fff;
}

.permission-basic-form input:focus,
.permission-basic-form select:focus,
.permission-inline-form select:focus,
.permission-field-toolbar select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(36, 104, 242, 0.12);
}

.permission-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px 0;
  border-bottom: 1px solid var(--border-soft);
}

.permission-tabs button {
  min-height: 34px;
  padding: 0 14px;
  color: #445064;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
}

.permission-tabs button.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.permission-content {
  min-height: 0;
  overflow: auto;
}

.permission-tab-panel {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.permission-section-head {
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
}

.permission-inline-form {
  padding: 12px;
  display: grid;
  grid-template-columns: 140px minmax(220px, 1fr) minmax(220px, 1fr) 120px auto;
  gap: 10px;
  align-items: end;
  border-bottom: 1px solid var(--border-soft);
}

.permission-table-wrap {
  position: relative;
  min-height: 0;
  padding: 0 12px 12px;
  overflow: auto;
  background: #fff;
}

.permission-table {
  min-width: 760px;
}

.permission-matrix-table {
  min-width: 1180px;
}

.permission-field-table {
  min-width: 820px;
}

.permission-table td,
.permission-matrix-table td,
.permission-field-table td {
  height: 42px;
  vertical-align: middle;
}

.permission-matrix-table td:first-child strong,
.permission-matrix-table td:first-child span {
  display: block;
}

.permission-matrix-table td:first-child span {
  color: var(--muted);
  font-size: 12px;
}

.permission-check-grid {
  min-width: 250px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.permission-check-grid label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #344154;
  font-size: 13px;
}

.permission-cell-select {
  width: 86px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

.permission-actions,
.permission-preview-actions {
  justify-content: flex-end;
  min-height: 48px;
  padding: 8px 12px;
  border-top: 1px solid var(--border-soft);
}

.permission-field-toolbar {
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(220px, 340px) auto;
  align-items: end;
  gap: 10px;
  border-bottom: 1px solid var(--border-soft);
}

.permission-preview {
  position: relative;
  min-height: 260px;
  padding: 12px;
}

.permission-preview .empty-state {
  position: static;
  min-height: 180px;
}

.permission-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
}

.permission-preview-grid > div,
.permission-preview-row {
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  background: #f8fbff;
}

.permission-preview-grid span,
.permission-preview-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.permission-preview-grid strong,
.permission-preview-row strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
}

.permission-preview-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.permission-preview-row {
  display: grid;
  grid-template-columns: 180px 1fr 160px;
  align-items: center;
  gap: 10px;
}

.permission-statusbar {
  min-height: 34px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--border-soft);
  background: #fff;
}

.permission-layout {
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 10px;
}

.permission-group-panel {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: #f8fafd;
}

.permission-side-head {
  min-height: auto;
  padding: 14px 16px 10px;
  align-items: flex-start;
}

.permission-side-head > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.permission-side-head strong {
  font-size: 18px;
  font-weight: 600;
}

.permission-side-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.permission-side-tabs {
  display: flex;
  gap: 18px;
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--border-soft);
}

.permission-side-tabs button {
  padding: 0;
  min-height: 26px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 600;
}

.permission-side-tabs button.active {
  color: var(--text);
}

.permission-side-search {
  padding: 10px 16px;
}

.permission-module-list {
  min-height: 0;
  padding: 10px 16px 14px;
  overflow: auto;
}

.permission-module-item {
  width: 100%;
  min-height: 38px;
  margin-bottom: 4px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #344154;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
}

.permission-module-item:hover,
.permission-module-item.active {
  color: var(--text);
  background: #edf1f6;
}

.permission-module-item span,
.permission-module-item em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permission-module-item span {
  font-size: 13px;
  font-weight: 600;
}

.permission-module-item em {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.permission-rule-list-card {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: #fff;
}

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

.permission-rule-list-head strong {
  font-size: 15px;
  font-weight: 600;
}

.permission-rule-list-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.permission-list-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.permission-list-actions input {
  width: 240px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
}

.permission-rule-list {
  display: grid;
  gap: 10px;
}

.permission-group-item {
  min-height: 0;
  margin-bottom: 0;
  padding: 14px 16px;
  gap: 12px;
  background: #fff;
  border-color: var(--border-soft);
  border-radius: 6px;
  cursor: pointer;
}

.permission-group-item:hover,
.permission-group-item.active {
  border-color: #9fc5ff;
  background: #fff;
  box-shadow: inset 3px 0 0 var(--primary);
}

.permission-group-title,
.permission-group-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.permission-group-title {
  justify-content: space-between;
}

.permission-group-title strong {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permission-card-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.permission-group-title em,
.permission-group-meta b {
  flex: none;
  padding: 3px 7px;
  border-radius: 4px;
  color: #46617f;
  background: #eef3f8;
  font-size: 12px;
  font-style: normal;
  font-weight: 500;
}

.permission-group-title em.is-disabled {
  color: var(--danger);
  background: var(--danger-soft);
}

.permission-group-item small {
  min-height: 18px;
  color: #2d3748;
  font-size: 12px;
  line-height: 1.5;
}

.permission-group-meta {
  flex-wrap: wrap;
}

.permission-summary-grid {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 10px 20px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
}

.permission-summary-grid span,
.permission-summary-grid strong {
  min-width: 0;
  font-size: 13px;
  line-height: 1.6;
}

.permission-summary-grid span {
  color: #52627a;
  font-weight: 400;
}

.permission-summary-grid strong {
  color: #263449;
  font-weight: 500;
  word-break: break-word;
}

.permission-main-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: #fff;
}

.permission-main-head {
  min-height: 56px;
  padding: 12px 18px;
}

.permission-main-head h1 {
  font-size: 18px;
}

.permission-editor-scroll {
  min-height: 0;
  padding: 14px 18px 18px;
  overflow: auto;
  background: #fff;
}

.permission-config-card {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: #fff;
}

.permission-config-card.permission-tab-panel {
  min-height: 0;
  display: block;
}

.permission-card-title,
.permission-rule-heading,
.permission-rule-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.permission-card-title {
  margin-bottom: 12px;
}

.permission-card-title strong,
.permission-rule-heading strong,
.permission-rule-section-title strong {
  font-size: 14px;
  font-weight: 600;
}

.permission-card-title span,
.permission-rule-heading span,
.permission-rule-section-title span {
  color: var(--muted);
  font-size: 12px;
}

.permission-basic-form {
  padding: 0;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px) 120px;
  border-bottom: 0;
}

.permission-inline-form {
  padding: 0;
  grid-template-columns: 130px minmax(180px, 1fr) minmax(180px, 1fr) 110px auto;
  border-bottom: 0;
}

.permission-member-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.permission-member-card {
  min-height: 42px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  background: #f9fbfe;
}

.permission-member-card strong,
.permission-member-card span {
  display: block;
}

.permission-member-card strong {
  font-size: 13px;
  font-weight: 600;
}

.permission-member-card > div > span {
  color: var(--muted);
  font-size: 12px;
}

.permission-module-toolbar,
.permission-field-toolbar {
  padding: 0;
  display: grid;
  grid-template-columns: minmax(240px, 360px) auto;
  align-items: end;
  gap: 10px;
  border-bottom: 0;
}

.permission-module-toolbar label,
.permission-field-toolbar label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.permission-module-toolbar label > span,
.permission-field-toolbar label > span {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.permission-module-toolbar select,
.permission-field-toolbar select {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  outline: none;
}

.permission-rule-stack {
  margin-top: 12px;
}

.permission-rule-card {
  display: grid;
  gap: 14px;
}

.permission-rule-heading {
  min-height: 38px;
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  background: #f8fbff;
}

.permission-rule-section {
  display: grid;
  gap: 10px;
}

.permission-check-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.permission-check-row > span {
  min-height: 28px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.permission-check-grid {
  min-width: 0;
  gap: 8px 16px;
}

.permission-check-grid label,
.permission-field-row label {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.permission-check-grid input,
.permission-field-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.permission-default-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 220px));
  gap: 10px;
}

.permission-default-grid label {
  display: grid;
  gap: 5px;
}

.permission-default-grid label > span {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.permission-field-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.permission-field-row {
  min-height: 46px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 86px 96px 92px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  background: #f9fbfe;
}

.permission-field-name {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.permission-field-name strong {
  font-size: 13px;
  font-weight: 600;
}

.permission-field-name code {
  color: var(--muted);
  font-size: 12px;
  background: transparent;
}

.permission-preview-actions {
  min-height: 0;
  padding: 0;
  justify-content: flex-start;
  border-top: 0;
}

.permission-preview {
  min-height: 180px;
  padding: 12px 0 0;
}

.permission-config-card > .empty-state {
  position: static;
  min-height: 72px;
  border: 1px dashed var(--border-soft);
  border-radius: 4px;
  background: #f9fbfe;
}

.permission-statusbar {
  background: #f8fafd;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

.status-pill.success {
  color: var(--success);
  background: #eaf8ef;
}

.status-pill.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.action-col {
  width: 84px;
}

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .ai-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(500px, 1fr) minmax(220px, auto);
  }

  .ai-kpi-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .permission-layout {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .permission-basic-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .permission-inline-form {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .sms-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(420px, 1fr) auto minmax(180px, 240px);
  }

  .sms-log-panel {
    grid-column: auto;
  }

  .recipient-workspace {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 8px;
  }

  .app-shell.survey-shell {
    min-height: 100vh;
    min-height: 100svh;
    padding: 0;
    background: #ffffff;
  }

  .survey-layout {
    background: #ffffff;
  }

  .survey-panel {
    min-height: 100vh;
    min-height: 100svh;
    display: block;
    border: 0;
    border-radius: 0;
  }

  .survey-form {
    gap: 14px;
    padding: 14px 8px 8px;
    overflow: visible;
  }

  .survey-form .form-field > label {
    margin-bottom: 6px;
    color: #161b23;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
  }

  .survey-form .form-field input:not([type="radio"]):not([type="checkbox"]),
  .survey-form .form-field select,
  .survey-form .form-field textarea {
    min-height: 40px;
    padding: 0 10px;
    border-color: #dde1e7;
    border-radius: 5px;
    color: #1f2530;
    font-size: 14px;
  }

  .survey-form .form-field input:not([type="radio"]):not([type="checkbox"]),
  .survey-form .form-field select {
    height: 40px;
  }

  .survey-form .form-field textarea {
    min-height: 84px;
    padding-top: 8px;
    line-height: 1.5;
  }

  .survey-form .form-field input:not([type="radio"]):not([type="checkbox"])::placeholder,
  .survey-form .form-field textarea::placeholder {
    color: #a9afb8;
  }

  .survey-form .survey-select-picker .select-trigger {
    height: 40px;
    padding: 0 28px 0 10px;
    border-color: #dde1e7;
    border-radius: 5px;
    font-size: 14px;
  }

  .survey-form .survey-select-picker .select-trigger::after {
    top: 50%;
  }

  .survey-form .survey-select-picker .select-menu {
    left: 8px;
    right: 8px;
    width: auto;
    font-size: 14px;
    border-radius: 5px;
    box-shadow: 0 10px 24px rgba(31, 42, 58, 0.18);
  }

  .survey-form .survey-select-picker .select-options {
    max-height: min(260px, 46vh);
  }

  .survey-form .survey-select-picker .select-option {
    min-height: 40px;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.45;
  }

  .survey-form .address-cascader-panel {
    width: 100%;
    font-size: 14px;
  }

  .survey-form .address-cascader-search,
  .survey-form .address-cascader-search input {
    height: 42px;
    font-size: 14px;
  }

  .survey-form .address-cascader-columns {
    grid-template-columns: 42% 58%;
    height: min(330px, 48vh);
    max-height: min(330px, 48vh);
  }

  .survey-form .address-cascader-option {
    min-height: 40px;
    padding-left: 10px;
    font-size: 14px;
  }

  .survey-form .radio-pill-group {
    min-height: 34px;
    gap: 16px;
  }

  .survey-form .radio-pill input {
    width: 16px;
    height: 16px;
    min-height: 0;
    padding: 0;
  }

  .survey-form .radio-pill span {
    min-width: 38px;
    height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
  }

  .survey-form .plain-radio-group {
    gap: 10px;
  }

  .survey-form .plain-radio-group label {
    gap: 8px;
    font-size: 14px;
    line-height: 1.5;
  }

  .survey-form .plain-radio-group input {
    width: 18px;
    height: 18px;
    min-height: 0;
    padding: 0;
    margin-top: 2px;
  }

  .survey-form .plain-radio-group span {
    font-size: 14px;
  }

  .survey-form .direction-option-list {
    border-color: #dde1e7;
    border-radius: 0;
  }

  .survey-form .experience-option-list {
    grid-template-columns: 1fr;
  }

  .survey-form .form-field .direction-option {
    min-height: 48px;
    padding: 0 12px;
    gap: 12px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
  }

  .survey-form .direction-check {
    width: 18px;
    height: 18px;
  }

  .inline-foot {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    justify-content: stretch;
    gap: 8px;
    min-height: 60px;
    padding: 8px 10px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid #e4e8ef;
    background: #ffffff;
  }

  .inline-foot .status-text {
    font-size: 12px;
    line-height: 1.5;
  }

  .inline-foot .status-text:empty {
    display: none;
  }

  .inline-foot .button.primary {
    width: 100%;
    min-height: 40px;
    border-radius: 20px;
    font-size: 14px;
  }

  .survey-confirm-mask {
    align-items: end;
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .survey-confirm-card {
    padding: 18px;
    gap: 14px;
    border-radius: 8px;
  }

  .survey-confirm-card h2 {
    font-size: 17px;
  }

  .survey-confirm-content {
    font-size: 15px;
    line-height: 1.7;
  }

  .survey-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .survey-confirm-actions .button {
    min-height: 42px;
  }

  .topbar {
    height: auto;
    min-height: 46px;
    align-items: flex-start;
    padding: 8px;
  }

  .title-block {
    display: grid;
    gap: 2px;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .ai-layout {
    min-height: calc(100vh - 16px);
    grid-template-columns: 1fr;
    grid-template-rows: minmax(480px, 1fr) minmax(220px, auto);
  }

  .ai-head,
  .ai-side-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-kpi-grid {
    grid-template-columns: 1fr;
  }

  .ai-input-bar {
    grid-template-columns: 1fr;
  }

  .ai-message,
  .ai-message.user {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .ai-message.user .ai-avatar {
    grid-column: 1;
  }

  .ai-message.user .ai-bubble {
    grid-column: 2;
    justify-self: start;
  }

  .permission-layout {
    min-height: calc(100vh - 16px);
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 240px) minmax(0, 1fr);
  }

  .permission-main-head,
  .permission-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .permission-head-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .permission-basic-form,
  .permission-inline-form,
  .permission-module-toolbar,
  .permission-field-toolbar,
  .permission-member-card,
  .permission-check-row,
  .permission-default-grid,
  .permission-field-row,
  .permission-preview-grid,
  .permission-preview-row {
    grid-template-columns: 1fr;
  }

  .permission-tabs {
    overflow-x: auto;
  }

  .detail-page {
    top: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
  }

  .toolbar,
  .pager {
    align-items: stretch;
    flex-direction: column;
  }

  .app-shell.embedded-shell:not(.survey-shell) {
    height: 100dvh;
    min-height: 100dvh;
    padding: 0;
    overflow: hidden;
    background: #ffffff;
  }

  .app-shell.survey-shell {
    height: auto;
    min-height: 100svh;
    overflow: visible;
  }

  body.activity-page-body {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .embedded-shell:not(.survey-shell) {
    padding: 0;
    background: #ffffff;
  }

  .embedded-shell:not(.survey-shell) .data-panel {
    height: 100dvh;
    border-width: 0;
    border-radius: 0;
    overflow: hidden;
  }

  body.activity-page-body .layout {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .data-panel .toolbar {
    min-height: 0;
    padding: 10px 10px 9px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .data-panel .toolbar-left {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .data-panel .toolbar-left::-webkit-scrollbar {
    display: none;
  }

  .data-panel .toolbar-left .button {
    flex: 0 0 auto;
    min-width: 92px;
    height: 40px;
    justify-content: center;
    padding: 0 12px;
    font-size: 15px;
  }

  .data-panel .toolbar-right {
    width: 100%;
    margin-left: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px 40px;
    gap: 8px;
  }

  .data-panel .toolbar-right .tool-icon-button {
    width: 40px;
    height: 40px;
  }

  .data-panel .search-box {
    width: 100%;
    height: 40px;
    grid-template-columns: 18px minmax(0, 1fr) 14px;
    border-color: #dfe5ef;
    border-radius: 5px;
  }

  .data-panel .search-box input {
    height: 38px;
    font-size: 14px;
  }

  .data-panel .toolbar-popover {
    top: calc(100% + 4px);
    right: 10px;
    left: 10px;
    width: auto;
    max-height: min(70vh, 520px);
    overflow: auto;
  }

  .data-panel .table-wrap {
    padding: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: contain;
  }

  .data-panel .data-table {
    min-width: 1180px;
  }

  .data-panel .data-table th,
  .data-panel .data-table td {
    height: 44px;
    padding: 0 12px;
    font-size: 14px;
  }

  .data-panel .data-table .check-col {
    width: 52px;
    min-width: 52px;
  }

  .data-panel .data-table input[type="checkbox"] {
    width: 18px;
    height: 18px;
  }

  .data-panel .pager {
    min-height: 0;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    gap: 8px;
  }

  .data-panel .pager-left,
  .data-panel .pager-actions {
    width: 100%;
    justify-content: space-between;
  }

  .data-panel .page-size-select {
    height: 34px;
    width: 106px;
  }

  .data-panel .pager-button,
  .data-panel .page-jump input {
    height: 34px;
  }

  .activity-date-picker-mask {
    align-items: end;
    justify-items: stretch;
    padding: 0;
    background: rgba(31, 42, 58, 0.34);
  }

  .activity-date-picker {
    width: 100%;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 12px 12px 0 0;
  }

  .activity-date-calendar {
    padding: 12px 16px 14px;
  }

  .activity-date-calendar-nav {
    min-height: 42px;
  }

  .activity-date-day,
  .activity-date-day-placeholder {
    height: 38px;
  }

  .activity-date-calendar-grid {
    min-height: calc(38px * 6 + 2px * 5);
  }

  .activity-date-day {
    width: 38px;
    font-size: 16px;
  }

  .activity-date-picker-shortcuts {
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .direction-preset-head,
  .direction-preset-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .direction-preset-groups {
    max-height: none;
    grid-template-columns: 1fr;
  }

  .toolbar-left,
  .toolbar-right,
  .pager-left,
  .pager-actions {
    flex-wrap: wrap;
  }

  .recipient-workspace {
    grid-template-columns: 1fr;
  }

  .activity-sms-sidebar {
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--border-soft);
  }

  .activity-sms-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .search-control {
    width: min(100%, 260px);
  }

  .form-grid,
  .survey-form,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-meta {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .form-field.wide,
  .detail-field.wide {
    grid-column: span 1;
  }

  .form-field.questionnaire-field-rules-field {
    grid-column: span 1;
  }

  .form-field.application-form-field {
    grid-column: span 1;
  }

  .questionnaire-field-rules {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  .questionnaire-field-rule {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  .field-status-segment {
    gap: 10px;
  }

  .status-radio-pill {
    min-width: 34px;
    padding: 0 9px;
  }

  .application-form-panel {
    grid-template-columns: 1fr;
  }

  .application-form-upload {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .detail-page.editing .detail-inline-panel .application-form-upload {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .application-form-upload input[type="file"] {
    width: 100%;
    max-width: none;
  }

  .detail-inline-panel,
  .detail-page.editing .detail-inline-panel {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .sms-layout {
    grid-template-rows: minmax(360px, 1fr) auto minmax(160px, 220px);
  }

  .segmented-control {
    width: 100%;
  }

  .segment-button {
    flex: 1;
  }
}
