* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

body {
  background: #cbd5e1;
  min-height: 100vh;
  padding: 20px;
  animation: fadeIn 0.4s ease-out;
  color: #1e293b;
}

.container {
  max-width: 2000px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  animation: slideIn 0.4s ease-out;
  height: calc(100vh - 40px);
  min-height: calc(100vh - 40px);
  background: white;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.left-panel {
  width: 70%;
  min-width: 300px;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-right: 1px solid #e2e8f0;
  flex: 7;
}

.import-section {
  display: flex;
  gap: 10px;
  padding: 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
  margin-top: auto !important;
  position: sticky;
  bottom: 0;
}

.import-btn {
  flex: 1;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border: none;
  color: white;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
}

.import-btn:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
}

.resizer {
  width: 12px;
  cursor: col-resize;
  background: #e2e8f0;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s ease;
  z-index: 100;
}

.resizer:hover {
  background: #cbd5e1;
  width: 16px;
}

.resizer::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 64px;
  background: rgba(59, 130, 246, 0.15);
  border-radius: 16px;
  pointer-events: none;
}

.resizer.dragging {
  background: #3b82f6;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
  width: 16px;
}

.card {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 20px;
  transition: none;
}

.card:hover {
  transform: none;
  box-shadow: none;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
}

.card-header .icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
}

.card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.tree-panel {
  flex: 1;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.tree-panel-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: auto;
  padding-right: 4px;
  position: relative;
  cursor: grab;
  /* 优化：固定容器高度，为虚拟滚动做准备 */
  max-height: calc(100vh - 200px);
  min-height: 300px;
  /* 优化：禁用动画，提升大数据性能 */
  will-change: scroll-position;
  contain: strict;
}

.tree-panel-content.dragging {
  cursor: grabbing;
  user-select: none;
}

.tree-zoom-container {
  min-width: 100%;
  min-height: 100%;
  transform-origin: left top;
  transition: transform 0.15s ease;
  position: relative;
}

.tree-zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f8fafc;
  border-radius: 8px;
  padding: 4px;
  border: 1px solid #e2e8f0;
}

.zoom-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  color: #64748b;
}

.zoom-btn:hover {
  background: #e2e8f0;
  color: #3b82f6;
}

.zoom-btn:active {
  transform: scale(0.95);
}

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

.zoom-level {
  font-size: 12px;
  color: #64748b;
  min-width: 50px;
  text-align: center;
  font-weight: 500;
}

.tree-panel .icon {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.form-panel {
  flex: 3;
  background: white;
  border-radius: 0;
  box-shadow: none;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.view-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.form-content {
  flex: 1;
  overflow-y: auto;
}

.form-content-single {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

.form-section-header {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  padding: 16px 0 12px 0;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-section-header::before {
  content: '';
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border-radius: 2px;
}

.form-row-single {
  display: flex;
  align-items: stretch;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  gap: 8px;
}

.form-row-single:last-child {
  border-bottom: none;
}

.form-row-single label,
.field-label {
  width: 50px;
  font-weight: 600;
  color: #333;
  font-size: 13px;
  flex-shrink: 0;
  text-align: right;
  padding-right: 8px;
}

.form-row-single input[type="text"],
.form-row-single textarea {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  transition: all 0.2s ease;
  min-height: 36px;
}

.form-row-single input[type="text"]:focus,
.form-row-single textarea:focus {
  outline: none;
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.form-row-single textarea {
  min-height: 48px;
  resize: vertical;
}

.form-row-single input:disabled,
.form-row-single select:disabled,
.form-row-single textarea:disabled {
  background: #f5f5f5;
  color: #999;
  border-color: #d9d9d9;
  cursor: not-allowed;
}

.form-group-area {
  background: #fafafa;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid #f0f0f0;
}

.form-divider {
  height: 1px;
  background: #d9d9d9;
  margin: 15px 0;
}

.form-section {
  background: #fafafa;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
  border: 1px solid #f0f0f0;
}

.form-section-title {
  font-size: 12px;
  font-weight: 600;
  color: #222;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 2px solid #1890ff;
  display: flex;
  align-items: center;
  gap: 5px;
}

.form-section-title::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1890ff;
}

.form-section-title::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1890ff;
}

.tree-item {
  display: flex;
  align-items: center;
  padding: 8px 10px;
  margin: 3px 0;
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  /* 优化：禁用动画，提升大数据性能 */
  transition: none;
  position: relative;
  /* 优化：提升渲染性能 */
  will-change: opacity, transform;
  contain: layout style;
}

.tree-item::before {
  content: '';
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #1890ff;
  margin-right: 6px;
  transition: all 0.2s ease;
}

.tree-item:hover {
  background: linear-gradient(90deg, #e6f7ff, transparent);
  padding-left: 12px;
}

.tree-item.active {
  background: linear-gradient(90deg, #1890ff, #096dd9);
  color: white;
}

.tree-item.active::before {
  background: white;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.tree-item.highlight {
  animation: highlight-pulse 0.5s ease-out;
}

@keyframes highlight-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(24, 144, 255, 0.7);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 0 0 8px rgba(24, 144, 255, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(24, 144, 255, 0);
  }
}

.tree-item.search-match {
  background: linear-gradient(90deg, #fff7e6, #fff1cc);
  border-left: 3px solid #fa8c16;
}

.tree-item.search-match::before {
  background: #fa8c16;
  box-shadow: 0 0 0 3px rgba(250, 140, 22, 0.3);
}

.tree-children {
  margin-left: 16px;
  border-left: 2px solid #e8e8e8;
  padding-left: 8px;
  /* 优化：禁用动画，提升大数据性能 */
  transition: none;
  /* 优化：提升渲染性能 */
  contain: layout style;
}

.form-group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.form-group label {
  font-weight: 600;
  font-size: 11px;
  color: #444;
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.form-group label::after {
  content: '';
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #1890ff;
}

.form-group input, 
.form-group textarea {
  padding: 8px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.2s ease;
  background: #fafafa;
  min-height: 36px;
}

.form-group input:focus, 
.form-group textarea:focus {
  outline: none;
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
  background: white;
}

.form-group textarea {
  resize: vertical;
  min-height: 36px;
}

select {
  padding: 8px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  min-height: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  min-width: 100px;
}

select:hover {
  border-color: #1890ff;
}

select:focus {
  outline: none;
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

select:disabled {
  background: #f5f5f5;
  color: #999;
  border-color: #d9d9d9;
  cursor: not-allowed;
}

select.sp-type {
  width: 60px !important;
  padding: 6px 10px !important;
  appearance: auto !important;
  background-image: none !important;
  background-position: unset !important;
  min-width: 60px !important;
}

.btn {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-right: 6px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.3s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary { 
  background: linear-gradient(135deg, #3b82f6, #2563eb); 
  color: white; 
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  transform: translateY(-2px);
}

.btn-success { 
  background: linear-gradient(135deg, #10b981, #059669); 
  color: white; 
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  transform: translateY(-2px);
}

.btn-warning { 
  background: linear-gradient(135deg, #f59e0b, #d97706); 
  color: white; 
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.btn-warning:hover {
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
  transform: translateY(-2px);
}

.btn-danger { 
  background: linear-gradient(135deg, #ef4444, #dc2626); 
  color: white; 
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

.btn-default { 
  background: linear-gradient(135deg, #f8fafc, #f1f5f9); 
  color: #475569; 
  border: 1px solid #e2e8f0;
}

.btn-default:hover {
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  transform: translateY(-1px);
  border-color: #cbd5e1;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.section-title {
  margin: 12px 0 8px;
  font-size: 13px;
  color: #222;
  border-left: 3px solid #1890ff;
  padding-left: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, #e8e8e8, transparent);
  margin-left: 6px;
}

.spouse-item {
  background: #fff;
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  border: 1px solid #e8e8e8;
  transition: all 0.2s ease;
}

.spouse-item:hover {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border-color: #1890ff;
}

.spouse-item-header {
  font-weight: 600;
  font-size: 13px;
  color: #333;
  margin-bottom: 6px;
  padding-bottom: 5px;
  border-bottom: 1px dashed #d9d9d9;
}

.action-bar {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.view-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 12px;
}

.view-tab {
  padding: 12px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  border-radius: 10px;
  transition: all 0.2s ease;
  flex: 1;
  text-align: center;
}

.view-tab:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

.view-tab.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.action-bar-left {
  display: flex;
  gap: 4px;
}

.action-bar-right {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.tip {
  font-size: 11px;
  color: #8c8c8c;
  margin-top: 2px;
  padding-left: 3px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.tip::before {
  content: '💡';
  font-size: 9px;
}

.family-tree-view {
  margin-top: 12px;
  padding: 16px;
  background: #fafafa;
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: auto;
  min-height: 280px;
  border: 1px solid #e8e8e8;
}

.family-tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.family-tree-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.family-tree-person-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.family-tree-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  min-width: 75px;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.family-tree-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.12);
}

.family-tree-card.active {
  border-color: #3b82f6;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.18);
}

.family-tree-card.spouse {
  background: #fff0f6;
  border-color: #ffc2e6;
  padding: 6px 10px;
  min-width: 60px;
  font-size: 12px;
}

.family-tree-card.spouse.active {
  border-color: #ec4899;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.18);
}

.family-tree-name {
  font-size: 13px;
  font-weight: 600;
  color: #333;
  text-align: center;
}

.family-tree-card.spouse .family-tree-name {
  font-size: 11px;
  font-weight: 500;
  color: #666;
}

.family-tree-connector {
  position: relative;
  width: 100%;
  height: 20px;
}

.family-tree-connector::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, #3b82f6, #60a5fa);
}

.family-tree-children-line {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 2px;
  background: linear-gradient(to right, transparent, #3b82f6, transparent);
}

.family-tree-children {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 16px;
  padding-top: 0;
  flex-wrap: wrap;
}

.family-tree-no-data {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 250px;
  color: #94a3b8;
  text-align: center;
}

.tree-children-row {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.search-box {
  position: relative;
  margin-bottom: 16px;
}

.search-box input {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 14px;
  background: white;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-box input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box .search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.search-box .search-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.search-box .search-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.search-box .search-reset-btn {
  position: absolute;
  right: 36px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
  color: #999;
}

.search-box .search-reset-btn:hover {
  background: rgba(255, 0, 0, 0.1);
  color: #ff4d4f;
}

.stats-bar {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-radius: 12px;
  border: 1px solid #bbf7d0;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #389e0d;
}

.stat-item .number {
  font-weight: 600;
  font-size: 16px;
  color: #1890ff;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
  display: flex;
}

.modal {
  background: white;
  border-radius: 12px;
  padding: 25px;
  min-width: 400px;
  max-width: 90vw;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.2s ease;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-content {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
  line-height: 1.6;
}

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

.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  z-index: 2000;
  animation: slideIn 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  max-width: 400px;
}

.toast-success {
  background: linear-gradient(135deg, #52c41a, #389e0d);
}

.toast-error {
  background: linear-gradient(135deg, #f5222d, #cf1322);
}

.toast-warning {
  background: linear-gradient(135deg, #faad14, #d48806);
}

.toast-info {
  background: linear-gradient(135deg, #1890ff, #096dd9);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.form-row .form-group {
  min-width: 0;
}

.form-row.col-2 {
  grid-template-columns: repeat(2, 1fr);
}

.form-row.col-3 {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1200px) {
  .left-panel {
    width: 320px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    flex-direction: column;
    gap: 15px;
    max-width: 100%;
    height: auto !important;
    min-height: calc(100vh - 20px) !important;
    max-height: none !important;
  }

  .left-panel {
    width: 100%;
    gap: 12px;
    min-width: auto;
    overflow: visible;
    flex: none;
  }

  .resizer {
    display: none;
  }

  .tree-panel {
    max-height: 350px;
    flex: none;
    overflow-y: auto;
    display: block !important;
    min-height: 200px;
    overflow-x: hidden;
  }

  .tree-panel-content {
    max-height: 300px;
    overflow-y: scroll !important;
    min-height: 150px;
    display: block !important;
    overflow-x: hidden;
    width: 100%;
  }

  .tree-item {
    padding: 14px 16px;
    margin: 6px 0;
    font-size: 16px;
    min-height: 56px;
  }

  .tree-children {
    margin-left: 15px;
    padding-left: 8px;
  }

  .form-panel {
    max-height: none;
    min-height: auto;
    height: auto;
    padding: 18px;
  }

  .form-group {
    margin-bottom: 15px;
  }

  .form-group label {
    font-size: 14px;
  }

  .form-group input, 
  .form-group textarea, 
  .form-group select {
    padding: 14px 16px;
    font-size: 16px;
    min-height: 48px;
  }

  .btn {
    padding: 14px 20px;
    font-size: 15px;
    margin-right: 6px;
    margin-top: 8px;
    min-height: 48px;
  }

  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .action-bar-left, .action-bar-right {
    justify-content: stretch;
    margin-left: 0;
    gap: 10px;
    flex-wrap: wrap;
  }

  .action-bar-left .btn,
  .action-bar-right .btn {
    flex: 1;
    min-width: calc(50% - 5px);
  }

  .section-title {
    font-size: 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .form-row.col-2,
  .form-row.col-3 {
    grid-template-columns: 1fr;
  }

  .tip {
    font-size: 12px;
  }

  .spouse-item {
    padding: 15px;
  }

  .spouse-item > div:first-child {
    flex-wrap: wrap;
    gap: 10px;
  }

  .spouse-item select.sp-type,
  .spouse-item input.sp-name,
  .spouse-item input.sp-dai {
    width: 100%;
    flex: 1;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 15px;
  }

  .spouse-item .btn {
    width: 100%;
    margin-left: 0 !important;
    margin-top: 10px;
    min-height: 48px;
    font-size: 15px;
  }

  .spouse-item input[type="text"],
  .spouse-item textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 15px;
  }

  .form-group-area {
    padding: 15px;
  }

  .family-tree-view {
    padding: 12px;
    min-height: 250px;
    overflow-x: auto;
    overflow-y: auto;
  }

  .family-tree-card {
    padding: 8px 12px;
    min-width: 65px;
  }

  .family-tree-name {
    font-size: 12px;
  }

  .family-tree-card.spouse {
    padding: 5px 8px;
    min-width: 50px;
    font-size: 11px;
  }

  .family-tree-card.spouse .family-tree-name {
    font-size: 10px;
  }

  .family-tree-person-row {
    gap: 6px;
  }

  .family-tree-children {
    gap: 12px;
  }

  .tree-children-row {
    gap: 8px;
    flex-wrap: nowrap;
  }

  .tree-line {
    height: 20px;
    border-width: 1.5px;
  }

  .modal {
    min-width: 90vw;
    padding: 20px;
    border-radius: 16px;
  }

  .modal-title {
    font-size: 18px;
  }

  .modal-content {
    font-size: 15px;
  }

  .modal-actions {
    gap: 12px;
  }

  .modal-actions .btn {
    flex: 1;
    min-height: 50px;
  }

  .stats-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }

  .toast {
    right: 10px;
    left: 10px;
    max-width: none;
    padding: 16px 20px;
  }

  .form-row-single {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .form-row-single label {
    width: 100%;
    text-align: left;
    padding-right: 0;
    padding-bottom: 6px;
    font-size: 14px;
  }

  .form-row-single:not(.inline-row) label {
    width: 100%;
    text-align: left;
    padding-right: 0;
    padding-bottom: 6px;
    font-size: 14px;
  }

  .form-row-single.inline-row {
    flex-wrap: nowrap;
    align-items: center;
  }

  .form-row-single.inline-row label,
  .form-row-single.inline-row .field-label {
    width: auto;
    padding-bottom: 0;
    margin-right: 8px;
  }

  .form-row-single input[type="text"],
  .form-row-single textarea {
    width: 100%;
    padding: 14px 16px;
    min-height: 48px;
    font-size: 16px;
  }

  .form-row-single input[type="text"]:not([style*="width"]),
  .form-row-single textarea:not([style*="width"]) {
    flex: 1;
  }

  .form-row-single select {
    width: 100%;
    padding: 14px 40px 14px 16px;
    min-height: 48px;
    font-size: 16px;
    background-size: 18px;
    background-position: right 12px center;
  }

  .form-row-single.inline-row select {
    width: auto;
  }

  .import-section {
    position: static;
    margin-top: 12px;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
  }

  .view-tabs {
    margin-bottom: 15px;
    border-radius: 10px;
    padding: 4px;
  }

  .view-tab {
    padding: 14px 16px;
    font-size: 15px;
    border-radius: 8px;
  }

  .gender-btn {
    padding: 12px 16px;
    font-size: 15px;
    min-height: 48px;
  }

  .search-box input {
    padding: 14px 44px 14px 16px;
    font-size: 16px;
    min-height: 50px;
  }

  .search-box .search-btn {
    font-size: 18px;
  }

  .card {
    border-radius: 16px;
    padding: 16px;
  }

  .card-header h3 {
    font-size: 17px;
  }

  .card-header .icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  select.sp-type {
    padding: 12px 10px !important;
    min-height: 48px !important;
    font-size: 16px !important;
  }

  #biaoJiBtn, #qrBtn, #heBtn, #genderBtn, #zunBtn {
    min-width: 70px;
    padding: 12px 12px;
    font-size: 14px;
  }

  #daiMing, #paiXu, #hangShu, #zun {
    width: auto;
    min-width: 80px;
  }

  #chengChuan {
    min-width: 120px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 8px;
  }

  .btn {
    padding: 12px 16px;
    font-size: 14px;
  }

  .form-row-single input[type="text"],
  .form-row-single textarea {
    padding: 12px 14px;
    min-height: 48px;
    font-size: 15px;
  }

  .form-row-single select {
    padding: 12px 36px 12px 14px;
    min-height: 48px;
    font-size: 15px;
    background-size: 16px;
  }

  .tree-item {
    padding: 12px 14px;
    font-size: 15px;
    min-height: 50px;
  }

  .card {
    padding: 14px;
    border-radius: 14px;
  }

  #biaoJiBtn, #qrBtn, #heBtn, #genderBtn, #zunBtn {
    min-width: 65px;
    padding: 10px 10px;
    font-size: 13px;
  }

  .left-panel {
    overflow: visible;
  }

  .tree-panel {
    max-height: none;
    flex: 1;
    min-height: 150px;
  }

  .tree-panel-content {
    max-height: calc(100vh - 320px);
  }

  .family-tree-view {
    padding: 8px;
    min-height: 200px;
  }

  .tree-node {
    padding: 8px 10px;
    font-size: 11px;
    min-width: 55px;
    margin: 3px;
    border-width: 1px;
    border-radius: 6px;
  }

  .tree-children-row {
    gap: 5px;
  }

  .tree-line {
    height: 15px;
    border-width: 1px;
  }
}

* {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.gender-switch {
  display: flex;
  gap: 4px;
}

.gender-btn {
  flex: 1;
  padding: 4px 8px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fafafa;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #666;
}

.gender-btn:hover {
  border-color: #1890ff;
  color: #1890ff;
}

.gender-btn.active {
  background: linear-gradient(135deg, #1890ff, #096dd9);
  border-color: #1890ff;
  color: white;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(3px);
}

.loading-overlay.show {
  display: flex;
}

.loading-container {
  background: white;
  border-radius: 12px;
  padding: 30px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease;
}

.loading-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 4px solid #f0f0f0;
  border-top-color: #1890ff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.loading-progress-bar {
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}

.loading-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1890ff, #096dd9);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.loading-progress-text {
  font-size: 13px;
  color: #666;
  text-align: center;
}

.loading-status {
  font-size: 14px;
  color: #333;
  text-align: center;
  margin-top: 15px;
}

.user-management-modal {
  min-width: 400px;
  max-width: 800px;
  width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.user-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 15px;
  background: #f8fafc;
  border-radius: 8px 8px 0 0;
  margin: -25px -25px 20px -25px;
  padding: 0 25px;
}

.user-tab-btn {
  flex: 1;
  padding: 15px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #64748b;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
}

.user-tab-btn:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.user-tab-btn.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
  font-weight: 600;
}

.user-tab-content {
  flex: 1;
  overflow-y: auto;
  max-height: 60vh;
}

.user-list-container, .log-list-container {
  max-height: 100%;
  overflow-y: auto;
}

.add-user-form {
  margin-bottom: 20px;
  padding: 15px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.add-user-title {
  font-weight: 600;
  font-size: 15px;
  color: #334155;
  margin-bottom: 12px;
}

.add-user-fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.add-user-input, .add-user-select {
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  min-height: 42px;
  flex: 1;
  min-width: 100px;
}

.add-user-btn {
  flex: none;
  min-width: 80px;
  padding: 10px 20px;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 15px;
  transition: all 0.2s ease;
}

.user-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

.user-name {
  font-size: 15px;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.user-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.current-user-tag {
  background: #dbeafe;
  color: #3b82f6;
}

.super-admin-tag {
  background: #fee2e2;
  color: #dc2626;
}

.user-role-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.user-card-info {
  margin-bottom: 10px;
}

.user-info-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  flex-wrap: wrap;
}

.user-info-label {
  color: #64748b;
  font-weight: 500;
}

.user-info-value {
  color: #1e293b;
}

.user-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.user-role-select {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  min-height: 36px;
}

.user-delete-btn {
  padding: 8px 16px;
  font-size: 13px;
  min-height: 36px;
}

.org-list-section {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
}

.org-list-title {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 12px;
}

.org-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.org-card-info {
  flex: 1;
  min-width: 150px;
}

.org-name {
  font-weight: 600;
  color: #1e293b;
  font-size: 14px;
  display: block;
  margin-bottom: 4px;
}

.org-details {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.org-detail {
  font-size: 12px;
  color: #64748b;
}

.org-delete-btn {
  padding: 6px 14px;
  font-size: 12px;
  min-height: 32px;
}

.log-filter-section {
  margin-bottom: 15px;
  padding: 15px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.log-filter-fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.log-filter-select, .log-filter-input {
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  min-height: 42px;
  flex: 1;
  min-width: 100px;
}

.log-filter-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.log-filter-btn {
  padding: 10px 16px;
  min-height: 42px;
  font-size: 13px;
}

.log-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.log-empty {
  text-align: center;
  padding: 30px;
  color: #94a3b8;
  font-size: 14px;
}

.log-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 15px;
  transition: all 0.2s ease;
}

.log-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

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

.log-action-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.log-time {
  font-size: 13px;
  color: #64748b;
}

.log-card-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-info-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}

.log-info-label {
  color: #64748b;
  font-weight: 500;
  min-width: 45px;
}

.log-info-value {
  color: #1e293b;
  flex: 1;
  word-break: break-word;
}

.log-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
  flex-wrap: wrap;
  gap: 10px;
}

.log-pagination-info {
  font-size: 13px;
  color: #64748b;
}

.log-pagination-buttons {
  display: flex;
  gap: 8px;
}

.log-pagination-btn {
  padding: 8px 16px;
  font-size: 13px;
  min-height: 36px;
}

@media (max-width: 768px) {
  .user-management-modal {
    min-width: 90vw;
    width: 95vw;
    max-height: 95vh;
    padding: 20px;
    border-radius: 16px;
  }

  .user-tabs {
    margin: -20px -20px 15px -20px;
    padding: 0 20px;
    border-radius: 12px 12px 0 0;
  }

  .user-tab-btn {
    padding: 14px 10px;
    font-size: 15px;
  }

  .user-tab-content {
    max-height: 65vh;
  }

  .add-user-form {
    padding: 15px;
  }

  .add-user-fields {
    flex-direction: column;
    align-items: stretch;
  }

  .add-user-input, .add-user-select {
    width: 100%;
    padding: 14px 16px;
    min-height: 50px;
    font-size: 16px;
  }

  .add-user-btn {
    width: 100%;
    min-height: 50px;
    font-size: 16px;
    padding: 14px 20px;
  }

  .user-card {
    padding: 16px;
  }

  .user-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-name {
    font-size: 16px;
  }

  .user-role-badge {
    font-size: 13px;
    padding: 6px 12px;
  }

  .user-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .user-role-select {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 15px;
  }

  .user-delete-btn {
    width: 100%;
    min-height: 48px;
    padding: 12px 20px;
    font-size: 15px;
  }

  .org-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .org-delete-btn {
    width: 100%;
    min-height: 44px;
    padding: 10px 20px;
    font-size: 14px;
  }

  .log-filter-section {
    padding: 15px;
  }

  .log-filter-fields {
    flex-direction: column;
    align-items: stretch;
  }

  .log-filter-select, .log-filter-input {
    width: 100%;
    padding: 14px 16px;
    min-height: 50px;
    font-size: 16px;
  }

  .log-filter-buttons {
    width: 100%;
  }

  .log-filter-btn {
    flex: 1;
    min-height: 50px;
    padding: 14px 16px;
    font-size: 15px;
  }

  .log-card {
    padding: 16px;
  }

  .log-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .log-action-badge {
    font-size: 13px;
    padding: 6px 14px;
  }

  .log-time {
    font-size: 14px;
  }

  .log-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .log-pagination-info {
    text-align: center;
    font-size: 14px;
  }

  .log-pagination-buttons {
    width: 100%;
  }

  .log-pagination-btn {
    flex: 1;
    min-height: 48px;
    padding: 12px 20px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .user-management-modal {
    padding: 16px;
  }

  .user-tabs {
    margin: -16px -16px 12px -16px;
    padding: 0 16px;
  }

  .user-tab-btn {
    padding: 12px 8px;
    font-size: 14px;
  }

  .user-tab-content {
    max-height: 70vh;
  }
}
