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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-neutral-800);
  background: var(--color-neutral-50);
  min-height: 100vh;
  overflow-x: clip;
  max-width: 100%;
  text-rendering: optimizeLegibility;
}

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

img { max-width: 100%; display: block; }

/* Layout */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--color-neutral-0);
  border-bottom: 1px solid var(--color-neutral-200);
  display: flex;
  align-items: center;
  padding: 0 max(var(--space-lg), calc((100vw - var(--content-max)) / 2));
  gap: var(--space-md);
  box-shadow: var(--shadow-sm);
}

body.admin-body .app-header {
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.app-header .logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 18px;
  color: var(--color-primary-700);
  text-decoration: none;
}

.app-header .logo img,
.app-header .logo svg { flex-shrink: 0; display: block; height: 34px; width: auto; }

.app-header nav {
  margin-left: auto;
  display: flex;
  gap: var(--space-xs);
}

.app-header nav a {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--color-neutral-700);
  font-size: 14px;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.app-header nav a:hover,
.app-header nav a.active {
  background: var(--color-primary-50);
  color: var(--color-primary-600);
  text-decoration: none;
}

.app-header .nav-admin-label {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-md);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-primary-700);
}

.page-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: var(--space-xl);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-xl) var(--space-lg);
}

.page-layout.no-sidebar { grid-template-columns: 1fr; max-width: var(--content-max); }

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

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + var(--space-xl));
  align-self: start;
}

/* Cards */
.card {
  background: var(--color-neutral-0);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-pad { padding: var(--space-xl); }

.card-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-neutral-900);
  margin-bottom: var(--space-xs);
}

.card-desc {
  color: var(--color-neutral-500);
  font-size: 14px;
  margin-bottom: var(--space-lg);
}

/* Forms */
.form-group { margin-bottom: var(--space-lg); }

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-neutral-800);
  margin-bottom: var(--space-xs);
}

.form-label .req { color: var(--color-danger-600); margin-left: 2px; }

.form-hint {
  font-size: 13px;
  color: var(--color-neutral-500);
  margin-top: var(--space-2xs);
}

.field-hint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-neutral-300);
  color: var(--color-neutral-600);
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  margin-left: 6px;
  position: relative;
  flex-shrink: 0;
  vertical-align: middle;
}

.field-hint-icon:hover { background: var(--color-primary-500); color: #fff; }

/*
 * 提示默认向下展开（避免弹窗顶部/header 裁切向上气泡）。
 * 弹窗 modal-body 有 overflow:auto，向上会显示不全。
 */
.field-hint-tip {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  transform: none;
  width: max(200px, min(260px, 72vw));
  max-width: min(280px, calc(100vw - 48px));
  padding: 8px 10px;
  background: var(--color-neutral-800);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  border-radius: 6px;
  white-space: normal;
  word-break: break-word;
  z-index: 800;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
  pointer-events: none;
  text-align: left;
}

.field-hint-tip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  top: auto;
  left: 10px;
  transform: none;
  border: 5px solid transparent;
  border-bottom-color: var(--color-neutral-800);
}

.field-hint-icon:hover .field-hint-tip,
.field-hint-icon:active .field-hint-tip,
.field-hint-icon:focus .field-hint-tip,
.field-hint-icon:focus-within .field-hint-tip { display: block; }

.field-hint-icon:focus { outline: 2px solid var(--color-primary-300); outline-offset: 1px; }

/* 悬停时抬高层级，避免被同卡片后续表单项盖住 */
.form-group:has(.field-hint-icon:hover),
.form-group:has(.field-hint-icon:focus),
.form-label:has(.field-hint-icon:hover),
.form-label:has(.field-hint-icon:focus) {
  position: relative;
  z-index: 20;
}

/* 弹窗内：允许提示溢出 modal-body 可视区外一层（仍受 dialog 约束时靠向下展开） */
.modal-body .form-group {
  overflow: visible;
}
.modal-body .form-label {
  overflow: visible;
  position: relative;
}

.form-error {
  font-size: 13px;
  color: var(--color-danger-600);
  margin-top: var(--space-2xs);
  display: none;
}



.form-group.has-error .form-error { display: block; }
.form-group.has-error .input,
.form-group.has-error .select,
.form-group.has-error .textarea {
  border-color: var(--color-danger-500);
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.12);
}
.form-group.has-error .option-grid {
  outline: 2px solid rgba(211, 47, 47, 0.28);
  border-radius: var(--radius-md);
  padding: 4px;
}
.form-group.has-error .option-card {
  border-color: rgba(211, 47, 47, 0.45);
}
.form-group.has-error #meetingList,
.form-group.has-error .select {
  border-color: var(--color-danger-500);
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.12);
}
.form-group.has-error .chip-group {
  outline: 2px solid rgba(211, 47, 47, 0.28);
  border-radius: var(--radius-md);
  padding: 6px;
  background: rgba(254, 242, 242, 0.5);
}
.form-group.has-error .fee-list {
  outline: 2px solid rgba(211, 47, 47, 0.28);
  border-radius: var(--radius-md);
  padding: 6px;
  background: rgba(254, 242, 242, 0.35);
}
.form-group.has-error .upload-zone {
  border-color: var(--color-danger-500);
  background: #fef2f2;
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

#meetingList { font-size: 14px; }
#meetingMeta { font-size: 12px; color: var(--color-neutral-500); margin-top: 6px; line-height: 1.4; }

@media (max-width: 600px) {
  #meetingList { font-size: 13px; padding: 10px 12px; }
  #meetingList option { word-break: break-all; white-space: normal; }
}

.input, .select, .textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-neutral-300);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-neutral-800);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input, .textarea {
  background: var(--color-neutral-0);
}

.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: var(--shadow-focus);
}

.textarea { resize: vertical; min-height: 88px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

/* Buttons — 统一高度阶梯，与 input/select(40px) 对齐 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  min-height: 40px;
  padding: 0 16px;
  line-height: 1.25;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), border-color var(--transition), color var(--transition);
}

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

.btn .btn-icon,
.btn span[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn .btn-icon svg,
.btn span[data-icon] svg {
  width: 16px;
  height: 16px;
  display: block;
}

.btn-primary {
  background: var(--color-primary-600);
  color: #fff;
  border-color: var(--color-primary-600);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-700);
  border-color: var(--color-primary-700);
}

.btn-secondary {
  background: var(--color-neutral-0);
  color: var(--color-neutral-700);
  border-color: var(--color-neutral-300);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-neutral-50);
  border-color: var(--color-neutral-300);
  color: var(--color-neutral-900);
}

.btn-ghost {
  background: transparent;
  color: var(--color-primary-600);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-primary-50);
  color: var(--color-primary-700);
}

/* sm：表格操作 / 工具栏次要动作 — 固定 32px */
.btn-sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  gap: 4px;
}

.btn-sm .btn-icon,
.btn-sm span[data-icon],
.btn-sm .btn-icon svg,
.btn-sm span[data-icon] svg {
  width: 14px;
  height: 14px;
}

/* lg：主流程 CTA */
.btn-lg {
  min-height: 48px;
  padding: 0 24px;
  font-size: 16px;
}

/* 图标方形按钮（删除 × 等） */
.btn-icon-only {
  min-width: 32px;
  padding: 0;
  width: 32px;
}

.btn-icon-only.btn-sm {
  min-width: 32px;
  width: 32px;
}

.btn-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.form-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-neutral-200);
}

.form-nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.form-nav .btn {
  min-width: 100px;
  white-space: nowrap;
  flex: 0 0 auto;
  width: auto;
}

.form-nav #btnSave {
  min-width: 90px;
}

/* Stepper */
.stepper-bar {
  margin-bottom: var(--space-xl);
  padding: 0 16px;
}

.stepper-steps {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  height: 64px;
}

.stepper-track {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 0;
}

.stepper-track-bg {
  position: absolute;
  top: 0;
  left: 16px;
  right: 16px;
  height: 100%;
  background: var(--color-neutral-200);
  border-radius: 2px;
}

.stepper-track-fill {
  position: absolute;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--color-success-500), var(--color-primary-500));
  border-radius: 2px;
  transition: width 0.4s ease, left 0.4s ease;
  z-index: 1;
}

.stepper-track-fill.has-warning {
  background: linear-gradient(90deg, var(--color-success-500), var(--color-warning-500));
}

.stepper-track-fill.has-error {
  background: linear-gradient(90deg, var(--color-success-500), var(--color-danger-500));
}

.stepper-step {
  position: relative;
  flex: 1 1 0;
  min-width: 32px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

.stepper-step .dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-neutral-0);
  border: 3px solid var(--color-neutral-200);
  color: var(--color-neutral-400);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}

.stepper-step .step-label {
  margin-top: 6px;
  white-space: nowrap;
  font-size: 12px;
  color: var(--color-neutral-500);
  transition: color var(--transition);
}

.stepper-step.active .dot {
  border-color: var(--color-primary-500);
  background: var(--color-primary-500);
  color: #fff;
  box-shadow: 0 0 0 4px var(--color-primary-100);
}

.stepper-step.done .dot {
  border-color: var(--color-success-500);
  background: var(--color-success-500);
  color: #fff;
}
.stepper-step.done .step-label { color: var(--color-success-600); }
.stepper-step.active .step-label { color: var(--color-primary-600); font-weight: 600; }

.stepper-step.warning .dot {
  border-color: var(--color-warning-500);
  background: var(--color-warning-500);
  color: #fff;
}
.stepper-step.warning .step-label { color: var(--color-warning-600); font-weight: 600; }

.stepper-step.error .dot {
  border-color: var(--color-danger-500);
  background: var(--color-danger-500);
  color: #fff;
}
.stepper-step.error .step-label { color: var(--color-danger-600); font-weight: 600; }

.step-panel { display: none; }
.step-panel.active { display: block; }

/* Selection cards */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
}

.option-card {
  border: 2px solid var(--color-neutral-200);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  text-align: center;
}

.option-card:hover { border-color: var(--color-primary-300); background: var(--color-primary-50); }
.option-card.selected { border-color: var(--color-primary-600); background: var(--color-primary-50); box-shadow: var(--shadow-md); }

.option-card .icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-primary-50);
  color: var(--color-primary-600);
}
.option-card .title { font-weight: 700; color: var(--color-neutral-900); margin-bottom: var(--space-2xs); }
.option-card .desc { font-size: 13px; color: var(--color-neutral-500); }

.meeting-card {
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: var(--space-sm);
}

.meeting-card:hover { border-color: var(--color-primary-400); }
.meeting-card.selected { border-color: var(--color-primary-600); background: var(--color-primary-50); }

.meeting-card .meta-en {
  font-size: 12px;
  color: var(--color-neutral-500);
  margin-top: 2px;
  line-height: 1.4;
}

.meeting-card .name { font-weight: 600; color: var(--color-neutral-900); }
.meeting-card .meta { font-size: 13px; color: var(--color-neutral-500); margin-top: 2px; }

/* Fee items */
.fee-list { display: flex; flex-direction: column; gap: var(--space-sm); }

.fee-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  gap: var(--space-md);
}

.fee-row.active { border-color: var(--color-primary-400); background: var(--color-primary-50); }

.fee-row .info { flex: 1; min-width: 0; }
.fee-row .name { font-weight: 600; }
.fee-row .hint { font-size: 12px; color: var(--color-neutral-500); }
.fee-row .price { font-weight: 700; color: var(--color-primary-600); white-space: nowrap; }

.qty-control {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.qty-control button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-neutral-300);
  border-radius: var(--radius-sm);
  background: var(--color-neutral-0);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.qty-control button:hover { background: var(--color-neutral-100); }
.qty-control .qty { min-width: 24px; text-align: center; font-weight: 600; }

.fee-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg);
  background: var(--color-primary-50);
  border-radius: var(--radius-md);
  margin-top: var(--space-md);
}

.fee-total .label { font-weight: 600; }
.fee-total .amount { font-size: 24px; font-weight: 800; color: var(--color-primary-600); }

/* Upload */
.upload-zone {
  display: block;
  position: relative;
  border: 2px dashed var(--color-neutral-300);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.upload-zone .upload-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  font-size: 0;
}

.upload-zone-content {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--color-primary-400);
  background: var(--color-primary-50);
}

.upload-zone .upload-icon {
  color: var(--color-primary-500);
  margin: 0 auto var(--space-sm);
  display: flex;
  justify-content: center;
}

.edit-upload-zone {
  border: 2px dashed var(--color-neutral-300);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.edit-upload-zone:hover, .edit-upload-zone.dragover {
  border-color: var(--color-primary-400);
  background: var(--color-primary-50);
}

.edit-upload-hint {
  font-size: 12px;
  color: var(--color-neutral-500);
  margin-bottom: var(--space-sm);
}

.edit-upload-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  text-align: left;
}

.edit-upload-list .file-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 10px;
  background: var(--color-neutral-50);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.edit-upload-list .file-item .file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-upload-list .file-item .file-size {
  color: var(--color-neutral-500);
  font-size: 11px;
}

/* 编辑表单：附件材料四类（与前台 payment/paper/student/avatar 一致） */
.edit-attach-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}
.edit-attach-row {
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-neutral-0);
}
.edit-attach-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 8px;
}
.edit-attach-head strong {
  font-size: 13px;
  color: var(--color-neutral-800);
}
.edit-attach-exist {
  margin: 0;
  font-size: 12px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.edit-existing-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.edit-existing-list:empty {
  display: none;
  margin: 0;
}
.edit-existing-list .file-item {
  background: var(--color-neutral-50);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
}
.edit-existing-list .file-item .file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.edit-upload-zone-sm {
  padding: var(--space-sm);
  margin: 0;
}
.edit-upload-zone-sm .edit-upload-hint {
  margin-bottom: 0;
}

.fee-section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-neutral-700);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fee-select-btn {
  padding: 8px 16px;
  border: 1px solid var(--color-neutral-300);
  border-radius: var(--radius-md);
  background: var(--color-neutral-0);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.fee-select-btn.selected {
  background: var(--color-primary-600);
  color: #fff;
  border-color: var(--color-primary-600);
}

.fee-breakdown {
  list-style: none;
  margin: var(--space-md) 0 0;
  padding: var(--space-md);
  background: var(--color-neutral-50);
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--color-neutral-700);
}

.fee-breakdown li { padding: 2px 0; }

.file-list {
  margin-top: var(--space-sm);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

/* 上传成功列表：左文件名（可截断保后缀）+ 大小 + 右固定「移除」；不展示磁盘路径 */
.file-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-neutral-100);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-xs);
  font-size: 14px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.file-item-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.file-item-name {
  display: flex;
  align-items: baseline;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  line-height: 1.35;
  color: var(--color-neutral-800);
}

/* 中间省略，后缀始终完整（便于核对是否传对） */
.file-name-base {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-name-ext {
  flex: 0 0 auto;
  white-space: nowrap;
  color: var(--color-neutral-700);
}

.file-item-size {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
  color: var(--color-neutral-500);
  line-height: 1.35;
}

.file-item .remove {
  flex: 0 0 auto;
  margin-left: 0;
  color: var(--color-danger-600);
  cursor: pointer;
  border: none;
  background: none;
  font-size: 13px;
  padding: 4px 2px;
  white-space: nowrap;
  line-height: 1.2;
}

.file-item .remove:hover,
.file-item .remove:focus-visible {
  text-decoration: underline;
  color: var(--color-danger-700, #b91c1c);
}

/* 窄屏：更紧凑，仍单行不换行溢出 */
@media (max-width: 480px) {
  .file-item {
    padding: 8px 10px;
    gap: 6px;
    font-size: 13px;
  }
  .file-item-main { gap: 6px; }
  .file-item-size { font-size: 11px; }
  .file-item .remove {
    font-size: 12px;
    padding: 4px 0 4px 4px;
  }
}

/* 上传进度条（前台 / 后台共用） */
.upload-progress-host {
  margin-top: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.upload-progress-host[hidden] { display: none !important; }
.upload-progress-row {
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--color-neutral-50);
}
.upload-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
}
.upload-progress-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-neutral-700);
  font-weight: 500;
}
.upload-progress-pct {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  color: var(--color-primary-700);
  font-weight: 600;
}
.upload-progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--color-neutral-200);
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary-500, #0d63af), var(--color-primary-400, #389dd8));
  transition: width 0.15s ease;
}
.upload-progress-row.is-indeterminate .upload-progress-fill {
  width: 40% !important;
  animation: uploadIndeterminate 1s ease-in-out infinite;
}
.upload-progress-row.is-done .upload-progress-fill {
  background: #059669;
}
.upload-progress-row.is-error .upload-progress-fill {
  background: #dc2626;
  width: 100% !important;
}
@keyframes uploadIndeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(280%); }
}
.upload-zone.is-uploading {
  pointer-events: none;
  opacity: 0.92;
}
.edit-upload-zone.is-uploading {
  pointer-events: none;
  opacity: 0.92;
}

/* Payment panel */
.info-panel {
  background: var(--color-info-100);
  border: 1px solid rgba(13, 138, 141, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: var(--space-sm);
  font-size: 14px;
}

.info-panel strong { color: var(--color-info-600); }

/* Radio / checkbox groups */
.chip-group { display: flex; flex-wrap: wrap; gap: var(--space-sm); }

.chip {
  padding: 8px 16px;
  border: 1px solid var(--color-neutral-300);
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition);
  user-select: none;
}

.chip:hover { border-color: var(--color-primary-400); }
.chip.selected { background: var(--color-primary-600); color: #fff; border-color: var(--color-primary-600); }

.chip input { display: none; }

/* Preview block */
.preview-grid {
  display: grid;
  gap: var(--space-sm);
}

.preview-row {
  display: flex;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-neutral-100);
  font-size: 14px;
}

.preview-row .label { width: 120px; color: var(--color-neutral-500); flex-shrink: 0; }
.preview-row .value { flex: 1; font-weight: 500; color: var(--color-neutral-900); }

/* Journal CTA */
.journal-cta {
  border: 1px solid var(--color-accent-500);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  background: var(--color-accent-50);
  margin-top: var(--space-lg);
}

.journal-cta .title { font-weight: 700; margin-bottom: var(--space-xs); }

/* Timeline */
.timeline { position: relative; padding-left: var(--space-xl); }

.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--color-neutral-200);
}

.timeline-node {
  position: relative;
  padding-bottom: var(--space-lg);
}

.timeline-node:last-child { padding-bottom: 0; }

.timeline-node .dot {
  position: absolute;
  left: calc(-1 * var(--space-xl) + 4px);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-neutral-300);
  border: 3px solid var(--color-neutral-0);
  box-shadow: 0 0 0 2px var(--color-neutral-200);
}

.timeline-node.done .dot { background: var(--color-success-600); box-shadow: 0 0 0 2px var(--color-success-100); }
.timeline-node.active .dot { background: var(--color-primary-600); box-shadow: 0 0 0 2px var(--color-primary-100); }

.timeline-node .title { font-weight: 600; color: var(--color-neutral-900); }
.timeline-node .date { font-size: 13px; color: var(--color-neutral-500); }
.timeline-node .desc { font-size: 13px; color: var(--color-neutral-500); margin-top: 2px; }
.timeline-node .eta { font-size: 12px; color: var(--color-neutral-400); margin-top: 4px; }
.timeline-node.active .eta { color: var(--color-primary-500); }
.timeline-node.active .title { color: var(--color-primary-600); }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  vertical-align: middle;
}

.badge-primary { background: var(--color-primary-100); color: var(--color-primary-700); }
.badge-success { background: var(--color-success-100); color: var(--color-success-600); }
.badge-warning { background: var(--color-warning-100); color: var(--color-warning-600); }
.badge-danger { background: var(--color-danger-100); color: var(--color-danger-600); }
.badge-neutral { background: var(--color-neutral-100); color: var(--color-neutral-700); }

/* 发票类型：普票 / 专票 明确区分 */
.badge-invoice-general {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #7dd3fc;
}
.badge-invoice-special {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
}

/* Stats（基础卡；层级细节见 astryx.css .ax-metric-*） */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

/* 注册审核：5 项指标（含注册金额）— 兼容旧类名 */
.stats-grid-reg {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1200px) {
  .stats-grid-reg { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .stats-grid-reg { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--color-neutral-0);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

/* 未挂 ax-metric 时的兜底字阶 */
.stat-card:not(.ax-metric-num) .value {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--color-primary-600);
  font-variant-numeric: tabular-nums;
}
.stat-card:not(.ax-metric-num) .label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-neutral-500);
  margin-top: 6px;
}

/* Table */
.table-wrap {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  overscroll-behavior-x: contain;
  /* 给滚动条留出独立触控带，减少误点表格行 */
  padding-bottom: 10px;
  margin-bottom: 2px;
  /* Firefox */
  scrollbar-width: auto;
  scrollbar-color: var(--color-neutral-400) var(--color-neutral-100);
  /* 左右边缘阴影提示「还可滑动」，不随内容滚动 */
  --table-fade-l: transparent;
  --table-fade-r: transparent;
  box-shadow:
    inset 18px 0 14px -14px var(--table-fade-l),
    inset -18px 0 14px -14px var(--table-fade-r);
  transition: box-shadow 0.15s ease;
}

.table-wrap.has-scroll-left {
  --table-fade-l: rgba(15, 23, 42, 0.14);
}
.table-wrap.has-scroll-right {
  --table-fade-r: rgba(15, 23, 42, 0.14);
}

/* 小屏可滚动时的轻提示（滚过后自动隐藏，由 JS 加 has-scrolled） */
.table-scroll-hint {
  display: none;
  position: absolute;
  right: 10px;
  bottom: 18px;
  z-index: 5;
  pointer-events: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-neutral-700);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--color-neutral-200);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@media (max-width: 900px) {
  .table-wrap.is-scrollable .table-scroll-hint {
    display: block;
    opacity: 1;
    transform: translateY(0);
  }

  .table-wrap.has-scrolled .table-scroll-hint,
  .table-wrap:not(.is-scrollable) .table-scroll-hint {
    opacity: 0;
    pointer-events: none;
  }
}

/* 横向滚动条加粗，方便小屏拖动 */
.table-wrap::-webkit-scrollbar {
  height: 14px;
}
.table-wrap::-webkit-scrollbar-track {
  background: var(--color-neutral-100);
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px var(--color-neutral-200);
}
.table-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--color-neutral-400), var(--color-neutral-500));
  border-radius: 10px;
  border: 3px solid var(--color-neutral-100);
  min-width: 56px;
}
.table-wrap::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--color-neutral-500), var(--color-neutral-600));
}
.table-wrap::-webkit-scrollbar-thumb:active {
  background: var(--color-primary-500);
}

@media (max-width: 900px) {
  .table-wrap {
    padding-bottom: 14px;
    margin-bottom: 4px;
  }
  .table-wrap::-webkit-scrollbar {
    height: 18px;
  }
  .table-wrap::-webkit-scrollbar-thumb {
    border-width: 3px;
    min-width: 72px;
  }

  /* 表格贴边全宽滚动（与默认 card-pad = space-xl 对齐） */
  .admin-panel .card.card-pad > .table-wrap {
    margin-left: calc(-1 * var(--space-xl));
    margin-right: calc(-1 * var(--space-xl));
    width: calc(100% + 2 * var(--space-xl));
    max-width: none;
  }
}

/* Responsive utilities */
.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.query-row {
  display: flex;
  gap: var(--space-sm);
  align-items: stretch;
}

.query-row .input { flex: 1; min-width: 0; }

.status-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.status-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.invoice-mark-panel {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-100);
  border-radius: var(--radius-md);
}

.invoice-mark-panel .panel-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.invoice-check-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-neutral-800);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.invoice-check-label input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.list-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-neutral-200);
  font-size: 13px;
  color: var(--color-neutral-600);
}

.list-pagination-meta {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--color-neutral-500);
}

.list-pagination-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-left: auto;
}

.list-pagination-actions .select {
  width: auto;
  min-width: 120px;
  min-height: 32px;
  height: 32px;
  padding: 0 32px 0 10px;
  font-size: 13px;
  background-position: right 8px center;
}

.list-pagination-actions .btn {
  min-height: 32px;
}

.list-pagination-pages {
  padding: 0 var(--space-xs);
  white-space: nowrap;
  color: var(--color-neutral-700);
  font-weight: 500;
}

@media (max-width: 640px) {
  .list-pagination {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }
  .list-pagination-meta {
    white-space: normal;
    line-height: 1.4;
  }
  .list-pagination-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--space-sm);
  }
  .list-pagination-actions .select {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }
  .list-pagination-actions .list-page-prev {
    justify-self: start;
  }
  .list-pagination-actions .list-page-next {
    justify-self: end;
  }
  .list-pagination-pages {
    justify-self: center;
    text-align: center;
  }
}

.meeting-multiselect {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
  padding: var(--space-sm);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  background: var(--color-neutral-50);
}

.meeting-multiselect .check-row { margin: 0; font-size: 13px; }

.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.page-toolbar .card-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-neutral-900);
  line-height: 1.25;
}

.page-toolbar .card-desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-neutral-500);
  max-width: 52ch;
}

.page-toolbar > .btn,
.page-toolbar .filter-actions .btn {
  flex-shrink: 0;
  align-self: center;
}

/* 仅标题、无 toolbar 的面板 */
.admin-panel > .card-title.page-title,
.admin-panel > h1.card-title {
  margin: 0 0 var(--space-lg);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-neutral-900);
  line-height: 1.25;
}

.admin-panel > .card-desc.page-desc,
.admin-panel > p.card-desc {
  margin: -12px 0 var(--space-lg);
  font-size: 13px;
  line-height: 1.5;
  color: var(--color-neutral-500);
  max-width: 60ch;
}

.filter-search {
  flex: 1 1 200px;
  min-width: 160px;
  max-width: 320px;
  margin-left: auto;
}

.filter-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.filter-bar .select {
  min-width: 140px;
  width: auto;
  flex: 0 1 auto;
}

.filter-bar .input[type="number"] {
  min-width: 100px;
  width: auto;
  max-width: 140px;
}

.filter-bar .input,
.filter-bar .select {
  min-height: 40px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

/* Dashboard「最近注册」4 列表：固定布局防叠字 */
.ax-dash-section-activity .table-compact {
  table-layout: fixed;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.ax-dash-section-activity .table-compact th,
.ax-dash-section-activity .table-compact td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  vertical-align: middle;
}

.ax-dash-section-activity .table-compact th:nth-child(1),
.ax-dash-section-activity .table-compact td:nth-child(1) { width: 28%; }
.ax-dash-section-activity .table-compact th:nth-child(2),
.ax-dash-section-activity .table-compact td:nth-child(2) { width: 22%; }
.ax-dash-section-activity .table-compact th:nth-child(3),
.ax-dash-section-activity .table-compact td:nth-child(3) { width: 22%; }
.ax-dash-section-activity .table-compact th:nth-child(4),
.ax-dash-section-activity .table-compact td:nth-child(4) { width: 28%; }

/*
 * 注册审核 / 发票管理：固定布局 + 足够 min-width，
 * 小屏横向滚动，关键列用固定 px 防止状态/时间等互相重叠
 */
#panel-registrations .table,
#panel-invoices .table {
  table-layout: fixed;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

#panel-registrations .table {
  min-width: 1240px;
}

#panel-invoices .table {
  min-width: 1420px;
}

#panel-registrations .table th,
#panel-registrations .table td,
#panel-invoices .table th,
#panel-invoices .table td {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  vertical-align: middle;
}

/* 费用列允许换行徽章，但仍裁剪横向溢出 */
#panel-registrations .table td:nth-child(7),
#panel-registrations .table td.cell-fee,
#panel-invoices .table td:nth-child(9) {
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
}

#panel-registrations .table th:nth-child(1),
#panel-registrations .table td:nth-child(1),
#panel-invoices .table th:nth-child(1),
#panel-invoices .table td:nth-child(1) {
  width: 44px;
  text-align: center;
  white-space: nowrap;
  overflow: visible; /* 勾选框不被裁切 */
}

/* 注册：编号 | 姓名 | 会议 | 类型 | 论文 | 费用 | 状态 | 时间 | 操作 */
#panel-registrations .table th:nth-child(2),
#panel-registrations .table td:nth-child(2) { width: 132px; }
#panel-registrations .table th:nth-child(3),
#panel-registrations .table td:nth-child(3) { width: 100px; }
#panel-registrations .table th:nth-child(4),
#panel-registrations .table td:nth-child(4) { width: 100px; }
#panel-registrations .table th:nth-child(5),
#panel-registrations .table td:nth-child(5) { width: 56px; white-space: nowrap; }
#panel-registrations .table th:nth-child(6),
#panel-registrations .table td:nth-child(6) { width: 180px; }
#panel-registrations .table th:nth-child(7),
#panel-registrations .table td:nth-child(7) { width: 110px; } /* 费用可多行 */
#panel-registrations .table th:nth-child(8),
#panel-registrations .table td:nth-child(8) {
  width: 120px;
  white-space: nowrap;
}
#panel-registrations .table th:nth-child(9),
#panel-registrations .table td:nth-child(9) {
  width: 132px;
  white-space: nowrap;
}
#panel-registrations .table th:nth-child(10),
#panel-registrations .table td:nth-child(10) {
  width: 88px;
  white-space: nowrap;
  overflow: visible;
}

/* 优惠码 / 日志：固定布局 + 单元格强制裁剪，禁止叠字 */
#panel-promos .table {
  table-layout: fixed;
  width: 100%;
  min-width: 920px;
  border-collapse: separate;
  border-spacing: 0;
}

#panel-promos .table th,
#panel-promos .table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

/* 优惠码 | 类型 | 折扣 | 限定会议 | 已用/上限 | 过期 | 操作 */
#panel-promos .table th:nth-child(1),
#panel-promos .table td:nth-child(1) { width: 15%; }
#panel-promos .table th:nth-child(2),
#panel-promos .table td:nth-child(2) { width: 10%; }
#panel-promos .table th:nth-child(3),
#panel-promos .table td:nth-child(3) { width: 10%; }
#panel-promos .table th:nth-child(4),
#panel-promos .table td:nth-child(4) { width: 26%; }
#panel-promos .table th:nth-child(5),
#panel-promos .table td:nth-child(5) { width: 12%; }
#panel-promos .table th:nth-child(6),
#panel-promos .table td:nth-child(6) { width: 12%; }
#panel-promos .table th:nth-child(7),
#panel-promos .table td:nth-child(7) {
  width: 80px;
  overflow: visible;
  white-space: nowrap;
}

#panel-logs .table {
  table-layout: fixed;
  width: 100%;
  min-width: 720px;
  border-collapse: separate;
  border-spacing: 0;
}

#panel-logs .table th,
#panel-logs .table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  min-width: 0;
}

/* 操作日志 5 列：时间 | 操作人 | 操作 | 目标 | 变更详情 */
#panel-logs .logs-ops-table th:nth-child(1),
#panel-logs .logs-ops-table td:nth-child(1) { width: 18%; }
#panel-logs .logs-ops-table th:nth-child(2),
#panel-logs .logs-ops-table td:nth-child(2) { width: 12%; }
#panel-logs .logs-ops-table th:nth-child(3),
#panel-logs .logs-ops-table td:nth-child(3) { width: 12%; }
#panel-logs .logs-ops-table th:nth-child(4),
#panel-logs .logs-ops-table td:nth-child(4) { width: 16%; }
#panel-logs .logs-ops-table th:nth-child(5),
#panel-logs .logs-ops-table td:nth-child(5) { width: 42%; }

/* 邮件日志 7 列：时间 | 状态 | 类型 | 收件人 | 主题 | 注册编号 | 说明 */
#panel-logs .logs-mail-table { min-width: 960px; }
#panel-logs .logs-mail-table th:nth-child(1),
#panel-logs .logs-mail-table td:nth-child(1) { width: 14%; }
#panel-logs .logs-mail-table th:nth-child(2),
#panel-logs .logs-mail-table td:nth-child(2) { width: 9%; }
#panel-logs .logs-mail-table th:nth-child(3),
#panel-logs .logs-mail-table td:nth-child(3) { width: 10%; }
#panel-logs .logs-mail-table th:nth-child(4),
#panel-logs .logs-mail-table td:nth-child(4) { width: 16%; }
#panel-logs .logs-mail-table th:nth-child(5),
#panel-logs .logs-mail-table td:nth-child(5) { width: 20%; }
#panel-logs .logs-mail-table th:nth-child(6),
#panel-logs .logs-mail-table td:nth-child(6) { width: 12%; }
#panel-logs .logs-mail-table th:nth-child(7),
#panel-logs .logs-mail-table td:nth-child(7) { width: 19%; }

/* 发票：编号 | 姓名 | 会议 | 类型 | 抬头 | 税号 | 项目 | 费用 | 开票状态 | 注册状态 */
#panel-invoices .table th:nth-child(2),
#panel-invoices .table td:nth-child(2) { width: 132px; }
#panel-invoices .table th:nth-child(3),
#panel-invoices .table td:nth-child(3) { width: 96px; }
#panel-invoices .table th:nth-child(4),
#panel-invoices .table td:nth-child(4) { width: 96px; }
#panel-invoices .table th:nth-child(5),
#panel-invoices .table td:nth-child(5) { width: 108px; white-space: nowrap; }
#panel-invoices .table th:nth-child(6),
#panel-invoices .table td:nth-child(6) { width: 160px; }
#panel-invoices .table th:nth-child(7),
#panel-invoices .table td:nth-child(7) { width: 140px; }
#panel-invoices .table th:nth-child(8),
#panel-invoices .table td:nth-child(8) { width: 120px; }
#panel-invoices .table th:nth-child(9),
#panel-invoices .table td:nth-child(9) { width: 88px; white-space: nowrap; }
#panel-invoices .table th:nth-child(10),
#panel-invoices .table td:nth-child(10) {
  width: 96px;
  white-space: nowrap;
}
#panel-invoices .table th:nth-child(11),
#panel-invoices .table td:nth-child(11) {
  width: 112px;
  white-space: nowrap;
}
/* 操作列：发票文件按钮 + 上传提示，禁止 overflow 裁切 */
#panel-invoices .table th:nth-child(12),
#panel-invoices .table td:nth-child(12) {
  width: 108px;
  white-space: nowrap;
  overflow: visible;
}

/* 单元格内徽章不撑破列宽、不叠到邻列 */
.table td .badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
  vertical-align: middle;
}

.table th {
  text-align: left;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-neutral-100);
  color: var(--color-neutral-700);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

.table td {
  padding: var(--space-md);
  border-bottom: 1px solid var(--color-neutral-200);
  vertical-align: middle;
}

.table tbody tr:hover td { background: var(--color-primary-50); }

/* 表格长文本省略：悬停 title 可看全文 */
.cell-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

/*
 * fixed 布局：max-width:0 + min-width:0 强制单元格遵守列宽，
 * 否则内容会按「最小内容宽度」撑出并盖住后面的列
 */
.table td.cell-ellipsis,
#panel-registrations .table td.cell-ellipsis,
#panel-invoices .table td.cell-ellipsis,
#panel-promos .table td.cell-ellipsis,
#panel-logs .table td.cell-ellipsis,
.meeting-table td.cell-ellipsis,
.user-table td.cell-ellipsis,
.ax-dash-section-activity .table td.cell-ellipsis {
  max-width: 0;
  min-width: 0;
}

/* 嵌套 strong 也要裁剪，否则会按内容最小宽度撑破列并叠到邻列 */
.table td.cell-ellipsis strong,
#panel-promos .table td strong,
.meeting-table td .meeting-code {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.table td.cell-ellipsis strong,
#panel-promos .table td strong {
  font-weight: 700;
}

.cell-regno {
  font-variant-numeric: tabular-nums;
}

.cell-status {
  overflow: hidden;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
}

/* 发票开票状态可多行（徽章 + 已发送提示） */
#panel-invoices .table td:nth-child(10).cell-status {
  white-space: normal;
}

.cell-time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--color-neutral-500);
  font-variant-numeric: tabular-nums;
}

.cell-actions {
  overflow: visible !important;
  white-space: nowrap;
  vertical-align: middle;
}

.cell-actions .btn {
  vertical-align: middle;
}

.cell-actions .form-hint,
.cell-actions .cell-action-hint {
  display: block;
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.3;
  color: var(--color-neutral-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* 表格空状态 */
.table-empty td {
  text-align: center !important;
  padding: 48px 24px !important;
  color: var(--color-neutral-500);
  font-size: 14px;
  background: transparent !important;
  border-bottom: none !important;
  overflow: visible !important;
}

.table-empty-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--color-neutral-500);
}

.table-empty-inner strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-neutral-700);
}

.table-empty-inner span {
  font-size: 13px;
  color: var(--color-neutral-500);
}

/* Filters：大分类一行 + 细分筛选一行 */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  align-items: stretch;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  min-width: 0;
}

.filter-row-primary {
  justify-content: space-between;
  gap: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-neutral-100);
}

.filter-row-primary .filter-tabs {
  flex: 1 1 auto;
  min-width: 0;
}

.filter-row-primary .filter-actions {
  margin-left: auto;
}

.filter-row-secondary {
  align-items: stretch;
}

.filter-row-secondary .select,
.filter-row-secondary .input {
  flex: 0 1 auto;
}

.filter-bar-simple .filter-row-primary {
  border-bottom: none;
  padding-bottom: 0;
}

.filter-tabs { display: flex; gap: var(--space-xs); flex-wrap: wrap; }

.filter-tab {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-neutral-300);
  background: var(--color-neutral-0);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-tab:hover { border-color: var(--color-primary-400); }
.filter-tab.active { background: var(--color-primary-600); color: #fff; border-color: var(--color-primary-600); }

/* Sidebar meeting promos（避免 ad- 前缀，防止广告拦截扩展误伤） */
.promo-panel { margin-bottom: var(--space-lg); }

.promo-panel h3 {
  font-size: 14px;
  color: var(--color-neutral-700);
  margin-bottom: var(--space-sm);
}

/* 会议推荐：固定最多 3 个展示位；超出在前台轮播 */
.promo-carousel {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.promo-carousel-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.promo-carousel-page.is-enter {
  animation: promoPageFade 0.35s ease both;
}

@keyframes promoPageFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.promo-carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
}

.promo-carousel-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--color-neutral-300);
  cursor: pointer;
  transition: background 0.15s ease, width 0.15s ease;
}

.promo-carousel-dot:hover {
  background: var(--color-neutral-500);
}

.promo-carousel-dot.active {
  width: 16px;
  background: var(--color-primary-500);
}

/* 会议推荐：任意端均为 4:3 容器，图片完整显示不裁切 */
.promo-item {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 120px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 0;
  border: 1px solid var(--color-neutral-200);
  background: var(--color-neutral-50);
  transition: box-shadow var(--transition);
}

.promo-item:hover { box-shadow: var(--shadow-md); text-decoration: none; }

.promo-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.promo-item-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-neutral-700);
  background: linear-gradient(180deg, var(--color-neutral-50), var(--color-neutral-100));
}

/* 平板：每页最多 3 个横排，仍保持 4:3 完整显示 */
@media (min-width: 641px) and (max-width: 1024px) {
  .promo-carousel-page {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
  }
  .promo-carousel-page .promo-item {
    flex: 1 1 calc(33.333% - 8px);
    max-width: calc(33.333% - 8px);
    min-width: 140px;
  }
}

@media (min-width: 641px) and (max-width: 820px) {
  .promo-carousel-page .promo-item {
    flex: 1 1 calc(50% - 6px);
    max-width: calc(50% - 6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .promo-carousel-page.is-enter {
    animation: none;
  }
}

/* 资料下载：年份与会议并排 */
.downloads-panel .downloads-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.downloads-panel .downloads-year-field,
.downloads-panel .downloads-meeting-field {
  flex: 0 0 auto;
  margin: 0;
  width: auto;
}

.downloads-panel .downloads-year-field {
  min-width: 120px;
  max-width: 140px;
}

.downloads-panel .downloads-meeting-field {
  min-width: 180px;
  max-width: 260px;
}

.downloads-panel .downloads-year-field .select,
.downloads-panel .downloads-meeting-field .select {
  width: 100%;
  min-width: 0;
}

.downloads-panel .downloads-filters .form-label {
  display: block;
  margin-bottom: 6px;
}

.logs-toolbar {
  margin-bottom: var(--space-md);
  align-items: center;
}

.logs-toolbar-hint {
  margin: 0;
}

@media (max-width: 520px) {
  .downloads-panel .downloads-filters {
    flex-wrap: wrap;
  }
  .downloads-panel .downloads-year-field,
  .downloads-panel .downloads-meeting-field {
    max-width: 100%;
    flex: 1 1 auto;
  }
}

.downloads-panel .downloads-actions {
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.downloads-panel .form-hint-warn {
  color: var(--color-warning-600);
}

.download-progress {
  margin-top: var(--space-sm);
  height: 6px;
  background: var(--color-neutral-100);
  border-radius: 999px;
  overflow: hidden;
}

.download-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--color-primary-500), var(--color-primary-600));
  transition: width 0.35s ease;
}

.btn.is-busy {
  opacity: 0.85;
  pointer-events: none;
}

.btn-block {
  width: 100%;
}

.form-hint-login {
  margin-bottom: 16px;
}

.col-check {
  width: 36px;
}

#autosaveStatus.error {
  color: var(--color-danger-600);
}

/* 优惠码使用明细：优惠码 | 注册编号 | 会议 | 抵扣 | 提交时间 */
.promo-usage-hint {
  margin: 0 0 var(--space-md);
}

.promo-usage-table {
  table-layout: fixed;
  width: 100%;
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 0;
}

.promo-usage-table th:nth-child(1),
.promo-usage-table td:nth-child(1) { width: 16%; }
.promo-usage-table th:nth-child(2),
.promo-usage-table td:nth-child(2) {
  width: 32%;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  font-family: var(--font-latin), var(--font-cjk);
}
.promo-usage-table th:nth-child(3),
.promo-usage-table td:nth-child(3) {
  width: 14%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.promo-usage-table th:nth-child(4),
.promo-usage-table td:nth-child(4) {
  width: 14%;
  white-space: nowrap;
}
.promo-usage-table th:nth-child(5),
.promo-usage-table td:nth-child(5) {
  width: 24%;
  white-space: nowrap;
}

.promo-usage-table th,
.promo-usage-table td {
  vertical-align: middle;
}

.promo-usage-table td.cell-regno {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  max-width: none;
}

/* 邮件日志：注册编号完整显示 */
.logs-mail-table td.cell-regno {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-latin), var(--font-cjk);
}

.promo-manage-card {
  margin-bottom: var(--space-md);
}

#panel-promos .settings-tabs {
  margin-bottom: var(--space-lg);
}

.downloads-panel .downloads-meeting-field .select {
  width: 100%;
  min-width: 0;
}

.downloads-panel .downloads-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0 var(--space-md);
}

.downloads-panel .downloads-stats .stat-card {
  min-height: 84px;
}

.downloads-panel code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--color-neutral-100);
  padding: 1px 6px;
  border-radius: 4px;
}

@media (max-width: 900px) {
  .downloads-panel .downloads-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 侧边栏管理：卡片式区块编辑 */
.sidebar-settings-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  max-width: 960px;
}

.sidebar-ad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
}

.sidebar-ad-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  background: var(--color-neutral-0);
}

.sidebar-ad-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.sidebar-ad-card-header .card-title-sm {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-neutral-800);
  margin: 0;
}

.sidebar-ad-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sidebar-ad-card-actions .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sidebar-ad-card .ad-img-box {
  aspect-ratio: 4 / 3;
  min-height: 0;
}

/* Modal（居中弹窗） */
.modal-overlay,
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, visibility 0.16s;
  overscroll-behavior: contain;
}

.modal-overlay.open,
.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-layer-base { z-index: var(--z-modal); }
.modal-layer-sub { z-index: var(--z-modal-sub); }

.modal-dialog {
  width: min(520px, 100%);
  max-height: min(88vh, 860px);
  background: var(--color-neutral-0);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  /* 圆角裁切改由子层处理；visible 避免字段提示气泡被整卡裁切 */
  overflow: visible;
}

.modal-dialog-md { width: min(440px, 100%); }
.modal-dialog-lg { width: min(640px, 100%); }
.modal-dialog-xl { width: min(860px, 100%); max-height: min(90vh, 920px); }

.modal-header {
  flex-shrink: 0;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-neutral-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--color-neutral-0);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-neutral-900);
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-close-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-neutral-100);
  color: var(--color-neutral-600);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.modal-close-btn:hover {
  background: var(--color-neutral-200);
  color: var(--color-neutral-900);
}

.modal-toolbar {
  flex-shrink: 0;
  padding: 0 var(--space-lg);
  background: var(--color-neutral-0);
  border-bottom: 1px solid var(--color-neutral-200);
}

.modal-toolbar .drawer-tabs {
  margin-bottom: 0;
  border-bottom: none;
}

.modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-lg);
  -webkit-overflow-scrolling: touch;
  /* 为向下展开的 field-hint 预留空间 */
  padding-bottom: calc(var(--space-lg) + 8px);
}

.modal-footer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-neutral-200);
  background: var(--color-neutral-0);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.modal-footer .btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  width: 100%;
}

.modal-footer:empty {
  display: none;
}

.modal-toolbar:empty {
  display: none;
}

#meetingModalFooter {
  justify-content: flex-end;
}

#meetingModalFooter #deleteMeetingBtn {
  margin-right: auto;
}

html.modal-open,
body.modal-open,
html.drawer-open,
body.drawer-open {
  overflow: hidden;
}

/* 兼容旧类名 */
.drawer-header { padding: var(--space-md) var(--space-lg); border-bottom: 1px solid var(--color-neutral-200); display: flex; justify-content: space-between; align-items: center; }
.drawer-body { padding: var(--space-lg); overflow-y: auto; overflow-anchor: auto; }

.drawer-tab { user-select: none; }
.drawer-tab:focus { outline: none; }
.drawer-tab:focus-visible { outline: 2px solid var(--color-primary-300); outline-offset: 2px; }

/* Autosave indicator */
.autosave {
  font-size: 12px;
  color: var(--color-neutral-500);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.autosave.saved { color: var(--color-success-600); }

/* Toast */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px 16px;
  border-radius: var(--radius-md);
  background: var(--color-neutral-900);
  color: #fff;
  font-size: 14px;
  z-index: var(--z-toast);
  opacity: 0;
  transition: opacity 0.18s ease;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 90vw;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.toast-icon { flex-shrink: 0; display: flex; opacity: 0.95; }
.toast-msg { flex: 1; }
.toast-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: rgba(255,255,255,0.2); }
.toast-progress-bar { height: 100%; width: 100%; background: rgba(255,255,255,0.7); transform-origin: left; animation: toastProgress linear forwards; }

@keyframes toastProgress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.toast.show { opacity: 1; }
.toast-success { background: var(--color-success-600); }
.toast-error { background: var(--color-danger-600); }
.toast-warning { background: var(--color-warning-600, #d97706); }
.toast-info { background: var(--color-neutral-800); }

/* Success page */
.success-hero {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
}

.success-hero .icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--color-success-100);
  color: var(--color-success-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.reg-no-box {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-200, var(--color-primary-100));
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary-700);
}

/* Landing */
.hero {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
}

.hero h1 {
  font-size: 36px;
  color: var(--color-neutral-900);
  margin-bottom: var(--space-sm);
}

.hero p {
  font-size: 18px;
  color: var(--color-neutral-500);
  max-width: 560px;
  margin: 0 auto var(--space-2xl);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--space-lg) var(--space-3xl);
}

.feature-card {
  background: var(--color-neutral-0);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
}

.feature-card .icon { font-size: 40px; margin-bottom: var(--space-md); }
.feature-card h3 { margin-bottom: var(--space-xs); color: var(--color-neutral-900); }
.feature-card p { font-size: 14px; color: var(--color-neutral-500); }

.draft-banner {
  background: var(--color-warning-100);
  border: 1px solid rgba(204, 112, 0, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  font-size: 14px;
}

.hidden { display: none !important; }

/* 系统检测（超管） */
.health-check-card { max-width: 900px; }
.health-check-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.health-check-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--color-neutral-50);
  border: 1px solid var(--color-neutral-200);
}
.health-summary-badge {
  font-weight: 700;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 999px;
}
.health-summary-badge.is-pass {
  background: #ecfdf5;
  color: #047857;
}
.health-summary-badge.is-fail {
  background: #fef2f2;
  color: #b91c1c;
}
.health-summary-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  font-size: 13px;
  color: var(--color-neutral-600);
}
.health-summary-stats .hs-pass { color: #047857; font-weight: 600; }
.health-summary-stats .hs-warn { color: #b45309; font-weight: 600; }
.health-summary-stats .hs-fail { color: #b91c1c; font-weight: 600; }
.health-group { margin-bottom: var(--space-lg); }
.health-group-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 var(--space-sm);
  color: var(--color-neutral-800);
}
.health-item-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.health-item {
  display: grid;
  grid-template-columns: 56px minmax(120px, 0.9fr) 1.4fr;
  gap: 10px 12px;
  align-items: start;
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-neutral-100);
  font-size: 13px;
}
.health-item:last-child { border-bottom: none; }
.health-item-status {
  font-weight: 700;
  font-size: 12px;
}
.health-pass .health-item-status { color: #047857; }
.health-warn .health-item-status { color: #b45309; }
.health-fail .health-item-status { color: #b91c1c; }
.health-item-label { font-weight: 600; color: var(--color-neutral-800); }
.health-item-detail { color: var(--color-neutral-500); word-break: break-word; }
@media (max-width: 640px) {
  .health-item {
    grid-template-columns: 48px 1fr;
  }
  .health-item-detail { grid-column: 1 / -1; }
}

/* Admin shell */
.admin-shell {
  display: grid;
  grid-template-columns: var(--admin-sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--header-h));
  width: 100%;
}

.admin-sidebar {
  position: sticky;
  top: var(--header-h);
  align-self: start;
  height: calc(100vh - var(--header-h));
  display: flex;
  flex-direction: column;
  background: var(--color-neutral-0);
  border-right: 1px solid var(--color-neutral-200);
  padding: var(--space-md);
  z-index: 20;
  overflow: hidden;
  transition: padding var(--transition);
}

.admin-nav .sidebar-collapse-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--color-neutral-600);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.admin-nav .sidebar-collapse-btn:hover {
  background: var(--color-neutral-100);
  color: var(--color-neutral-800);
}

.nav-icon-slot {
  display: inline-flex;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
}

.admin-nav .sidebar-collapse-btn svg {
  transition: transform var(--transition);
}

.admin-shell.sidebar-collapsed {
  grid-template-columns: var(--admin-sidebar-collapsed-w) minmax(0, 1fr);
}

.admin-shell.sidebar-collapsed .sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

.admin-shell.sidebar-collapsed .nav-label {
  display: none;
}

.admin-shell.sidebar-collapsed .admin-nav button {
  justify-content: center;
  padding: 10px;
}

.ad-img-field { margin: 10px 0; }
.ad-img-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 0;
  border: 1px dashed var(--color-neutral-300);
  border-radius: var(--radius-md);
  background: var(--color-neutral-50);
  overflow: hidden;
}
.ad-img-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center;
}
.ad-img-placeholder { font-size: 13px; color: var(--color-neutral-400); }
.ad-img-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.ad-edit-row { padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--color-neutral-200); }

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.admin-nav button span[data-icon] {
  display: inline-flex;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.admin-nav button span[data-icon] svg {
  width: 18px;
  height: 18px;
}

.admin-nav button {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
  padding: 10px 14px;
  position: relative;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--color-neutral-700);
  cursor: pointer;
  text-align: left;
}

.admin-nav button .nav-label {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.admin-nav button:hover { background: var(--color-neutral-100); }
.admin-nav button.active { background: var(--color-primary-50); color: var(--color-primary-700); font-weight: 600; }

.admin-main {
  padding: var(--space-xl);
  background: var(--color-neutral-50);
  min-width: 0;
  overflow-x: hidden;
  max-width: 100%;
}

.admin-panel {
  display: none;
  min-width: 0;
  max-width: 100%;
}
.admin-panel.active { display: block; }
.admin-panel .card {
  min-width: 0;
  max-width: 100%;
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.5);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.login-card {
  width: min(400px, 100%);
  background: var(--color-neutral-0);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
}

.login-card h2 { margin-bottom: var(--space-xs); }
.login-card .sub { font-size: 14px; color: var(--color-neutral-500); margin-bottom: var(--space-lg); }

.drawer { width: min(560px, 100vw); } /* legacy */

.drawer-tabs {
  display: flex;
  gap: var(--space-xs);
  border-bottom: 1px solid var(--color-neutral-200);
  margin-bottom: var(--space-lg);
}

.drawer-tab {
  padding: var(--space-sm) var(--space-md);
  border: none;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--color-neutral-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.drawer-tab.active { color: var(--color-primary-600); border-bottom-color: var(--color-primary-600); font-weight: 600; }

.attach-section { margin-bottom: var(--space-lg); }

.attach-section h4 {
  font-size: 14px;
  color: var(--color-neutral-800);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.attach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-sm);
}

.attach-card {
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-neutral-0);
  font-size: 12px;
}

.attach-card .thumb {
  height: 100px;
  background: var(--color-neutral-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-neutral-500);
}

.attach-card .thumb img { width: 100%; height: 100%; object-fit: cover; }

.attach-card .meta { padding: var(--space-sm); }
.attach-card .name { font-weight: 600; word-break: break-all; }
.attach-card .size { color: var(--color-neutral-500); margin-top: 2px; }

.attach-empty {
  padding: var(--space-md);
  background: var(--color-neutral-100);
  border-radius: var(--radius-md);
  color: var(--color-neutral-500);
  font-size: 13px;
}

.user-table .actions { white-space: nowrap; }

.config-fee-grid {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: var(--space-sm) var(--space-md);
  align-items: center;
  max-width: 480px;
}

.fee-override-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 12px;
  font-size: 14px;
}

.fee-override-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: 16px;
}

/* Fee sheet card grid */
.fee-sheet-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.fee-sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
}

.fee-sheet-card {
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
}

.fee-sheet-card-default {
  border-color: var(--color-primary-300, #93c5fd);
}

.fee-sheet-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.fee-sheet-card-header .input.fee-sheet-name {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
}

.fee-sheet-card-header .input.fee-sheet-name[readonly] {
  border-color: transparent;
  background: transparent;
  padding-left: 0;
}

.badge-default {
  display: inline-block;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  background: var(--color-primary-100, #dbeafe);
  color: var(--color-primary-700, #1d4ed8);
  white-space: nowrap;
}

.fee-sheet-save-btn {
  margin-top: 12px;
  width: 100%;
}

.fee-sheet-early {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-neutral-200, #e5e7eb);
}

.fee-sheet-early-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-neutral-800, #1f2937);
  margin-bottom: 2px;
}

.fee-sheet-early-hint {
  margin: 0 0 8px;
  font-size: 12px;
}

.fee-sheet-early-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.fee-sheet-early-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fee-sheet-early-fields .form-group {
  margin-bottom: 0;
}

.fee-sheet-early-fields .form-label {
  font-size: 12px;
}

.fee-sheet-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fee-sheet-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fee-sheet-row-label {
  flex: 1;
  font-size: 13px;
  color: var(--color-neutral-700);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fee-sheet-row .input {
  width: 100px;
  flex-shrink: 0;
  text-align: right;
}

/* Admin dashboard / 会议等页头 */
.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  gap: var(--space-md);
  flex-wrap: wrap;
}

.admin-page-header .card-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-neutral-900);
  line-height: 1.25;
}

.admin-page-header .btn {
  flex-shrink: 0;
}

.admin-updated { font-size: 12px; color: var(--color-neutral-500); white-space: nowrap; }

.dash-header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-sm);
  flex-shrink: 0;
}

/* 周期切换：与筛选 segmented 同高 */
.period-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--color-neutral-100);
  border-radius: var(--radius-full);
}

.period-tab {
  padding: 8px 16px;
  min-height: 40px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-neutral-600);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.period-tab:hover { color: var(--color-primary-600); }

.period-tab.active {
  background: var(--color-neutral-0);
  color: var(--color-primary-700);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.status-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
}

.stats-grid-6 { grid-template-columns: repeat(6, 1fr); }

.stat-card.stat-warn { border-color: var(--color-warning-100); background: var(--color-warning-100); }
.stat-card:not(.ax-metric-num).stat-warn .value { color: var(--color-warning-600); }

.stat-card:not(.ax-metric-num) .value-sm { font-size: 20px; }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.dashboard-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.dashboard-meetings { grid-column: 1 / -1; }

.invoice-mark-panel .invoice-locked {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-success-600);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.section-header h3 { font-size: 16px; font-weight: 600; color: var(--color-neutral-900); }

.todo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-neutral-100);
  font-size: 14px;
}

.todo-item:last-child { border-bottom: none; }

.table-compact th, .table-compact td { padding: 10px 12px; font-size: 13px; }

.row-click { cursor: pointer; }
.row-click:hover { background: var(--color-primary-50); }

.meeting-overview {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: var(--space-md);
  padding-bottom: var(--space-sm);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.meeting-overview .meeting-overview-card {
  flex: 0 0 260px;
  min-width: 260px;
  scroll-snap-align: start;
}

.meeting-overview::-webkit-scrollbar { height: 6px; }
.meeting-overview::-webkit-scrollbar-track { background: var(--color-neutral-100); border-radius: 3px; }
.meeting-overview::-webkit-scrollbar-thumb { background: var(--color-neutral-400); border-radius: 3px; }
.meeting-overview::-webkit-scrollbar-thumb:hover { background: var(--color-neutral-500); }

.meeting-overview-card {
  display: flex;
  flex-direction: column;
  min-height: 108px;
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  background: var(--color-neutral-0);
}

.meeting-overview-card .meeting-overview-body {
  flex: 1 1 auto;
}

.meeting-overview-card .top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-sm);
  margin-bottom: 6px;
}

.meeting-overview-card .meta { font-size: 12px; color: var(--color-neutral-500); margin-top: 4px; }

.meeting-overview-card .foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-sm);
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--color-neutral-100);
  font-size: 12px;
  color: var(--color-neutral-600);
}

.drawer-wide { width: min(680px, 100vw); }

.edit-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

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

.fee-edit-grid { display: flex; flex-direction: column; gap: 8px; }

.fee-edit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.status-timeline { margin-top: var(--space-lg); padding-top: var(--space-md); border-top: 1px solid var(--color-neutral-200); }

.timeline-item {
  display: flex;
  gap: var(--space-sm);
  padding: 8px 0;
  font-size: 13px;
}

.timeline-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary-500);
  margin-top: 6px;
  flex-shrink: 0;
}

.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.settings-tab {
  padding: 8px 16px;
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  background: var(--color-neutral-0);
  font: inherit;
  font-size: 13px;
  color: var(--color-neutral-600);
  cursor: pointer;
}

.settings-tab.active {
  background: var(--color-primary-50);
  border-color: var(--color-primary-200);
  color: var(--color-primary-700);
  font-weight: 600;
}

.copy-section {
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  overflow: hidden;
}

.copy-section summary {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  background: var(--color-neutral-50);
}

.copy-fields {
  padding: var(--space-md);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.copy-fields .form-group { margin: 0; }

.check-row { display: block; margin: 6px 0; font-size: 14px; }

/* Attachments — clickable preview */
.attach-card.attach-clickable {
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.attach-card.attach-clickable:hover {
  border-color: var(--color-primary-300);
  box-shadow: var(--shadow-md);
}

.attach-card.attach-clickable:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

.attach-no-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--color-neutral-500);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-lightbox);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(4px);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: 90vh;
  background: var(--color-neutral-0);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-body {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: var(--space-xl);
  background: var(--color-neutral-100);
}

.lightbox-body img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-file-placeholder {
  text-align: center;
  color: var(--color-neutral-600);
  padding: var(--space-xl);
}

.lightbox-footer {
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--color-neutral-200);
  font-size: 13px;
}

.lightbox-name { font-weight: 600; word-break: break-all; }
.lightbox-size { color: var(--color-neutral-500); }

.attach-card .meta .btn { margin-top: 6px; width: 100%; justify-content: center; }

/* Form builder — visual editor */
.form-builder-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: start;
}

.form-builder-editor { min-width: 0; }

.form-builder-preview {
  position: sticky;
  top: calc(var(--header-h) + var(--space-md));
  min-width: 0;
}

.preview-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-neutral-500);
  margin-bottom: var(--space-md);
}

.builder-subtitle {
  font-size: 15px;
  font-weight: 600;
  margin: 16px 0 10px;
  color: var(--color-neutral-800);
}

.visual-step-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.preview-form-shell { font-size: 14px; }

.preview-form-shell .option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.preview-form-shell .option-card {
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  padding: 10px;
  font-size: 12px;
}

.preview-form-shell .option-card.selected { border-color: var(--color-primary-400); background: var(--color-primary-50); }

.preview-upload {
  border: 1px dashed var(--color-neutral-300);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  color: var(--color-neutral-500);
  font-size: 13px;
}

.preview-stepper {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.preview-success {
  margin-top: 16px;
  padding: 12px;
  background: var(--color-success-50);
  border-radius: var(--radius-md);
  font-size: 13px;
}

.required-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px 16px;
}

.required-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.ad-edit-row {
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 10px;
}

.schema-list { display: flex; flex-direction: column; gap: 8px; }

.schema-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  background: var(--color-neutral-0);
}

.schema-row.dragging { opacity: 0.5; }
.schema-row.drag-over { border-color: var(--color-primary-400); background: var(--color-primary-50); }

.schema-drag { cursor: grab; color: var(--color-neutral-400); font-weight: 700; user-select: none; }

.schema-fields { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-width: 0; }

.schema-type { grid-column: 1 / -1; }

.schema-req { white-space: nowrap; font-size: 13px; }

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-confirm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: rgba(15, 23, 42, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.confirm-overlay.open { opacity: 1; pointer-events: auto; }

.confirm-card {
  width: min(400px, 100%);
  background: var(--color-neutral-0);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
}

.confirm-card h3 { margin-bottom: 8px; font-size: 18px; }
.confirm-card p { color: var(--color-neutral-600); font-size: 14px; margin-bottom: var(--space-lg); }

.confirm-actions { display: flex; justify-content: flex-end; gap: var(--space-sm); }

.btn-danger {
  background: var(--color-danger-600, #dc2626);
  color: #fff;
  border-color: var(--color-danger-600, #dc2626);
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(1.05);
}

.payment-info-panel { margin-top: 12px; }

.payment-qr { margin-top: 12px; text-align: center; }

.payment-qr img { max-width: 220px; border-radius: var(--radius-md); border: 1px solid var(--color-neutral-200); }

.bank-lines { margin-top: 8px; font-size: 14px; line-height: 1.7; }
.bank-line { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); flex-wrap: wrap; }
.bank-copy-actions { margin-top: 10px; }
.bank-copy-btn {
  flex-shrink: 0;
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

.reject-templates { margin-bottom: var(--space-md); text-align: left; }
.reject-template-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.reject-template-chip { cursor: pointer; font-size: 12px; }
.confirm-card .reject-reason-input { width: 100%; resize: vertical; min-height: 72px; }

.success-next-steps {
  text-align: left;
  max-width: 520px;
  margin: var(--space-xl) auto var(--space-lg);
  padding: var(--space-lg);
  background: var(--color-neutral-50);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
}
.success-next-steps h3 { font-size: 16px; margin-bottom: 6px; color: var(--color-neutral-800); }
.success-flow { margin-top: var(--space-md); }

@media (max-width: 1200px) {
  .form-builder-layout { grid-template-columns: 1fr; }
  .form-builder-preview { position: static; }
}

@media (max-width: 1440px) {
  .admin-main { padding: var(--space-lg); }

  .dashboard-grid-3 { grid-template-columns: 1fr 1fr; }
  .dashboard-grid-3 .dash-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 1200px) {
  .dashboard-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 1200px) {
  .stats-grid-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .copy-fields { grid-template-columns: 1fr; }
  .edit-form-grid { grid-template-columns: 1fr; }
  .stats-grid-6 { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { grid-template-columns: 1fr; min-width: 0; }
  .admin-sidebar {
    position: sticky;
    top: var(--header-h);
    height: auto;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid var(--color-neutral-200);
    padding: var(--space-md);
    overflow: visible;
  }
  .admin-nav {
    flex: none;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    gap: var(--space-xs);
    padding-bottom: var(--space-xs);
    scrollbar-width: none;
  }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav button {
    flex-shrink: 0;
    width: auto;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* Responsive */
@media (max-width: 1024px) {
  .page-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .stepper-steps { height: 36px; }
  .stepper-step .step-label { display: none; }
  .stepper-step .dot { width: 28px; height: 28px; font-size: 12px; border-width: 2px; }
  .stepper-track { top: 14px; }
  /* 手机：左上一步 / 右下一步；暂存草稿另起一行与下一步右对齐 */
  .form-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: var(--space-sm);
  }
  .form-nav-actions { display: contents; }
  .form-nav .btn {
    min-width: 96px;
    width: auto;
    max-width: 100%;
    flex: none;
  }
  .form-nav #btnPrev {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
  }
  .form-nav #btnNext,
  .form-nav #btnSubmit {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .form-nav #btnSave {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
  }
  .stats-grid { grid-template-columns: 1fr; }
  .draft-banner { flex-direction: column; align-items: stretch; }
  .fee-row { flex-direction: column; align-items: stretch; }
  .fee-row .price { align-self: flex-end; }
  .promo-input-row { flex-direction: column; }
  .lightbox-footer { flex-direction: column; gap: var(--space-xs); align-items: flex-start; }
  .preview-form-shell .option-grid { grid-template-columns: 1fr; }
  .schema-fields { grid-template-columns: 1fr; }
}

/* —— R.md 新增样式 —— */
.char-count { font-size: 12px; color: var(--color-neutral-500); text-align: right; margin-top: 4px; }
.char-count.over-limit { color: var(--color-danger-600); font-weight: 600; }

.collapse-section { margin-top: var(--space-md); border: 1px solid var(--color-neutral-200); border-radius: var(--radius-md); overflow: hidden; }
.collapse-toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--color-neutral-50); border: none; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--color-neutral-700); }
.collapse-toggle .collapse-arrow { transition: transform 0.2s; font-size: 10px; color: var(--color-neutral-400); }
.collapse-toggle.open .collapse-arrow { transform: rotate(180deg); }
.collapse-body { padding: 0 16px; max-height: 300px; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; }
.collapse-body.collapsed { max-height: 0; padding-top: 0; padding-bottom: 0; }

.promo-input-row { display: flex; gap: 8px; }
.promo-input-row .input { flex: 1; }
.pricing-tier-badge { display: inline-block; margin-top: 8px; padding: 4px 10px; border-radius: var(--radius-full); background: var(--color-primary-50); color: var(--color-primary-700); font-size: 12px; font-weight: 600; }
.fee-discount { color: var(--color-success-600); font-size: 13px; margin-top: 4px; }

/* 已不再在注册上传列表展示磁盘路径；保留类名以免旧缓存样式报错 */
.file-path { display: none !important; }

.confirm-card-wide { max-width: 560px; }
.confirm-summary { margin: 16px 0; padding: 0; background: transparent; border-radius: var(--radius-md); text-align: left; }
.confirm-lines { text-align: left; }
.confirm-line {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-neutral-100);
  font-size: 0;
  line-height: 1.45;
}
.confirm-line:last-child { border-bottom: none; }
.confirm-line-k,
.confirm-line-v {
  display: inline-block;
  vertical-align: top;
  font-size: 13px;
  box-sizing: border-box;
}
.confirm-line-k {
  width: 128px;
  padding-right: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-neutral-500);
}
.confirm-line-v {
  width: calc(100% - 128px);
  font-weight: 500;
  color: var(--color-neutral-900);
  word-break: break-word;
}
.confirm-line-v-en {
  font-family: var(--font-latin), var(--font-cjk);
  font-size: 12.5px;
  color: var(--color-neutral-700);
}
.confirm-line-total { padding-top: 11px; }
.confirm-line-v-total {
  color: var(--color-primary-700);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.confirm-summary-grid.confirm-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--space-lg);
}
.confirm-summary-grid .preview-row { padding: 7px 0; border-bottom: 1px solid var(--color-neutral-100); }
.confirm-summary-grid .preview-row .label { width: 88px; font-size: 13px; }
.confirm-summary-grid .preview-row .value { font-size: 13px; word-break: break-word; }
.confirm-fee-block {
  grid-column: 1 / -1;
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px dashed var(--color-neutral-200);
}
.confirm-fee-title { font-size: 12px; font-weight: 600; color: var(--color-neutral-600); margin-bottom: 6px; }
.confirm-fee-list { margin: 0; padding-left: 18px; font-size: 12px; color: var(--color-neutral-700); line-height: 1.6; }

@media (max-width: 640px) {
  .confirm-summary-grid.confirm-preview { grid-template-columns: 1fr; }
}

.meeting-table {
  table-layout: fixed;
  width: 100%;
  min-width: 780px;
  border-collapse: separate;
  border-spacing: 0;
}

.user-table {
  table-layout: fixed;
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
}

/*
 * 小屏横向滑动时固定左侧关键列，避免「滑过去就不知道是谁」
 * 依赖 table-layout:fixed + border-collapse:separate
 */
@media (max-width: 900px) {
  #panel-registrations .table th:nth-child(1),
  #panel-registrations .table td:nth-child(1),
  #panel-invoices .table th:nth-child(1),
  #panel-invoices .table td:nth-child(1),
  .meeting-table th:nth-child(1),
  .meeting-table td:nth-child(1),
  .user-table th:nth-child(1),
  .user-table td:nth-child(1),
  #panel-promos .table th:nth-child(1),
  #panel-promos .table td:nth-child(1),
  #panel-logs .table th:nth-child(1),
  #panel-logs .table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--color-neutral-0);
  }

  #panel-registrations .table thead th:nth-child(1),
  #panel-invoices .table thead th:nth-child(1),
  .meeting-table thead th:nth-child(1),
  .user-table thead th:nth-child(1),
  #panel-promos .table thead th:nth-child(1),
  #panel-logs .table thead th:nth-child(1) {
    z-index: 3;
    background: var(--color-neutral-100);
  }

  .meeting-table thead th:nth-child(1) {
    background: var(--color-neutral-50);
  }

  /* 注册 / 发票：勾选列 + 编号列双固定 */
  #panel-registrations .table th:nth-child(2),
  #panel-registrations .table td:nth-child(2),
  #panel-invoices .table th:nth-child(2),
  #panel-invoices .table td:nth-child(2) {
    position: sticky;
    left: 44px;
    z-index: 2;
    background: var(--color-neutral-0);
  }

  #panel-registrations .table thead th:nth-child(2),
  #panel-invoices .table thead th:nth-child(2) {
    z-index: 3;
    background: var(--color-neutral-100);
  }

  #panel-registrations .table tbody tr:hover td:nth-child(1),
  #panel-registrations .table tbody tr:hover td:nth-child(2),
  #panel-invoices .table tbody tr:hover td:nth-child(1),
  #panel-invoices .table tbody tr:hover td:nth-child(2),
  .meeting-table tbody tr:hover td:nth-child(1),
  .user-table tbody tr:hover td:nth-child(1),
  #panel-promos .table tbody tr:hover td:nth-child(1),
  #panel-logs .table tbody tr:hover td:nth-child(1) {
    background: var(--color-primary-50);
  }

  /* 固定列右侧阴影：仅在已向右滑时显示 */
  #panel-registrations .table-wrap.has-scroll-left .table th:nth-child(2),
  #panel-registrations .table-wrap.has-scroll-left .table td:nth-child(2),
  #panel-invoices .table-wrap.has-scroll-left .table th:nth-child(2),
  #panel-invoices .table-wrap.has-scroll-left .table td:nth-child(2),
  .table-wrap.has-scroll-left .meeting-table th:nth-child(1),
  .table-wrap.has-scroll-left .meeting-table td:nth-child(1),
  .table-wrap.has-scroll-left .user-table th:nth-child(1),
  .table-wrap.has-scroll-left .user-table td:nth-child(1),
  #panel-promos .table-wrap.has-scroll-left .table th:nth-child(1),
  #panel-promos .table-wrap.has-scroll-left .table td:nth-child(1),
  #panel-logs .table-wrap.has-scroll-left .table th:nth-child(1),
  #panel-logs .table-wrap.has-scroll-left .table td:nth-child(1) {
    box-shadow: 6px 0 10px -6px rgba(15, 23, 42, 0.18);
  }
}

.user-table th,
.user-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  vertical-align: middle;
}

/* 用户名 | 姓名 | 角色 | 邮箱 | 状态 | 操作 */
.user-table th:nth-child(1),
.user-table td:nth-child(1) { width: 16%; }
.user-table th:nth-child(2),
.user-table td:nth-child(2) { width: 14%; }
.user-table th:nth-child(3),
.user-table td:nth-child(3) { width: 14%; }
.user-table th:nth-child(4),
.user-table td:nth-child(4) { width: 28%; }
.user-table th:nth-child(5),
.user-table td:nth-child(5) { width: 10%; }
.user-table th:nth-child(6),
.user-table td:nth-child(6) {
  width: 148px;
  overflow: visible;
  white-space: nowrap;
}

.user-table td.actions {
  overflow: visible;
  white-space: nowrap;
}
.meeting-table th,
.meeting-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  vertical-align: middle;
  padding: 12px 14px;
  line-height: 1.45;
}
.meeting-table thead th {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-neutral-600);
  background: var(--color-neutral-50);
  border-bottom: 1px solid var(--color-neutral-200);
  white-space: nowrap;
}
.meeting-table tbody tr { border-bottom: 1px solid var(--color-neutral-100); }
.meeting-table tbody tr:hover { background: var(--color-primary-50); }
.meeting-table .meeting-code {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  letter-spacing: 0.02em;
}
/* 简称 | 阶段 | 会议日期 | 注册人数 | 注册截止 | 操作 */
.meeting-table th:nth-child(1),
.meeting-table td:nth-child(1) { width: 18%; }
.meeting-table th:nth-child(2),
.meeting-table td:nth-child(2) { width: 12%; white-space: nowrap; }
.meeting-table th:nth-child(3),
.meeting-table td:nth-child(3) { width: 28%; white-space: nowrap; }
.meeting-table th:nth-child(4),
.meeting-table td:nth-child(4) { width: 12%; text-align: center; white-space: nowrap; }
.meeting-table th:nth-child(5),
.meeting-table td:nth-child(5) { width: 16%; text-align: center; white-space: nowrap; }
.meeting-table th:nth-child(6),
.meeting-table td:nth-child(6) {
  width: 100px;
  text-align: right;
  white-space: nowrap;
  overflow: visible;
}
.meeting-table .actions {
  text-align: right;
  white-space: nowrap;
  overflow: visible;
}

.chart-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
.chart-grid-rich { grid-template-columns: repeat(4, 1fr); }
.chart-grid-compact { grid-template-columns: repeat(4, 1fr); }
.chart-grid-rich .chart-card-wide { grid-column: 1 / -1; max-width: 480px; }
.chart-card { min-width: 0; }
.chart-card h4 { font-size: 14px; margin-bottom: 12px; color: var(--color-neutral-700); font-weight: 600; }
.chart-grid h4 { font-size: 14px; margin-bottom: 12px; color: var(--color-neutral-700); }

.refund-alert { max-width: 100%; margin-bottom: var(--space-lg); padding: 14px 18px; background: #fef2f2; border: 1px solid #fecaca; border-radius: var(--radius-md); color: #991b1b; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.refund-alert strong { font-size: 15px; }

.rejected-alert { max-width: 100%; margin-bottom: var(--space-lg); padding: 14px 18px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius-md); color: #9a3412; font-size: 14px; display: flex; flex-direction: column; gap: 4px; }
.rejected-alert strong { font-size: 15px; }
.rejected-alert-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }

.payment-slow-hint { margin-top: 8px; color: var(--color-warning-700, #b45309); }
.value-refund { color: var(--color-danger-600); font-weight: 600; }
.timeline-node.refund-node .dot { background: var(--color-danger-500); box-shadow: 0 0 0 4px #fecaca; }
/* bulk-bar 细节见 astryx.css；此处保留基础布局兜底 */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 12px;
  background: var(--color-primary-50);
  border-radius: var(--radius-md);
  font-size: 14px;
}



@media (max-width: 1200px) {
  .chart-grid-rich { grid-template-columns: repeat(2, 1fr); }
  .chart-grid-rich .chart-card-wide { grid-column: 1 / -1; max-width: none; }
  .stats-grid-8 { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1024px) {
  .chart-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-grid-rich { grid-template-columns: repeat(2, 1fr); }
  .stats-grid-8 { grid-template-columns: repeat(2, 1fr); }
  .admin-page-header { flex-wrap: wrap; }
}

@media (max-width: 768px) {
  .app-header {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-h);
    padding: var(--space-sm) var(--space-md);
    gap: var(--space-xs);
  }
  .app-header .logo { font-size: 16px; }
  .app-header nav {
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    gap: var(--space-2xs);
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .app-header nav::-webkit-scrollbar { display: none; }
  .app-header nav a,
  .app-header nav .btn {
    flex-shrink: 0;
    font-size: 13px;
    padding: var(--space-xs) var(--space-sm);
    white-space: nowrap;
  }
  .page-layout {
    padding: var(--space-md) var(--space-sm);
    gap: var(--space-md);
  }
  .card-pad { padding: var(--space-md); }
  /* 与缩小后的 card-pad 对齐，表格继续贴边全宽 */
  .admin-panel .card.card-pad > .table-wrap {
    margin-left: calc(-1 * var(--space-md));
    margin-right: calc(-1 * var(--space-md));
    width: calc(100% + 2 * var(--space-md));
    max-width: none;
  }
  .card-title { font-size: 20px; }
  .card-header-row {
    flex-direction: column;
    align-items: stretch;
  }
  .card-header-row .autosave { align-self: flex-start; }
  .query-row { flex-direction: column; }
  .query-row .btn { width: 100%; }
  .status-card-header { flex-direction: column; align-items: flex-start; }
  .page-toolbar { flex-direction: column; align-items: stretch; }
  .page-toolbar .btn { align-self: flex-start; }
  .admin-page-header {
    flex-direction: column;
    align-items: stretch;
  }
  .dash-header-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  .period-tabs {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .period-tabs::-webkit-scrollbar { display: none; }
  .period-tab {
    flex: 1;
    min-width: 72px;
    padding: 10px 12px;
    text-align: center;
  }
  .admin-main { padding: var(--space-md); }
  .section-header { flex-wrap: wrap; gap: var(--space-sm); }
  .filter-row-primary {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }
  .filter-row-primary .filter-tabs {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .filter-row-primary .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-row-primary .filter-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .filter-row-secondary .select,
  .filter-row-secondary .input:not(.filter-search) {
    flex: 1 1 calc(50% - var(--space-sm));
    min-width: 0;
    max-width: none;
    width: auto;
  }
  .filter-search {
    flex: 1 1 100%;
    max-width: none;
    margin-left: 0;
    width: 100%;
  }
  .bulk-bar { flex-wrap: wrap; gap: var(--space-sm); }
  .status-result-grid { grid-template-columns: 1fr; }
  .chart-grid,
  .chart-grid-rich { grid-template-columns: 1fr; }
  .todo-item {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  .preview-row { flex-direction: column; gap: 2px; }
  .preview-row .label { width: auto; }
  .drawer-header { flex-wrap: wrap; gap: var(--space-sm); }
  .success-hero { padding: var(--space-xl) var(--space-md); }
}

@media (max-width: 480px) {
  .stats-grid-8,
  .stats-grid-6,
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card:not(.ax-metric-num) .value { font-size: 24px; }
  .ax-metric-hero .value { font-size: 26px; }
  .ax-metric-num .value { font-size: 22px; }
  .app-header { padding: var(--space-xs) var(--space-sm); }
  .option-grid { grid-template-columns: 1fr; }
  .filter-tab,
  .period-tab { min-height: 44px; }
  .filter-row-secondary .select,
  .filter-row-secondary .input:not(.filter-search) { flex: 1 1 100%; }
}

/* Email template editor */
.email-template-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-lg);
  align-items: start;
}

.email-template-sidebar {
  padding: var(--space-md) !important;
  position: sticky;
  top: calc(var(--header-h) + var(--space-md));
  max-height: calc(100vh - var(--header-h) - var(--space-xl));
  overflow-y: auto;
}

.email-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-neutral-500);
  margin-bottom: var(--space-sm);
  padding: 0 4px;
}

.email-tpl-group-block + .email-tpl-group-block {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-neutral-100);
}

.email-tpl-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-neutral-500);
  margin-bottom: 6px;
  padding: 0 4px;
}

.email-tpl-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  font: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.email-tpl-item:hover {
  background: var(--color-neutral-50);
  border-color: var(--color-neutral-200);
}

.email-tpl-item.active {
  border-color: var(--color-primary-300);
  background: var(--color-primary-50);
  box-shadow: inset 3px 0 0 var(--color-primary-500);
}

.email-tpl-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-neutral-800);
  line-height: 1.4;
}

.email-template-workspace {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-width: 0;
}

.email-workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.email-workspace-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary-700);
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-200);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 6px;
}

.email-workspace-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-neutral-900);
  margin: 0 0 4px;
  line-height: 1.3;
}

.email-workspace-desc {
  font-size: 13px;
  color: var(--color-neutral-500);
  margin: 0;
  max-width: 520px;
}

.email-workspace-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.email-workspace-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 1.2fr);
  gap: var(--space-lg);
  align-items: start;
}

.email-editor-pane { min-width: 0; }

.email-subject-input { font-weight: 500; }

.email-body-editor {
  font-family: ui-monospace, Consolas, Monaco, monospace;
  font-size: 13px;
  line-height: 1.65;
  min-height: 300px;
  resize: vertical;
}

.email-vars-panel {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--color-neutral-50);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
}

.email-vars-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-neutral-800);
  margin-bottom: 2px;
}

.email-vars-hint {
  font-size: 12px;
  color: var(--color-neutral-500);
  margin: 0 0 10px;
}

.email-var-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 6px;
}

.email-var-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 7px 10px;
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-sm);
  background: var(--color-neutral-0);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.email-var-chip:hover {
  border-color: var(--color-primary-300);
  background: var(--color-primary-50);
  box-shadow: var(--shadow-sm);
}

.email-var-key {
  font-size: 11px;
  font-family: ui-monospace, Consolas, Monaco, monospace;
  font-weight: 600;
  color: var(--color-primary-700);
}

.email-var-hint {
  font-size: 11px;
  color: var(--color-neutral-500);
  line-height: 1.3;
}

.email-test-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-neutral-100);
}

.email-test-field {
  flex: 1;
  margin: 0 !important;
  min-width: 0;
}

.email-preview-pane {
  position: sticky;
  top: calc(var(--header-h) + var(--space-md));
  min-width: 0;
}

.email-preview-note {
  font-size: 12px;
  color: var(--color-neutral-500);
  margin: -4px 0 var(--space-md);
  line-height: 1.5;
}

.email-preview-mock {
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-neutral-0);
  box-shadow: var(--shadow-sm);
}

.email-preview-meta {
  padding: 12px 14px;
  background: var(--color-neutral-50);
  border-bottom: 1px solid var(--color-neutral-200);
}

.email-preview-meta-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  font-size: 12px;
  line-height: 1.5;
}

.email-preview-meta-row + .email-preview-meta-row {
  margin-top: 6px;
}

.email-preview-meta-label {
  color: var(--color-neutral-500);
  font-weight: 600;
}

.email-preview-meta-value {
  color: var(--color-neutral-800);
  word-break: break-word;
}

.email-preview-subject-text {
  font-weight: 600;
}

.email-preview-meta-bar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--color-neutral-600);
  margin-bottom: 10px;
  padding: 8px 10px;
  background: var(--color-neutral-50);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
}

.email-preview-meta-bar strong {
  color: var(--color-neutral-500);
  font-weight: 600;
  margin-right: 4px;
}

.email-preview-frame {
  width: 100%;
  min-height: 560px;
  height: min(72vh, 680px);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  background: #f3f4f6;
}

.email-preview-content {
  padding: 16px 14px;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-neutral-700);
  min-height: 200px;
  max-height: 480px;
  overflow-y: auto;
}

@media (max-width: 1280px) {
  .email-workspace-grid { grid-template-columns: 1fr; }
  .email-preview-pane { position: static; }
  .email-preview-frame { height: 520px; min-height: 420px; }
}

@media (max-width: 900px) {
  .email-template-layout { grid-template-columns: 1fr; }
  .email-template-sidebar {
    position: static;
    max-height: none;
  }
  .email-tpl-group-block {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
  }
  .email-tpl-group-block + .email-tpl-group-block {
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
  }
  .email-tpl-group-title {
    grid-column: 1 / -1;
    margin-bottom: 0;
  }
  .email-tpl-item { margin-bottom: 0; }
  .email-test-bar { flex-direction: column; align-items: stretch; }
}