/* —— 常规管理 · 个人资料 —— */
#module-view:has(.gen-prof-page) {
  padding: 0;
  width: 100%;
  background: #f0f2f5;
}

.gen-prof-page {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 20px;
  min-height: calc(100vh - var(--topbar-h));
  padding: 24px 28px 32px;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.gen-prof-page.gen-prof-ready {
  opacity: 1;
  transform: translateY(0);
}

.gen-prof-aside {
  min-width: 0;
}

.gen-prof-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.gen-prof-hero {
  position: relative;
  padding: 0 20px 22px;
  text-align: center;
}

.gen-prof-hero-bg {
  height: 96px;
  margin: 0 -20px 0;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 42%, #3b82f6 100%);
  background-size: 200% 200%;
  animation: gen-prof-gradient 8s ease infinite;
}

@keyframes gen-prof-gradient {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.gen-prof-avatar-wrap {
  position: relative;
  display: inline-flex;
  margin-top: -44px;
  padding: 0;
  border: 4px solid #fff;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gen-prof-avatar-wrap:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.gen-prof-avatar {
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
}

.gen-prof-avatar-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gen-prof-avatar-wrap:hover .gen-prof-avatar-overlay {
  opacity: 1;
}

.gen-prof-display-name {
  margin: 14px 0 4px;
  font-size: 20px;
  font-weight: 600;
  color: #262626;
}

.gen-prof-display-role {
  margin: 0;
  font-size: 13px;
  color: #8c8c8c;
}

.gen-prof-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 16px 16px;
  padding: 12px;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid #f0f0f0;
}

.gen-prof-stat {
  text-align: center;
  padding: 4px 2px;
}

.gen-prof-stat strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #262626;
  line-height: 1.3;
}

.gen-prof-stat span {
  font-size: 11px;
  color: #8c8c8c;
}

.gen-prof-stat.accent strong {
  color: #52c41a;
}

.gen-prof-form {
  padding: 4px 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gen-prof-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gen-prof-label {
  font-size: 13px;
  color: #595959;
  font-weight: 500;
}

.gen-prof-input,
.gen-prof-select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: #262626;
  background: #fff;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.gen-prof-input:focus,
.gen-prof-select:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.gen-prof-input.readonly {
  background: #f5f5f5;
  color: #8c8c8c;
  cursor: not-allowed;
}

.gen-prof-input-group {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.gen-prof-input-group .gen-prof-input {
  flex: 1;
  border-radius: 6px 0 0 6px;
  border-right: none;
}

.gen-prof-inline-btn {
  flex-shrink: 0;
  padding: 0 14px;
  border: 1px solid #1677ff;
  border-radius: 0 6px 6px 0;
  background: #fff;
  color: #1677ff;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.gen-prof-inline-btn:hover {
  background: #1677ff;
  color: #fff;
}

.gen-prof-pw-hint {
  margin: 0;
  font-size: 12px;
  color: #bfbfbf;
}

.gen-prof-pw-meter {
  height: 4px;
  margin-top: 6px;
  background: #f0f0f0;
  border-radius: 2px;
  overflow: hidden;
}

.gen-prof-pw-bar {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: #ff4d4f;
  transition: width 0.25s ease, background 0.25s ease;
}

.gen-prof-pw-bar.level-2 {
  background: #faad14;
}

.gen-prof-pw-bar.level-3 {
  background: #52c41a;
}

.gen-prof-pw-label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #8c8c8c;
}

.gen-prof-pw-label.level-1 {
  color: #ff4d4f;
}
.gen-prof-pw-label.level-2 {
  color: #faad14;
}
.gen-prof-pw-label.level-3 {
  color: #52c41a;
}

.gen-prof-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.gen-prof-btn {
  flex: 1;
  height: 38px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.gen-prof-btn:active {
  transform: scale(0.98);
}

.gen-prof-btn.primary {
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.gen-prof-btn.primary:hover {
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
}

.gen-prof-btn.ghost {
  background: #f5f5f5;
  color: #595959;
  border: 1px solid #e8e8e8;
}

.gen-prof-btn.ghost:hover {
  background: #ebebeb;
}

/* —— 操作日志 —— */
.gen-prof-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.gen-prof-log-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e8e8e8;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.gen-prof-log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 12px;
  flex-wrap: wrap;
}

.gen-prof-log-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #262626;
}

.gen-prof-log-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gen-prof-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  background: #fff;
  color: #595959;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.gen-prof-icon-btn:hover {
  color: #1677ff;
  border-color: #91caff;
  background: #f0f7ff;
}

.gen-prof-icon-btn.active {
  color: #1677ff;
  border-color: #1677ff;
  background: #e6f4ff;
}

.gen-prof-page.is-loading .gen-prof-refresh-icon {
  animation: gen-prof-spin 0.7s linear infinite;
}

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

.gen-prof-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  min-width: 200px;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  background: #fafafa;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.gen-prof-search:focus-within,
.gen-prof-search.has-value {
  border-color: #91caff;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

.gen-prof-search svg {
  flex-shrink: 0;
  color: #bfbfbf;
}

.gen-prof-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  font-family: inherit;
}

.gen-prof-log-filters {
  display: flex;
  gap: 6px;
  padding: 0 20px 12px;
  flex-wrap: wrap;
}

.gen-prof-filter-tab {
  height: 28px;
  padding: 0 12px;
  border: 1px solid #f0f0f0;
  border-radius: 14px;
  background: #fafafa;
  font-size: 12px;
  font-family: inherit;
  color: #595959;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.gen-prof-filter-tab:hover {
  color: #1677ff;
  border-color: #d6e4ff;
}

.gen-prof-filter-tab.active {
  background: #e6f4ff;
  border-color: #91caff;
  color: #1677ff;
  font-weight: 500;
}

.gen-prof-table-wrap {
  position: relative;
  flex: 1;
  min-height: 320px;
  overflow: auto;
  margin: 0 12px;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
}

.gen-prof-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.gen-prof-log-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fafafa;
}

.gen-prof-log-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: #595959;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}

.gen-prof-log-table td {
  padding: 11px 14px;
  border-bottom: 1px solid #f5f5f5;
  color: #434343;
  vertical-align: middle;
}

.gen-prof-log-row {
  transition: background 0.15s ease;
}

.gen-prof-log-row:hover {
  background: #f8fbff;
}

.gen-prof-log-table.compact td,
.gen-prof-log-table.compact th {
  padding: 8px 12px;
}

.gen-prof-col-id {
  width: 72px;
  color: #8c8c8c;
  font-variant-numeric: tabular-nums;
}

.gen-prof-col-time {
  white-space: nowrap;
  color: #8c8c8c;
  font-size: 12px;
}

.gen-prof-log-tag {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  vertical-align: middle;
}

.gen-prof-log-tag.green {
  background: #f6ffed;
  color: #52c41a;
}
.gen-prof-log-tag.blue {
  background: #e6f4ff;
  color: #1677ff;
}
.gen-prof-log-tag.purple {
  background: #f9f0ff;
  color: #722ed1;
}
.gen-prof-log-tag.orange {
  background: #fff7e6;
  color: #fa8c16;
}
.gen-prof-log-tag.grey {
  background: #f5f5f5;
  color: #8c8c8c;
}

.gen-prof-log-title {
  vertical-align: middle;
}

.gen-prof-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 0;
  border: none;
  background: none;
  font-size: 13px;
  font-family: inherit;
  color: #1677ff;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s ease;
}

.gen-prof-link-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}

.gen-prof-link-btn:hover {
  color: #0958d9;
  text-decoration: underline;
}

.gen-prof-ip-btn {
  padding: 0;
  border: none;
  background: none;
  font-size: 13px;
  font-family: inherit;
  color: #434343;
  cursor: pointer;
  transition: color 0.2s ease;
}

.gen-prof-ip-btn:hover {
  color: #1677ff;
}

.gen-prof-log-empty {
  text-align: center;
  padding: 48px 16px !important;
  color: #bfbfbf;
}

.gen-prof-table-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  color: #595959;
}

.gen-prof-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e8e8e8;
  border-top-color: #1677ff;
  border-radius: 50%;
  animation: gen-prof-spin 0.7s linear infinite;
}

.gen-prof-log-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px 18px;
  font-size: 13px;
  color: #595959;
}

.gen-prof-log-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gen-prof-page-size select {
  margin: 0 4px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
}

.gen-prof-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.gen-prof-page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  color: #595959;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.gen-prof-page-btn:hover:not(:disabled) {
  color: #1677ff;
  border-color: #1677ff;
}

.gen-prof-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gen-prof-page-num {
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  font-size: 13px;
  font-family: inherit;
  color: #595959;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.gen-prof-page-num:hover {
  color: #1677ff;
  border-color: #1677ff;
}

.gen-prof-page-num.active {
  background: #1677ff;
  border-color: #1677ff;
  color: #fff;
}

.gen-prof-page-ellipsis {
  padding: 0 6px;
  color: #bfbfbf;
}

.gen-prof-page-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  font-size: 13px;
}

.gen-prof-page-jump input {
  width: 48px;
  height: 32px;
  padding: 0 6px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  text-align: center;
  font-size: 13px;
  font-family: inherit;
}

@media (max-width: 1100px) {
  .gen-prof-page {
    grid-template-columns: 1fr;
  }

  .gen-prof-stats {
    grid-template-columns: 1fr;
  }

  .gen-prof-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 8px 4px;
  }

  .gen-prof-stat strong,
  .gen-prof-stat span {
    display: inline;
  }
}

@media (max-width: 640px) {
  .gen-prof-page {
    padding: 16px;
  }

  .gen-prof-log-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .gen-prof-search {
    min-width: 100%;
  }
}
