:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe2ea;
  --primary: #0f766e;
  --primary-hover: #0d5f59;
  --danger: #b91c1c;
}

* {
  box-sizing: border-box;
  transition: none !important;
  animation: none !important;
  scroll-behavior: auto !important;
}

body {
  margin: 0;
  font-family: 'Segoe UI', 'PingFang SC', sans-serif;
  color: var(--text);
  background: linear-gradient(145deg, #eef6ff, #f8fafc 50%, #f0fdf4);
  overscroll-behavior: none;
}

html {
  overscroll-behavior: none;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.header h1 {
  margin: 0;
  font-size: 28px;
}

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

.export-user-checklist {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 220px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 20;
}

.export-user-picker {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  position: relative;
}

#exportUserPickerBtn {
  width: 220px;
  justify-content: space-between;
}

.export-user-item {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  width: 100%;
  padding: 4px 6px;
  border-radius: 8px;
}

.export-user-item:hover {
  background: #f1f5f9;
}

.export-user-checkbox {
  cursor: pointer;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.card.full {
  grid-column: 1 / -1;
}

.card h2 {
  margin-top: 0;
  font-size: 18px;
}

.system-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.select-actions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.sys-btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sys-btn-group .btn:not(.secondary) {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.2);
}

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

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.btn {
  background: var(--primary);
  border: 0;
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
}

.btn:hover {
  background: var(--primary-hover);
}

.btn.secondary {
  background: #334155;
}

.btn.small {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.btn.danger {
  background: var(--danger);
}

.delete-btn {
  width: 108px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.muted,
.hint {
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.list-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.table-wrap {
  overflow-x: auto;
}

#adminManageCard .table-wrap {
  overflow-x: auto;
}

#adminManageCard table {
  width: 100%;
  min-width: 560px;
  table-layout: auto;
  border-collapse: collapse;
  border-spacing: 0;
}

#adminManageCard th:nth-child(1),
#adminManageCard td:nth-child(1) {
  width: 88px;
}

#adminManageCard th:nth-child(2),
#adminManageCard td:nth-child(2) {
  width: 112px;
  text-align: left;
  padding-left: 2px;
}

#adminManageCard th:nth-child(1),
#adminManageCard td:nth-child(1),
#adminManageCard th:nth-child(2),
#adminManageCard td:nth-child(2) {
  padding-left: 2px;
  padding-right: 2px;
}

#adminManageCard th:nth-child(3),
#adminManageCard td:nth-child(3) {
  width: auto;
  text-align: right;
  padding-right: 2px;
}

#adminManageCard tbody td {
  border-bottom: 1px solid var(--line);
  padding-top: 16px;
  padding-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px 8px;
  font-size: 14px;
  white-space: nowrap;
  vertical-align: middle;
}

.group-row td {
  background: #f1f5f9;
  font-weight: 600;
  cursor: pointer;
}

.group-row td:hover {
  background: #e2e8f0;
}

.photo-cell {
  display: flex;
  align-items: center;
  flex-direction: row;
  gap: 6px;
  justify-content: center;
}

.delete-cell {
  text-align: center;
}

.password-cell {
  display: table-cell;
  text-align: right;
  vertical-align: middle;
  gap: 6px;
  min-width: 300px;
  min-height: 140px;
  white-space: nowrap;
  margin-left: 0;
  float: none;
}

.password-cell > * {
  margin-left: auto;
}

.password-text {
  display: inline-block;
  width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-toggle-btn {
  width: 64px;
  min-width: 64px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding-left: 0;
  padding-right: 0;
}

.password-reset-btn {
  width: 64px;
  min-width: 64px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding-left: 0;
  padding-right: 0;
}

.feature-expand-btn {
  width: 96px;
  min-width: 96px;
  justify-content: space-between;
}

.feature-box {
  display: inline-flex;
  position: relative;
  align-items: flex-start;
  width: 96px;
  margin-left: 0;
}

.feature-box .sys-btn-group {
  margin-top: 0;
}

.feature-panel {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 140px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.password-row {
  display: grid;
  grid-template-columns: 120px 136px;
  align-items: center;
  justify-items: end;
  column-gap: 8px;
  min-height: 40px;
  width: 264px;
}

.password-actions {
  display: grid;
  grid-template-columns: 120px 136px;
  align-items: center;
  justify-items: end;
  column-gap: 8px;
  min-height: 40px;
  width: 264px;
}

.password-change-btn {
  width: 84px;
  min-width: 84px;
}

.password-change-slot {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  width: 120px;
  min-width: 120px;
}

.password-change-input {
  width: 120px;
  min-width: 120px;
  padding: 6px 8px;
}

.password-save-btn,
.password-cancel-btn {
  width: 64px;
  min-width: 64px;
  padding-left: 0;
  padding-right: 0;
}

.password-top-actions,
.password-edit-actions,
.password-right-slot {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.password-edit-actions,
.password-right-slot {
  grid-column: 2;
  justify-self: end;
}

.password-right-slot {
  width: 136px;
  min-width: 136px;
}

.password-user-delete-btn {
  width: 136px;
  min-width: 136px;
  padding-left: 0;
  padding-right: 0;
}

.thumb {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

#listCard th:nth-child(5),
#listCard td:nth-child(5),
#listCard th:nth-child(7),
#listCard td:nth-child(7) {
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.modal-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.modal-inner img {
  display: block;
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 10px;
  border: 1px solid #1e293b;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
  background: #0f172a;
}

.modal-close {
  position: absolute;
  right: 8px;
  top: 8px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 12px 14px;
  background: #111827;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.3);
}

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

  .system-options {
    grid-template-columns: 1fr;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
