* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  overflow: hidden;
}
body { 
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif; 
  background: linear-gradient(135deg, #eef2ff 0%, #ede9fe 50%, #ddd6fe 100%);
}
.hidden { display: none !important; }

#app {
  height: 100%;
}

/* 登录页面 */
#login-screen {
  min-height: 100%;
  height: 100%;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: #fff;
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(139, 111, 192, 0.3);
  width: 100%;
  max-width: 420px;
}
.login-box h1 { 
  margin: 0 0 0.5rem; 
  font-size: 2rem; 
  background: linear-gradient(135deg, #8b6fc0, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  text-align: center;
}
.login-box p { color: #999; font-size: 0.9rem; margin: 0 0 2rem; text-align: center; }
.login-box input {
  width: 100%;
  padding: 0.9rem;
  margin-bottom: 1.5rem;
  border: 2px solid #e5e7ff;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s;
}
.login-box input:focus {
  outline: none;
  border-color: #8b6fc0;
  box-shadow: 0 0 0 3px rgba(139, 111, 192, 0.12);
}
.login-box button {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, #8b6fc0, #a78bfa);
  color: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s;
}
.login-box button:hover { 
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 111, 192, 0.4);
}
.error { color: #6d4fa0; font-size: 0.85rem; margin-top: 1rem; text-align: center; }

/* 主界面布局：占满视口，由内部面板滚动，整页不滚 */
#main-screen {
  display: flex;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

/* 侧边栏 */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #8b6fc0 0%, #6d4fa0 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 10px rgba(0,0,0,0.1);
  overflow-y: auto;
}

.logo {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}
.logo h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
  font-weight: 700;
}
.logo p {
  font-size: 0.85rem;
  opacity: 0.9;
}

.nav-menu {
  flex: 1;
  padding: 1.5rem 0;
}
.nav-item {
  width: 100%;
  padding: 1rem 1.5rem;
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
  transition: all 0.3s;
  border-left: 3px solid transparent;
}
.nav-item .icon {
  font-size: 1.25rem;
}
.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}
.nav-item.active {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-left-color: #c4b5fd;
  font-weight: 600;
}

.logout-btn {
  margin: 1.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  transition: all 0.3s;
}
.logout-btn:hover {
  background: rgba(255,255,255,0.3);
}

/* 主内容区：占满剩余宽度，子面板内再滚动 */
.main-content {
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 2rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel {
  background: #fff;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(139, 111, 192, 0.15);
}

/* 姿势库 / 审核上传：表格区域单独纵向滚动，工具栏与分页固定 */
.panel-scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-scroll .table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 0.75rem;
}
.panel-scroll .pagination {
  flex-shrink: 0;
}
.panel-scroll .toolbar {
  flex-shrink: 0;
}

.panel h2 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  color: #333;
  font-weight: 700;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
.stat-card {
  background: linear-gradient(135deg, #8b6fc0, #a78bfa);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(139, 111, 192, 0.35);
  transition: all 0.3s;
}
.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(139, 111, 192, 0.45);
}
.stat-card .value { 
  font-size: 3rem; 
  font-weight: 700; 
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  margin-bottom: 0.5rem;
}
.stat-card .label { 
  font-size: 1rem; 
  color: rgba(255,255,255,0.95); 
  font-weight: 500;
}

/* 工具栏 */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: #eef2ff;
  border-radius: 12px;
}
.toolbar input, .toolbar select {
  padding: 0.6rem 0.9rem;
  border: 2px solid #e5e7ff;
  border-radius: 10px;
  font-size: 0.9rem;
  transition: border-color 0.3s;
}
.toolbar input:focus, .toolbar select:focus {
  outline: none;
  border-color: #8b6fc0;
}
.toolbar button {
  padding: 0.6rem 1.25rem;
  background: #8b6fc0;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}
.toolbar button:hover { 
  background: #7c5fb0;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 111, 192, 0.35);
}
.toolbar .btn-primary {
  background: linear-gradient(135deg, #8b6fc0, #a78bfa);
  font-weight: 600;
}

/* 筛选按钮 */
.filter-btn {
  padding: 0.6rem 1.25rem;
  background: #fff;
  color: #666;
  border: 2px solid #e5e7ff;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}
.filter-btn:hover {
  border-color: #8b6fc0;
  color: #8b6fc0;
  transform: translateY(-2px);
}
.filter-btn.active {
  background: linear-gradient(135deg, #8b6fc0, #a78bfa);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(139, 111, 192, 0.35);
}

/* 表格 */
.table-wrap { 
  overflow-x: auto; 
  margin-bottom: 1.5rem;
  border-radius: 12px;
  border: 1px solid #e5e7ff;
}
.data-table { 
  width: 100%; 
  border-collapse: collapse; 
}
.data-table th, .data-table td { 
  padding: 0;
  text-align: left; 
  border-bottom: 1px solid #e5e7ff; 
  vertical-align: middle;
}
.data-table th > *, .data-table td > * {
  padding: 1rem;
}
/* 操作列：与缩略图行高约一致，按钮不再用过大 line-height */
.data-table td.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  min-height: 100px;
  vertical-align: middle;
}
.data-table td.actions > * {
  padding: 0.35rem 0.65rem;
}
.data-table th {
  padding: 1rem;
}
.data-table th { 
  background: linear-gradient(135deg, #eef2ff 0%, #ede9fe 100%); 
  font-weight: 600; 
  color: #6d4fa0; 
  font-size: 0.85rem;
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.75rem 1rem !important;
  height: 50px;
}
.data-table tbody tr {
  transition: background 0.2s;
}
.data-table tbody tr:hover { 
  background: #f8f7ff;
}

.data-table th:nth-child(5) {
  text-align: center;
}
.data-table th:nth-child(6) {
  text-align: center;
}
.data-table th:nth-child(2) {
  text-align: center;
}

.data-table .pose-thumb {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgb(196, 181, 253);
  cursor: pointer;
  transition: all 0.2s;
  display: block;
  margin: 0 auto !important;
  border: none !important;
  line-height: 0;
  padding: 1px;
}

.data-table .pose-thumb:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.data-table .pose-title { 
  font-weight: 600; 
  color: #333;
  font-size: 0.95rem;
}
.data-table .pose-desc {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.6;
  word-break: break-all;
  white-space: normal;
}
.data-table .scene-style {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.6;
}

/* 标签：每行最多 4 个，超出自动换行，高度自适应 */
.tags {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  padding: 0.25rem 0;
}
.tag {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  background: linear-gradient(135deg, #8b6fc0, #a78bfa);
  color: #fff;
  border-radius: 15px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(139, 111, 192, 0.25);
}

/* 徽章 */
.badge {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge-success {
  background: #d4f4dd;
  color: #1e7e34;
}
.badge-secondary {
  background: #f0f0f0;
  color: #6c757d;
}
.badge-danger {
  background: #f8d7da;
  color: #721c24;
}
.badge-muted {
  background: #e8e4f5;
  color: #5b4b8a;
}

/* 操作按钮 */
.data-table .btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.35;
}
.data-table .btn-edit { 
  background: #17a2b8; 
  color: #fff; 
}
.data-table .btn-edit:hover { 
  background: #138496; 
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(23, 162, 184, 0.3);
}
.data-table .btn-danger { 
  background: #dc3545; 
  color: #fff; 
}
.data-table .btn-danger:hover { 
  background: #c82333; 
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}
.data-table .btn-success { 
  background: #28a745; 
  color: #fff; 
}
.data-table .btn-success:hover { 
  background: #218838; 
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}
.data-table .btn-warning { 
  background: #ffc107; 
  color: #333; 
}
.data-table .btn-warning:hover { 
  background: #e0a800; 
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(255, 193, 7, 0.3);
}

/* 分页 */
.pagination { 
  display: flex; 
  align-items: center; 
  justify-content: center;
  gap: 1rem; 
  font-size: 0.9rem;
  padding: 1rem;
}
.pagination button {
  padding: 0.5rem 1.25rem;
  border: 2px solid #e5e7ff;
  background: #fff;
  border-radius: 10px;
  cursor: pointer;
  color: #8b6fc0;
  font-weight: 500;
  transition: all 0.3s;
}
.pagination button:hover:not(:disabled) {
  background: linear-gradient(135deg, #8b6fc0, #a78bfa);
  color: #fff;
  border-color: transparent;
}
.pagination button:disabled { 
  opacity: 0.4; 
  cursor: not-allowed; 
}

/* 弹窗 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}
.modal-content {
  background: #fff;
  padding: 2rem;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(139, 111, 192, 0.3);
}
.modal-content h3 { 
  margin: 0 0 1.5rem; 
  font-size: 1.5rem;
  color: #8b6fc0;
  font-weight: 700;
}
.modal-content label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #555;
  font-weight: 500;
}
.modal-content label input, 
.modal-content label select,
.modal-content label textarea {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.4rem;
  border: 2px solid #e5e7ff;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.3s;
}
.modal-content label input:focus,
.modal-content label select:focus,
.modal-content label textarea:focus {
  outline: none;
  border-color: #8b6fc0;
  box-shadow: 0 0 0 3px rgba(139, 111, 192, 0.1);
}
.modal-content label textarea {
  resize: vertical;
  min-height: 80px;
}
.modal-content .checkbox-label { 
  display: flex; 
  align-items: center; 
  gap: 0.5rem; 
}
.modal-content .checkbox-label input { 
  width: auto; 
  margin: 0;
}
.modal-actions { 
  margin-top: 1.5rem; 
  display: flex; 
  gap: 0.75rem; 
}
.modal-actions button { 
  flex: 1;
  padding: 0.75rem 1.5rem; 
  border-radius: 10px; 
  border: none; 
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s;
}
.modal-actions .btn-cancel { 
  background: #f0f0f0; 
  color: #666; 
}
.modal-actions .btn-cancel:hover { 
  background: #e0e0e0; 
  transform: translateY(-2px); 
}
#modal-pose-save, #modal-review-submit { 
  background: linear-gradient(135deg, #8b6fc0, #a78bfa); 
  color: #fff; 
}
#modal-pose-save:hover, #modal-review-submit:hover { 
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 111, 192, 0.4);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.pose-image-field {
  margin-bottom: 1rem;
}
.pose-image-field > label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  color: #555;
  font-weight: 500;
}
.pose-image-field > input[type="text"] {
  width: 100%;
  padding: 0.6rem;
  margin-bottom: 0.65rem;
  border: 2px solid #e5e7ff;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: inherit;
}
.pose-image-hint {
  font-size: 0.78rem;
  color: #888;
  line-height: 1.45;
  margin: 0 0 0.5rem;
}
.pose-image-hint kbd {
  font-size: 0.72rem;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  border: 1px solid #ddd;
  background: #f8f8fc;
}
.pose-image-preview-area {
  position: relative;
  min-height: 140px;
  border: 2px dashed rgba(139, 111, 192, 0.4);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 111, 192, 0.06);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  margin-bottom: 0.5rem;
  cursor: pointer;
  padding: 0.5rem;
}
.pose-image-preview-area:hover {
  border-color: #8b6fc0;
  background: rgba(139, 111, 192, 0.1);
}
.pose-image-preview-area:focus {
  outline: 2px solid #8b6fc0;
  outline-offset: 2px;
}
.pose-image-preview-area.dragover {
  border-color: #8b6fc0;
  background: rgba(139, 111, 192, 0.14);
  box-shadow: inset 0 0 0 2px rgba(139, 111, 192, 0.2);
}
.pose-image-placeholder {
  font-size: 0.9rem;
  color: #8b6fc0;
  text-align: center;
  padding: 0.75rem 1rem;
  pointer-events: none;
  user-select: none;
}
.pose-image-preview {
  max-width: 100%;
  max-height: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #e5e7ff;
  display: block;
  margin: 0 auto;
}
.pose-image-status {
  font-size: 0.82rem;
  color: #666;
  margin: 0.25rem 0 0;
}
.pose-image-status.error {
  color: #c53030;
}
.pose-save-error {
  font-size: 0.88rem;
  color: #c53030;
  margin: 0 0 0.5rem;
  padding: 0.5rem 0.65rem;
  background: #fff5f5;
  border-radius: 8px;
  border: 1px solid #feb2b2;
}
.pose-save-error.hidden {
  display: none !important;
}

/* 图片预览弹窗 */
#image-modal {
  cursor: pointer;
}
.image-modal-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  background: transparent;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.image-modal-content img {
  max-width: 95vw;
  max-height: 95vh;
  display: block;
  border-radius: 8px;
}
.image-modal-close {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 40px;
  height: 40px;
  background: #8b6fc0;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  box-shadow: 0 4px 12px rgba(139, 111, 192, 0.4);
  transition: all 0.3s;
}
.image-modal-close:hover {
  background: #6d4fa0;
  transform: rotate(90deg);
}

/* 响应式 */
@media (max-width: 768px) {
  #main-screen {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .logo {
    flex: 1;
  }
  .nav-menu {
    display: flex;
    padding: 0;
  }
  .nav-item {
    flex: 1;
    justify-content: center;
  }
  .logout-btn {
    margin: 1rem;
  }
}

#panel-feedback h2 {
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
  color: #4c3a6b;
}
.feedback-cell {
  max-height: 140px;
  overflow-y: auto;
  font-size: 0.88rem;
  line-height: 1.45;
  text-align: left;
  word-break: break-word;
}
