.apple-card {
  background: #fff;
  border: 1px solid var(--bp-border-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
  background: #fff;
  color: var(--ds-text-secondary);
  transition: 0.15s ease;
}

.btn:disabled {
  color: var(--ds-disabled);
  cursor: not-allowed;
}

.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.btn-plain {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: #fff;
}

.btn-plain:hover:not(:disabled) {
  background: rgba(58, 109, 246, 0.06);
}

.btn-ghost {
  border-color: var(--bp-border-card);
  background: #fff;
  color: var(--ds-text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  border-color: #98a8ba;
  color: var(--ds-text-primary);
}

/* —— 语义按钮（见名知色，各页复用）——
   返回/取消 → ghost
   保存草稿 → draft（中性灰）
   保存单据 → save（品牌蓝描边）
   提交审批 → submit（品牌蓝实心，主操作）
   作废/删除 → danger（红色）
*/
.btn-draft {
  background: #f5f7fa;
  border-color: #c5ced9;
  color: #4b5563;
}

.btn-draft:hover:not(:disabled) {
  background: #ebeef3;
  border-color: #a8b4c4;
  color: #313131;
}

.btn-save {
  background: #fff;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-save:hover:not(:disabled) {
  background: rgba(58, 109, 246, 0.08);
  border-color: var(--color-primary-hover);
  color: var(--color-primary-hover);
}

.btn-submit {
  background: var(--ds-success);
  border-color: var(--ds-success);
  color: #fff;
}

.btn-submit:hover:not(:disabled) {
  background: #0a9a39;
  border-color: #0a9a39;
}

.btn-danger {
  background: #fff;
  border-color: var(--ds-danger);
  color: var(--ds-danger);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(243, 66, 60, 0.08);
}

.btn-link {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--color-primary);
  font-size: 14px;
  cursor: pointer;
}

.btn-link:hover {
  color: var(--color-primary-hover);
}

/* 文字链危险操作（删除等） */
.btn-link.is-danger {
  color: var(--ds-danger);
}

.btn-link.is-danger:hover {
  color: #d93630;
}

.btn-sm {
  height: 30px;
  font-size: 12px;
  border-radius: 8px;
  padding: 0 10px;
}

.field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

.field label {
  width: 72px;
  flex: 0 0 72px;
  text-align: right;
  font-size: 12px;
  font-weight: 500;
  color: var(--ds-text-secondary);
  line-height: 32px;
}

.field.detail label {
  width: 88px;
  flex: 0 0 88px;
}

/* 表单控件：值用主色可读，占位符弱化（列表/详情共用） */
.input,
.select {
  height: 32px;
  width: 100%;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-input);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--bp-border-input);
  outline: none;
  font-size: 13px;
  font-weight: 400;
  line-height: 30px;
  color: var(--ds-text-primary);
  font-family: var(--font-query), "Noto Sans SC", "Source Han Sans SC", "思源黑体", sans-serif;
}

.input::placeholder,
.select::placeholder,
.textarea::placeholder {
  color: var(--ds-text-tertiary);
  font-weight: 400;
  opacity: 1;
}

.input:hover,
.select:hover {
  box-shadow: inset 0 0 0 1px #98a8ba;
}

.input:focus,
.select:focus {
  box-shadow: inset 0 0 0 1px var(--color-primary);
}

.input:disabled,
.select:disabled,
.input.is-readonly {
  background: #f5f7fa;
  box-shadow: inset 0 0 0 1px var(--bp-border-input-readonly);
  color: var(--ds-text-primary);
  cursor: default;
  -webkit-text-fill-color: var(--ds-text-primary);
  opacity: 1;
}

.textarea {
  width: 100%;
  min-height: 64px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-input);
  box-shadow: inset 0 0 0 1px var(--bp-border-input);
  outline: none;
  resize: vertical;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ds-text-primary);
  font-family: var(--font-query), "Noto Sans SC", "Source Han Sans SC", "思源黑体", sans-serif;
}

.textarea:disabled,
.textarea.is-readonly {
  background: #f5f7fa;
  box-shadow: inset 0 0 0 1px var(--bp-border-input-readonly);
  color: var(--ds-text-primary);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
}

.tag-info {
  background: #edf3fe;
  color: var(--color-primary);
}

.tag-warning {
  background: #fff6e8;
  color: var(--ds-warning);
}

.tag-success {
  background: #e8f8ef;
  color: var(--ds-success);
}

.tag-danger {
  background: #fdeceb;
  color: var(--ds-danger);
}

.section-label {
  position: relative;
  padding-left: 10px;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ds-text-primary);
}

.section-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 3px;
  border-radius: 2px;
  background: var(--color-primary);
}

.table-shell {
  border: 1px solid var(--bp-adt-border-shell);
  border-radius: var(--radius-table);
  overflow: auto;
  background: #fff;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.data-table {
  width: 100%;
  /* separate + sticky 才能稳定冻结单行表头 */
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  min-width: 0;
}

.data-table.tf-ready {
  width: max-content;
  max-width: none;
}

.data-table th,
.data-table td {
  height: var(--adt-row-height);
  padding: 2px 10px;
  border-bottom: 1px solid var(--bp-adt-border-row);
  border-right: 1px solid var(--bp-adt-border-col);
  font-size: 12px;
  color: var(--ds-text-secondary);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table th {
  font-size: 14px;
  font-weight: 700;
  color: var(--ds-text-primary);
  background: linear-gradient(180deg, #f8faff 0%, #f3f6fc 100%);
  border-bottom: 1px solid var(--bp-adt-border-grid);
}

/* 仅单行表头冻结；多级表头（.tf-multi）不启用 sticky，避免错位 */
.data-table:not(.tf-multi) thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}

.data-table tbody tr:nth-child(even) {
  background: #fafbfd;
}

.data-table tbody tr:hover {
  background: rgba(58, 109, 246, 0.05);
}

.data-table th:last-child,
.data-table td:last-child {
  border-right: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  line-height: 20px;
  font-size: 12px;
  color: var(--ds-text-tertiary);
}

.breadcrumb .sep {
  color: var(--ds-border);
}

.breadcrumb a.crumb,
.breadcrumb .crumb {
  color: var(--ds-text-tertiary);
  text-decoration: none;
  cursor: pointer;
  border-radius: 2px;
  transition: color 0.15s ease;
}

.breadcrumb a.crumb:hover,
.breadcrumb .crumb:hover {
  color: var(--color-primary);
}

.breadcrumb .current {
  color: var(--color-primary);
  font-weight: 500;
  cursor: default;
}

.breadcrumb.detail .current {
  color: var(--ds-text-secondary);
  font-weight: 400;
}

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(49, 49, 49, 0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.toast.show {
  opacity: 1;
}

/* 通用弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(29, 29, 31, 0.45);
  box-sizing: border-box;
}

.modal-mask.is-open {
  display: flex;
}

.modal-panel {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--bp-border-card, #a8b4c4);
  box-shadow: 0 12px 40px rgba(29, 29, 31, 0.18);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef1f6;
}

.modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--ds-text-primary);
}

.modal-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8b93a7;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: #f3f5f9;
  color: #313131;
}

.modal-body {
  padding: 16px;
  display: grid;
  gap: 12px;
  font-size: 13px;
  color: var(--ds-text-secondary);
}

.modal-body .modal-hint {
  margin: 0;
  color: var(--ds-text-tertiary);
  font-size: 12px;
}

.modal-radio {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-radio label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--ds-text-primary);
  font-size: 13px;
}

.modal-radio input {
  accent-color: var(--color-primary);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
}

.anno-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  background: #fff6e8;
  color: var(--ds-warning);
  border: 1px solid #f3d29a;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
}

.anno-mark:hover,
.anno-mark.active {
  background: var(--ds-warning);
  color: #fff;
  border-color: var(--ds-warning);
}

.placeholder-page {
  padding: 48px 24px;
  text-align: center;
  color: var(--ds-text-tertiary);
}

.placeholder-page h2 {
  margin: 0 0 8px;
  color: var(--ds-text-primary);
  font-size: 18px;
}

.placeholder-page p {
  margin: 0;
  font-size: 13px;
}
